public async Task <ActionResult> CreateCategoryAsync(int categoryId)
        {
            var meta = await AppUsers.GetCurrentAsync().ConfigureAwait(true);

            try
            {
                await CalendarCategoryModel.DeleteCategoryAsync(this.Tenant, meta, categoryId).ConfigureAwait(true);

                return(this.Ok());
            }
            catch (Exception ex)
            {
                return(this.Failed(ex.Message, HttpStatusCode.InternalServerError));
            }
        }
        public async Task <ActionResult> UpdateCategoryAsync(int categoryId, CalendarCategory model)
        {
            if (!this.ModelState.IsValid)
            {
                return(this.InvalidModelState(this.ModelState));
            }


            var meta = await AppUsers.GetCurrentAsync().ConfigureAwait(true);

            try
            {
                await CalendarCategoryModel.UpdateCategoryAsync(this.Tenant, meta, categoryId, model).ConfigureAwait(true);

                return(this.Ok());
            }
            catch (Exception ex)
            {
                return(this.Failed(ex.Message, HttpStatusCode.InternalServerError));
            }
        }
        public async Task <ActionResult> OrderCategoriesAsync(List <CategoryOrder> orderInfo)
        {
            if (!this.ModelState.IsValid)
            {
                return(this.InvalidModelState(this.ModelState));
            }


            var meta = await AppUsers.GetCurrentAsync().ConfigureAwait(true);

            try
            {
                await CalendarCategoryModel.OrderCategoriesAsync(this.Tenant, meta, orderInfo).ConfigureAwait(true);

                return(this.Ok());
            }
            catch (Exception ex)
            {
                return(this.Failed(ex.Message, HttpStatusCode.InternalServerError));
            }
        }