Пример #1
0
        public async Task <ICommandResult> Handle(ManufacturerManagementChangeCommand mesage)
        {
            try
            {
                Manufacturer manufacturer = new Manufacturer(mesage.Version);
                manufacturer.Change(mesage);
                await _manufacturerService.ChangeToDb(manufacturer);

                ICommandResult result = new CommandResult()
                {
                    Message  = "",
                    ObjectId = Convert.ToString(manufacturer.Id),
                    Status   = CommandResult.StatusEnum.Sucess
                };
                return(result);
            }
            catch (Exception e)
            {
                e.Data["Param"] = mesage;
                ICommandResult result = new CommandResult()
                {
                    Message = e.Message,
                    Status  = CommandResult.StatusEnum.Fail
                };
                return(result);
            }
        }