コード例 #1
0
		public IEnumerable<Customer> Get()
		{
			using (var context = new OrderManagementContext())
			{
				return context.Customers.ToArray();
			}
		}
コード例 #2
0
		public Customer Get(Guid id)
		{
			using (var context = new OrderManagementContext())
			{
				return context.Customers
					.SingleOrDefault(c => c.CustomerId == id);
			}
		}
コード例 #3
0
		public IEnumerable<Customer> Get(string countryIsoCode)
		{
			using (var context = new OrderManagementContext())
			{
				return context.Customers
					.Where(c => c.CountryIsoCode == countryIsoCode)
					.ToArray();
			}
		}
コード例 #4
0
ファイル: Program.cs プロジェクト: mkandroid15/Samples
		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();
		}