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); }
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); }
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; }
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); }
public BooksController(BookAppContext context) { this.context = context; }
public UsersController(BookAppContext context, IOptions <JWTSettings> jwtSettings) { _context = context; _jwtSettings = jwtSettings.Value; }