views:

94

answers:

1

Can I extend or use partial classes to add more functions to EntityCollection< Class>

eg.

this is the auto-generated classses from LINQ to SQL

customer.Orders

I want to be able to do

customer.Orders.FindByOrderID(orderID)

but Order is EntityCollection < Order >

Can I make this a partial class or extend it like I can do with just the Order class?

A: 

Yes I can

public static class OrderExtension
{
    public static Order FindByOrderID(this EntityCollection<Order> orders, String orderID)
    {
soldieraman