/*This method is simply use to get all locations * using service GetAllLocations, this method is use * for listing purpose. */ public IActionResult Location() { var locations = _location.GetAllLocations(); if (locations is null) { locations = new List <LocationDto>(); } return(View(locations)); }
/*GetAllLocations, for listing purpose */ public IActionResult Location() { var locations = _location.GetAllLocations(); //Returns a list of all available Locations (as DTO) if (locations is null) { locations = new List <LocationDto>(); } return(View(locations)); //Givers this List to the view ... Admin / Location }
//This method is use to return a view of store and populate location dropdown public IActionResult StorePlace() { ProductDto product = new ProductDto(); var locations = _location.GetAllLocations(); if (locations is null) { locations = new List <LocationDto>(); product.Locations = locations; } else { product.Locations = locations; } return(View(product)); }