eli
eli
CC#
Created by eli on 11/13/2024 in #help
Possible to use a class as composite key in entity framework?
class Book
{
[Key] public required BookIdentifier Id { get; init; }
}

[Owned]
class BookIdentifier
{
public required Storefront Storefront { get; init; }
public required string ListingId { get; init; }
}
class Book
{
[Key] public required BookIdentifier Id { get; init; }
}

[Owned]
class BookIdentifier
{
public required Storefront Storefront { get; init; }
public required string ListingId { get; init; }
}
Is there any way to do something like this?
11 replies