Exemplo n.º 1
0
        protected override async Task Handle(CreateColorCommand request, CancellationToken cancellationToken)
        {
            var color = _mapper.Map <Domain.Model.Color.Color>(request.CreateColorDto);
            await _colorRepository.AddAsync(color);

            await _colorRepository.Context.SaveChangesAsync();
        }
Exemplo n.º 2
0
 /// <summary>
 /// Add specified color object to JSON file
 /// </summary>
 /// <param name="filePath"></param>
 /// <param name="color"></param>
 /// <returns></returns>
 public async Task <Color> AddAsync(string filePath, Color color) =>
 await _colorRepository.AddAsync(filePath, color);