here i am sharing my c# code where we are using [LogedInID] and on the basis of this id I should show my response data that is if the [LogedInID] matches with Adjuster user then only adjuster object shows the response.
my c# code
{
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.ReleaseNoteView = db.ReleaseVersions.AsNoTracking().Where(x => x.ReleaseVersionID == ID).OrderBy(x => x.ReleaseVersionName).Select(x => new ReleaseNoteModel
ReleaseVersionID = x.ReleaseVersionID,
ReleaseVersionName = x.ReleaseVersionName,
IsCurrentVersion = x.IsCurrentVersion,
Staff = db.UserLoginProfiles.Where(s => s.UserLoginProfileID == 3).Select(s => new ReleaseItemModel
Improvement = s.ReleaseNotes.Where(a=> a.ReleaseItemTypeID == 2 && a.ReleaseVersionID ==ID).OrderBy(a => a.ReleaseNoteDescription).Select(a => new ReleaseNotesModel
ReleaseNoteID = a.ReleaseNoteID,
ReleaseNoteHeader = a.ReleaseNoteHeader,
ReleaseNoteDescription = a.ReleaseNoteDescription,
}).ToList(),
Feature = s.ReleaseNotes.Where(a => a.ReleaseItemTypeID == 1 && a.ReleaseVersionID == ID).OrderBy(a => a.ReleaseNoteDescription).Select(p => new ReleaseNotesModel
ReleaseNoteID = p.ReleaseNoteID,
ReleaseNoteHeader = p.ReleaseNoteHeader,
ReleaseNoteDescription = p.ReleaseNoteDescription
}).ToList()
}).FirstOrDefault(),
Adjuster = db.UserLoginProfiles.Where(a => a.UserLoginProfileID == 2).Select(s => new ReleaseItemModel
Improvement = s.ReleaseNotes.Where(a => a.ReleaseItemTypeID == 2 && a.ReleaseVersionID == ID).OrderBy(a => a.ReleaseNoteDescription).Select(a => new ReleaseNotesModel
ReleaseNoteDescription = a.ReleaseNoteDescription
Feature = s.ReleaseNotes.Where(a => a.ReleaseItemTypeID == 1 && a.ReleaseVersionID == ID).OrderBy(a => a.ReleaseNoteDescription).Select(a => new ReleaseNotesModel
Client = db.UserLoginProfiles.Where(t => t.UserLoginProfileID == 1).Select(t => new ReleaseItemModel
Improvement = t.ReleaseNotes.Where(a => a.ReleaseItemTypeID == 2 && a.ReleaseVersionID == ID).OrderBy(a => a.ReleaseNoteDescription).Select(a => new ReleaseNotesModel
}
).ToList(),
Feature = t.ReleaseNotes.Where(a => a.ReleaseItemTypeID == 1 && a.ReleaseVersionID == ID).OrderBy(a => a.ReleaseNoteDescription).Select(a => new ReleaseNotesModel
}).ToList<ReleaseNoteModel>();
catch (Exception ex)
Global.InsertException(ex);
return Ok(ReleaseNote);
my json response
"ReleaseNoteView": [
"ReleaseVersionID": 3,
"ReleaseVersionName": "v5.1.1",
"IsCurrentVersion": false,
"Staff": {
"Feature": [],
"Improvement": [
"ReleaseNoteID": 9,
"ReleaseNoteHeader": "CMS Profile Creation",
"ReleaseNoteDescription": "Adjuster’s CMS Profile and Branch Add to the CMS Profile automation will now go forward be triggered when assignment is added (instead of check-in approval)",
"ReleaseVersionID": null,
"ReleaseItemTypeID": null
},
"ReleaseNoteID": 10,
"ReleaseNoteHeader": "Commission Assignments",
"ReleaseNoteDescription": "An issue was resolved that was causing delays in the compensation for commission-based adjusters if/when billing was entered post-assignment dates. A grace period (35 days). Compensation is still done on a weekly basis – work needs to be input before Friday to be calculated in payroll.",
"ReleaseNoteID": 11,
"ReleaseNoteHeader": "Admin",
"ReleaseNoteDescription": "Enhancements to the Expenses permission when accessed from adjuster profile.",
],
"ReleaseNoteView": null
"Adjuster": {
"ReleaseNoteID": 8,
"ReleaseNoteHeader": "Profile",
"ReleaseNoteDescription": "Adjusters no longer have the capability to update address on Profile. Must contact Manager or Resource Team staff for any updates",
"Client": {
"Improvement": [],
so i need to show the response if user is Adjuster then json response will be like
"