public bool Update(Empleado EntidadModificada) { try { using (var db = new LiteDataBase(DBName)) { var coleccion = db.GetCollection <Empleado>(TableName); coleccion.Update(EntidadModificada); } return(true); } catch (Exception) { return(false); } }
public bool Delete(string id) { try { int r; using (var db = new LiteDataBase(DBName)) { var coleccion = db.GetCollection <Empleado>(TableName); r = coleccion.Delete(e => e.Id == id); } return(r > 0); } catch (Exception) { return(false); } }
public bool Create(Empleado entidad) { entidad.Id = Guid.NewGuid().ToString(); try { using (var db = new LiteDataBase(DBName)) { var coleccion = db.GetCollection <Empleado>(TableName); coleccion.Insert(entidad); } return(true); } catch (Exception) { return(false); } }