예제 #1
0
        public static void Initialize(BacchusDbContext c)
        {
            c.Database.EnsureCreated();
            if (c.Bids.Any())
            {
                return;
            }

            //fakeData(c); //TODO For mocking/testing
        }
예제 #2
0
        private static async void fakeData(BacchusDbContext c)
        {
            for (var i = 0; i < GetRandom.Int16(1, 5); i++)
            {
                var bid = new BidDbRecord {
                    ID        = Guid.NewGuid().ToString(),
                    UserId    = GetRandom.String() + GetRandom.DateTime(),
                    ProductId = Guid.NewGuid().ToString(),
                    Price     = GetRandom.Decimal(1, 100)
                };
                c.Bids.Add(bid);
            }

            await c.SaveChangesAsync();
        }
예제 #3
0
 public BidObjectsRepository(BacchusDbContext context)
 {
     db = context;
 }