示例#1
0
		private static void AddSomeEvents(int instanceNum)
		{
			const int numToAdd = 5000;
			Console.Write("Adding {0} events...", numToAdd);

			foreach (int i in Enumerable.Range(++instanceNum, numToAdd))
			{
				Event e = new Event()
				{
					Id = Guid.NewGuid(),
					Description = "Event #" + i,
					Price = i,
					StartTime = DateTime.UtcNow,
					InstanceNum = i
				};
				repo.Add(e);
			}

			Console.WriteLine("Done");
		}
示例#2
0
		private static void AddTomorrowsEvents(int num)
		{
			const int numToAdd = 10;
			DateTime tomorrow = DateTime.Now.AddDays(1);
			Console.Write("Adding {0} events for tomorrow...", numToAdd);

			foreach (int i in Enumerable.Range(++num, numToAdd))
			{
				Event e = new Event()
				{
					Id = Guid.NewGuid(),
					Description = "Event #" + i,
					Price = i,
					StartTime = tomorrow,
					InstanceNum = i
				};
				repo.Add(e);
			}

			Console.WriteLine("Done");
		}