protected async override Task OnInitializedAsync()
        {
            int.TryParse(Id, out int bookId);
            if (bookId != 0)
            {
                Book = await BookServices.GetBook(int.Parse(Id));

                HeaderText = "Edit Book";
            }
            else
            {
                Book = new Book
                {
                    locationId = 1,
                    Category   = 0,
                    PhotoPath  = "images/5.png"
                };
            }
            Locations = (await LocationServices.GetLocations()).ToList();

            Mapper.Map(Book, EditBookModel);
        }
Example #2
0
 protected async override Task OnInitializedAsync()
 {
     Locations = await LocationServices.GetLocations();
 }
Example #3
0
 protected async override Task OnInitializedAsync()
 {
     Books     = (await BookServices.GetBooks()).ToList();
     Locations = (await LocationServices.GetLocations()).ToList();
 }