Hi @Basit Nisar,
You can run the Web API project and search https://localhost:*****/api/ReleaseNote from your browser. Use the following code to view specific error messages in your browser.
catch (
Exception ex)
{
throw(ex);
}
First, there is no ReleaseItemTypeName parameter in ReleaseItemTypeView.
Remove AsNoTracking() method.
This is all the code:
[Route("api/ReleaseNote")]
#pragma warning disable CS1998 // Async method lacks 'await' operators and will run synchronously
public async Task<IHttpActionResult> GetReleaseNotes()
#pragma warning restore CS1998 // Async method lacks 'await' operators and will run synchronously
{
// ClaimsPrincipal principal = Request.GetRequestContext().Principal as ClaimsPrincipal;
//Int32 LogedInID = Convert.ToInt32(principal.Claims.FirstOrDefault(t => t.Type == "LogedInID").Value);
ReleaseNoteViewModel Releasenote = new ReleaseNoteViewModel();
try
{
Releasenote.ReleaseVersionTypeView = db.ReleaseVersions.OrderBy(x => x.ReleaseVersionName).Select(x => new ReleaseVersionModel
{
ReleaseVersionID = x.ReleaseVersionID,
ReleaseVersionName = x.ReleaseVersionName,
ReleaseUserTypeView = db.UserTypes.OrderBy(ka => ka.UserTypeName).Select(ka => new UserTypeModel
{
UserTypeID = ka.UserTypeID,
UserTypeName = ka.UserTypeName,
CreatedBy = ka.CreatedBy,
CreatedDate = ka.CreatedDate,
ModifiedBy = ka.ModifiedBy,
ModifiedDate = ka.ModifiedDate,
ReleaseItemTypeView = db.ReleaseItemTypes.OrderBy(t => t.ReleaseItemTypeNote).Select(t => new ReleaseItemModel
{
ReleaseItemTypeID = t.ReleaseItemTypeID,
ReleaseItemTypeNote = t.ReleaseItemTypeNote,
ReleaseNoteTypeView = db.ReleaseNotes.OrderBy(a => a.ReleaseNoteDescription).Select(a => new ReleaseNotesModel
{
ReleaseNoteID = a.ReleaseNoteID,
ReleaseNoteDescription = a.ReleaseNoteDescription,
}).ToList<ReleaseNotesModel>()
}).ToList<ReleaseItemModel>()
}).ToList<UserTypeModel>()
}).ToList<ReleaseVersionModel>();
}
catch (Exception ex)
{
throw(ex);
}
return Ok(Releasenote);
}
Best regards,
Lan Huang
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.