Mercurial > pub > bltoolkit
comparison Demo/Silverlight/Client/DataModel.generated.cs @ 0:f990fcb411a9
Копия текущей версии из github
author | cin |
---|---|
date | Thu, 27 Mar 2014 21:46:09 +0400 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:f990fcb411a9 |
---|---|
1 //--------------------------------------------------------------------------------------------------- | |
2 // <auto-generated> | |
3 // This code was generated by BLToolkit template for T4. | |
4 // Changes to this file may cause incorrect behavior and will be lost if the code is regenerated. | |
5 // </auto-generated> | |
6 //--------------------------------------------------------------------------------------------------- | |
7 using System; | |
8 using System.Collections.Generic; | |
9 using System.Linq; | |
10 using System.Linq.Expressions; | |
11 using System.Reflection; | |
12 using System.ServiceModel; | |
13 using System.Text; | |
14 | |
15 using BLToolkit.Data; | |
16 using BLToolkit.Data.DataProvider; | |
17 using BLToolkit.Data.Linq; | |
18 using BLToolkit.Data.Sql; | |
19 using BLToolkit.Data.Sql.SqlProvider; | |
20 using BLToolkit.DataAccess; | |
21 using BLToolkit.Mapping; | |
22 using BLToolkit.ServiceModel; | |
23 | |
24 namespace Client | |
25 { | |
26 public partial class DataModel : SoapDataContext | |
27 { | |
28 public Table<AlphabeticalListOfProducts> AlphabeticalListOfProducts { get { return this.GetTable<AlphabeticalListOfProducts>(); } } | |
29 /// <summary> | |
30 /// Description for Categories table. | |
31 /// </summary> | |
32 public Table<Categories> Categories { get { return this.GetTable<Categories>(); } } | |
33 public Table<CategorySalesFor1997> CategorySalesFor1997 { get { return this.GetTable<CategorySalesFor1997>(); } } | |
34 public Table<CurrentProductList> CurrentProductList { get { return this.GetTable<CurrentProductList>(); } } | |
35 public Table<CustomerAndSuppliersByCity> CustomerAndSuppliersByCity { get { return this.GetTable<CustomerAndSuppliersByCity>(); } } | |
36 public Table<CustomerCustomerDemo> CustomerCustomerDemo { get { return this.GetTable<CustomerCustomerDemo>(); } } | |
37 public Table<CustomerDemographics> CustomerDemographics { get { return this.GetTable<CustomerDemographics>(); } } | |
38 /// <summary> | |
39 /// Description of Customers table. | |
40 /// </summary> | |
41 public Table<Customers> Customers { get { return this.GetTable<Customers>(); } } | |
42 public Table<Employees> Employees { get { return this.GetTable<Employees>(); } } | |
43 public Table<EmployeeTerritories> EmployeeTerritories { get { return this.GetTable<EmployeeTerritories>(); } } | |
44 public Table<Invoices> Invoices { get { return this.GetTable<Invoices>(); } } | |
45 public Table<OrderDetails> OrderDetails { get { return this.GetTable<OrderDetails>(); } } | |
46 public Table<OrderDetailsExtended> OrderDetailsExtended { get { return this.GetTable<OrderDetailsExtended>(); } } | |
47 public Table<OrderSubtotals> OrderSubtotals { get { return this.GetTable<OrderSubtotals>(); } } | |
48 public Table<Orders> Orders { get { return this.GetTable<Orders>(); } } | |
49 public Table<OrdersQry> OrdersQry { get { return this.GetTable<OrdersQry>(); } } | |
50 public Table<ProductSalesFor1997> ProductSalesFor1997 { get { return this.GetTable<ProductSalesFor1997>(); } } | |
51 public Table<Products> Products { get { return this.GetTable<Products>(); } } | |
52 public Table<ProductsAboveAveragePrice> ProductsAboveAveragePrice { get { return this.GetTable<ProductsAboveAveragePrice>(); } } | |
53 public Table<ProductsByCategory> ProductsByCategory { get { return this.GetTable<ProductsByCategory>(); } } | |
54 public Table<QuarterlyOrders> QuarterlyOrders { get { return this.GetTable<QuarterlyOrders>(); } } | |
55 public Table<Region> Region { get { return this.GetTable<Region>(); } } | |
56 public Table<SalesByCategory> SalesByCategory { get { return this.GetTable<SalesByCategory>(); } } | |
57 public Table<SalesTotalsByAmount> SalesTotalsByAmount { get { return this.GetTable<SalesTotalsByAmount>(); } } | |
58 public Table<Shippers> Shippers { get { return this.GetTable<Shippers>(); } } | |
59 public Table<SummaryOfSalesByQuarter> SummaryOfSalesByQuarter { get { return this.GetTable<SummaryOfSalesByQuarter>(); } } | |
60 public Table<SummaryOfSalesByYear> SummaryOfSalesByYear { get { return this.GetTable<SummaryOfSalesByYear>(); } } | |
61 public Table<Suppliers> Suppliers { get { return this.GetTable<Suppliers>(); } } | |
62 public Table<Territories> Territories { get { return this.GetTable<Territories>(); } } | |
63 | |
64 #region FreeTextTable | |
65 | |
66 public class FreeTextKey<T> | |
67 { | |
68 public T Key; | |
69 public int Rank; | |
70 } | |
71 | |
72 class FreeTextTableExpressionAttribute : TableExpressionAttribute | |
73 { | |
74 public FreeTextTableExpressionAttribute() | |
75 : base("") | |
76 { | |
77 } | |
78 | |
79 public override void SetTable(SqlTable table, MemberInfo member, IEnumerable<Expression> expArgs, IEnumerable<ISqlExpression> sqlArgs) | |
80 { | |
81 var aargs = sqlArgs.ToArray(); | |
82 var arr = ConvertArgs(member, aargs).ToList(); | |
83 var method = (MethodInfo)member; | |
84 var sp = new MsSql2008SqlProvider(); | |
85 | |
86 { | |
87 var ttype = method.GetGenericArguments()[0]; | |
88 var tbl = new SqlTable(ttype); | |
89 | |
90 var database = tbl.Database == null ? null : sp.Convert(tbl.Database, ConvertType.NameToDatabase). ToString(); | |
91 var owner = tbl.Owner == null ? null : sp.Convert(tbl.Owner, ConvertType.NameToOwner). ToString(); | |
92 var physicalName = tbl.PhysicalName == null ? null : sp.Convert(tbl.PhysicalName, ConvertType.NameToQueryTable).ToString(); | |
93 | |
94 var name = sp.BuildTableName(new StringBuilder(), database, owner, physicalName); | |
95 | |
96 arr.Add(new SqlExpression(name.ToString(), Precedence.Primary)); | |
97 } | |
98 | |
99 { | |
100 var field = ((ConstantExpression)expArgs.First()).Value; | |
101 | |
102 if (field is string) | |
103 { | |
104 arr[0] = new SqlExpression(field.ToString(), Precedence.Primary); | |
105 } | |
106 else if (field is LambdaExpression) | |
107 { | |
108 var body = ((LambdaExpression)field).Body; | |
109 | |
110 if (body is MemberExpression) | |
111 { | |
112 var name = ((MemberExpression)body).Member.Name; | |
113 | |
114 name = sp.Convert(name, ConvertType.NameToQueryField).ToString(); | |
115 | |
116 arr[0] = new SqlExpression(name, Precedence.Primary); | |
117 } | |
118 } | |
119 } | |
120 | |
121 table.SqlTableType = SqlTableType.Expression; | |
122 table.Name = "FREETEXTTABLE({6}, {2}, {3}) {1}"; | |
123 table.TableArguments = arr.ToArray(); | |
124 } | |
125 } | |
126 | |
127 [FreeTextTableExpressionAttribute] | |
128 public Table<FreeTextKey<TKey>> FreeTextTable<TTable,TKey>(string field, string text) | |
129 { | |
130 return this.GetTable<FreeTextKey<TKey>>( | |
131 this, | |
132 ((MethodInfo)(MethodBase.GetCurrentMethod())).MakeGenericMethod(typeof(TTable), typeof(TKey)), | |
133 field, | |
134 text); | |
135 } | |
136 | |
137 [FreeTextTableExpressionAttribute] | |
138 public Table<FreeTextKey<TKey>> FreeTextTable<TTable,TKey>(Expression<Func<TTable,string>> fieldSelector, string text) | |
139 { | |
140 return this.GetTable<FreeTextKey<TKey>>( | |
141 this, | |
142 ((MethodInfo)(MethodBase.GetCurrentMethod())).MakeGenericMethod(typeof(TTable), typeof(TKey)), | |
143 fieldSelector, | |
144 text); | |
145 } | |
146 | |
147 #endregion | |
148 } | |
149 | |
150 // View | |
151 [TableName(Name="Alphabetical list of products")] | |
152 public partial class AlphabeticalListOfProducts | |
153 { | |
154 public int ProductID { get; set; } // int(10) | |
155 public string ProductName { get; set; } // nvarchar(40) | |
156 [Nullable] public int? SupplierID { get; set; } // int(10) | |
157 [Nullable] public int? CategoryID { get; set; } // int(10) | |
158 [Nullable] public string QuantityPerUnit { get; set; } // nvarchar(20) | |
159 [Nullable] public decimal? UnitPrice { get; set; } // money(19,4) | |
160 [Nullable] public short? UnitsInStock { get; set; } // smallint(5) | |
161 [Nullable] public short? UnitsOnOrder { get; set; } // smallint(5) | |
162 [Nullable] public short? ReorderLevel { get; set; } // smallint(5) | |
163 public bool Discontinued { get; set; } // bit | |
164 public string CategoryName { get; set; } // nvarchar(15) | |
165 } | |
166 | |
167 /// <summary> | |
168 /// Description for Categories table. | |
169 /// </summary> | |
170 [TableName(Name="Categories")] | |
171 public partial class Categories | |
172 { | |
173 /// <summary> | |
174 /// Description of Categories.CategoryID field. | |
175 /// </summary> | |
176 [Identity, PrimaryKey(1)] public int CategoryID { get; set; } // int(10) | |
177 public string CategoryName { get; set; } // nvarchar(15) | |
178 [Nullable ] public string Description { get; set; } // ntext(1073741823) | |
179 [Nullable ] public byte[] Picture { get; set; } // image(2147483647) | |
180 | |
181 // FK_Products_Categories_BackReference | |
182 [Association(ThisKey="CategoryID", OtherKey="CategoryID", CanBeNull=true)] | |
183 public IEnumerable<Products> Productss { get; set; } | |
184 } | |
185 | |
186 // View | |
187 [TableName(Name="Category Sales for 1997")] | |
188 public partial class CategorySalesFor1997 | |
189 { | |
190 public string CategoryName { get; set; } // nvarchar(15) | |
191 [Nullable] public decimal? CategorySales { get; set; } // money(19,4) | |
192 } | |
193 | |
194 // View | |
195 [TableName(Name="Current Product List")] | |
196 public partial class CurrentProductList | |
197 { | |
198 [Identity] public int ProductID { get; set; } // int(10) | |
199 public string ProductName { get; set; } // nvarchar(40) | |
200 } | |
201 | |
202 // View | |
203 [TableName(Name="Customer and Suppliers by City")] | |
204 public partial class CustomerAndSuppliersByCity | |
205 { | |
206 [Nullable] public string City { get; set; } // nvarchar(15) | |
207 public string CompanyName { get; set; } // nvarchar(40) | |
208 [Nullable] public string ContactName { get; set; } // nvarchar(30) | |
209 public string Relationship { get; set; } // varchar(9) | |
210 } | |
211 | |
212 [TableName(Name="CustomerCustomerDemo")] | |
213 public partial class CustomerCustomerDemo | |
214 { | |
215 [PrimaryKey(1)] public string CustomerID { get; set; } // nchar(5) | |
216 [PrimaryKey(2)] public string CustomerTypeID { get; set; } // nchar(10) | |
217 | |
218 // FK_CustomerCustomerDemo | |
219 [Association(ThisKey="CustomerTypeID", OtherKey="CustomerTypeID", CanBeNull=false)] | |
220 public CustomerDemographics FK_CustomerCustomerDemo { get; set; } | |
221 | |
222 // FK_CustomerCustomerDemo_Customers | |
223 [Association(ThisKey="CustomerID", OtherKey="CustomerID", CanBeNull=false)] | |
224 public Customers Customers { get; set; } | |
225 } | |
226 | |
227 [TableName(Name="CustomerDemographics")] | |
228 public partial class CustomerDemographics | |
229 { | |
230 [ PrimaryKey(1)] public string CustomerTypeID { get; set; } // nchar(10) | |
231 [Nullable ] public string CustomerDesc { get; set; } // ntext(1073741823) | |
232 | |
233 // FK_CustomerCustomerDemo_BackReference | |
234 [Association(ThisKey="CustomerTypeID", OtherKey="CustomerTypeID", CanBeNull=true)] | |
235 public IEnumerable<CustomerCustomerDemo> CustomerCustomerDemos { get; set; } | |
236 } | |
237 | |
238 /// <summary> | |
239 /// Description of Customers table. | |
240 /// </summary> | |
241 [TableName(Name="Customers")] | |
242 public partial class Customers | |
243 { | |
244 /// <summary> | |
245 /// Just ID. | |
246 /// </summary> | |
247 [ PrimaryKey(1)] public string CustomerID { get; set; } // nchar(5) | |
248 /// <summary> | |
249 /// Name of the Company. | |
250 /// </summary> | |
251 public string CompanyName { get; set; } // nvarchar(40) | |
252 [Nullable ] public string ContactName { get; set; } // nvarchar(30) | |
253 [Nullable ] public string ContactTitle { get; set; } // nvarchar(30) | |
254 [Nullable ] public string Address { get; set; } // nvarchar(60) | |
255 [Nullable ] public string City { get; set; } // nvarchar(15) | |
256 [Nullable ] public string Region { get; set; } // nvarchar(15) | |
257 [Nullable ] public string PostalCode { get; set; } // nvarchar(10) | |
258 [Nullable ] public string Country { get; set; } // nvarchar(15) | |
259 [Nullable ] public string Phone { get; set; } // nvarchar(24) | |
260 [Nullable ] public string Fax { get; set; } // nvarchar(24) | |
261 | |
262 // FK_Orders_Customers_BackReference | |
263 [Association(ThisKey="CustomerID", OtherKey="CustomerID", CanBeNull=true)] | |
264 public IEnumerable<Orders> Orderss { get; set; } | |
265 | |
266 // FK_CustomerCustomerDemo_Customers_BackReference | |
267 [Association(ThisKey="CustomerID", OtherKey="CustomerID", CanBeNull=true)] | |
268 public IEnumerable<CustomerCustomerDemo> CustomerCustomerDemos { get; set; } | |
269 } | |
270 | |
271 [TableName(Name="Employees")] | |
272 public partial class Employees | |
273 { | |
274 [Identity, PrimaryKey(1)] public int EmployeeID { get; set; } // int(10) | |
275 public string LastName { get; set; } // nvarchar(20) | |
276 public string FirstName { get; set; } // nvarchar(10) | |
277 [Nullable ] public string Title { get; set; } // nvarchar(30) | |
278 [Nullable ] public string TitleOfCourtesy { get; set; } // nvarchar(25) | |
279 [Nullable ] public DateTime? BirthDate { get; set; } // datetime(3) | |
280 [Nullable ] public DateTime? HireDate { get; set; } // datetime(3) | |
281 [Nullable ] public string Address { get; set; } // nvarchar(60) | |
282 [Nullable ] public string City { get; set; } // nvarchar(15) | |
283 [Nullable ] public string Region { get; set; } // nvarchar(15) | |
284 [Nullable ] public string PostalCode { get; set; } // nvarchar(10) | |
285 [Nullable ] public string Country { get; set; } // nvarchar(15) | |
286 [Nullable ] public string HomePhone { get; set; } // nvarchar(24) | |
287 [Nullable ] public string Extension { get; set; } // nvarchar(4) | |
288 [Nullable ] public byte[] Photo { get; set; } // image(2147483647) | |
289 [Nullable ] public string Notes { get; set; } // ntext(1073741823) | |
290 [Nullable ] public int? ReportsTo { get; set; } // int(10) | |
291 [Nullable ] public string PhotoPath { get; set; } // nvarchar(255) | |
292 | |
293 // FK_Employees_Employees | |
294 [Association(ThisKey="ReportsTo", OtherKey="EmployeeID", CanBeNull=true)] | |
295 public Employees FK_Employees_Employees { get; set; } | |
296 | |
297 // FK_Orders_Employees_BackReference | |
298 [Association(ThisKey="EmployeeID", OtherKey="EmployeeID", CanBeNull=true)] | |
299 public IEnumerable<Orders> Orderss { get; set; } | |
300 | |
301 // FK_EmployeeTerritories_Employees_BackReference | |
302 [Association(ThisKey="EmployeeID", OtherKey="EmployeeID", CanBeNull=true)] | |
303 public IEnumerable<EmployeeTerritories> EmployeeTerritoriess { get; set; } | |
304 | |
305 // FK_Employees_Employees_BackReference | |
306 [Association(ThisKey="EmployeeID", OtherKey="ReportsTo", CanBeNull=true)] | |
307 public IEnumerable<Employees> FK_Employees_Employees_BackReference { get; set; } | |
308 } | |
309 | |
310 [TableName(Name="EmployeeTerritories")] | |
311 public partial class EmployeeTerritories | |
312 { | |
313 [PrimaryKey(1)] public int EmployeeID { get; set; } // int(10) | |
314 [PrimaryKey(2)] public string TerritoryID { get; set; } // nvarchar(20) | |
315 | |
316 // FK_EmployeeTerritories_Employees | |
317 [Association(ThisKey="EmployeeID", OtherKey="EmployeeID", CanBeNull=false)] | |
318 public Employees Employees { get; set; } | |
319 | |
320 // FK_EmployeeTerritories_Territories | |
321 [Association(ThisKey="TerritoryID", OtherKey="TerritoryID", CanBeNull=false)] | |
322 public Territories Territories { get; set; } | |
323 } | |
324 | |
325 // View | |
326 [TableName(Name="Invoices")] | |
327 public partial class Invoices | |
328 { | |
329 [Nullable] public string ShipName { get; set; } // nvarchar(40) | |
330 [Nullable] public string ShipAddress { get; set; } // nvarchar(60) | |
331 [Nullable] public string ShipCity { get; set; } // nvarchar(15) | |
332 [Nullable] public string ShipRegion { get; set; } // nvarchar(15) | |
333 [Nullable] public string ShipPostalCode { get; set; } // nvarchar(10) | |
334 [Nullable] public string ShipCountry { get; set; } // nvarchar(15) | |
335 [Nullable] public string CustomerID { get; set; } // nchar(5) | |
336 public string CustomerName { get; set; } // nvarchar(40) | |
337 [Nullable] public string Address { get; set; } // nvarchar(60) | |
338 [Nullable] public string City { get; set; } // nvarchar(15) | |
339 [Nullable] public string Region { get; set; } // nvarchar(15) | |
340 [Nullable] public string PostalCode { get; set; } // nvarchar(10) | |
341 [Nullable] public string Country { get; set; } // nvarchar(15) | |
342 public string Salesperson { get; set; } // nvarchar(31) | |
343 public int OrderID { get; set; } // int(10) | |
344 [Nullable] public DateTime? OrderDate { get; set; } // datetime(3) | |
345 [Nullable] public DateTime? RequiredDate { get; set; } // datetime(3) | |
346 [Nullable] public DateTime? ShippedDate { get; set; } // datetime(3) | |
347 public string ShipperName { get; set; } // nvarchar(40) | |
348 public int ProductID { get; set; } // int(10) | |
349 public string ProductName { get; set; } // nvarchar(40) | |
350 public decimal UnitPrice { get; set; } // money(19,4) | |
351 public short Quantity { get; set; } // smallint(5) | |
352 public float Discount { get; set; } // real(24) | |
353 [Nullable] public decimal? ExtendedPrice { get; set; } // money(19,4) | |
354 [Nullable] public decimal? Freight { get; set; } // money(19,4) | |
355 } | |
356 | |
357 [TableName(Name="Order Details")] | |
358 public partial class OrderDetails | |
359 { | |
360 [PrimaryKey(1)] public int OrderID { get; set; } // int(10) | |
361 [PrimaryKey(2)] public int ProductID { get; set; } // int(10) | |
362 public decimal UnitPrice { get; set; } // money(19,4) | |
363 public short Quantity { get; set; } // smallint(5) | |
364 public float Discount { get; set; } // real(24) | |
365 | |
366 // FK_Order_Details_Orders | |
367 [Association(ThisKey="OrderID", OtherKey="OrderID", CanBeNull=false)] | |
368 public Orders OrderDetailsOrders { get; set; } | |
369 | |
370 // FK_Order_Details_Products | |
371 [Association(ThisKey="ProductID", OtherKey="ProductID", CanBeNull=false)] | |
372 public Products OrderDetailsProducts { get; set; } | |
373 } | |
374 | |
375 // View | |
376 [TableName(Name="Order Details Extended")] | |
377 public partial class OrderDetailsExtended | |
378 { | |
379 public int OrderID { get; set; } // int(10) | |
380 public int ProductID { get; set; } // int(10) | |
381 public string ProductName { get; set; } // nvarchar(40) | |
382 public decimal UnitPrice { get; set; } // money(19,4) | |
383 public short Quantity { get; set; } // smallint(5) | |
384 public float Discount { get; set; } // real(24) | |
385 [Nullable] public decimal? ExtendedPrice { get; set; } // money(19,4) | |
386 } | |
387 | |
388 // View | |
389 [TableName(Name="Order Subtotals")] | |
390 public partial class OrderSubtotals | |
391 { | |
392 public int OrderID { get; set; } // int(10) | |
393 [Nullable] public decimal? Subtotal { get; set; } // money(19,4) | |
394 } | |
395 | |
396 [TableName(Name="Orders")] | |
397 public partial class Orders | |
398 { | |
399 [Identity, PrimaryKey(1)] public int OrderID { get; set; } // int(10) | |
400 [Nullable ] public string CustomerID { get; set; } // nchar(5) | |
401 [Nullable ] public int? EmployeeID { get; set; } // int(10) | |
402 [Nullable ] public DateTime? OrderDate { get; set; } // datetime(3) | |
403 [Nullable ] public DateTime? RequiredDate { get; set; } // datetime(3) | |
404 [Nullable ] public DateTime? ShippedDate { get; set; } // datetime(3) | |
405 [Nullable ] public int? ShipVia { get; set; } // int(10) | |
406 [Nullable ] public decimal? Freight { get; set; } // money(19,4) | |
407 [Nullable ] public string ShipName { get; set; } // nvarchar(40) | |
408 [Nullable ] public string ShipAddress { get; set; } // nvarchar(60) | |
409 [Nullable ] public string ShipCity { get; set; } // nvarchar(15) | |
410 [Nullable ] public string ShipRegion { get; set; } // nvarchar(15) | |
411 [Nullable ] public string ShipPostalCode { get; set; } // nvarchar(10) | |
412 [Nullable ] public string ShipCountry { get; set; } // nvarchar(15) | |
413 | |
414 // FK_Orders_Shippers | |
415 [Association(ThisKey="ShipVia", OtherKey="ShipperID", CanBeNull=true)] | |
416 public Shippers Shippers { get; set; } | |
417 | |
418 // FK_Orders_Employees | |
419 [Association(ThisKey="EmployeeID", OtherKey="EmployeeID", CanBeNull=true)] | |
420 public Employees Employees { get; set; } | |
421 | |
422 // FK_Orders_Customers | |
423 [Association(ThisKey="CustomerID", OtherKey="CustomerID", CanBeNull=true)] | |
424 public Customers Customers { get; set; } | |
425 | |
426 // FK_Order_Details_Orders_BackReference | |
427 [Association(ThisKey="OrderID", OtherKey="OrderID", CanBeNull=true)] | |
428 public IEnumerable<OrderDetails> OrderDetailss { get; set; } | |
429 } | |
430 | |
431 // View | |
432 [TableName(Name="Orders Qry")] | |
433 public partial class OrdersQry | |
434 { | |
435 public int OrderID { get; set; } // int(10) | |
436 [Nullable] public string CustomerID { get; set; } // nchar(5) | |
437 [Nullable] public int? EmployeeID { get; set; } // int(10) | |
438 [Nullable] public DateTime? OrderDate { get; set; } // datetime(3) | |
439 [Nullable] public DateTime? RequiredDate { get; set; } // datetime(3) | |
440 [Nullable] public DateTime? ShippedDate { get; set; } // datetime(3) | |
441 [Nullable] public int? ShipVia { get; set; } // int(10) | |
442 [Nullable] public decimal? Freight { get; set; } // money(19,4) | |
443 [Nullable] public string ShipName { get; set; } // nvarchar(40) | |
444 [Nullable] public string ShipAddress { get; set; } // nvarchar(60) | |
445 [Nullable] public string ShipCity { get; set; } // nvarchar(15) | |
446 [Nullable] public string ShipRegion { get; set; } // nvarchar(15) | |
447 [Nullable] public string ShipPostalCode { get; set; } // nvarchar(10) | |
448 [Nullable] public string ShipCountry { get; set; } // nvarchar(15) | |
449 public string CompanyName { get; set; } // nvarchar(40) | |
450 [Nullable] public string Address { get; set; } // nvarchar(60) | |
451 [Nullable] public string City { get; set; } // nvarchar(15) | |
452 [Nullable] public string Region { get; set; } // nvarchar(15) | |
453 [Nullable] public string PostalCode { get; set; } // nvarchar(10) | |
454 [Nullable] public string Country { get; set; } // nvarchar(15) | |
455 } | |
456 | |
457 // View | |
458 [TableName(Name="Product Sales for 1997")] | |
459 public partial class ProductSalesFor1997 | |
460 { | |
461 public string CategoryName { get; set; } // nvarchar(15) | |
462 public string ProductName { get; set; } // nvarchar(40) | |
463 [Nullable] public decimal? ProductSales { get; set; } // money(19,4) | |
464 } | |
465 | |
466 [TableName(Name="Products")] | |
467 public partial class Products | |
468 { | |
469 [Identity, PrimaryKey(1)] public int ProductID { get; set; } // int(10) | |
470 public string ProductName { get; set; } // nvarchar(40) | |
471 [Nullable ] public int? SupplierID { get; set; } // int(10) | |
472 [Nullable ] public int? CategoryID { get; set; } // int(10) | |
473 [Nullable ] public string QuantityPerUnit { get; set; } // nvarchar(20) | |
474 [Nullable ] public decimal? UnitPrice { get; set; } // money(19,4) | |
475 [Nullable ] public short? UnitsInStock { get; set; } // smallint(5) | |
476 [Nullable ] public short? UnitsOnOrder { get; set; } // smallint(5) | |
477 [Nullable ] public short? ReorderLevel { get; set; } // smallint(5) | |
478 public bool Discontinued { get; set; } // bit | |
479 | |
480 // FK_Products_Suppliers | |
481 [Association(ThisKey="SupplierID", OtherKey="SupplierID", CanBeNull=true)] | |
482 public Suppliers Suppliers { get; set; } | |
483 | |
484 // FK_Products_Categories | |
485 [Association(ThisKey="CategoryID", OtherKey="CategoryID", CanBeNull=true)] | |
486 public Categories Categories { get; set; } | |
487 | |
488 // FK_Order_Details_Products_BackReference | |
489 [Association(ThisKey="ProductID", OtherKey="ProductID", CanBeNull=true)] | |
490 public IEnumerable<OrderDetails> OrderDetailss { get; set; } | |
491 } | |
492 | |
493 // View | |
494 [TableName(Name="Products Above Average Price")] | |
495 public partial class ProductsAboveAveragePrice | |
496 { | |
497 public string ProductName { get; set; } // nvarchar(40) | |
498 [Nullable] public decimal? UnitPrice { get; set; } // money(19,4) | |
499 } | |
500 | |
501 // View | |
502 [TableName(Name="Products by Category")] | |
503 public partial class ProductsByCategory | |
504 { | |
505 public string CategoryName { get; set; } // nvarchar(15) | |
506 public string ProductName { get; set; } // nvarchar(40) | |
507 [Nullable] public string QuantityPerUnit { get; set; } // nvarchar(20) | |
508 [Nullable] public short? UnitsInStock { get; set; } // smallint(5) | |
509 public bool Discontinued { get; set; } // bit | |
510 } | |
511 | |
512 // View | |
513 [TableName(Name="Quarterly Orders")] | |
514 public partial class QuarterlyOrders | |
515 { | |
516 [Nullable] public string CustomerID { get; set; } // nchar(5) | |
517 [Nullable] public string CompanyName { get; set; } // nvarchar(40) | |
518 [Nullable] public string City { get; set; } // nvarchar(15) | |
519 [Nullable] public string Country { get; set; } // nvarchar(15) | |
520 } | |
521 | |
522 [TableName(Name="Region")] | |
523 public partial class Region | |
524 { | |
525 [PrimaryKey(1)] public int RegionID { get; set; } // int(10) | |
526 public string RegionDescription { get; set; } // nchar(50) | |
527 | |
528 // FK_Territories_Region_BackReference | |
529 [Association(ThisKey="RegionID", OtherKey="RegionID", CanBeNull=true)] | |
530 public IEnumerable<Territories> Territoriess { get; set; } | |
531 } | |
532 | |
533 // View | |
534 [TableName(Name="Sales by Category")] | |
535 public partial class SalesByCategory | |
536 { | |
537 public int CategoryID { get; set; } // int(10) | |
538 public string CategoryName { get; set; } // nvarchar(15) | |
539 public string ProductName { get; set; } // nvarchar(40) | |
540 [Nullable] public decimal? ProductSales { get; set; } // money(19,4) | |
541 } | |
542 | |
543 // View | |
544 [TableName(Name="Sales Totals by Amount")] | |
545 public partial class SalesTotalsByAmount | |
546 { | |
547 [Nullable] public decimal? SaleAmount { get; set; } // money(19,4) | |
548 public int OrderID { get; set; } // int(10) | |
549 public string CompanyName { get; set; } // nvarchar(40) | |
550 [Nullable] public DateTime? ShippedDate { get; set; } // datetime(3) | |
551 } | |
552 | |
553 [TableName(Name="Shippers")] | |
554 public partial class Shippers | |
555 { | |
556 [Identity, PrimaryKey(1)] public int ShipperID { get; set; } // int(10) | |
557 public string CompanyName { get; set; } // nvarchar(40) | |
558 [Nullable ] public string Phone { get; set; } // nvarchar(24) | |
559 | |
560 // FK_Orders_Shippers_BackReference | |
561 [Association(ThisKey="ShipperID", OtherKey="ShipVia", CanBeNull=true)] | |
562 public IEnumerable<Orders> Orderss { get; set; } | |
563 } | |
564 | |
565 // View | |
566 [TableName(Name="Summary of Sales by Quarter")] | |
567 public partial class SummaryOfSalesByQuarter | |
568 { | |
569 [Nullable] public DateTime? ShippedDate { get; set; } // datetime(3) | |
570 public int OrderID { get; set; } // int(10) | |
571 [Nullable] public decimal? Subtotal { get; set; } // money(19,4) | |
572 } | |
573 | |
574 // View | |
575 [TableName(Name="Summary of Sales by Year")] | |
576 public partial class SummaryOfSalesByYear | |
577 { | |
578 [Nullable] public DateTime? ShippedDate { get; set; } // datetime(3) | |
579 public int OrderID { get; set; } // int(10) | |
580 [Nullable] public decimal? Subtotal { get; set; } // money(19,4) | |
581 } | |
582 | |
583 [TableName(Name="Suppliers")] | |
584 public partial class Suppliers | |
585 { | |
586 [Identity, PrimaryKey(1)] public int SupplierID { get; set; } // int(10) | |
587 public string CompanyName { get; set; } // nvarchar(40) | |
588 [Nullable ] public string ContactName { get; set; } // nvarchar(30) | |
589 [Nullable ] public string ContactTitle { get; set; } // nvarchar(30) | |
590 [Nullable ] public string Address { get; set; } // nvarchar(60) | |
591 [Nullable ] public string City { get; set; } // nvarchar(15) | |
592 [Nullable ] public string Region { get; set; } // nvarchar(15) | |
593 [Nullable ] public string PostalCode { get; set; } // nvarchar(10) | |
594 [Nullable ] public string Country { get; set; } // nvarchar(15) | |
595 [Nullable ] public string Phone { get; set; } // nvarchar(24) | |
596 [Nullable ] public string Fax { get; set; } // nvarchar(24) | |
597 [Nullable ] public string HomePage { get; set; } // ntext(1073741823) | |
598 | |
599 // FK_Products_Suppliers_BackReference | |
600 [Association(ThisKey="SupplierID", OtherKey="SupplierID", CanBeNull=true)] | |
601 public IEnumerable<Products> Productss { get; set; } | |
602 } | |
603 | |
604 [TableName(Name="Territories")] | |
605 public partial class Territories | |
606 { | |
607 [PrimaryKey(1)] public string TerritoryID { get; set; } // nvarchar(20) | |
608 public string TerritoryDescription { get; set; } // nchar(50) | |
609 public int RegionID { get; set; } // int(10) | |
610 | |
611 // FK_Territories_Region | |
612 [Association(ThisKey="RegionID", OtherKey="RegionID", CanBeNull=false)] | |
613 public Region Region { get; set; } | |
614 | |
615 // FK_EmployeeTerritories_Territories_BackReference | |
616 [Association(ThisKey="TerritoryID", OtherKey="TerritoryID", CanBeNull=true)] | |
617 public IEnumerable<EmployeeTerritories> EmployeeTerritoriess { get; set; } | |
618 } | |
619 } | |
620 | |
621 namespace Client | |
622 { | |
623 public partial class DataModel | |
624 { | |
625 public DataModel() : base( | |
626 new BasicHttpBinding(BasicHttpSecurityMode.None) | |
627 { | |
628 MaxReceivedMessageSize = 10000000, | |
629 MaxBufferSize = 10000000, | |
630 CloseTimeout = new TimeSpan(00, 01, 00), | |
631 OpenTimeout = new TimeSpan(00, 01, 00), | |
632 ReceiveTimeout = new TimeSpan(00, 10, 00), | |
633 SendTimeout = new TimeSpan(00, 10, 00), | |
634 }, | |
635 new EndpointAddress("http://localhost:31020/LinqWebService.asmx")) | |
636 // base("TestLinqWebServiceSoap") | |
637 { | |
638 } | |
639 } | |
640 } |