I have the following controller method where the AppVersion contains the exact value in Name, with some other string, like Name: Some Application, AppVersion: Some Application - Production. I need to strip the value of Name from the value of AppVersion. I tried to search but not sure what I am looking for.
public IActionResult GetByAppId(string Id)
{
return new JsonResult(_db.Applications
.Select(a => new
{
a.Id,
a.AppId,
a.Name,
a.AppVersion
})
.Where(a => a.Id == Id)
.SingleOrDefault()
);
}
Examples of current output:
Name: Employee Recognition
AppVersion: Employee Recognition - Acceptance
Name: Content Delivery Platform (CDP)
AppVersion: Content Delivery Platform (CDP) - pod 2 - Production
JsonResultcall. Store the result in a variable and modify the properties.