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); }
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); }