Example #1
0
        public async Task <StandardOutput <bool> > CreateCategory(string name)
        {
            var responseMessage = await _categoryProvider.CreateCategory(new CreateUpdateCategoryInput { Name = name });

            if (responseMessage.StateCode != Define.StateCode.OK)
            {
                return new StandardOutput <bool>
                       {
                           Entity  = false,
                           Message = $"Create category failed. Check if category Name: {name} is already existed."
                       }
            }
            ;
            return(new StandardOutput <bool>
            {
                Entity = true,
                Message = "Create category succeed."
            });
        }