예제 #1
0
 public static void Initialize(EBooksContext context)
 {
     if (!context.Suppliers.Any())
     {
         context.Suppliers.Add(
             new Supplier()
         {
             CompanyName = "IBook",
             Description = "One of the best seller for e-books",
             Phone       = "+375447682231",
             Email       = "*****@*****.**",
         }
             );
         context.SaveChanges();
     }
 }
예제 #2
0
 public SupplierRepository(EBooksContext context) : base(context)
 {
     _context = context;
 }
 public OrderDetailRepository(EBooksContext context) : base(context)
 {
     _context = context;
 }
예제 #4
0
 public UnitOfWork(EBooksContext context)
 {
     _context = context;
 }
 /// <summary>
 /// creates instance of PollResults repository
 /// </summary>
 /// <param name="context">DbContext</param>
 public PollResultsRepository(EBooksContext context)
 {
     db = context;
 }
예제 #6
0
 /// <summary>
 /// creates instance of reviews repository
 /// </summary>
 /// <param name="context">DbContext</param>
 public ReviewsRepository(EBooksContext context)
 {
     db = context;
 }
예제 #7
0
 public Repository(EBooksContext db)
 {
     _entity = db.Set <T>();
     _db     = db;
 }
예제 #8
0
 public CustomerRepository(EBooksContext context) : base(context)
 {
     _context = context;
 }
예제 #9
0
 public ProductRepository(EBooksContext context) : base(context)
 {
     _context = context;
 }
예제 #10
0
 /// <summary>
 /// creating instance of EF unit of work
 /// </summary>
 /// <param name="connectionString">string of connection</param>
 public EFUnitOfWork(string connectionString)
 {
     db = new EBooksContext(connectionString);
 }