コード例 #1
0
        protected static EntityKey CreateEntityKey(IObjectContextAdapter context, object entity)
        {
            if (entity == null)
            {
                throw new ArgumentNullException("entity");
            }

            return(context.ObjectContext.CreateEntityKey(context.GetEntitySetName(entity.GetType()), entity));
        }
コード例 #2
0
 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));
 }