Quantcast
Channel: Entity Framework
Viewing all articles
Browse latest Browse all 10318

Created Issue: BufferingReader :: error when using sprocs with multiple results for which second result has a spatial property [1006]

$
0
0
When running a stored proc with multiple results, where second result is spatial, I get the following exception:

Unhandled Exception: System.Data.Entity.Core.ProviderIncompatibleException: Spatial readers can only be produced from readers of type SqlDataReader. A reader of type System.Data.Entity.Core.Objects.Internal.BufferedDataReader was provided.
at System.Data.Entity.SqlServer.SqlProviderServices.GetDbSpatialDataReader(DbDataReader fromReader, String versionHint)
at System.Data.Entity.Core.Common.DbProviderServices.GetSpatialDataReader(DbDataReader fromReader, String manifestToken)
at System.Data.Entity.Spatial.SpatialHelpers.CreateSpatialDataReader(MetadataWorkspace workspace, DbDataReader reader)
at System.Data.Entity.Core.Common.Internal.Materialization.Shaper.CreateSpatialDataReader()
at System.Lazy`1.CreateValue()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Lazy`1.get_Value()
at System.Data.Entity.Core.Common.Internal.Materialization.Shaper.<GetSpatialPropertyValueWithErrorHandling>b__19[TProperty](DbDataReader reader, Int32 column)
at System.Data.Entity.Core.Common.Internal.Materialization.Shaper.ErrorHandlingValueReader`1.GetValue(DbDataReader reader, Int32 ordinal)
at System.Data.Entity.Core.Common.Internal.Materialization.Shaper.GetSpatialPropertyValueWithErrorHandling[TProperty](Int32 ordinal, String propertyName, String typeName, PrimitiveTypeKind spatialTypeKind)
at lambda_method(Closure , Shaper )
at System.Data.Entity.Core.Common.Internal.Materialization.Shaper.HandleEntityAppendOnly[TEntity](Func`2 constructEntityDelegate, EntityKey entityKey, EntitySet entitySet)
at lambda_method(Closure , Shaper )
at System.Data.Entity.Core.Common.Internal.Materialization.Shaper.Discriminate[TElement](Object[] discriminatorValues, Func`2 discriminate, KeyValuePair`2[] elementDelegates)
at lambda_method(Closure , Shaper )
at System.Data.Entity.Core.Common.Internal.Materialization.Coordinator`1.ReadNextElement(Shaper shaper)
at System.Data.Entity.Core.Common.Internal.Materialization.Shaper`1.SimpleEnumerator.MoveNext()

Classes are as follows:

public partial class Blog
{
public Blog()
{
this.Posts = new HashSet<Post>();
}

public int Id { get; set; }
public string Title { get; set; }
public int Rating { get; set; }

public virtual ICollection<Post> Posts { get; set; }
}

public partial class Post
{
public int Id { get; set; }
public string Content { get; set; }
public DbGeometry Shape { get; set; }
public System.DateTime DoB { get; set; }
public int SomeEnum { get; set; }
public Nullable<int> Blog_Id { get; set; }

public virtual Blog Blog { get; set; }
}

Stored proc returns collection of first ones and then collection of second ones.



Viewing all articles
Browse latest Browse all 10318

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>