how to filter in DBcontext where value in list

ahmed omar 181 Reputation points
2023-05-13T21:43:57.4166667+00:00

Hello,

please I need to make dbcontect where value in list

the current code is

[HttpGet("FindOwnersDocotr")]
        public async Task<IActionResult> GetWonerDotor(string wonerId)
        {
            List<FellowDoctors> dr = await dbContext.FollowDoctors.Where(a => a.ownerId == wonerId).ToListAsync();
         

            if (dr.Count == 0)
            {
                return NotFound("not found");
            }
            return Ok(dr);
        }

and the result is



and I need to get from the Doctor table where DoctorId is in the above json

Developer technologies | .NET | Entity Framework Core
Developer technologies | C#
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.