Base solution for your next web application

Activities of "walkerscott"

Hi,

I downloaded Zero version 8.0.0 but when opening in Visual Studio it doesn't build. Looks to be because some NuGet packages got upgraded to .NET Core 3.0 but projects are still on .NET Core 2.2

Maybe not all changes got included in the zip file ? I tried to download multiple times but still the same.

Sample error

Package Microsoft.EntityFrameworkCore.SqlServer 3.0.0 is not compatible with netcoreapp2.2

Please advise

Hi,

Is there a way I can load my configuration from database? Like adding a configs aside from existing appsettings.json I'm planning to use specific data from AbpSettings table and load it in addition from appsettings.json

Question

I think I am missing something in the documentation. But is it possible to cache the language translations (by source) for better performance? Note, we are using Zero interface for Host and a custom AngularJS based UI for Tenants/Users, but leveraging Abp functionality where possible.

Ideally we don't want to get all translation texts on each page load:

GET /api/services/app/Language/GetLanguageTexts

Thanks in advance

Hi.

We have a project that is in ABP ASP.NET MVC 5 using Swashbuckle 5.0 for Swagger UI implementation. We follow the steps in this documentation ([https://aspnetboilerplate.com/Pages/Documents/Swagger-UI-Integration#aspnet-5x])) as the guide for implementing swagger and we successfully accessed /swagger/ui/index.

From the image below, we want to show only the Account and OrderUpload endpoint, hiding all default endpoints.

We followed the documentation in [https://aspnetboilerplate.com/Pages/Documents/Dynamic-Web-API]) to just create specific endpoints only but we're unsuccessful. We encountered problems on using #2 to #4 approach. The only working is #1 that creates all endpoints.

public override void Initialize()
{
    IocManager.RegisterAssemblyByConvention(Assembly.GetExecutingAssembly());

    //-- APPROACH [#1](https://support.aspnetzero.com/QA/Questions/1)
    //Automatically creates Web API controllers for all application services of the application
    DynamicApiControllerBuilder
        .ForAll<IApplicationService>(typeof(DC4ApplicationModule).Assembly, "app")
        .Build();

    //-- APPROACH [#2](https://support.aspnetzero.com/QA/Questions/2)
    DynamicApiControllerBuilder
        .For<IApplicationService>("app")
        .ForMethod("Clear").DontCreateAction()
        .ForMethod("ClearAll").DontCreateAction()
        .Build();

    //-- APPROACH [#3](https://support.aspnetzero.com/QA/Questions/3)
    DynamicApiControllerBuilder
        .ForAll<IApplicationService>(typeof(DC4ApplicationModule).Assembly, "app")
        .ForMethod(builder =>
        {
            if (builder.Method.IsDefined(typeof(MyIgnoreApiAttribute)))
            {
                builder.DontCreate = true;
            }
        })
        .Build();

    //-- APPROACH [#4](https://support.aspnetzero.com/QA/Questions/4)
    DynamicApiControllerBuilder
        .For<IApplicationService>("app")
        .ForMethod("UploadOrders").WithVerb(HttpVerb.Post)
        .Build();

    Configuration.Modules.AbpWebApi().HttpConfiguration.Filters.Add(new HostAuthenticationFilter("Bearer"));
    ConfigureSwaggerUi();
}

For approach #2 and #4, this was the encountered error:

For approach #3, the ForMethod is not available as a definition.

We are thinking that we need to map the correct path put it in "app" in this line of code to access the two controllers (Account and OrderUpload) on WebApi project to use the approaches above.

.ForAll<IApplicationService>(typeof(DC4ApplicationModule).Assembly, "app")

How can we show/hide API end-points using the ABP and user based permissions?

Question

In TokenAuth/Authenticate API method, what's the use of RememberClient? I also tried logging in the UI but it's always false even I checked "Remember Me". It also doesn't extend the expiration of the token. So I'm wondering what is it for?

Question

Hi,

How can I set the tenant based on URL?

Scenario is an email is sent to the users with the URL to access specific page. The URL has an identifier that can let us know what tenant the URL is for. In our case GUID.

What we want is upon accessing the URL, if not logged in, it will set the Tenant on TenancyName on Login Page. So that the page will not lose the return URL as well.

I was able to set the Tenant but I can't write the cookie for Abp.TenantId. I write it on SessionAppService.GetCurrentLoginInformations(), but can't write the cookie from it.

My code for writing the cookie is below..

_httpContextAccessor.HttpContext.Response.Cookies.Append(
                    "Abp.TenantId",
                    userUrlTenantId.ToString(),
                    new CookieOptions
                    {
                        Expires = DateTimeOffset.Now.AddYears(5),
                        Path = "/"
                    }
                );
Question

Hi,

Is it possible to change existing project from ASP.NET MVC 5.x & Angularjs 1.xto ASP.NET Core & Angular?

Hi.

We created an API Endpoint same as the solution on this ticket (#3295). We managed to create an API Response with Status Code 304 with our desired return fields when we encountered an error in the validation. But when the process is all good and accepted with Status Code 200 , it shows different return and ignored the API Response we created. Please see the code snippets below for reference.

using block:

using Abp.Domain.Repositories;
using AutoMapper;
using PRJ.Application.Dto;
using PRJ.Core.Entities;
using PRJ.OrderTask.OrderTaskDto;
using PRJ.Utility;
using System;
using System.Collections.Generic;
using System.Web;
using System.Linq;
using System.Net.Http;
using System.Net;
using System.Web.Script.Serialization;
using PRJ.Common.Dto;
using System.Net.Http.Headers;

Class implementation:

public class OrderUploadAppService : PRJAppServiceBase, IOrderUploadAppService

IF Status Code 200:

APIResponse apiResponse = new APIResponse()
{
   ResponseCode = (int)HttpStatusCode.OK,
   ResponseMessage = "Success",
   OrderUploadId = orderUploadId,
   ValidationMessages = validationMessage 
};

var json = new JavaScriptSerializer().Serialize(apiResponse);
response = new HttpResponseMessage()
{
   StatusCode = HttpStatusCode.OK,
   Content = new StringContent(json)
};

return response;

IF Status Code 304:

APIResponse apiResponse = new APIResponse()
{
   ResponseCode = (int)HttpStatusCode.NotModified,
   ResponseMessage = "Validation unsuccessful, check validation messages.",
   OrderUploadId = 0,
   ValidationMessages = validationMessage 
};

var json = new JavaScriptSerializer().Serialize(apiResponse);
response = new HttpResponseMessage()
{
   StatusCode = HttpStatusCode.NotModified,
   Content = new StringContent(json)
};

return response;

Expected Return for 200:

{
   "ResponseCode":200,
   "ResponseMessage":"Success.",
   "OrderUploadId":123,
   "ValidationMessages":[]
}

Actual Return for 200:

{
    "success": true,
    "result": null,
    "error": null,
    "unAuthorizedRequest": false
}

Actual Return for 304:

{
   "ResponseCode":304,
   "ResponseMessage":"Validation unsuccessful, check validation messages.",
   "OrderUploadId":0,
   "ValidationMessages":[]
}

The question is why in 200, the API ignores the customized return. At break point, it passes the setup of API Response, JSON Serialization and encountered no errors but shows different response once done? And if 304, there's no problem displaying the desired return.

If the default response for 200 cannot be modified, how can I put a value (string or int or obj) on the result field? Something like this:

{
    "success": true,
    "result": "TESTResponseMessage",
    "error": null,
    "unAuthorizedRequest": false
}

Thank you.

Is it possible for Host users to globally manage tenant values e.g. Tenant Roles, Users, Settings etc. ?

Use case is SaaS application where the Host is providing support for the Tenant.

Hi.

We have an existing MVC solution that is in ABP v4.0.30319. Is it possible to add a new API project on the solution? Or create an API Endpoint in one of the controllers? Kindly advice on what is the best approach in creating an API Endpoint.

Thanks.

Showing 1 to 10 of 21 entries