Base solution for your next web application

Activities of "p.j.keukens"

That was what I was looking for, thanks!

Question

Hi,

I'm using Aspnetzero 6.9 for .NET Core + JQuery.

In my application I've enabled Swagger which is working fine. The only problem is that for the return object it shows the actual object that is returned from the method but aspnet zero encapsulates the object in a default response.

For example if we have simple get operation that returns a list of cars like

public List<Car> GetCars()

Then in Swagger the response message will look like:

{
    "cars": [
        { "name": "Tesla Model 3" },
        { "name": "Opel Empera-E"}
    ]
}

But the actual response is:

{
    "result": {
        "cars": [
            {
                "name": "Telsa Model 3"
            },
            {
                "name": "Opel Ampera-E",
            },
        ]
    },
    "targetUrl": null,
    "success": true,
    "error": null,
    "unAuthorizedRequest": false,
    "__abp": true
}

So is there a way to add the default return object to the response in swagger ui so that it corresponds to the actual returned result?

Best regards,

Patrick

That worked! Thanks

No for example I have a view with a datatable on there, in je javascript file I call the app service like so:

var _carService = abp.services.app.car;

var dataTable = _$opticianInsurancesTable.DataTable({
            paging: true,
            serverSide: true,
            processing: true,
listAction: {
                ajaxFunction:  _carService.getAll

but when I decorate the car app service with Remote services the _carService.getAll doesn't work anymore.

[RemoteService(IsMetadataEnabled = false)]
    [AbpAuthorize(AppPermissions.Pages_Cars)]
    public class CarAppService : CarAppServiceBase, ICarAppService

When I add [RemoteService(IsMetadataEnabled = false)] or [RemoteService(IsEnabled = false)] then it doesn't show in swagger but also the application doesn't work anymore because those services can't be reached through javascript.

So I need some thing to remove it from swagger but in a way that the methods can still be accessed by the application through javascript.

Hi,

I'm using the aspnet zero .net core and jquery version 6.9, I've just added swagger to my project which is working fine. But I would like swagger to only show a few of the actions. For example I would only like to show "api/TokenAuth/Authenticate" and "api/Cars/GetAll". There are more calls that are used by the application and that are generated which is fine but I don't want them to appear in the public swagger api definition.

Is there a way to configure which methods show up in Swagger (but still generate all api's as they are needed by the web application)?

Best regards,

Patrick

Question

Hi,

We are using v6.9.0 of the asp.net zero .net core + jquery.

The problem arrises when a host user logs in to the application and impersonates a user, this is all fine but when the host user logs-out (while impersonating a user) of the application the host user can't login again because it says that the tenant is not active. Removing the cookies resolves the problem and the user can login again.

The problem is the Abp.TenantId cookie doesn't get cleared/removed on logout. Please advice on how to resolve.

Best regards,

Patrick

yes thank you.

Oké they are in the database now, they are not yet on schowing up on the entity histroy screen but I can probably solve that one. Thanks

Do I have to enable it in my job because my core module already does:

Configuration.Auditing.IsEnabledForAnonymousUsers = true;

So should I call the line below inside the background job?

IocManager.Resolve<IEntityHistoryConfiguration>().IsEnabledForAnonymousUsers = true;
Showing 1 to 10 of 56 entries