/
aprogrammer
/
dotnet-docs
Обзор
Документация
Войти
/
aprogrammer
/
dotnet-docs
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
samples/snippets/csharp/VS_Snippets_Data/DLinqObjectIdentity/cs/Program.cs
45 строк
1 KB
Next Turn
Normalizes trailing spaces in samples, Part 1 (#17895)
17 апр 2020, 19:02
Не верифицирован
17 апр 2020, 19:02
63ee2a4
Код
Авторство
О чём код?
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace cs_objectidentity { class Program { static void Main(string[] args) { Northwnd db = new Northwnd(@"c:\northwnd.mdf"); // <Snippet1> Customer cust1 = (from cust in db.Customers where cust.CustomerID == "BONAP" select cust).First(); Customer cust2 = (from cust in db.Customers where cust.CustomerID == "BONAP" select cust).First(); // </Snippet1> } void method2() { Northwnd db = new Northwnd(@"c:\northwnd.mdf"); // <Snippet2> Customer cust1 = (from cust in db.Customers where cust.CustomerID == "BONAP" select cust).First(); Customer cust2 = (from ord in db.Orders where ord.Customer.CustomerID == "BONAP" select ord).First().Customer; // </Snippet2> } } }