Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HasColumnName throws Exception: Missing Column #532

Open
virzak opened this issue May 8, 2023 · 2 comments
Open

HasColumnName throws Exception: Missing Column #532

virzak opened this issue May 8, 2023 · 2 comments
Assignees

Comments

@virzak
Copy link

virzak commented May 8, 2023

Description

HasColumnName on entities throws exception when HasColumnName is used on either owned entity or main entity.

This is a bit urgent :(

Exception

If you are seeing an exception, include the full exceptions details (message and stack trace).

System.Exception
  HResult=0x80131500
  Message=An error occured while resolving mapping by expression. See the inner exception for details.
  Source=Z.EntityFramework.Extensions.EFCore
  StackTrace:
   at Z.BulkOperations.BulkOperation.()
   at Z.BulkOperations.BulkOperation.Execute()
   at Z.BulkOperations.BulkOperation.BulkUpdate()
   at .BulkUpdate[T](DbContext this, IEntityType entityType, IEnumerable`1 list, Action`1 options, SavingSelector savingSelector, Boolean forceSpecificTypeMapping)
   at .BulkUpdate[T](DbContext this, IEnumerable`1 entities, Action`1 options, Boolean isBulkSaveChanges)
   at DbContextExtensions.BulkUpdate[T](DbContext this, IEnumerable`1 entities, Action`1 options)
   at Program.<Main>$(String[] args) in Q:\Code\Sandbox\BulkUpdateOwned\BulkUpdateOwned\Program.cs:line 19

  This exception was originally thrown at this call stack:
    Z.BulkOperations.BulkOperation.(string, bool, bool, bool)
    Z.BulkOperations.BulkOperation.()

Inner Exception 1:
Exception: Missing Column : Name.MiddleName
On entity : Customer
On Table : [Customers]

Fiddle or Project (Optional)

https://dotnetfiddle.net/718w6F

Further technical details

  • EF version: 7, 8
  • EF Extensions version: 7, 8
  • Database Provider: SqlServer
@JonathanMagnan JonathanMagnan self-assigned this May 9, 2023
@JonathanMagnan
Copy link
Member

Hello @virzak ,

Could this solution work for you? https://dotnetfiddle.net/NS6kem

Best Regards,

Jon

@virzak
Copy link
Author

virzak commented May 9, 2023

@JonathanMagnan thanks, this solution works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants