Exemple #1
0
        public async Task OnGet()
        {
            BookDetail = await bookFacade.GetUserById(Request.Query.FirstOrDefault(a => a.Key == "id").Value);

            Authors = authorFacade.GetAuthorSelectorAsync().GetAwaiter().GetResult().Select(a =>
                                                                                            new SelectListItem
            {
                Selected = BookDetail.AuthorId == a.Key,
                Value    = a.Key.ToString(),
                Text     = a.Value
            }).ToList();
        }
Exemple #2
0
 public CreateBook(ILogger <CreateBook> logger, IBookFacade bookFacade, IAuthorFacade authorFacade)
 {
     BookDto         = new BookCreateDTO();
     this.logger     = logger;
     this.bookFacade = bookFacade;
     Authors         = authorFacade.GetAuthorSelectorAsync().GetAwaiter().GetResult().Select(a =>
                                                                                             new SelectListItem
     {
         Value = a.Key.ToString(),
         Text  = a.Value
     }).ToList();;
 }