Ctp5 entity infrastructure receives an unsolicited entity

EF CTP 5. I have one instance where I would like to receive an unprotected entity. I can't seem to find a way to do this. I do not want to disable the creation of a proxy server together, I just need this for this single request. Can anyone help?

Here is a simple example:

var myEntity = DbContext.Entities.Find(1);
var unproxy = myEntity...?
+3
source share
1 answer

, - DbContext . , DynamicProxy - , , . -, . :

using (var context = new MyDbContext(connectionString))
{
  ((IObjectContextAdapter)context).ObjectContext.ContextOptions.ProxyCreationEnabled = false;
  var myEntity = context.Entities.Find(1);
}
+3

Source: https://habr.com/ru/post/1792290/


All Articles