コード例 #1
0
        public static void Seed(this kwooncjpContext dbContext)
        {
            // Add entities for DbContext instance

            dbContext.Productinfos.Add(new Productinfos
            {
                Id          = 1,
                Productname = "Test",
                Unitprice   = 1
            });
        }
コード例 #2
0
        public static kwooncjpContext GetWideWorldImportersDbContext(string dbName)
        {
            // Create options for DbContext instance
            var options = new DbContextOptionsBuilder <kwooncjpContext>()
                          .UseInMemoryDatabase(databaseName: dbName)
                          .Options;

            // Create instance of DbContext
            var dbContext = new kwooncjpContext(options);

            // Add entities in memory
            dbContext.Seed();

            return(dbContext);
        }
コード例 #3
0
 public ProductsRespository(kwooncjpContext context, IMapper mapper) : base(context)
 {
     _mapper = mapper;
 }
コード例 #4
0
 public BaseRepository(kwooncjpContext context)
 {
     _context = context;
 }