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(); }
/// <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);