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

Boolean fields marked as pk and also pk fields not marked as such in edmx model #37

Open
alessaro92 opened this issue Nov 12, 2018 · 4 comments
Assignees
Labels

Comments

@alessaro92
Copy link

It's the first time I use this EF provider to work with access databases and I'm trying to configure the database first mode, creating the edmx model from a database file which has always been used as a reference for application development and test.
I suppose the access file I'm working with was created with a fairly old version of office: it has MDB extension.
The model generated from this file contains a table whose boolean fields have been marked as primary key even though they aren't part of primary key of the table in the database.
So I tried editing the table removing some fields, and I got another strange result generating again the model: the boolean fields are not part of primary key anymore, but the fields that are part of the primary key are not defined as such in the model, only one of four fields has been marked as primary key.
I am not able to understand why there is this behaviour, so I attach here the two database file and the screenshots of the models generated from them.
I used Microsoft JET 4.0 as a provider.

edmx_model_test1
edmx_model_test2
test_db_files.zip

@alessaro92
Copy link
Author

Have you abandoned this project in order to work only on the .NET Core one?

@bubibubi
Copy link
Owner

bubibubi commented Jan 4, 2019

I'm still working on this project (more than .NET Core because in my "real life" I still use EF 6.2).
The problem is the informations returned from OLEDB (that depends also on OLEDB version).
I suggest to use Code First from Database approach so you can fix errors like this on classes.

@bubibubi bubibubi self-assigned this Jan 4, 2019
@bubibubi bubibubi added the bug label Jan 4, 2019
@alessaro92
Copy link
Author

Ok, thanks. I was wondering that because I saw your activity on other projects and these issues were left ignored.
Do you mean the issue is in the OLEDB which returns a kind of information schema with wrong informations?
Is there any chance to fix?

@bubibubi
Copy link
Owner

bubibubi commented Jan 5, 2019

You could try to use a newer version of oledb (>=12)

I'm updating ef core provider to version 2.2, after that I will have a look to this issue (but I think that it's a oledb bug).

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

No branches or pull requests

2 participants