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

Mapping numeric types in the same configurable way you can do in Oracle [DNET796] #733

Closed
firebird-automations opened this issue Nov 22, 2017 · 9 comments

Comments

@firebird-automations
Copy link

Submitted by: Roberto Carlos da Silva (robertosistemas)

It would be great if in the Firebird .NET Drive there was a way to map the same numeric types you can do in the Oracle Driver.
It would solve various system and framework migration incompatibility issues and make it easier to choose firebird as a database for the .NET platform. I think it would be very easy to do that.

https://docs.oracle.com/database/121/ODPNT/entityDataTypeMapping.htm#ODPNT8300

@firebird-automations
Copy link
Author

Commented by: @cincuranet

That's interesting request. Can you share what " various system and framework migration incompatibility issues" you'd solve with it? Because I don't see it there (except for some hacky situations).

@firebird-automations
Copy link
Author

Commented by: Roberto Carlos da Silva (robertosistemas)

First of all I would like you to know that I appreciate your work as a .NET Driver Developer for Firebird. I'm also a big firebird enthusiast, having suggested and implemented this SGDB on major projects like the Unimed Enterprise management system that I worked on. Now with respect to the problems faced, in the current company I work for. We use ASPNETZERO (https://www.aspnetzero.com/) as well as ASPNETBOILERPLATE (https://aspnetboilerplate.com/) which are two widely used frameworks for large enterprises. It works very well with databases (Sql Server, oracle, mysql) but due to a limitation in the Firebird EntityFramework drive that does not allow mapping the data type (Byte or tinyint) I can not use the database First feature. I would love to be able to use firebird with this framework but unfortunately I am not getting through a basic mapping limitation. This is why I suggest a way to change the mapping of the numeric type to a configuration that could be in the configuration file or otherwise. I believe that this would also make the migration of other systems and also frameworks that work in other databases easier. I already tried to change the mapping in OnModelCreating I also tried to create a DOMAIN with the tinyint name, but the problem is that essentially the mapped type does not change.

@firebird-automations
Copy link
Author

Commented by: @cincuranet

Thinking where overriding the property to i.e. smallint with "public new short FooBar { get; set; }" would break it. Of course that would be some work.

Anyway, there's already a hack for missing pre-FB3 bool type with smallint_bool EdmType. Although that was needed for SSDL mappings to even work. I suppose similar hack can be done for byte. I don't personally like the idea of having it configurable. That adds unneeded complexity.

Same should be done also for EF Core.

@firebird-automations
Copy link
Author

Modified by: @cincuranet

priority: Major [ 3 ] => Minor [ 4 ]

Component: Entity Framework [ 10110 ]

Component: Entity Framework Core [ 10160 ]

@firebird-automations
Copy link
Author

Commented by: @cincuranet

I'll schedule it after 6.0 is finished.

@firebird-automations
Copy link
Author

Modified by: @cincuranet

Fix Version: 6.post [ 10857 ]

@firebird-automations
Copy link
Author

Commented by: Roberto Carlos da Silva (robertosistemas)

Thank you! This adjustment will help me a lot!

@firebird-automations
Copy link
Author

Modified by: @cincuranet

Fix Version: 6.planned [ 10857 ] =>

@cincuranet
Copy link
Member

In EF Core this could be done via value converters now.

EF6 provider is in maintenance/legacy mode.

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

No branches or pull requests

2 participants