EF6 Relationships

I have two classes built in EF Core, that I used to scaffold the database and use in the frontend Blazor app.

c#
  public class StreamPointListenerStep {
    public Guid Id { get; set; } = Guid.NewGuid();
    //....
    public StreamPointIntegrationELogger? StreamPointIntegrationELogger { get; set; } = null;
  }

  public class StreamPointIntegrationELogger {
    public Guid Id { get; set; } = Guid.NewGuid();

    [ForeignKey(nameof(StreamPointListenerStep))]
    public Guid StepId { get; set; }
    public StreamPointListenerStep? StreamPointListenerStep { get; set; } = null;
    //...
  }


Now, building and using this in Blazor is fine. However, I also need the table in a .NET Framework app. So I've ported the DB model to EF6 just to simply use the context for accessing the database and the models without writing the queries manually. However, EF6 refuses to work with this due to the relationship. It throws an error for Because the Dependent Role properties are not the key properties, the upper bound of the multiplicity of the Dependent Role must be '*'.

What solutions are there for getting around this? I have to use .NET Framework, and building an API is overhead that's just not needed.
Was this page helpful?