public string InsertarUsers(Dtos.usersDTO dto) { try { using (var modelo = new PersistenciaDatos.SignalDBEntities()) { var entity = dto.ToEntity(); modelo.users.Add(entity); modelo.SaveChanges(); return(entity.id_user); } } catch (Exception) { throw new NotImplementedException(); } }
public bool ActualizarUsers(Dtos.usersDTO dto) { try { using (var modelo = new PersistenciaDatos.SignalDBEntities()) { var w = modelo.users.Where(q => q.id_user == dto.id_user).Select(q => q).FirstOrDefault(); if (w == null) { return(false); } Dominio.Convertidores.usersCONVERTIDOR.Actualizar(dto, w); modelo.SaveChanges(); return(true); } } catch (Exception) { throw new NotImplementedException(); } }