Many-To-Many with same fields of same type
I have a tables Users and Transactions.
I want to make my Transactions store two entities:
sender and reciever (Both are users)
How do I configure with Entity Framework Fluent API?
10 Replies
what have you tried so far? 😁
Any reason you think
wouldn't work?
How do I configure this with FluentAPI?
Like, I need to specify that it is a joining table
And I can reference a transaction by User object and vise versa
Thats the problem 😦
I dont even know how to google it lol
have you tried anything yet? Any errors?
Yes, I did. But I found it wrong. But seemingly this actually is a solution:
Stack Overflow
Adding a second one-to-one relationship with the same table in enti...
I am doing code-first entity framework design.
I have a table, Account, which has a property, Supervisor:
public class Account
{
public int Id { get; set; }
public Account Supervisor { get; s...
Or [InverseProperty] attribute must be used I guess
DataAnnotations - InverseProperty Attribute in Code-First
Learn about the [InverseProperty] DataAnnotation attribute in EF 6 and EF Core Code-First approach.
yeees I feel so happy because finally solution is here
@Tvde1 thank you!
https://learn.microsoft.com/en-us/ef/core/modeling/relationships
This article also contains all you need to know about EF relationships
Relationships - EF Core
How to configure relationships between entity types when using Entity Framework Core
🍎🍐🍋
yes! I was not aware of multiple relationships between two entities