Results 1 to 2 of 2

Thread: how to filter records based on a particular field

  1. #1

    Thread Starter
    Member
    Join Date
    Sep 2020
    Location
    Kampala
    Posts
    39

    how to filter records based on a particular field

    Please help i have my API . my APi has a table employees which has a filed called gender . Please help how can i filter this table records based on gender.

    Code:
     Public Class EmployeesidController
            Inherits ApiController
    
            Public Function Getid(ByVal id As Integer) As Employee
                Dim dbContext As SCHOOLEntities = New EmployeeDBContext
                Return dbContext.Employees.Find(id)
    
    
            End Function
        End Class

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,302

    Re: how to filter records based on a particular field

    You use the Where method to filter when using LINQ to Entities or any LINQ provider.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width