Sushant Torankar

Sushant Torankar

  • 2k
  • 92
  • 2.7k

Getting list in core from another table

Jun 15 2022 4:12 PM


I am new to 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 core web api ?

sorry, if I'm not able to explain you well ?


thank you


Answers (5)