public static tLearing ToEntity(ViewtLearing model) { tLearing item = new tLearing(); item.ID = model.ID; item.Uid = model.Uid; item.sPic = model.sPic; item.CreateDate = model.CreateDate; item.sTitle = model.sTitle; item.iReadNums = model.iReadNums; item.iWritelogNums = model.iWritelogNums; item.iZanNums = model.iZanNums; item.iType = model.iType; item.sContent = model.sContent; item.ifexamine = model.ifexamine; item.UrlType = model.UrlType; return(item); }
public static ViewtLearing ToViewModel(tLearing model) { if (model == null) { return(null); } ViewtLearing item = new ViewtLearing(); item.ID = model.ID; item.Uid = model.Uid; item.sPic = model.sPic; item.CreateDate = model.CreateDate; item.sTitle = model.sTitle; item.iReadNums = model.iReadNums; item.iWritelogNums = model.iWritelogNums; item.iZanNums = model.iZanNums; item.iType = model.iType; item.sContent = model.sContent; item.ifexamine = model.ifexamine; item.UrlType = model.UrlType; return(item); }