However, I found the perfect use for C# dynamic keyword ... dealing with JSON.
Often times, I need to send back a JSON Result with a subset of my object graph, or a flattened object graph. I only want to send back the fields that the front end needs (trying to be judicious with bandwidth).
dynamic result = new Object(); result.AgendaOrigFileName = agenda.AgendaOrigFileName; result.AgendaId = agenda.AgendaId; return Json(result);
No comments:
Post a Comment