示例#1
0
 public GenreController(BookstoreContext ctx) => data = new Repository <Genre>(ctx);
示例#2
0
 public ImportService(BookstoreContext context)
 {
     this.context = context;
 }
示例#3
0
 public CartController(BookstoreContext ctx) => data = new Repository <Book>(ctx);
示例#4
0
 public EfGetSingleAuthor(BookstoreContext context)
 {
     _context = context;
 }
示例#5
0
 public BookController(BookstoreContext ctx) => data = new BookstoreUnitOfWork(ctx);
 public DbUseCaseLogger(BookstoreContext context)
 {
     _context = context;
 }
 public AuthorsController(BookstoreContext db)
 {
     this.db = db;
 }
示例#8
0
 public BooksRepository(BookstoreContext db)
 {
     this.db = db;
 }
示例#9
0
 public Repository(BookstoreContext ctx)
 {
     context = ctx;
     dbSet   = context.Set <T>();
 }
示例#10
0
 public PrivilegedClientController(BookstoreContext context, IMapper mapper)
 {
     _context = context;
     _mapper  = mapper;
 }
 public BookstoreOrdersController(BookstoreContext context)
 {
     _context = context;
 }
示例#12
0
 public BookStoreUnitOfWork(BookstoreContext ctx)
 {
     context = ctx;
 }
示例#13
0
 public WarehouseService(BookstoreContext context)
 {
     this.context = context;
 }
示例#14
0
 public BookstoreUnitOfWork(BookstoreContext ctx) => context = ctx;
示例#15
0
 public ImageRepository(BookstoreContext context)
 {
     this._context = context;
 }
示例#16
0
 public BookstoreController(BookstoreContext context, IConfiguration configuration)
 {
     _context = context;
     ny       = new NYTimesDAL(configuration);
 }
 // Fully sets up the HomeIndexViewModel by calling its extension methods defined below
 public static void FullSetUp(this HomeIndexViewModel homeIndexVM, BookstoreContext db)
 {
     homeIndexVM.SetFeaturedBooks(db);
     homeIndexVM.SetSections(db);
     homeIndexVM.SetOtherGenres(db);
 }
示例#18
0
 public BooksRepository(BookstoreContext context)
 {
     context.Database.EnsureCreated();
     _context = context;
 }
示例#19
0
 public EfDeleteAuthorCommand(BookstoreContext context)
 {
     _context = context;
 }
示例#20
0
 public EfUpdateRoleCommand(BookstoreContext context, UpdateRoleValidator validator)
 {
     _context   = context;
     _validator = validator;
 }
 protected ControllerContext(BookstoreContext context, IMapper mapper)
 {
     _context = context;
     _mapper  = mapper;
 }
示例#22
0
        private static void AddTestData(BookstoreContext context)
        {
            context.Books.Add(new Book
            {
                Title          = "Where the Red Fern Grows",
                Description    = "Where the Red Fern Grows is a 1961 children's novel...",
                PublishedMonth = 0,
                PublishedDay   = 0,
                PublishedYear  = 1961,
                CoverImageUrl  = "//via.placeholder.com/100x100"
            });

            context.Books.Add(new Book
            {
                Title          = "Another Book",
                Description    = "...",
                PublishedMonth = 4,
                PublishedDay   = 1,
                PublishedYear  = 1975,
                CoverImageUrl  = "//via.placeholder.com/100x100"
            });


            context.Authors.Add(new Author
            {
                FirstName        = "Wilson",
                LastName         = "Rawls",
                HeadshotImageUrl = "//via.placeholder.com/100x100"
            });

            context.Authors.Add(new Author
            {
                FirstName        = "Mark",
                LastName         = "Twain",
                HeadshotImageUrl = "//via.placeholder.com/100x100"
            });

            context.Authors.Add(new Author
            {
                FirstName        = "John",
                LastName         = "Smith",
                HeadshotImageUrl = "//via.placeholder.com/100x100"
            });

            context.BookAuthors.Add(new BookAuthor
            {
                BookID   = 1,
                AuthorID = 1
            });

            context.BookAuthors.Add(new BookAuthor
            {
                BookID   = 1,
                AuthorID = 2
            });

            context.BookAuthors.Add(new BookAuthor
            {
                BookID   = 2,
                AuthorID = 3
            });

            context.Reviews.Add(new Review
            {
                BookID        = 1,
                ReviewerName  = "John Smith",
                ReviewContent = "Great book!",
                Rating        = 5,
                DatePublished = new DateTime()
            });

            context.Reviews.Add(new Review
            {
                BookID        = 1,
                ReviewerName  = "Bill Jones",
                ReviewContent = "One of the best classics, but sad :-(",
                Rating        = 4,
                DatePublished = new DateTime()
            });

            context.SaveChanges();
        }
示例#23
0
 public EfGetLogs(BookstoreContext context)
 {
     _context = context;
 }
示例#24
0
 public ValidationController(BookstoreContext ctx)
 {
     authorData = new Repository <Author>(ctx);
     genreData  = new Repository <Genre>(ctx);
 }
示例#25
0
 public AuthorController(BookstoreContext ctx) => data = new Repository <Author>(ctx);
示例#26
0
 public BookStoreUnitOfwork(BookstoreContext ctx)
 {
     this.ctx = ctx;
 }
 public CaseController(BookstoreContext context, IMapper mapper) : base(context, mapper) {}
 public EfGetSingleOrder(BookstoreContext context, IApplicationActor actor)
 {
     _context = context;
     _actor   = actor;
 }
示例#29
0
 public UserRepository(BookstoreContext context)
 {
     this._context = context;
 }
示例#30
0
 protected void Init()
 {
     Database.SetInitializer<BookstoreContext>(new LocalDbContextInitializer());
     Context = new BookstoreContext(connString);
 }
示例#31
0
 public CustomerController(BookstoreContext context)
 {
     _context = context;
 }