question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Resolve ambiguous type definitions

See original GitHub issue

The problem is that in one of the databases I want to reverse engineer, there is a table called EventHandler. So the created model for the entity is called EventHandler, which conflicts with the System.EventHandler. I would have to resolve this problem manually every time EF scaffold is executed. For now, this is not a huge problem because I just have to add the line

using EventHandler = Database.Models.EventHandler;

But if this would not be the only entity then this could get an annoying problem. So is it possible to automatically specify the whole type name including the namespace to resolve ambiguous type definitions?

Further technical details

EF Core version in use: EF Core 5

Is Handlebars used: no

EF Core Power Tools version: 2.5.908.0

Database engine: SQL Server

Visual Studio version: VS 2019

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:13 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
ErikEJcommented, Feb 17, 2022

Keep in mind that this is free open source software.

If you use Handlebars you can add this to the top of all files, maybe conditionally

  using EventHandler = Database.Models.EventHandler;
1reaction
Inplaticularcommented, Feb 17, 2022

I’m asking for an automated fix which is not the renaming feature. If there is one pls tell me because currently, I have to do it manually. That’s what the issue is about

Read more comments on GitHub >

github_iconTop Results From Across the Web

Ambiguity of same-named types from two different modules
I have two modules with distinct names that each define a top-level type with the same ... The error is "Ambiguous type name...
Read more >
Haskell - Ambiguous type variable
But there are special rules for resolving ambiguous type variables when there is one numeric class involved (where ambiguities are most frequent ...
Read more >
6.11.2. Ambiguous types and the ambiguity check
Here strange 's type is ambiguous, but the call in foo is OK because it gives rise to a constraint (D Bool beta)...
Read more >
Ambiguous base classes (C++ only)
When you derive classes, ambiguities can result if base and derived classes have members with the same names. Access to a base class...
Read more >
Ambiguous type reference should suggest adding a using ...
Most times that I have an ambiguous type reference I don't want to resolve it by fully qualifying. It can appear many files...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found