Пример #1
0
        public static void DetachLocal <T>(this SODbContext context, T t, int entryId, EntityState state)
            where T : class, IIdentifier
        {
            var local = context.Set <T>()
                        .Local
                        .FirstOrDefault(entry => entry.Id.Equals(entryId));

            if (local != null)
            {
                context.Entry(local).State = EntityState.Detached;
            }

            context.Entry(t).State = state;
        }
Пример #2
0
 public InMemoryProductRepository(SODbContext context)
 {
     _context = context;
 }