public void UpdateUser(User user) { using (var context = new DiplomnaRabotaEntities()) { context.Entry(user).State = EntityState.Modified; //System.Data.EntityState.Added; EF4 context.SaveChanges(); } }
protected virtual void Dispose(bool disposing) { if (!disposed) { if (disposing) { // Free any other managed objects here. if (context != null) { context.Dispose(); context = null; } } } // Free any unmanaged objects here. disposed = true; }
public UserRepository(DiplomnaRabotaEntities contextArg) { context = contextArg; }
public ClientRepository(DiplomnaRabotaEntities contextArg) { context = contextArg; }