Changing an extention method from linq-to-sql to entity framework

Posted by Jova on Stack Overflow See other posts from Stack Overflow or by Jova
Published on 2010-03-21T12:29:19Z Indexed on 2010/03/21 12:31 UTC
Read the original article Hit count: 423

I'm changing my project from working with Linq-to-SQL to working with Entity Framework.

I have some extention methods that extend the classes created by LINQ and I'm wondering how to change them to work with the entities instead

Here's an example.

public static int GetPublishedArticlesCount(this Table<Article> source)
    {
        return GetPublishedArticles(source.Context as DataContext, null).Count();
    }

This method gets the number of published articles. Instead of using this Table<Article>, what should I use instead?

© Stack Overflow or respective owner

Related posts about c#

Related posts about linq-to-sql