BLOB field in EF4 generate System.NotSupportedException:
PrimitiveTypeKind.Binary
----------------------------------------------------------------------------------
Key: DNET-456
URL: http://tracker.firebirdsql.org/browse/DNET-456
Project: .NET Data provider
Issue Type: Bug
Components: Entity Framework support
Affects Versions: 2.7.7, 2.7.5, 2.7, 2.6.5, 2.6
Environment: Win7(32) - visual studio 2010 - EF4
Reporter: Full Metal Jacket
Assignee: Jiri Cincura
Mapping a field of type BLOB sub_type 0 as a Byte[] in EF4, during the call of
SaveChanges() method, it returns an incomprehensible exception:
System.NotSupportedException: PrimitiveTypeKind.Binary
I created a dataannotation like:
[Column(TypeName="BLOB")]
public Byte[] filecontent { get; set; }
I can't find online documentation about how to map a blob field in EF4, maybe
you can help us.
STACK TRACE
[NotSupportedException: PrimitiveTypeKind.Binary]
FirebirdSql.Data.Entity.SqlGenerator.GetSqlPrimitiveType(TypeUsage type) +712
FirebirdSql.Data.Entity.DmlSqlGenerator.GenerateReturningSql(StringBuilder
commandText, DbModificationCommandTree tree, ExpressionTranslator translator,
DbExpression returning) +586
FirebirdSql.Data.Entity.DmlSqlGenerator.GenerateInsertSql(DbInsertCommandTree
tree, List`1& parameters) +589
FirebirdSql.Data.Entity.SqlGenerator.GenerateSql(DbCommandTree tree, List`1&
parameters, CommandType& commandType) +308
FirebirdSql.Data.FirebirdClient.FbProviderServices.CreateCommand(DbProviderManifest
manifest, DbCommandTree commandTree) +601
FirebirdSql.Data.FirebirdClient.FbProviderServices.CreateDbCommandDefinition(DbProviderManifest
manifest, DbCommandTree commandTree) +16
System.Data.Common.DbProviderServices.CreateCommandDefinition(DbCommandTree
commandTree) +147
System.Data.Common.DbProviderServices.CreateCommand(DbCommandTree
commandTree) +7
System.Data.Mapping.Update.Internal.UpdateTranslator.CreateCommand(DbModificationCommandTree
commandTree) +40
[EntityCommandCompilationException: Errore durante la preparazione della
definizione del comando. Per ulteriori informazioni, vedere l'eccezione
interna.]
System.Data.Mapping.Update.Internal.UpdateTranslator.CreateCommand(DbModificationCommandTree
commandTree) +78
System.Data.Mapping.Update.Internal.DynamicUpdateCommand.CreateCommand(UpdateTranslator
translator, Dictionary`2 identifierValues) +163
System.Data.Mapping.Update.Internal.DynamicUpdateCommand.Execute(UpdateTranslator
translator, EntityConnection connection, Dictionary`2 identifierValues, List`1
generatedValues) +52
System.Data.Mapping.Update.Internal.UpdateTranslator.Update(IEntityStateManager
stateManager, IEntityAdapter adapter) +267
[UpdateException: Errore durante l'aggiornamento delle voci. Per ulteriori
informazioni, vedere l'eccezione interna.]
System.Data.Mapping.Update.Internal.UpdateTranslator.Update(IEntityStateManager
stateManager, IEntityAdapter adapter) +389
System.Data.EntityClient.EntityAdapter.Update(IEntityStateManager
entityCache) +163
System.Data.Objects.ObjectContext.SaveChanges(SaveOptions options) +609
System.Data.Entity.Internal.InternalContext.SaveChanges() +120
[DbUpdateException: Errore durante l'aggiornamento delle voci. Per ulteriori
informazioni, vedere l'eccezione interna.]
System.Data.Entity.Internal.InternalContext.SaveChanges() +206
System.Data.Entity.Internal.LazyInternalContext.SaveChanges() +24
System.Data.Entity.DbContext.SaveChanges() +20
DbContext.SaveChanges() in DbContext.cs:735
AttachmentRepository.Save(Attachment attachment, ICollection`1 clsCat, Int32
currentUserId) in AttachmentRepository.cs:360
Controllers.AttachmentController.CreateConfirm(Attachment attach,
IEnumerable`1 files, List`1 ClsTreeView_checkedNodes, String sessioneVarId,
Boolean LastDoc) in
lambda_method(Closure , ControllerBase , Object[] ) +288
System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller,
Object[] parameters) +17
System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext
controllerContext, IDictionary`2 parameters) +208
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext
controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters)
+27
System.Web.Mvc.<>c__DisplayClass15.<InvokeActionMethodWithFilters>b__12() +55
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter
filter, ActionExecutingContext preContext, Func`1 continuation) +263
System.Web.Mvc.<>c__DisplayClass17.<InvokeActionMethodWithFilters>b__14() +19
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter
filter, ActionExecutingContext preContext, Func`1 continuation) +263
System.Web.Mvc.<>c__DisplayClass17.<InvokeActionMethodWithFilters>b__14() +19
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodWithFilters(ControllerContext
controllerContext, IList`1 filters, ActionDescriptor actionDescriptor,
IDictionary`2 parameters) +191
System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext
controllerContext, String actionName) +343
System.Web.Mvc.Controller.ExecuteCore() +116
System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +97
System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext
requestContext) +10
System.Web.Mvc.<>c__DisplayClassb.<BeginProcessRequest>b__5() +37
System.Web.Mvc.Async.<>c__DisplayClass1.<MakeVoidDelegate>b__0() +21
System.Web.Mvc.Async.<>c__DisplayClass8`1.<BeginSynchronous>b__7(IAsyncResult
_) +12
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62
System.Web.Mvc.<>c__DisplayClasse.<EndProcessRequest>b__d() +50
System.Web.Mvc.SecurityUtil.<GetCallInAppTrustThunk>b__0(Action f) +7
System.Web.Mvc.SecurityUtil.ProcessInApplicationTrust(Action action) +22
System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +60
System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult
result) +9
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
+8970061
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
completedSynchronously) +184
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Firebird-net-provider mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider