Exemple #1
0
        public async Task <IActionResult> GetCategoryByCateId(Guid cid)
        {
            var        userIdStr = User.Claims.FirstOrDefault(x => x.Type == "OryxUser")?.Value;
            ApiMessage apiMsg;

            if (string.IsNullOrEmpty(userIdStr))
            {
                apiMsg = await ApiMessage.Wrap(async() =>
                {
                    return(await contentBusiness.GetCategoryById(cid));
                });
            }
            else
            {
                var userId = Guid.Parse(userIdStr);
                apiMsg = await ApiMessage.Wrap(async() =>
                {
                    return(await contentBusiness.GetCategoryByIdWithUserReadLog(cid, userId));
                });
            }
            return(Json(apiMsg));
        }