public IEnumerable<Customer> Get()
		{
			using (var context = new OrderManagementContext())
			{
				return context.Customers.ToArray();
			}
		}
		public Customer Get(Guid id)
		{
			using (var context = new OrderManagementContext())
			{
				return context.Customers
					.SingleOrDefault(c => c.CustomerId == id);
			}
		}
		public IEnumerable<Customer> Get(string countryIsoCode)
		{
			using (var context = new OrderManagementContext())
			{
				return context.Customers
					.Where(c => c.CountryIsoCode == countryIsoCode)
					.ToArray();
			}
		}
示例#4
0
		static void Main(string[] args)
		{
			Console.WriteLine("Press any key to continue with clearing the database 'ODataFaq' on (localdb)\\v11.0 and filling it with demo data ...");
			Console.ReadKey();

			Console.WriteLine("Please be patient, generating data ...");
			using (var omc = new OrderManagementContext())
			{
				omc.ClearAndFillWithDemoData().Wait();
			}

			Console.WriteLine("Done. Press any key to quit ...");
			Console.ReadKey();
		}