예제 #1
0
        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));
        }
예제 #2
0
        public async Task <IResult> Add(Color color)
        {
            await _colorDal.AddAsync(color);

            return(new SuccessResult(Messages.ColorCreated));
        }
예제 #3
0
        public async Task <IResult> AddAsync(Color entity)
        {
            await _colorDal.AddAsync(entity);

            return(new SuccessResult());
        }