Results 1 to 6 of 6

Thread: parameter in api controller ...

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 2019
    Posts
    1

    parameter in api controller ...

    this is my code in parameter of table Porto (fields are CodPorto and Des)

    Namespace Controllers
    Public Class PortoController
    Inherits System.Web.Http.ApiController

    Private db As New ES42Entities

    ' GET: api/Porto
    Function GetPortoes() As IQueryable(Of Porto)
    Return db.Porto
    End Function

    I don't know how to add parameters to search with url like this:
    http://localhost/abc/api/Porto?CodPorto=1

    I thanks in advance everyone that could help me.
    bye
    George

  2. #2
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    25,464

    Re: parameter in api controller ...

    That looks like an Asp.Net question and this is the VB.Net forum. Try this...

    http://www.vbforums.com/forumdisplay...d-ASP-NET-Core

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

    Re: parameter in api controller ...

    Please don't post unformatted code snippets. They are hard to read.
    vb.net Code:
    1. Namespace Controllers
    2.     Public Class PortoController
    3.         Inherits System.Web.Http.ApiController
    4.  
    5.         Private db As New ES42Entities
    6.  
    7.         ' GET: api/Porto
    8.         Function GetPortoes() As IQueryable(Of Porto)
    9.             Return db.Porto
    10.         End Function

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

    Re: parameter in api controller ...

    Perhaps start with the obvious search:

    https://www.bing.com/search?q=vb.net...aa&FORM=ANNTA1

    Apart from that, I find it hard to believe that any Web API tutorial doesn't include information on action parameters. In fact, the official ASP.NET Web API home page even contains an example:

    https://dotnet.microsoft.com/apps/aspnet/apis

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

    Re: parameter in api controller ...

    Quote Originally Posted by .paul. View Post
    That looks like an Asp.Net question and this is the VB.Net forum. Try this...

    http://www.vbforums.com/forumdisplay...d-ASP-NET-Core
    I have asked the mods to move this thread, rather than the OP creating a duplicate.

  6. #6
    Banned
    Join Date
    Dec 2019
    Posts
    9

    Re: parameter in api controller ...

    Quote Originally Posted by jmcilhinney View Post
    Perhaps start with the obvious search:

    https://www.bing.com/search?q=vb.net...aa&FORM=ANNTA1

    Apart from that, I find it hard to believe that any Web API tutorial doesn't include information on action parameters. In fact, the official ASP.NET Web API home page even contains an example:

    https://dotnet.microsoft.com/apps/aspnet/apis
    I'd also start with this step

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