public static void DetachLocal <T>(this GithubExplorerContext context, T t, int entryId) 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 = EntityState.Modified;
        }
 public UserRepository(GithubExplorerContext context)
 {
     _context = context;
 }
 public UnitOfWork(GithubExplorerContext githubExplorerContext)
 {
     _context = githubExplorerContext;
 }
Exemple #4
0
 public SeedingService(GithubExplorerContext context)
 {
     _context = context;
 }