Skip to content

Instantly share code, notes, and snippets.

@talhajunaidd
Created December 14, 2017 08:14
Show Gist options
  • Save talhajunaidd/9f953ebd7cf19aa419d9df7f3a8b309c to your computer and use it in GitHub Desktop.
Save talhajunaidd/9f953ebd7cf19aa419d9df7f3a8b309c to your computer and use it in GitHub Desktop.
WorkAround to get updated value from db using entity framework
var result = Context.Set<SomeEntity>().Where(someCondition).FirstOrDefault();
if (result != null)
{
Context.Entry<SomeEntity>(result).Reload();
}
return result;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment