Click here to enter the ABP Development Notes directory
Create a view model
Models in the display layer (i.e. JD.CRS.Web.Mvc) // New Course folder for storing model view associated Course
New models in two views JD.CRS.Web.Mvc / Models / Course
Read-only model
CourseListViewModel.cs // view model for querying Course
1 using System.Collections.Generic; 2 using JD.CRS.Course.Dto; 3 4 namespace JD.CRS.Web.Models.Course 5 { 6 7 public class CourseListViewModel 8 { 9 //public CourseDto Course { get; set; } 10 public IReadOnlyList<CourseDto> Courses { get; set; } 11 } 12 }
Writable model
EditCourseModalViewModel.cs // create / modify Course View Model
1 using JD.CRS.Course.Dto; 2 3 namespace JD.CRS.Web.Models.Course 4 { 5 6 public class EditCourseModalViewModel 7 { 8 public CourseDto Course { get; set; } 9 } 10 }