protected static EntityKey CreateEntityKey(IObjectContextAdapter context, object entity) { if (entity == null) { throw new ArgumentNullException("entity"); } return(context.ObjectContext.CreateEntityKey(context.GetEntitySetName(entity.GetType()), entity)); }
public static ObjectResult <T> ReadSingleResult <T>(this IObjectContextAdapter dbContext, DbDataReader dbReader) where T : class { return(dbContext.ObjectContext.Translate <T>(dbReader, dbContext.GetEntitySetName <T>(), MergeOption.AppendOnly)); }