Exemple #1
0
        public static void SeedData(this IGameStoreAdvertisementDbContext context, IDateTime dateTime)
        {
            var advertisements = Enumerable.Range(1, 2).Select(index => new Domain.Models.Advertisement
            {
                Description = "Top " + index,
                EndDateTime = dateTime.Now.AddDays(index)
            }).ToArray();

            context.Advertisements.AddRange(advertisements);
        }
Exemple #2
0
 public AdvertisementController(IDateTime dateTime, IGameStoreAdvertisementDbContext context)
 {
     this.dateTime = dateTime;
     this.context  = context;
 }