コード例 #1
0
        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);
        }
コード例 #2
0
 protected async override Task OnInitializedAsync()
 {
     Locations = await LocationServices.GetLocations();
 }
コード例 #3
0
 protected async override Task OnInitializedAsync()
 {
     Books     = (await BookServices.GetBooks()).ToList();
     Locations = (await LocationServices.GetLocations()).ToList();
 }