Helllo,
I am new to asp.net core 5.0 web api entity framework, with sql database.
I have two tables LogsMaster with columns Id, title, Description and PermissionMaster with columns Id, LogId and ContactId
When Log details is saved in LogsMaster, along with it I am saving LogId(Primary Id column of LogsMaster) and ContactId in PermissionMaster table. So one LogId can have multiple ContactId in PermissionMaster table.
Using following property in LogsMaster table to save ContactId List
public IEnumerable
Here I want to fetch List of Logs by LogId, I am getting that list,but Contact is coming as null
so how to bind multiple contact id's for that logid in asp.net core web api ?
sorry, if I'm not able to explain you well ?
thank you

Riccardo RigutiniRank #8,774 · 216 reputationPosted Jun 15, 2022, 1:19 PM EDT
Hi,
is ContactsMaster another table?
Anyway, in Entity Framework related entities are not loaded by default; there are three main ways to load them:
The documentation shows how to implement these patterns:
https://docs.microsoft.com/en-us/ef/core/querying/related-data/
Sachin SinghRank #66 · 26.2K reputationPosted Jun 15, 2022, 1:25 PM EDT
Sushant TorankarRank #3,026 · 476 reputationPosted Jun 16, 2022, 9:33 AM EDT
Sachin SinghRank #66 · 26.2K reputationPosted Jun 16, 2022, 10:00 AM EDT
Sushant TorankarRank #3,026 · 476 reputationPosted Jun 17, 2022, 4:20 AM EDT
> GetAllLogs()