开发者

ObjectQuery<T> without Entity Framework

开发者 https://www.devze.com 2022-12-09 00:39 出处:网络
How to use ObjectContext and ObjectQuery<T> with my own c开发者_如何学Pythonlasses and objects?

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

精彩评论

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