Käyttäjän "murat.yuceer" toiminnot

Maybe generate partial class could be option

Vastaus

Blazor-Server MongoDb

After migrate security-log page not work, throw error I found problem, if BrowserInfo field is null in AbpSecurityLogs table/collection, page not load because of null reference exception.

I can override some base repository method to do this, for example like ApplyFilter, just i will override IQuaryable object. But I guess you don't have a common method that every request goes through.

Yes. For example, I have EntityRowLevelPermission table, users can create row based permissions and store there (like x == 5 condition must apply for user or group a). Then I cache it and building expression on runtime. But I have to apply this expressions. But where? Global filters look like not help me.

Also can we transfer client ip address from http. Example from blazor server IP Address is empty

Vastaus

ABP Framework version: v4.4.2 UI type: Blazor Server DB provider: EF Core

When you create from module template, its not add lines below for Blazor.Server.Host module

            Configure<AbpMultiTenancyOptions>(options =>
            {
                options.IsEnabled = MultiTenancyConsts.IsEnabled;
            });
Vastaus

I using ILookupApiRequestService to call abp api without dynamicsystem (i have some reasons).

I using module template to start project with Blazor.Server.Host (unified)

But line 58 not throw error, because of that its not add headers or cookie to authenticate

https://github.com/abpframework/abp/blob/6253849bc59c0158e77237bb3652ae0585fe110e/framework/src/Volo.Abp.AspNetCore.Components.Server/Volo/Abp/AspNetCore/Components/Server/Extensibility/BlazorServerLookupApiRequestService.cs

override devex api controllers

using System.Threading.Tasks;
using DevExpress.AspNetCore.Reporting.WebDocumentViewer;
using DevExpress.AspNetCore.Reporting.WebDocumentViewer.Native.Services;
using Kuys.Shared.AspNetCore.DevExp.Reporting.HttpApi.Services;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace Kuys.Shared.AspNetCore.DevExp.Reporting.HttpApi.Controllers
{
    [ApiExplorerSettings(IgnoreApi = true)]
    [Route("DXXRDV")]
    public class CustomWebDocumentViewerController : WebDocumentViewerController
    {
        private readonly IExportResultProvider _exportResultProvider;

        public CustomWebDocumentViewerController(
            IWebDocumentViewerMvcControllerService controllerService, 
            IExportResultProvider exportResultProvider) : 
            base(controllerService)
        {
            _exportResultProvider = exportResultProvider;
        }

        [Authorize]
        [Route("Invoke")]
        public override Task<IActionResult> Invoke()
        {
            return base.Invoke();
        }

        [HttpPost]
        [Route("GetExportResult")]
        public ActionResult GetExportResult(string token)
        {
            ExportResult exportResult;
            if (!_exportResultProvider.TryGetExportResult(token, out exportResult))
            {
                return StatusCode(StatusCodes.Status404NotFound, "Exported document was not found. Try to export the document once again.");
            }
            var fileResult = File(exportResult.GetBytes(), exportResult.ContentType);
            if (exportResult.ContentDisposition != System.Net.Mime.DispositionTypeNames.Inline)
            {
                fileResult.FileDownloadName = exportResult.FileName;
            }

            return fileResult;
        }
    }
}

startup settings

using DevExpress.AspNetCore;
using DevExpress.AspNetCore.Reporting;
using DevExpress.AspNetCore.Reporting.WebDocumentViewer;
using DevExpress.DataAccess;
using DevExpress.XtraReports.Web.Extensions;
using DevExpress.XtraReports.Web.ReportDesigner.Services;
using DevExpress.XtraReports.Web.WebDocumentViewer;
using Kuys.Framework.Reporting;
using Kuys.Shared.AspNetCore.DevExp.Reporting.HttpApi.Services;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Volo.Abp;
using Volo.Abp.AspNetCore.Mvc.AntiForgery;
using Volo.Abp.Modularity;

namespace Kuys.Shared.AspNetCore.DevExp.Reporting.HttpApi
{
    [DependsOn(typeof(KuysFrameworkReportingModule))]
    public class KuysSharedAspNetCoreDevExpReportingHttpApiModule : AbpModule
    {
        public override void ConfigureServices(ServiceConfigurationContext context)
        {
            Configure<AbpAntiForgeryOptions>(options =>
            {
                options.AutoValidateFilter = type => !type.Namespace.StartsWith("Kuys.Shared.AspNetCore.DevExp.Reporting.HttpApi");
            });

            context.Services.AddDevExpressControls();

            context.Services.AddMvcCore().ConfigureApplicationPartManager(x =>
            {
                var parts = x.ApplicationParts;
                var aspNetCoreReportingAssemblyName = typeof(WebDocumentViewerController).Assembly.GetName().Name;
                var reportingPart = parts.FirstOrDefault(part => part.Name == aspNetCoreReportingAssemblyName);
                if (reportingPart != null)
                {
                    parts.Remove(reportingPart);
                }
            });

            context.Services.ConfigureReportingServices(configurator =>
            {
                configurator.ConfigureWebDocumentViewer(viewerConfigurator =>
                {
                    viewerConfigurator.UseCachedReportSourceBuilder();
                });
            });

            context.Services.AddTransient<ReportStorageWebExtension, CustomReportStorage>();
            context.Services.AddScoped<IWebDocumentViewerReportResolver, CustomWebDocumentViewerReportResolver>();
            context.Services.AddScoped<ObjectDataSourceInjector>();
            context.Services.AddScoped<PreviewReportCustomizationService, CustomPreviewReportCustomizationService>();
            context.Services.AddScoped<IWebDocumentViewerExportResultUriGenerator, CustomWebDocumentViewerExportResultUriGenerator>();
            context.Services.AddScoped<IExportResultProvider, CustomWebDocumentViewerExportResultUriGenerator>();
        }

        public override void OnApplicationInitialization(ApplicationInitializationContext context)
        {
            var app = context.GetApplicationBuilder();

            app.UseDevExpressControls();
        }
    }
}

hi

I only implemented the ScopedServiceProvider. no other linq querys.

Can you try to query in an uow?

https://docs.abp.io/en/abp/latest/Unit-Of-Work#begin-a-new-unit-of-work

Thank you,

I have already add UnitOfWork attribute but it didn't work.. After making sure that the example you gave is working, I found that it doesn't work because I didn't add virtual to method

        [HighlightedMember]
        [UnitOfWork(isTransactional: false)]
        public **virtual** IEnumerable<ToWhomItMayConcernReportModel> Get(Guid id, string lang = "tr")
        {
                var result = _employeeRepository.AsQueryable().ToList(); 
                
                ...
        }

I dont use multiple context, this linq working in application service. Can you send the project you solved before?

Näytetään 11 - 20/64 tietueesta
Made with ❤️ on ABP v8.2.0-preview Updated on maaliskuuta 25, 2024, 15.11