Beispiel #1
0
 public GenreController(BookstoreContext ctx) => data = new Repository <Genre>(ctx);
Beispiel #2
0
 public ImportService(BookstoreContext context)
 {
     this.context = context;
 }
Beispiel #3
0
 public CartController(BookstoreContext ctx) => data = new Repository <Book>(ctx);
Beispiel #4
0
 public EfGetSingleAuthor(BookstoreContext context)
 {
     _context = context;
 }
Beispiel #5
0
 public BookController(BookstoreContext ctx) => data = new BookstoreUnitOfWork(ctx);
 public DbUseCaseLogger(BookstoreContext context)
 {
     _context = context;
 }
 public AuthorsController(BookstoreContext db)
 {
     this.db = db;
 }
Beispiel #8
0
 public BooksRepository(BookstoreContext db)
 {
     this.db = db;
 }
Beispiel #9
0
 public Repository(BookstoreContext ctx)
 {
     context = ctx;
     dbSet   = context.Set <T>();
 }
Beispiel #10
0
 public PrivilegedClientController(BookstoreContext context, IMapper mapper)
 {
     _context = context;
     _mapper  = mapper;
 }
 public BookstoreOrdersController(BookstoreContext context)
 {
     _context = context;
 }
Beispiel #12
0
 public BookStoreUnitOfWork(BookstoreContext ctx)
 {
     context = ctx;
 }
Beispiel #13
0
 public WarehouseService(BookstoreContext context)
 {
     this.context = context;
 }
Beispiel #14
0
 public BookstoreUnitOfWork(BookstoreContext ctx) => context = ctx;
Beispiel #15
0
 public ImageRepository(BookstoreContext context)
 {
     this._context = context;
 }
Beispiel #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);
 }
Beispiel #18
0
 public BooksRepository(BookstoreContext context)
 {
     context.Database.EnsureCreated();
     _context = context;
 }
Beispiel #19
0
 public EfDeleteAuthorCommand(BookstoreContext context)
 {
     _context = context;
 }
Beispiel #20
0
 public EfUpdateRoleCommand(BookstoreContext context, UpdateRoleValidator validator)
 {
     _context   = context;
     _validator = validator;
 }
 protected ControllerContext(BookstoreContext context, IMapper mapper)
 {
     _context = context;
     _mapper  = mapper;
 }
Beispiel #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();
        }
Beispiel #23
0
 public EfGetLogs(BookstoreContext context)
 {
     _context = context;
 }
 public ValidationController(BookstoreContext ctx)
 {
     authorData = new Repository <Author>(ctx);
     genreData  = new Repository <Genre>(ctx);
 }
Beispiel #25
0
 public AuthorController(BookstoreContext ctx) => data = new Repository <Author>(ctx);
Beispiel #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;
 }
Beispiel #29
0
 public UserRepository(BookstoreContext context)
 {
     this._context = context;
 }
Beispiel #30
0
 protected void Init()
 {
     Database.SetInitializer<BookstoreContext>(new LocalDbContextInitializer());
     Context = new BookstoreContext(connString);
 }
Beispiel #31
0
 public CustomerController(BookstoreContext context)
 {
     _context = context;
 }