开发者

ObjectQuery<T> without Entity Framework

How to use ObjectContext and ObjectQuery<T> with my own c开发者_如何学Pythonlasses and objects?

I.e. I don't want to use them with Entity Framework.

How can I do this?


ObjectContext and ObjectQuery are the Entity Framework. You could implement your own Custom Linq Provider. A very good example can be found at "THE WAYWARD WEBLOG" http://blogs.msdn.com/mattwar/pages/linq-links.aspx. This Blog helped me implementing my own custom Provider.

public interface IQueryable : IEnumerable {       
    Type ElementType { get; }
    Expression Expression { get; }
    IQueryProvider Provider { get; }
}

public interface IQueryProvider {
    IQueryable CreateQuery(Expression expression);
    IQueryable<TElement> CreateQuery<TElement>(Expression expression);
    object Execute(Expression expression);
    TResult Execute<TResult>(Expression expression);
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