Click here to Skip to main content
15,937,127 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
        public async Task<ActionResult<User>> getDeparts(string DeptName)

         User ues = await DBCon.department.Select(
             s => new User()
                 FirstName = s.FirstName,
                 LastName = s.LastName,
                 Gender = s.Gender,
                 DeptName = s.DeptName
             }).FirstAsync(s =>s.DeptName == DeptName.ToString());
           if(ues == null)
               return NotFound();
               return ues;

What I have tried:

How to shown data according to DeptName field Repeated data shown
Updated 6-Dec-22 21:11pm

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900