public int InsertarFiles(Dtos.filesDTO dto) { try { using (var modelo = new PersistenciaDatos.SignalDBEntities()) { var entity = dto.ToEntity(); modelo.files.Add(entity); modelo.SaveChanges(); return(entity.id_file); } } catch (Exception) { throw new NotImplementedException(); } }
public bool ActualizarFiles(Dtos.filesDTO dto) { try { using (var modelo = new PersistenciaDatos.SignalDBEntities()) { var w = modelo.files.Where(q => q.id_file == dto.id_file).Select(q => q).FirstOrDefault(); if (w == null) { return(false); } Dominio.Convertidores.filesCONVERTIDOR.Actualizar(dto, w); modelo.SaveChanges(); return(true); } } catch (Exception) { throw new NotImplementedException(); } }