Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC

Activities of "AuroraBMS"

Good day,

Version 12.4 Angular Core

This has been something that has been haunting us for a while now and I've been looking for a resolution for a very long time but I can't find anything worth mentioning in terms of string.Format usage that is generate by power tools.

The below is the structure that we are using when generating some navigation properties:

It generates this as part of the query:

.WhereIf(!string.IsNullOrWhiteSpace(input.TaxCodeSetupDisplayPropertyFilter), e => string.Format("{0} ( {1} )", e.TaxCodeSetupFk == null || e.TaxCodeSetupFk.TaxGroupCode == null ? "" : e.TaxCodeSetupFk.TaxGroupCode.ToString() , e.TaxCodeSetupFk == null || e.TaxCodeSetupFk.TaxGroupName == null ? "" : e.TaxCodeSetupFk.TaxGroupName.ToString() ) == input.TaxCodeSetupDisplayPropertyFilter)

As this has been part of the general ASP.NET ZERO releases for a while now I assume I am just missing some kind of package that allows for the translation to actually succeed but I am completely in the dark as to what it could be as string.format is a known linq to entity framework translation issue.

Below the error that is thrown: System.InvalidOperationException: The LINQ expression 'DbSet() .Where(t => __ef_filter__p_0 || !(((ISoftDelete)t).IsDeleted) && __ef_filter__p_1 || ((IMayHaveTenant)t).TenantId == __ef_filter__CurrentTenantId_2) .Where(t => string.Format( format: "{0} ( {1} )", arg0: t.TaxGroupCode, arg1: t.TaxGroupName).Contains(__input_Filter_0))' could not be translated. Additional information: Translation of method 'string.Format' failed. If this method can be mapped to your custom function, see https://go.microsoft.com/fwlink/?linkid=2132413 for more information. Either rewrite the query in a form that can be translated, or switch to client evaluation explicitly by inserting a call to 'AsEnumerable', 'AsAsyncEnumerable', 'ToList', or 'ToListAsync'. See https://go.microsoft.com/fwlink/?linkid=2101038 for more information. at Microsoft.EntityFrameworkCore.Query.QueryableMethodTranslatingExpressionVisitor.g__CheckTranslated|15_0(ShapedQueryExpression translated, <&gt;c__DisplayClass15_0&) at Microsoft.EntityFrameworkCore.Query.QueryableMethodTranslatingExpressionVisitor.VisitMethodCall(MethodCallExpression methodCallExpression) at Microsoft.EntityFrameworkCore.Query.RelationalQueryableMethodTranslatingExpressionVisitor.VisitMethodCall(MethodCallExpression methodCallExpression) at Microsoft.EntityFrameworkCore.Query.QueryableMethodTranslatingExpressionVisitor.VisitMethodCall(MethodCallExpression methodCallExpression) at Microsoft.EntityFrameworkCore.Query.RelationalQueryableMethodTranslatingExpressionVisitor.VisitMethodCall(MethodCallExpression methodCallExpression) at Microsoft.EntityFrameworkCore.Query.QueryCompilationContext.CreateQueryExecutor[TResult](Expression query) at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.<>c__DisplayClass12_0`1.b__0() at Microsoft.EntityFrameworkCore.Query.Internal.CompiledQueryCache.GetOrAddQuery[TResult](Object cacheKe...

As this is out of the box functionality in a released version I would assume that the base generated code does not require customizations such as changing to base generated code, ref to: Either rewrite the query in a form that can be translated, or switch to client evaluation explicitly by inserting a call to 'AsEnumerable', 'AsAsyncEnumerable', 'ToList', or 'ToListAsync'.

any assistance regarding this would be greatly appreciated.

Good day,

We are trying to implement full offline functionality for within controlled work spaces.

PWA seems like the logical route to go and would like to find out if there is any guidance from the ANZ team as to implement it correctly in angular core version.

We are aware of security risks due to offline mode but it will be in a controlled environment which always for the risks to not be an issue for us.

