Пример #1
0
        public void PopulateGenreDropDownList(BookAppContext _context, object selectGenre = null)
        {
            var genreQuery = from d in _context.Genres
                             orderby d.GenreName
                             select d;

            GenreSL = new SelectList(genreQuery.AsNoTracking(), "ID", "GenreName", selectGenre);
        }
Пример #2
0
        public void PopulateAuthorDropDownList(BookAppContext _context,
                                               object selectAuthor = null)
        {
            var authorQuery = from d in _context.Authors
                              orderby d.LastName    // Sort by name.
                              select d;

            AuthorSL = new SelectList(authorQuery.AsNoTracking(),
                                      "ID", "FirstName" + " " + "MiddleName" + " " + "LastName", selectAuthor);
        }
Пример #3
0
        public void PopulatePublisherDropDownList(BookAppContext _context,
                                                  object selectPublisher = null)
        {
            var publisherQuery = from d in _context.Publishers
                                 orderby d.PublisherName
                                 select d;

            PublisherSL = new SelectList(publisherQuery.AsNoTracking(),
                                         "ID", "PublisherName", selectPublisher);
        }
 public BasicAuthenticationHandler(
     IOptionsMonitor <AuthenticationSchemeOptions> options,
     ILoggerFactory logger,
     UrlEncoder encoder,
     ISystemClock clock,
     BookAppContext context
     ) : base(options, logger, encoder, clock)
 {
     _context = context;
 }
Пример #5
0
        public void PopulateAuthorDropDownList(BookAppContext _context,
                                               object selectAuthor = null)
        {
            var authorQuery = from d in _context.Authors
                              orderby d.LastName
                              select d;


            AuthorSL = new SelectList((from d in _context.Authors.ToList()
                                       select new
            {
                ID = d.ID,
                FullName = d.FirstName + " " + d.MiddleName + " " + d.LastName
            }), "ID", "FullName", selectAuthor);
        }
Пример #6
0
 public BooksController(BookAppContext context)
 {
     this.context = context;
 }
Пример #7
0
 public UsersController(BookAppContext context, IOptions <JWTSettings> jwtSettings)
 {
     _context     = context;
     _jwtSettings = jwtSettings.Value;
 }