public List <ViewClassDetail> GetClassDetail(string whereStr, int page, int pagesize, out int count) { List <ClassDetail> list = _repository.GetClassDetail(whereStr, page, pagesize, out count); List <ViewClassDetail> model = new List <ViewClassDetail>(); foreach (var item in list) { model.Add(ViewClassDetail.ToViewModel(item)); } return(model); }
public ViewClassDetail Add(ViewClassDetail entity) { ClassDetail model = _repository.Add(ViewClassDetail.ToEntity(entity)); return(ViewClassDetail.ToViewModel(model)); }