/
aprogrammer
/
dotnet-docs
Обзор
Документация
Войти
/
aprogrammer
/
dotnet-docs
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
samples/snippets/visualbasic/VS_Snippets_Data/DLinqOverrideDefaultSproc/vb/Module1.vb
51 строка
1 KB
Benjamin Michaelis
Fix northwnd typo (#24700)
17 июн 2021, 16:33
Не верифицирован
17 июн 2021, 16:33
486aa22
Код
Авторство
О чём код?
Imports System.Linq Module Module1 Sub method5() ' <Snippet5> Dim db As New Northwind("...") ' Use a method call (stored procedure wrapper) instead of ' a LINQ query against the database. Dim custQuery = db.CustomersByCity("London") For Each custObj In custQuery ' Deferred loading of custObj.Orders uses the override ' LoadOrders. There is no dynamic SQL. For Each ord In custObj.Orders ' Make some changes to customers/orders. ' Overrides for Customer are called during the execution ' of the following: db.SubmitChanges() Next Next ' </Snippet5> End Sub Sub Main() ' <Snippet3> Dim db As New NorthwindThroughSprocs() Dim custQuery = From cust In db.Customers _ Where cust.City = "London" _ Select cust For Each custObj In custQuery ' Deferred loading of cust.Orders uses the override LoadOrders. For Each ord In custObj.Orders ' ... ' Make some changes to customers/orders. ' Overrides for Customer are called during the execution ' of the following: db.SubmitChanges() Next Next ' </Snippet3> End Sub End Module