Error while trying to display records from the table.
error message
{"Message":"The request is invalid.","MessageDetail":"The parameters dictionary contains a null entry for parameter 'id' of non-nullable type 'System.Int32' for method 'System.Web.Http.IHttpActionResult GetAnouncement(Int32)' in 'KABOJJAAPPAPI.Controllers.AnouncementsController'. An optional parameter must be a reference type, a nullable type, or be declared as an optional parameter."}
This is the code below
Namespace Controllers
Public Class AnouncementsController
Inherits System.Web.Http.ApiController
Private db As New KABOJJAEntities
' GET: api/Anouncements
Function GetAnouncements() As IQueryable(Of Anouncement)
Return db.Anouncements
End Function
' GET: api/Anouncements/5
<ResponseType(GetType(Anouncement))>
Function GetAnouncement(ByVal id As Integer) As IHttpActionResult
Dim anouncement As Anouncement = db.Anouncements.Find(id)
If IsNothing(anouncement) Then
Return NotFound()
End If
Return Ok(anouncement)
End Function
End Class
End Namespace