Any information / guidance on PWE offline functionality would be greatly appreciated.

Thanks!

Hi @ismcagdas,

Apologies for the delay. We are on version 11.2.0 currently, are all of the packages on the latest version ivy compatible?

Regards,

Good day,

Will angular ivy be considered going forward at some stage?

Currently quite a few packages that do not support it in aspnetzero angular core side.

Processing legacy "View Engine" libraries:

  • abp-ng2-module [es2015/esm2015] (https://github.com/aspnetboilerplate/abp-ng2-module)
  • ng2-file-upload [es2015/esm2015] ()
  • ngx-image-cropper [es2015/esm2015] (https://github.com/Mawi137/ngx-image-cropper.git)
  • ngx-perfect-scrollbar [es2015/esm2015] (https://github.com/zefoy/ngx-perfect-scrollbar.git)
  • angular2-counto [main/commonjs] (https://github.com/izupet/angular2-counto.git)
  • angular2-text-mask [main/commonjs] (https://github.com/text-mask/text-mask.git) Encourage the library authors to publish an Ivy distribution.

thanks in advance

Hi Ismcagdas,

I've tried different versions, new versions, historical versions and all of them work normally until ELSA is involved.

I've followed the MVC guide, I followed the steps for getting the dashboard up and running on and that is fine, everything works perfectly except for nswag generation for serivce proxies.

I've tried excluding elsa from nswag generation, i've added in filters and it keeps generating the service proxies.

Is there some guidance that you can provide in getting this up and running please. Another part that is also a nightmare now is the api-version being added to all endpoints, if I am not mistaken, this should also be something that should not be occuring due to how aspnetzero does not use version and it should be isolated to elsa only. getFriendProfilePicture(userId: number | undefined, tenantId: number | undefined, **api_version: string **| undefined): Observable<GetProfilePictureOutput> {

Any assistance in getting this up and running on a blank solution will be greatly appreciated.

Project Type: Angular Core Version: 12^

Good day,

We are busy implementing Elsa Integration into our solution and started testing it out on a clean project instance. Elsa integration has been added based on the MVC guide on the site however we are encountering issues on the angular side now due to endpoints being generated via nswag.

Could you please assist with proper steps of how to implement Elsa on aspnetzero angular core. This is a guide that people have requested for several years already and there are bits and pieces of help on the support site but following it only bring the backend online without issues.

below is a portion of the errors encountered by including elsa especially duplications triggered:

Error: src/shared/service-proxies/service-proxies.ts:5444:9 - error TS2322: Type 'Observable<WorkflowInstance | PagedListOfWorkflowInstanceSummaryModel>' is not assignable to type 'Observable<PagedListOfWorkflowInstanceSummaryModel>'. Type 'WorkflowInstance | PagedListOfWorkflowInstanceSummaryModel' is not assignable to type 'PagedListOfWorkflowInstanceSummaryModel'. Type 'WorkflowInstance' is missing the following properties from type 'PagedListOfWorkflowInstanceSummaryModel': items, page, pageSize, totalCount

5444 return this.http.request("get", url_, options_).pipe(observableMergeMap((response : any) => { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 5445 return this.processWorkflowInstancesGet(response_); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ... 5454 return observableThrow(response) as any as Observable<PagedListOfWorkflowInstanceSummaryModel>; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 5455 })); ~~~~~~~~~~~~

Error: src/shared/service-proxies/service-proxies.ts:5458:15 - error TS2393: Duplicate function implementation.

5458 protected processWorkflowInstancesGet(response: HttpResponseBase): Observable<PagedListOfWorkflowInstanceSummaryModel> { ~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: src/shared/service-proxies/service-proxies.ts:5491:5 - error TS2393: Duplicate function implementation.

5491 workflowDefinitionsGet(ids: string | undefined, searchTerm: string | undefined, orderBy: WorkflowDefinitionOrderBy | undefined, sortBy: SortBy | undefined, page: number | undefined, pageSize: number | undefined, version: string | undefined): Observable<PagedListOfWorkflowDefinitionSummaryModel> { ~~~~~~~~~~~~~~~~~~~~~~

Error: src/shared/service-proxies/service-proxies.ts:5531:9 - error TS2322: Type 'Observable<WorkflowDefinition | PagedListOfWorkflowDefinitionSummaryModel>' is not assignable to type 'Observable<PagedListOfWorkflowDefinitionSummaryModel>'. Type 'WorkflowDefinition | PagedListOfWorkflowDefinitionSummaryModel' is not assignable to type 'PagedListOfWorkflowDefinitionSummaryModel'. Type 'WorkflowDefinition' is missing the following properties from type 'PagedListOfWorkflowDefinitionSummaryModel': items, page, pageSize, totalCount

5531 return this.http.request("get", url_, options_).pipe(observableMergeMap((response : any) => { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 5532 return this.processWorkflowDefinitionsGet(response_); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ... 5541 return observableThrow(response) as any as Observable<PagedListOfWorkflowDefinitionSummaryModel>; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 5542 })); ~~~~~~~~~~~~

Error: src/shared/service-proxies/service-proxies.ts:5545:15 - error TS2393: Duplicate function implementation.

5545 protected processWorkflowDefinitionsGet(response: HttpResponseBase): Observable<PagedListOfWorkflowDefinitionSummaryModel> { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: src/shared/service-proxies/service-proxies.ts:5784:5 - error TS2393: Duplicate function implementation.

5784 workflowRegistryGet(version: string | undefined): Observable<PagedListOfWorkflowBlueprintSummaryModel> { ~~~~~~~~~~~~~~~~~~~

Error: src/shared/service-proxies/service-proxies.ts:5800:9 - error TS2322: Type 'Observable<PagedListOfWorkflowBlueprintModel | PagedListOfWorkflowBlueprintSummaryModel>' is not assignable to type 'Observable<PagedListOfWorkflowBlueprintSummaryModel>'. Type 'PagedListOfWorkflowBlueprintModel | PagedListOfWorkflowBlueprintSummaryModel' is not assignable to type 'PagedListOfWorkflowBlueprintSummaryModel'. Type 'PagedListOfWorkflowBlueprintModel' is not assignable to type 'PagedListOfWorkflowBlueprintSummaryModel'. Types of property 'items' are incompatible. Type 'WorkflowBlueprintModel[]' is not assignable to type 'WorkflowBlueprintSummaryModel[]'. Property 'versionId' is missing in type 'WorkflowBlueprintModel' but required in type 'WorkflowBlueprintSummaryModel'.

5800 return this.http.request("get", url_, options_).pipe(observableMergeMap((response : any) => { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 5801 return this.processWorkflowRegistryGet(response_); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ... 5810 return observableThrow(response) as any as Observable<PagedListOfWorkflowBlueprintSummaryModel>; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 5811 })); ~~~~~~~~~~~~

src/shared/service-proxies/service-proxies.ts:40620:5 40620 versionId!: string | undefined; ~~~~~~~~~ 'versionId' is declared here.

Error: src/shared/service-proxies/service-proxies.ts:5814:15 - error TS2393: Duplicate function implementation.

5814 protected processWorkflowRegistryGet(response: HttpResponseBase): Observable<PagedListOfWorkflowBlueprintSummaryModel> { ~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: src/shared/service-proxies/service-proxies.ts:6486:5 - error TS2393: Duplicate function implementation.

6486 dispatchPost(signalName: string, body: DispatchSignalRequest | undefined): Observable<DispatchSignalResponse> { ~~~~~~~~~~~~

Error: src/shared/service-proxies/service-proxies.ts:6519:15 - error TS2393: Duplicate function implementation.

6519 protected processDispatchPost(response: HttpResponseBase): Observable<DispatchSignalResponse> { ~~~~~~~~~~~~~~~~~~~

Error: src/shared/service-proxies/service-proxies.ts:6602:5 - error TS2393: Duplicate function implementation.

6602 dispatchPost(token: string, api_version: string | undefined): Observable<void> { ~~~~~~~~~~~~

Error: src/shared/service-proxies/service-proxies.ts:6620:9 - error TS2322: Type 'Observable<void | DispatchSignalResponse>' is not assignable to type 'Observable<void>'. Type 'void | DispatchSignalResponse' is not assignable to type 'void'. Type 'DispatchSignalResponse' is not assignable to type 'void'.

6620 return this.http.request("post", url_, options_).pipe(observableMergeMap((response : any) => { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 6621 return this.processDispatchPost(response_); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ... 6630 return observableThrow(response) as any as Observable<void>; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 6631 })); ~~~~~~~~~~~~

Error: src/shared/service-proxies/service-proxies.ts:6634:15 - error TS2393: Duplicate function implementation.

6634 protected processDispatchPost(response: HttpResponseBase): Observable<void> { ~~~~~~~~~~~~~~~~~~~

Had the same issue. Downgrading swagger in web.core to 6.2.3 helps currently.

Some possible Related information on this: https://github.com/domaindrivendev/Swashbuckle.AspNetCore/issues/2368 https://github.com/domaindrivendev/Swashbuckle.AspNetCore/pull/2373

Not sure if there is a negative effect with downgrading currently.

100% will send a sample project with the issue to [email protected]

Hi Ismcagdas,

I've tried the above and it still results in the same issue.

Updated code:

public async Task DailySync()
        {
            try
            {
                //using (var unitOfWork = UnitOfWorkManager.Begin(TransactionScopeOption.RequiresNew))
                //{
                    var queryString = _queryManager.Single(x => x.QueryName == "GetDaily_OCRD").QueryString;

                    hanaConnection.Open();
                    HanaDataReader reader = null;
                    HanaCommand data = new HanaCommand(queryString, hanaConnection);
                    reader = data.ExecuteReader();
                    List<BusinessPartnerMasterData> existingDataList = new List<BusinessPartnerMasterData>();
                    existingDataList = _businessPartnerMasterData.GetAll().ToList();


                    if (reader != null)
                    {
                        while (reader.Read())
                        {

                            bool isNew = false;
                            BusinessPartnerMasterData existingData = existingDataList.Where(x => x.Id == Convert.ToString(reader.GetValue("CardCode"))).FirstOrDefault();
                            if (existingData == null)
                            {
                                existingData = new BusinessPartnerMasterData();
                                isNew = true;
                            }

                            existingData.Id = Convert.ToString(reader.GetValue("CardCode"));
                            existingData.BusinessPartnerTypeId = Convert.ToString(reader.GetValue("CardType"));
                            existingData.CardCode = Convert.ToString(reader.GetValue("CardCode"));
                            existingData.CardName = Convert.ToString(reader.GetValue("CardName"));
                            existingData.IsActive = Convert.ToString(reader.GetValue("validFor")) == "Y" ? true : false;

                        await _businessPartnerMasterData.InsertOrUpdateAndGetIdAsync(existingData);

                        //    await _businessPartnerMasterData.InsertAsync(existingData);
                        //if (isNew)
                        //    await _businessPartnerMasterData.InsertAsync(existingData);
                        //else
                        //    await _businessPartnerMasterData.UpdateAsync(existingData);
                    }


                }

                //    await UnitOfWorkManager.Current.SaveChangesAsync();
                //    await unitOfWork.CompleteAsync();
                //}
            }
            catch (System.Exception ex)
            {

                //TODO: Notification logic (TBC)
            }
        }

Hi @ismcagdas,

Please see below:

using Abp.BackgroundJobs; using Abp.Dependency; using Abp.Domain.Repositories; using Abp.Domain.Uow; using Abp.EntityFrameworkCore; using Abp.Runtime.Session; using BRM.Configuration; using BRM.MultiTenancy; using BRM.MultiTenancy.Dto; using BRM.Web.Startup.Hangfire.Helpers; using Hangfire; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; using Sap.Data.Hana; using System.Collections.Generic; using System.Data; using System.Linq.Dynamic.Core; using System.Linq; using BRM.SystemSetup; using BRM.InventoryManagement; using System; using System.Transactions;

namespace BRM.Web.Startup.Hangfire.DataSyncs.Inbound { public class StockMasterDataInboundSync : BackgroundJob<int>, ITransientDependency { private readonly IRepository<Tenant, int> _tenantAppService; private readonly IRepository<QueryManager, long> _queryManager; private readonly IRepository<StockMasterData, string> _stockMasterData; private DataConnections _dataConnections; private IDbContextProvider<AbpDbContext> _Context; public IAbpSession _abpSession; private QueryHelpers _qH; private HanaConnection hanaConnection;

    private readonly IConfigurationRoot _appConfiguration;
    private readonly IWebHostEnvironment _hostingEnvironment;

    public StockMasterDataInboundSync(
        IWebHostEnvironment env,
        IDbContextProvider&lt;AbpDbContext&gt; Context,
        IAbpSession abpSession,
        IRepository&lt;Tenant, int&gt; tenantAppService,
        DataConnections dataConnections,
        IRepository&lt;QueryManager, long&gt; queryManager,
        IRepository&lt;StockMasterData, string&gt; stockMasterData)
    {
        _hostingEnvironment = env;
        _appConfiguration = env.GetAppConfiguration();
        _abpSession = abpSession;
        _Context = Context;
        _tenantAppService = tenantAppService;
        _dataConnections = dataConnections;
        _queryManager = queryManager;
        _stockMasterData = stockMasterData;
        hanaConnection = _dataConnections.GetHanaConnectionInstance
         (
             _appConfiguration.GetValue&lt;string&gt;("SAPHanaODBCConnectionDetail:Server"),
             _appConfiguration.GetValue&lt;string&gt;("SAPHanaODBCConnectionDetail:UserName"),
             _appConfiguration.GetValue&lt;string&gt;("SAPHanaODBCConnectionDetail:Password")
         );

    }



    [DisableConcurrentExecution(timeoutInSeconds: 10 * 60)]
    [AutomaticRetry(Attempts = 0)]
    [UnitOfWork]
    public override void Execute(int number)
    {
        
        //updated this from the standard (UnitOfWorkManager.Begin()) due to a post on here
            using (var unitOfWork = UnitOfWorkManager.Begin(TransactionScopeOption.RequiresNew))
            {
                var queryString = _queryManager.Single(x => x.QueryName == "GetDaily_OITM").QueryString;

                hanaConnection.Open();
                HanaDataReader reader = null;
                HanaCommand data = new HanaCommand(queryString, hanaConnection);
                reader = data.ExecuteReader();

                if (reader != null)
                {
                    while (reader.Read())
                    {
                     
                     
                            //_stockMasterData.InsertOrUpdateAndGetId(new StockMasterData()
                            _stockMasterData.InsertOrUpdate(new StockMasterData()
                            {
                                Id = Convert.ToString(reader.GetValue("ItemCode")),
                                ItemCode = Convert.ToString(reader.GetValue("ItemCode")),
                                ItemName = Convert.ToString(reader.GetValue("ItemName")),
                                IsActive = Convert.ToString(reader.GetValue("validFor")) == "Y" ? true : false
                            });
                       

                    }

                    reader.Close();
                }
                //this area has been modified several times with varying completion/save segments.
                UnitOfWorkManager.Current.SaveChanges();
                unitOfWork.Complete();
                //UnitOfWorkManager.Current.SaveChangesAsync().Wait();
                //unitOfWork.CompleteAsync().Wait();
            }
       
    }


}

}

Showing 1 to 10 of 76 entries