示例#1
0
        public static InterestedClass ToEntity(ViewInterestedClass model)
        {
            InterestedClass item = new InterestedClass();

            item.Id         = model.Id;
            item.ClassId    = model.ClassId;
            item.UserId     = model.UserId;
            item.IsDeleted  = model.IsDeleted;
            item.CreateTime = model.CreateTime;

            return(item);
        }
示例#2
0
        public static ViewInterestedClass ToViewModel(InterestedClass model)
        {
            if (model == null)
            {
                return(null);
            }

            ViewInterestedClass item = new ViewInterestedClass();

            item.Id                    = model.Id;
            item.ClassId               = model.ClassId;
            item.UserId                = model.UserId;
            item.IsDeleted             = model.IsDeleted;
            item.CreateTime            = model.CreateTime;
            item.Class                 = model.Class;
            item.Class.InterestedClass = null;
            return(item);
        }