© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•2y ago•
2 replies
Klepsi ⚦

C# Entity core framework gaslighting

        modelBuilder.Entity<Transaction>().Property("ItemsSoldAndAmount").IsRequired();
        modelBuilder.Entity<Transaction>().Property("ItemsSoldAndAmount").IsRequired();


public class Transaction
{
...
    [Required]
    public List<AmountItem> ItemsSoldAndAmount { get; set; } = new List<AmountItem>();
...
}
public class Transaction
{
...
    [Required]
    public List<AmountItem> ItemsSoldAndAmount { get; set; } = new List<AmountItem>();
...
}

public class AmountItem
{
    [Required]
    public ObjectId Identifier { get; set; }
    [Required]
    public Item? Item { get; set; }
    [Required]
    public double amount { get; set; }
}
public class AmountItem
{
    [Required]
    public ObjectId Identifier { get; set; }
    [Required]
    public Item? Item { get; set; }
    [Required]
    public double amount { get; set; }
}


how is this not supported by the database when a List<> in another POCO of mine is OK??
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Entity framework core - database
C#CC# / help
2y ago
❔ Entity framework core Fluent API
C#CC# / help
3y ago
Entity Framework Core DB issues [Answered]
C#CC# / help
4y ago
Entity framework
C#CC# / help
14mo ago