public async Task <IResult> AddAsync(ColorAddDto colorAddDto) { Color colorToAdd = new Color() { Name = colorAddDto.Name }; bool addResult = await _colorDal.AddAsync(colorToAdd); if (!addResult) { return(new ErrorResult(Messages.ColorNotAdded)); } return(new SuccessResult(Messages.ColorAdded)); }
public async Task <IResult> Add(Color color) { await _colorDal.AddAsync(color); return(new SuccessResult(Messages.ColorCreated)); }
public async Task <IResult> AddAsync(Color entity) { await _colorDal.AddAsync(entity); return(new SuccessResult()); }