1

I'd like to create the context extension methods described in Cesar de la Torre's blog post.

But I'm not sure how to declare the class that holds my extension methods.

Griff Townsend wrote:

If I include a reference to this class (or have the class in my namespace), any ObjectContext references will be able to execute these extensions:

ADO.NET Entity Framework extension method intellisense

If you look at the tool tip in the photo above, you should be able to see that I can now cleanly access any function that I add to the EntitySet that I create.

How do I declare the class that holds my extension methods?

1 Answer 1

1

You just have to declare a static class :

public static class MyExtensions
{
    // extension methods go here
}
Sign up to request clarification or add additional context in comments.

1 Comment

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.