Base solution for your next web application

Activities of "razkhan78"

Hi, We have AspNetZero (Paid) Product version --> 4.0 Product type --> MVC Product framework type --> .net core

and we are having following issue right now:

We have 3 tables Table Product Table ProductPayment & ProductPaymentDetail

We have an operation where we delete data from ProductPayment (which deletes automatically any child data from ProductPaymentDetail) and updating boolean column IsPaid in Product.

We are facing an issue that "sometimes" in Product table IsPaid is not getting updated. When we check Audit Logs , we see update operation in AbpEntityChanges for product but no field change in AbpEntityPropertyChanges and Product table itself.

public async Task Delete(EntityDto input)
{

            var productPayment = await _productPaymentRepository.FirstOrDefaultAsync(m => m.Id == input.Id);
            var productPaymentDetail  = _ProductPaymentDetailRepository.GetAll().Where(x => x.ProductPaymentId == (int)input.Id && x.ProductId != null).GroupBy(x => x.ProductId);            

            if (productPaymentDetail != null)
            {
                foreach (var item in productPaymentDetail)
                {
                    var product = await _productRepository.FirstOrDefaultAsync(item.Key.Value);
                    
                    product.IsPaid  = false;
                    
                    
                    await _productRepository.UpdateAsync(product);

                }
            }
          
          
            await _productPaymentRepository.DeleteAsync(input.Id);
}

Hi

Permission class is not part of actual entities in database. so how this will work?

We are using latest version of aspnetzero with asp.net core mvc and jquery.

We want to add custom parameter in Permission class and pass it from CreateChildPermission as well as retrieve it in GetAllPermissions for using it on role permission tree.

Is there any way we can extend it?

Hi

We are using AspNetZero (Paid) Product version --> 4.0 Product type --> MVC Product framework type --> .net core

We have 1)Enabled below lines to enable entity history Configuration.EntityHistory.IsEnabled = true;

2)/Uncomment below lines to write change logs for the entities: Configuration.EntityHistory.Selectors.Add("LoadStopEntities", EntityHistoryHelper.TrackedTypes); Configuration.CustomConfigProviders.Add(new EntityHistoryConfigProvider(Configuration));

Now in logs it creates entries for create record, update record and delete record.

But we need to disable history logging for create record action.

So we would like to know is there any class or interface we can implement to achive it?

We have use latest jquery and it returns datetime json without millisconds so, is there any wey to get datetime with milliseconds ?

Hi

We are using latest version of asp.net MVC Core and jQuery.

In one of our app service we have multiple item deletion which works ike this:

public async Task FirstLevel(List<int> Ids) { foreach(var i in Ids) { SecondLevel(id); } }

private async Task SecondLevel(int id) { //Fetch data from repository //Delete obj MethodWithThread(obj.extId) }

private async Task MethodWithThread(string extId) { Task.Factory.StartNew(() => { call external apis }; }

Here in MethodWithThread we were getting A second operation started on this context before a previous operation completed so tried to used using (var uow = UnitOfWorkManager.Begin(TransactionScopeOption.RequiresNew)).

But after using that in our second level methid still randomlt getting A second operation started on this context before a previous operation completed and also 2nd record in loops randomly not gets deleted.

Is there any other way to get data in method with thread?

Provided solution is working, thanks

We have some scenario in our app for UTC DateTime

  1. Right now when we storing the date value with AuditedEntity in the table it always stores dates with a local provider,

For that we found some details to set clock provider to UTC but for the same, we have 2 more queries:

1)When we select datepicker from the front side we need to store that Datepciker date to UTC DateTime in the table, Is there any way for that? 2)Consider that in the table we have all the DateTime in the UTC format, now the user came to our app and search via local date, then how we can search date with UTC DateTime in the table?

Hi

We are using latest asp.net core jQuery. We need to get list of organization units assigned to user along with child organizationunits.

We have tried below code as explained here https://aspnetboilerplate.com/Pages/Documents/Zero/Organization-Units

var user = await _userManager.GetUserByIdAsync((long)AbpSession.UserId);
var organizationUnits = await _userManager.GetOrganizationUnitsAsync(user);
var organizationUnitCodes = organizationUnits.Select(ou => ou.Code);

organizationUnitList = (from o in _organizationUnitRepository.GetAll()
                        where organizationUnitCodes.Any(code => o.Code.StartsWith(code))
                        select new OrganizationUnit()
                        {
                            Id = o.Id,
                            DisplayName = o.DisplayName,
                            TenantId = o.TenantId
                        });

And getting this error

System.InvalidOperationException: The LINQ expression 'DbSet<OrganizationUnit> .Where(o => __ef_filter__p_0 || !(((ISoftDelete)o).IsDeleted) && __ef_filter__p_1 || ((IMayHaveTenant)o).TenantId == __ef_filter__CurrentTenantId_2) .Where(o => __organizationUnitCodes_0 .Any(code => code == "" || o.Code != null && code != null && o.Code.StartsWith(code)))' could not be translated. Either rewrite the query in a form that can be translated, or switch to client evaluation explicitly by inserting a call to either AsEnumerable(), AsAsyncEnumerable(), ToList(), or ToListAsync(). See https://go.microsoft.com/fwlink/?linkid=2101038 for more information. at Microsoft.EntityFrameworkCore.Query.QueryableMethodTranslatingExpressionVisitor.<VisitMethodCall>g__CheckTranslated|8_0(ShapedQueryExpression translated, <>c__DisplayClass8_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.Storage.Database.CompileQuery[TResult](Expression query, Boolean async) at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.CompileQueryCore[TResult](IDatabase database, Expression query, IModel model, Boolean async) at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.<>c__DisplayClass9_0`1.

We found solution to use url https://localhost:44302/swagger not https://localhost:44302/swagger/ui

Showing 21 to 30 of 94 entries