How to Create Response using HttpResponseMessage in ASP.NET Web Api

preview_player
Показать описание

Рекомендации по теме
Комментарии
Автор

thank you sir for your video but i am facing a problem I cannot get the message if no data found this is my code public HttpResponseMessage GetPatResult(int Patid, int branchid)
{
using (DBEntities1 entities = new DBEntities1())
{
var entity = => e.Patient_No == Patid &&
if (entity == null)
{ return Request.CreateResponse(HttpStatusCode.NotFound, "No Data Found"); } else {

return Request.CreateResponse(HttpStatusCode.OK, entity); } when i run data not found its shows this This XML file does not appear to have any style information associated with it. The document tree is shown below.

ziadabuqasem