JsonResult - how to return an empty JSON result?
As of asp.net mvc 5 you could simple write:
Json(new EmptyResult(), JsonRequestBehavior.AllowGet)
In .Net Core 3.0 for a controller of type ControllerBase you can do this:
return new JsonResult(new object());
if (portfolioManagerPortalData.salesData.myYTDSalesClients == null) {
returnJsonResult = Json(new object[] { new object() }, JsonRequestBehavior.AllowGet);
}
else {
returnJsonResult = Json(portfolioManagerPortalData.salesData.myYTDSalesClients, JsonRequestBehavior.AllowGet);
}