public BaseViewModel(IConfiguration configuration) { _configuration = configuration; _baseUrl = _configuration["EndpointURL"]; MenuDTO menu = new MenuDTO(); var response = StaticDataHandler.GetDynamicMenuItems(_baseUrl);//This gets menu list from the database for all pages to be populated on load this.PageSetup = new PageSetupDTO { PageTitle = "Title" }; //initialising tto avoid null exception menu = JsonConvert.DeserializeObject <MenuDTO>(response); this.MinistryArms = menu.MinistryArms; this.ResourceTypes = menu.ResourceTypes; this.Branches = menu.Branches; }