0
ajayak created
I want to access Request object in ApplicationService. As the AppService is not a MVC Controller, how can I do so? I am trying something like this:
var json = new StreamReader(Request.InputStream).ReadToEnd();
Markdown is supported
Copy & paste or drag & drop images (max 30 MB per image)
5 Answer(s)
-
0
@ajayak, are you working on ASP.NET Core or MVC 5.x ?
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
I'm using ASP.NET Core
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Hi @ajayak,
you can use app services (this is the better way) for your example from client side, for example:
Client side
var userAppService = abp.services.app.user; var tenantAppService = abp.services.app.tenant; ... userAppService.sendAnyData(anyDataDto);App service
public AnyReturnValue SendAnyData(AnyDataDto anyDataDto) { }Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Hi @ajayak,
You can inject IHttpContextAccessor into your app service and use it to access HttpContext and it's Requet property.
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Hi @ismcagdas,
IHttpContextAccessor solution worked for me :)
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image)