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
Sushant TorankarPosted Jun 17, 2022, 8:20 AM
> GetAllLogs()
Sachin SinghPosted Jun 16, 2022, 2:00 PM
Sushant TorankarPosted Jun 16, 2022, 1:33 PM
Sachin SinghPosted Jun 15, 2022, 5:25 PM
Riccardo RigutiniPosted Jun 15, 2022, 5:19 PM
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/