public void LoadBuildings() { IBuildingService buildingService = new BuildingService(); string message = String.Empty; try { var buildings = buildingService.GetAllBuildings(); buildingList = new List <Building>(buildings); gvBuilding.DataSource = buildings; gvBuilding.Refresh(); if (gvBuilding.RowCount != 0) { gvBuilding.Rows[0].IsSelected = true; } } catch (Exception ex) { message = "Error Loading Building List"; MessageBox.Show(ex.ToString()); } }
public async Task <IActionResult> GetAllBuildings() { var res = await BuildingService.GetAllBuildings(_context); return(new ObjectResult(res)); }