
268Microsoft Visual Studio 2010: A Beginner’s Guide
(From cust In m_ctx.Customers Select cust).ToList()
Return customers
End Function
Public Sub DeleteCustomer(ByVal custID As Integer)
Dim customer =
(From cust In m_ctx.Customers Where cust.CustomerID = custID Select cust).SingleOrDefault()
m_ctx.Customers.DeleteOnSubmit(customer) m_ctx.SubmitChanges()
End Sub
End Class
You can have more methods in a repository for doing whatever is required with data for the application, but the items in Listing