Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

Blazor generic API that returns list of T

$
0
0

I'm building some blazor appand would like to have some generic methods that can returns any type from shared project.

The idea is that I would like to do:

 List<GSPparam> parameters.... // stored proc params List<person> ret = await this._ihttp.Post<List<person>>("api/...",parameters )

and in API:

 [HttpPost] [Route("...")] public async Task<T> ExecProcTable<T>( [FromBody] List<GSPparam> parameters){   .... somehow KNOWN WHAT THE T IS ? in this case List<person> so List<person> ret = ..... ; return ok (ret)}

but I have no idea how to pass this Type from shared project.via string? and some reflection?Please advise.


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>