PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197
VS 2019 parameter in api controller ...-VBForums
Results 1 to 5 of 5

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
    22,596

    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
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    103,482

    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
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    103,482

    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
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    103,482

    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.

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width