C
C#2y ago
PontiacGTX

❔ API doesnt return dynamic object in ASP.NET Core 2.0

I am looking to return a list from a Dynamic linq query but the problem comes when returning the list it doesnt return anything on swagger the code is like
var result = _ctx.AccionFormativa
.Include(x => x.OfertaFormativa)
.Include(x => x.Modalidad)
.Include(x => x.ProgramasFormacion)
.Include(x => x.StatusCurso)
.Include(x => x.Centro)
.ThenInclude(x => x.DireccionCentro)
.Include(x => x.Ambito)
.GroupBy(fields, "it")
.ToDynamicList()
.Select(x => (new DynamicExpando(x)).GetCurrentObject);
var result = _ctx.AccionFormativa
.Include(x => x.OfertaFormativa)
.Include(x => x.Modalidad)
.Include(x => x.ProgramasFormacion)
.Include(x => x.StatusCurso)
.Include(x => x.Centro)
.ThenInclude(x => x.DireccionCentro)
.Include(x => x.Ambito)
.GroupBy(fields, "it")
.ToDynamicList()
.Select(x => (new DynamicExpando(x)).GetCurrentObject);
2 Replies
Angius
Angius2y ago
uh why No wonder Swagger can't make heads or tails of it, it's some weird dynamic expando-object
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server
More Posts