Skip to content
This repository has been archived by the owner on Jan 16, 2024. It is now read-only.

If NotifyPropertyChanged is active, wrong Output is generated #97

Closed
ByteCraftServices opened this issue Sep 3, 2019 · 16 comments
Closed
Labels
released Issue is resolved in a current release
Milestone

Comments

@ByteCraftServices
Copy link

Generally it seems to work. When NotifyPropertyChanged is enabled, then in the generated ouput the HasIndex Syntax targets the shadow property, which is protected.

e.g.:modelBuilder.Entity<global::Test.Model.ParentTable>().HasIndex(t => t._Name);
is generated instead of
modelBuilder.Entity<global::Test.Model.ParentTable>().HasIndex(t => t.Name);

@msawczyn msawczyn added the investigating Looking into this label Sep 9, 2019
@msawczyn
Copy link
Owner

Found it and (hopefully) fixed it. Turned out to be a mixup between the AutoProperty and ImplementNotify flags. Give it a go in 1.3.0.5 and let me know if there are still issues.

@msawczyn msawczyn added bug Confirmed bug pending release Issue is resolved in the current codebase, will be published with the next release and removed investigating Looking into this bug Confirmed bug labels Sep 30, 2019
@msawczyn msawczyn added this to the 1.3.0.5 milestone Sep 30, 2019
@msawczyn msawczyn added released Issue is resolved in a current release and removed pending release Issue is resolved in the current codebase, will be published with the next release labels Sep 30, 2019
@ByteCraftServices
Copy link
Author

Oh no - just tried to test out this issue with the new version, but opening the model fails with "object reference is not set to an instance" error. Any ideas what causes the error message?

@msawczyn
Copy link
Owner

Hmm. Let me look. What project type, EF version and .NET version?

@msawczyn msawczyn reopened this Sep 30, 2019
@ByteCraftServices
Copy link
Author

ByteCraftServices commented Sep 30, 2019 via email

@msawczyn msawczyn added investigating Looking into this and removed released Issue is resolved in a current release labels Sep 30, 2019
@msawczyn
Copy link
Owner

msawczyn commented Sep 30, 2019

Thanks for the report - there definitely is a problem, but it appears to be limited to EFCore3 (I hope). It's going to be more involved than I have time for right now, but I believe I know how to work around it and will have a fix in tonight.

I've pulled it from the Marketplace for the interim period until I can get that fix in place.

@ByteCraftServices
Copy link
Author

1.3.0.4 did work work fine with Core3 (since the release, on last Monday)

@msawczyn msawczyn modified the milestones: 1.3.0.5, 1.3.0.6 Sep 30, 2019
@msawczyn msawczyn added bug Confirmed bug pending release Issue is resolved in the current codebase, will be published with the next release and removed investigating Looking into this labels Sep 30, 2019
@msawczyn
Copy link
Owner

Please take a look at the 1.3.0.6 pre-release. Look forward to your feedback.

@msawczyn msawczyn added released Issue is resolved in a current release and removed pending release Issue is resolved in the current codebase, will be published with the next release labels Oct 1, 2019
@ByteCraftServices
Copy link
Author

Hi Michael, Thanks for your quick response. I've just installed 1.3.0.6, but the problem is still existing.
Any things I can do to support your investigations?

@msawczyn
Copy link
Owner

msawczyn commented Oct 1, 2019

Could you please make available a small model file that shows the problem? Or repro steps? Does this happen right when you open an existing model?

@msawczyn msawczyn removed the released Issue is resolved in a current release label Oct 1, 2019
@ByteCraftServices
Copy link
Author

Tricky thing... I just tried to create a new project for reproducing the error during loading the diagram and which i can send to you. But I had no success, there it worked. So I back on my development solution. There I have 2 diagrams in use. One gives the error with the null reference. The second diagram now opens (it didn't yesterday), but now it looks like a new one. No entity or enum is displayed. It is completely empty. I have no idea, what's causing that

@ByteCraftServices
Copy link
Author

I just want to let you know that now the error is back on both models in my project - that's crazy

@msawczyn
Copy link
Owner

msawczyn commented Oct 3, 2019

Not sure what's going on here, but I'm unable to reproduce it. I'm posting 1.3.0.7 for a critical fix to Min/MaxLength properties; please see if this version still causes you issues. If so, I'll need to see a model file that shows the problem.

@msawczyn msawczyn added no repro Can't reproduce. Need sample code that exhibits the issue. and removed bug Confirmed bug labels Oct 3, 2019
@msawczyn
Copy link
Owner

msawczyn commented Oct 5, 2019

v1.3.0.7 is now in the releases section here on GitHub

@ByteCraftServices
Copy link
Author

Some kind of good news.
I've attached an link to a ZIP file
You'll find a TestModel.efmodel file in it, which will cause the null reference error message wenn you try to open it. With v1.3.0.4 you will be still able to open it anyway. It is a very simple diagram, just for test purposes, but it reproduces the same error as the model in our application.

One more thing => I played a bit around with it, to find out which entity makes the trouble. It is the entity named "ParentEntity" on the Top. If you remove it, the diagram will open also in v1.3.0.5 and above. I was not able to spot any suspicious properties or anything like that. So maybe you can find something, which causes the null reference.

@ByteCraftServices
Copy link
Author

Add: If you remove the 2 navigations ParentTable->Child and ParentTable->CustomEntity, you will be able to open the diagramm again.

@msawczyn msawczyn modified the milestones: 1.3.0.6, 1.3.0.8 Oct 20, 2019
@msawczyn msawczyn added pending release Issue is resolved in the current codebase, will be published with the next release and removed no repro Can't reproduce. Need sample code that exhibits the issue. labels Oct 20, 2019
@msawczyn msawczyn added released Issue is resolved in a current release and removed pending release Issue is resolved in the current codebase, will be published with the next release labels Nov 10, 2019
@ByteCraftServices
Copy link
Author

I just took a short look on it => seems to work again now. Great Job! Thx!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
released Issue is resolved in a current release
Projects
None yet
Development

No branches or pull requests

2 participants