Пример #1
0
        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());
        }
Пример #2
0
 public RoomItemView()
 {
     InitializeComponent();
     _room = new RoomItemViewModel();
 }