示例#1
0
        public static GCR.Core.Entities.News ToModel(NewsViewModel model, GCR.Core.Entities.News news = null)
        {
            if (news == null)
            {
                news = new GCR.Core.Entities.News();
            }

            news.Title   = model.Title;
            news.Link    = model.Link;
            news.Summary = model.Summary;
            news.Article = model.Article;

            return(news);
        }
示例#2
0
        public static NewsViewModel ToViewModel(GCR.Core.Entities.News news, NewsViewModel model = null)
        {
            if (model == null)
            {
                model = new NewsViewModel();
            }
            model.NewsId     = news.NewsId;
            model.Title      = news.Title;
            model.Link       = news.Link;
            model.Summary    = news.Summary;
            model.Article    = news.Article;
            model.CreatedOn  = news.CreatedOn;
            model.ModifiedOn = news.ModifiedOn;

            return(model);
        }