Ejemplo n.º 1
0
        /// <summary>
        ///  The business implementation when the IAgentCategoryCreateFailed occurs
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public async Task Consume(ConsumeContext <IAgentCategoryCreateFailed> context)
        {
            AgentCategoryIdDetails agentCategoryIdDetails = new AgentCategoryIdDetails
            {
                AgentCategoryId = context.Message.Id
            };

            UpdateAgentCategory updateAgentCategory = new UpdateAgentCategory
            {
                Name             = context.Message.Name,
                DataTypeId       = context.Message.AgentCategoryType,
                DataTypeMinValue = context.Message.DataTypeMinValue,
                DataTypeMaxValue = context.Message.DataTypeMaxValue,
                ModifiedDate     = context.Message.ModifiedDate,
                IsDeleted        = true,
                IsUpdateRevert   = true
            };

            await _agentCategoryService.UpdateAgentCategory(agentCategoryIdDetails, updateAgentCategory);
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> UpdateAgentCategory(int agentCategoryId, [FromBody] UpdateAgentCategory agentCategoryDetails)
        {
            var result = await _agentCategoryService.UpdateAgentCategory(new AgentCategoryIdDetails { AgentCategoryId = agentCategoryId }, agentCategoryDetails);

            return(StatusCode((int)result.Code, result.Value));
        }