-
Notifications
You must be signed in to change notification settings - Fork 127
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
Bug: FluentMapper is not working with Abstract Properties #666
Comments
@SpaceOgre, same findings, this issue is fixed at the latest beta version RepoDb v1.12.5-beta4. Would you be able to install such beta version and test your solution there? |
Tested with v1.12.5-beta4 With the classes looking like above and using RepoDb.FluentMapper.Entity<PrivateCustomer>().DbType(e => e.CustomerTypeId, DbType.Int32); and calling with ExecuteScalarAsync I still get this error: |
I am pretty sure I had tested the abstract properties from the abstract classes using the latest beta version, but that is using the .NET Core 3.1. But yes, please leave this one open, I may be revoking the "labels" in placed and do the fix for this (if needed). If I can't replicate it as it is also working on our DEV ENV (and the latest beta as we tested), then I might be needing a small project from you that replicate this. But while we are investigating it, you do not have any action items for now. Hope that is okay. |
@SpaceOgre - I again retested this in our Integration Tests and even recreated the project solution, the issue is rectified in v1.12.5-betaX. Please see attached project for your reference. Project: RawSqlExecutionForEnum.zip Or, would you be able to replicate it using the attached project and attached it back from here? Please note that I am using the .NET Core 3.1 version. |
I will check it out and test on Monday. |
Thanks. Even though I cannot replicate this problem using the latest build, but when I am fixing the #668, I have made some direct fix in relation to the abstract properties when being configured via FluentMapper. Therefore, it is very important that this issue must be replicated by you and revert back to me so it will surely be covered by the next beta. Please do let me know ASAP. Thanks a lot. |
@mikependon I have tested with your project now and have these findings: FluentMapper.Type<CustomerType>().DbType(System.Data.DbType.Int32); Don't Work FluentMapper.Entity<Customer>().DbType(x => x.CustomerTypeId, System.Data.DbType.Int32); Project: RawSqlExecutionForEnum.zip |
@SpaceOgre - great, and I can replicate this one now, but it seems that this kind of problem is already solved by the updates I made on the issue #654 Anyway, I will give you an update later and will probably issue a beta later night or tomorrow morning. :) |
@SpaceOgre - I had investigated and analyzed this one further, only to realize that the library is just doing it as expected. It is correct that it should throw an exception if you are to use the code below. FluentMapper.Entity<Customer>().DbType(x => x.CustomerTypeId, System.Data.DbType.Int32); Due to the fact that the The reason why the type-level mapping is working, is due to the fact that it ignores the binding in the model, but instead, it is inspecting the type of the property instead. I would say this one as "not a bug". Hope this explains well. [EDIT] P.S: I will close this one and will issue a beta. |
#666 - Fixed the related issues found at model-based operation Execut…
@mikependon Ah that explains it well :) |
Yeah, but TBH, I also saw a bug on the model-based operation |
Just tried the FluentMapper and found a problem with abstract properties. RepoDb.FluentMapper.Entity().DbType(e => e.CustomerTypeId, DbType.Int32);
Created by @SpaceOgre from #633.
My classes look like this
If I use the Attribute it works, but not the FluentMapper. If I remove abstract and change override to new then the FluentMapper works.
The text was updated successfully, but these errors were encountered: