Missing 'using System.ComponentModel;' in EF Core 5 templates

Posts   
 
    
JSobell
User
Posts: 145
Joined: 07-Jan-2006
# Posted on: 16-Mar-2021 12:04:19   

Not sure if I'm missing something here, as I don't usually generate EF Core 5... When the EntityClasses are generated some have an attribute [Browsable(false)] that doesn't resolve because the file has no 'using System.ComponentModel;' statement.

LLBLGen Pro v5.8 (RTM) Entity Framework Core v5

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 17-Mar-2021 00:07:01   

Reproduced.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 17-Mar-2021 09:16:18   

Strange, build tests succeed here, but we'll look into it.

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 17-Mar-2021 09:31:20   

Well, I can't reproduce it, at least not with a project with entities and typed views. Could you tell me on which properties the attribute was present? I recreated a new project btw. If you migrated a project from another framework (e.g. Entity Framework 6 or LLBLGen Pro) to Entity Framework Core 5 by changing the target framework, the attributes defined on various elements by the original framework are still in the project. To fix that, go to the project settings -> Entity model -> Code generation -> Attributes and remove all the ones you don't need. [Browsable(false)] is something we only define in LLBLGen Pro RTF projects.

Frans Bouma | Lead developer LLBLGen Pro
JSobell
User
Posts: 145
Joined: 07-Jan-2006
# Posted on: 18-Mar-2021 12:01:09   

Yes, there is an Attribute Browsable($false) under the NavigatorSingleValue, possibly because this was originally using the LLBLGen framework. This thing of auto-added attributes has cropped up a few times for me. Given that they are set for generation automatically, perhaps the auto-created ones should either be removed when switching frameworks or a warning should be included in the output? Just a thought.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 18-Mar-2021 16:44:52   

We actually thought about it, but it's unclear when the target framework is changed if they're autogenerated or manually added. As switching frameworks is rare we therefore didn't add code for it due to this ambiguity.

Frans Bouma | Lead developer LLBLGen Pro