SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 515 | Next

Scott Klein

"Professional LINQ"

Contact.Where
("it.MiddleName IS NOT NULL").OrderBy("it.LastName");
You can also do something like the following, which returns an entity type:
private AdventureWorksEntities productSalesContext;
string qry = @"SELECT VALUE Contact FROM AdventureWorksEntities.Contact";
ObjectQuery con = new ObjectQuery(qry, productSalesContext);
Likewise, you can create and use an ObjectQueryclass with parameters:
private AdventureWorksEntities productSalesContext;
string qry = @"SELECT VALUE Contact FROM AdventureWorksEntities.Contact WHERE
Contact.LastName = @lastname AND Contat.FirstName = @fn";
ObjectQuery con = new ObjectQuery(qry, productSalesContext);
con.Parameters.Add(new ObjectParameter("ln","Klein"));
con.Parameters.Add(new ObjectParameter("fn","Jason"));
You can also use an ObjectQuery class to return primitive and anonymous types, and you can shape
the results:
private AdventureWorksEntities productSalesContext;
ObjectQuery con = salesPerson.Include("SalesOrderHeader
.SalesOrderDetail");
340
Appendix B: LINQ to Entities: The ADO.


Pages:
503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527
hotel jelenia góra Russian bride Free English grammar and study guid powiekszenia wielkoformatowe counter strike 1.6