You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Materializing results from a SqlDataReader (Translate from EF6.x) #4675
To avoid round trips, a large number of small queries (sometimes up to 40) are batched into a single command. Most of the result sets of these queries are outside the scope of Entity Framework, but some result sets are intended to be used by Entity Framework to materialize entities.
The use case is exactly the same as RawSql but batched with other queries, only some of which should be handled by Entity Framework.
In EF6, we had ObjectContext.Translate. Can we have such an API on EF Core as well in the future?
In the meantime, where is the extensibility point in EntityFramework.MicrosoftSqlServer or EntityFramework.Relational that deals with DbDataReader? Specifically I want to simulate Set<T>().AsNoTracking().RawSql(q) but hand in my own SqlDataReader.
changed the title [-]Materializing results from a SqlDataReader[/-][+]Materializing results from a SqlDataReader (Translate from EF6.x)[/+]on Mar 4, 2016
I think I finally got my head wrapped around what stuff does. Until you have API support for FromReader, here's my workaround. It does not handle inheritance or tracking, since I don't need or want those at the moment for this use case.
We want to port our code from EF6 to EF core. However we have been using Translate extensively because of the performance reason. availability of this feature is absolutely must for us.
Activity
[-]Materializing results from a SqlDataReader[/-][+]Materializing results from a SqlDataReader (Translate from EF6.x)[/+]rowanmiller commentedon Mar 4, 2016
Agreed that a top level API would be good - we'll look at this post 1.0.0
rowanmiller commentedon Mar 4, 2016
IRelationalValueBufferFactoryis probably the low-level piece you are afterjnm2 commentedon Mar 8, 2016
I think I finally got my head wrapped around what stuff does. Until you have API support for
FromReader, here's my workaround. It does not handle inheritance or tracking, since I don't need or want those at the moment for this use case.Usage:
Code:
Bit better factored here for both
FromReaderandFromReaderAsync.ajayvikas commentedon Aug 28, 2017
We want to port our code from EF6 to EF core. However we have been using Translate extensively because of the performance reason. availability of this feature is absolutely must for us.