public async Task <long> Handle(ModifyFormulatedMeasureUnit request, CancellationToken cancellationToken)
        {
            var dimension = await _measureDimensionRepository.GetById(request.MeasureDimensionId);

            dimension.ModifyFormulatedUnit(_measureDimensionArgFactory.MapToArg(request));
            await _measureDimensionRepository.Add(dimension, cancellationToken);

            return(dimension.Id);
        }
 public FormulatedMeasureUnitArg MapToArg(ModifyFormulatedMeasureUnit request)
 {
     return(new FormulatedMeasureUnitArg
     {
         Id = new Symbol(request.SymbolId),
         Title = request.Title,
         TitleSlug = request.TitleSlug,
         ConvertFormulaFromBasicUnit = new ConvertFormulaArg {
             Formula = request.ConvertFormulaFromBasicUnit
         },
         ConvertFormulaToBasicUnit = new ConvertFormulaArg {
             Formula = request.ConvertFormulaToBasicUnit
         }
     });
 }
Beispiel #3
0
 public Task <long> Put(long id, ModifyFormulatedMeasureUnit command)
 {
     command.MeasureDimensionId = id;
     return(_mediator.Send(command));
 }