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.

SetupEntitiesDirect fails if one uses records in the entities

See original GitHub issue
public class entity:
{
    [Key]
   public long Id { get; set; }
   public Reference Object { get; set; }
}
[Owned]
    public record Reference {

        public Reference(string type, Guid id)
        {
            Id = id;
            Type = type;
        }

        [StringLength(50)]  
        public string Type { get; set; }

        public Guid Id { get; set; }
    }

will fail with The class Reference was not found in the TestCtx DbContext. The class must be either be an entity class derived from the GenericServiceDto/Async class.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
JonPSmithcommented, Feb 1, 2022

Interesting. I have reproduced this error in this test. I will work on it, but I have other things so might be some days.

0reactions
JonPSmithcommented, Feb 2, 2022

Hi @Akku-21,

That was an interesting problem caused to the IEntityType for an Owned Type class changed in EF Core 6. I’m now using the IsOwned type which came out in EF Core 5.

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - cannot add view to the edmx
Just add a column to your view I added a Row_Number to create a key like this. SELECT ISNULL(CAST((row_number() OVER (ORDER BY tab....
Read more >
ReleaseNotes.md
A library to help you quickly code CRUD accesses for a web/mobile/desktop application using EF Core. - EfCore.GenericServices/ReleaseNotes.md at master ...
Read more >
EfCore.GenericServices 1.2.6
This library helps you quickly code Create, Read, Update and Delete (CRUD) accesses for a web/mobile/desktop application. It acts as a adapter ...
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