public User Create(User entity) { User response; try { using (var AFEIEntities = new AFEIEntities()) { AFEIEntities.Users.AddObject(entity); AFEIEntities.SaveChanges(); response = AFEIEntities.Users.Single(x => x.Id == entity.Id); ChangesLog changesLog = new ChangesLog() { Date = DateTime.Now, Description = "Nuevo Usuario", Module = "Usuario", User = LogInfo.LoggedUser }; changesLogPersistence.Create(changesLog); } } catch (Exception e) { throw e; } return(response); }
public void Create(ChangesLog entity) { ChangesLogPersistence changesLogPersistence = new ChangesLogPersistence(); changesLogPersistence.Create(entity); }