public async Task <IActionResult> OnGetAsync(int?id) { if (id > 0) { room = await _context.ClassRooms.Where(d => d.Id == id).Select(d => new RoomItemViewModel { id = d.Id, className = d.ClassName, teacherName = d.TeacherName, location = d.Location }).FirstOrDefaultAsync(); if (room == null) { return(NotFound()); } } return(Page()); }
public RoomItemView() { InitializeComponent(); _room = new RoomItemViewModel(); }