Пример #1
0
        public async Task <ViewModel.ServiceResult> PostEditRss([FromBody] ViewModel.ContentManager.RssVM model)
        {
            try
            {
                var res = await ContentManagerRepository.EditRss(new Models.ContentManager.Rss()
                {
                    _id        = model._id,
                    title      = model.title,
                    url        = model.url,
                    siteid     = model.siteid,
                    lang       = model.lang,
                    tags       = model.tags,
                    categories = model.categories
                });

                if (res)
                {
                    return new ViewModel.ServiceResult()
                           {
                               ServiceResultStatus  = (int)Rdio.Util.Common.ServiceResultStatus.OK,
                               ServiceResultMassage = Util.Common.ServiceResultMessage.OKMessage.ToString()
                           }
                }
                ;
                else
                {
                    return new ViewModel.ServiceResult()
                           {
                               ServiceResultStatus  = (int)Rdio.Util.Common.ServiceResultStatus.Error,
                               ServiceResultMassage = Util.Common.ServiceResultMessage.FaildMessage.ToString()
                           }
                };
            }
            catch (Exception ex)
            {
                return(new ViewModel.ServiceResult()
                {
                    ServiceResultStatus = (int)Rdio.Util.Common.ServiceResultStatus.Error,
                    ServiceResultMassage = ex.GetBaseException().Message
                });
            }
        }