Sushant Torankar

Sushant Torankar

  • 1.4k
  • 220
  • 22.4k

Getting list in asp.net core from another table

Jun 15 2022 4:12 PM

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<ContactsMaster> Contacts { get; set; }

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

 


Answers (5)