public async Task <IResult> Delete(Guid id) { var todo = await _todoDal.Get(t => t.Id == id); if (todo == null) { return(new ErrorResult(Messages.UnSuccessfully)); } await _todoDal.Delete(todo); return(new SuccessResult(Messages.Successfully)); }
public bool Complete(int id) { var entity = _todoDal.Get(td => td.Id == id); if (entity != null) { entity.IsCompleted = true; _todoDal.Update(entity); return(true); } return(false); }
public IDataResult <Todo> GetById(int id) { return(new SuccessDataResult <Todo>(_todoDal.Get(x => x.ID == id))); }