public IActionResult Post([FromBody] BasicProductAliasInsertCommandInputDTO model)
        {
            var appResult = this.InsertCommand.Execute(model);

            if (appResult.IsSucceed)
            {
                var signalArgs = new SignalREventArgs(SignalREvents.DATA_CHANGED.Identifier, nameof(SignalREvents.DATA_CHANGED.ActionEnum.ADDED_ITEM), nameof(DomainModel.Product.BasicProductAlias), appResult.Bag);
                this.SignalRHubContext.Clients.All.DataChanged(signalArgs);
            }

            return(appResult.IsSucceed ? (IActionResult)this.Ok(appResult) : (IActionResult)this.BadRequest(appResult));
        }
        public OperationResponse <BasicProductAliasInsertCommandOutputDTO> Execute(BasicProductAliasInsertCommandInputDTO input)
        {
            var result = new OperationResponse <BasicProductAliasInsertCommandOutputDTO>();

            using (var dbContextScope = this.DbContextScopeFactory.Create())
            {
                var entity = new DomainModel.Product.BasicProductAlias
                {
                    Name                  = input.Name,
                    ColorTypeId           = input.ColorTypeId,
                    ProductId             = input.ProductId,
                    ProductCategorySizeId = input.ProductCategorySizeId
                };

                try
                {
                    var insertResult = this.Repository.Insert(entity);
                    result.AddResponse(insertResult);
                    if (result.IsSucceed)
                    {
                        dbContextScope.SaveChanges();
                    }
                }
                catch (Exception ex)
                {
                    result.AddError("Error Adding ProductAlias", ex);
                }

                if (result.IsSucceed)
                {
                    var getByIdResult = this.Repository.GetById(entity.Id);
                    result.AddResponse(getByIdResult);
                    if (result.IsSucceed)
                    {
                        result.Bag = new BasicProductAliasInsertCommandOutputDTO
                        {
                            Id   = getByIdResult.Bag.Id,
                            Name = getByIdResult.Bag.Name
                        };
                    }
                }
            }

            return(result);
        }