In my application I want to check if a record exists, if it does I want to update it, if it does not then I want to create a new record. Originally I just used the Single operator as follows: ADMUser admUser = myDBContext .ADMUser.Single< ADMUser >(c => c.ADMUserId == userId); if (admUser != null) { admUser.LastRegistered = DateTime.Now; } else { admUser = new ADMUser(); : : myDBContext.ADMUser.Add(admUser); } The first line of code caused an exception when there was no record matching which
Read More...