private async Task Add100AnsweredContacts(ZooPlanetDbContext db)
        {
            for (var i = 0; i < 100; i++)
            {
                await db.AddAsync(new Contact
                {
                    Title       = $"Random title {i}",
                    AddedOn     = DateTime.UtcNow,
                    Message     = $"Some Random Message {i}",
                    IsAnswered  = true,
                    ContactType = (ContactType)this.randomGenerator.Next(1, 4)
                });
            }

            await db.SaveChangesAsync();
        }
Пример #2
0
 public UserAdminService(ZooPlanetDbContext db)
 {
     this.db = db;
 }
Пример #3
0
 public ContactService(ZooPlanetDbContext db)
 {
     this.db = db;
 }
Пример #4
0
 public AnimalService(ZooPlanetDbContext db)
 {
     this.db = db;
 }