I am trying to select an entity of type Member with this code in C#. I was watching a video tutorial and they do it just the same, but it doesn’t work for me.
Member member = new Member();
var query = from m in db.Members where Member.MemberID == textBox1.Text
select m;
var currentMember = query.FirstOrDefault();
string CurrentID = M.MemberID;
There are no exceptions or stuff, but I get all of the currentMember’s properties are null.
Any ideas to get the expected result?
I think you might be mixing up your variables a little bit here. Let’s try to clean this code up: