Activities of "berkansasmaz"

Yes that's right, there's no direct way to achieve this.

https://support.abp.io/QA/Questions/456/How-to-Insert-Photo-In-ABP-Suite#answer-fc6a1a07-a8fd-c0d6-f43a-39f80a4c98d0

Hi,

Unfortunately, product service does not support code generation with Suite in versions 4.*.*. This is valid even if you add SuiteTemplates.dll manually. Please wait for 5.0.0-rc.1 to come out or try it in version 5.0.0.beta.*.

Hi,

You can define permissions to be available only at the host/tenant or both levels.

myGroup.AddPermission(
    "BookStore_Author_Create",
    LocalizableString.Create<BookStoreResource>("Permission:BookStore_Author_Create"),
    multiTenancySide: MultiTenancySides.Host //set multi-tenancy side!
);

For more information 👉 https://docs.abp.io/en/abp/latest/Authorization#multi-tenancy

Answer

Hello,

Slowness is a very relative concept, how much of a slowness are we talking about?

I see that you are in a tiered structure. Is the Redis server up?
If Redis is not up please see here 👉 https://stackoverflow.com/a/69371513/9922629

If redis is up can you send logs of a run cycle, please?

Hello,

Thank you for the information 🙏🙏

I created an internal issue related to the topic because the issue only exists in the lepton theme.

In the meantime, I'd like to share some information for more elegant error handling.

In general, we do not want users to go to the Error page, so I generally prefer to use a method like the one below.

I am creating a method inside MyProjectNamePageModel (class inherited from AbpPageModel) as below.

        protected void ShowAlert(Exception exception)
        {
            Logger.LogException(exception);
            var errorInfoConverter = LazyServiceProvider.LazyGetRequiredService<IExceptionToErrorInfoConverter>();
            var errorInfo = errorInfoConverter.Convert(exception, false);
            Alerts.Danger(errorInfo.Message);
        }

The errorInfoConverter.Convert method here makes the message of a BusinessException(or others Abp's exceptions) thrown in the domain appear in the UI, if you don't need it, you can remove it.

Then, with a code like the following, we ensure that the user stays on this page instead of a separate page when the error is thrown.

        public async Task<IActionResult> OnPostAsync()
        {
            try
            {
                ValidateModel();

               //Your CODE

                return RedirectToPage("/");
            }
            catch (Exception exception)
            {
                ShowAlert(exception);
               
                return Page();
            }
        }

For more information you can check here.

You probably already know, but I still wanted to share this information in case it helps users who have the same problem, I hope it helps 👋

Hi,

We don't need to write a custom exception handling middleware for this, but instead we need to override ABP's DefaultExceptionToErrorInfoConverter.

Based on what I understand from your needs, I created a folder named ExceptionHandling in MyProjectName.Domain and put the following code in it.

    [Dependency(ReplaceServices = true)]
    [ExposeServices(typeof(IExceptionToErrorInfoConverter))]
    public class MyExceptionToErrorInfoConverter : DefaultExceptionToErrorInfoConverter, IExceptionToErrorInfoConverter
    {
        public MyExceptionToErrorInfoConverter(IOptions<AbpExceptionLocalizationOptions> localizationOptions, IStringLocalizerFactory stringLocalizerFactory, IStringLocalizer<AbpExceptionHandlingResource> stringLocalizer, IServiceProvider serviceProvider) : base(localizationOptions, stringLocalizerFactory, stringLocalizer, serviceProvider)
        {
        }
        
        protected override RemoteServiceErrorInfo CreateErrorInfoWithoutCode(Exception exception, bool includeSensitiveDetails)
        {
            if (includeSensitiveDetails)
            {
                return CreateDetailedErrorInfoFromException(exception);
            }

            exception = TryToGetActualException(exception);

            if (exception is AbpRemoteCallException remoteCallException)
            {
                return remoteCallException.Error;
            }

            if (exception is AbpDbConcurrencyException)
            {
                return new RemoteServiceErrorInfo(L["AbpDbConcurrencyErrorMessage"]);
            }

            if (exception is EntityNotFoundException)
            {
                return CreateEntityNotFoundError(exception as EntityNotFoundException);
            }

            var errorInfo = new RemoteServiceErrorInfo();

            if (exception is IUserFriendlyException or ArgumentNullException) // Here ArgumentNullException
            {
                errorInfo.Message = exception.Message;
                errorInfo.Details = (exception as IHasErrorDetails)?.Details;
            }

            if (exception is IHasValidationErrors)
            {
                if (errorInfo.Message.IsNullOrEmpty())
                {
                    errorInfo.Message = L["ValidationErrorMessage"];
                }

                if (errorInfo.Details.IsNullOrEmpty())
                {
                    errorInfo.Details = GetValidationErrorNarrative(exception as IHasValidationErrors);
                }

                errorInfo.ValidationErrors = GetValidationErrorInfos(exception as IHasValidationErrors);
            }

            TryToLocalizeExceptionMessage(exception, errorInfo);

            if (errorInfo.Message.IsNullOrEmpty())
            {
                errorInfo.Message = L["InternalServerErrorMessage"];
            }

            errorInfo.Data = exception.Data;

            return errorInfo;
        }
    }

The only difference from the default CreateErrorInfoWithoutCode method is the line with the comment line.

Now you can see ArgumentException thrown in domain. Of course, you can customize how you want to see it according to your needs.

I hope my answer helps in customizing to your needs.

Hello, as a result of my tests, I encountered the same problem, it's a bug.

As a workaround, I copied the appsettings.json file inside the MyProjectName.Blazor project into the MyProjectName.Blazor/wwwroot folder.

I'm creating an internal issue related to the topic.

Hi, can't you download when you request via swagger?

Please give some more code details.

Hi 👋,

This question doesn't seem to be about ABP, but I still want to share with you a few tips we use in our own kitchen ✌️

For preview, you can convert the PDF file to JPG and show it to the user.

For printing we use the PdfSharpCore package. You can check this video about using the package. Basically what is done is to place the data according to the coordinates on PDF.

I hope this information will help you and you can do what you want more easily 😊

Showing 211 to 220 of 267 entries
Made with ❤️ on ABP v9.1.0-rc.1. Updated on January 17, 2025, 14:13