Volo.Abp.Identity.Pro.Domain need standard 2.1?
So I must change all of my projects with Domain from NET Standard 2.0 to NET Standard 2.1.
/builds/change/account/src/Yee.Change.Account.Domain.Shared/Yee.Change.Account.Domain.Shared.csproj : error NU1103: Unable to find a stable package Volo.Abp.Identity.Pro.Domain.Shared with version (>= 5.3.0)
The newest stable version of above package is 5.0.2?
var query = dbContext.Where(p => p.ItemKey == input.ItemKey && p.ItemType == input.ItemType).DistinctBy(p => p.EventTypeId);
I can not change the color of the text.
[09:15:02 WRN] Unhandled exception rendering component: The LINQ expression 'DbSet<EventDesc>()
.Where(p => (Guid?)p.ItemKey == __input_ItemKey_0 && p.ItemType == __input_ItemType_1)
.DistinctBy(p => p.EventTypeId)' 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 'AsEnumerable', 'AsAsyncEnumerable', 'ToList', or 'ToListAsync'. See https://go.microsoft.com/fwlink/?linkid=2101038 for more information.
System.InvalidOperationException: The LINQ expression 'DbSet<EventDesc>()
.Where(p => (Guid?)p.ItemKey == __input_ItemKey_0 && p.ItemType == __input_ItemType_1)
.DistinctBy(p => p.EventTypeId)' 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 'AsEnumerable', 'AsAsyncEnumerable', 'ToList', or 'ToListAsync'. See https://go.microsoft.com/fwlink/?linkid=2101038 for more information.
at Microsoft.EntityFrameworkCore.Query.Internal.NavigationExpandingExpressionVisitor.VisitMethodCall(MethodCallExpression methodCallExpression)
at Microsoft.EntityFrameworkCore.Query.Internal.NavigationExpandingExpressionVisitor.VisitMethodCall(MethodCallExpression methodCallExpression)
at Microsoft.EntityFrameworkCore.Query.Internal.NavigationExpandingExpressionVisitor.Expand(Expression query)
at Microsoft.EntityFrameworkCore.Query.QueryTranslationPreprocessor.Process(Expression query)
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.<Execute>b__0()
at Microsoft.EntityFrameworkCore.Query.Internal.CompiledQueryCache.GetOrAddQuery[TResult](Object cacheKey, Func`1 compiler)
at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.Execute[TResult](Expression query)
at Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryProvider.Execute[TResult](Expression expression)
at System.Linq.Queryable.Count[TSource](IQueryable`1 source)
at Yee.Change.EventRecorder.EventDescs.EventDescAppMoreService.GetAllEventsListAsync(GetEventDescsInput input) in D:\abp-change\event-recorder\src\Yee.Change.EventRecorder.Application\EventDescs\EventDescAppMoreService.cs:line 38
at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo)
at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync()
at Volo.Abp.GlobalFeatures.GlobalFeatureInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo)
at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync()
at Volo.Abp.Authorization.AuthorizationInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo)
at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync()
at Volo.Abp.Validation.ValidationInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo)
at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync()
at Volo.Abp.Auditing.AuditingInterceptor.ProceedByLoggingAsync(IAbpMethodInvocation invocation, IAuditingHelper auditingHelper, IAuditLogScope auditLogScope)
at Volo.Abp.Auditing.AuditingInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo)
at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync()
at Volo.Abp.Uow.UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
at Yee.Change.EventRecorder.Blazor.Shared.MyCaseWorksListView.OnInitializedAsync() in D:\abp-change\event-recorder\src\Yee.Change.EventRecorder.Blazor\Shared\MyCaseWorksListView.razor:line 28
at Microsoft.AspNetCore.Components.ComponentBase.RunInitAndSetParametersAsync()
[Authorize(EventRecorderPermissions.EventDescs.Default)]
public class EventDescAppMoreService : ApplicationService, IEventDescAppMoreService
{
private readonly IEventDescRepository _eventDescRepository;
private readonly EventDescManager _eventDescManager;
private readonly IRepository<ReplyRole, Guid> _replyRoleRepository;
public EventDescAppMoreService(IEventDescRepository eventDescRepository, EventDescManager eventDescManager, IRepository<ReplyRole, Guid> replyRoleRepository)
{
_eventDescRepository = eventDescRepository;
_eventDescManager = eventDescManager; _replyRoleRepository = replyRoleRepository;
}
public virtual async Task<PagedResultDto<EventDescDto>> GetAllEventsListAsync(GetEventDescsInput input)
{
var dbContext = await this._eventDescRepository.GetQueryableAsync();
var query = dbContext.Where(p => p.ItemKey == input.ItemKey && p.ItemType == input.ItemType).**DistinctBy(p => p.EventTypeId);**
int totalCount = query.Count();
return new PagedResultDto<EventDescDto>
{
TotalCount = totalCount,
Items = ObjectMapper.Map<List<EventDesc>, List<EventDescDto>>(query.Skip(input.SkipCount).Take(input.MaxResultCount).ToList())
};
}
}
tks a lot!
Happend again。
thank you! all my questions have been resolved.
The questions has changed, now there are 2 as below
I want to get all users in the database, so I disable the DataFilter. But it seems that the IMultiTenant has not been disabled. I only get the users in the current tenant.
using (this.DataFilter.Disable<IMultiTenant>())
{
users = await userRepository.GetListAsync();
}
Thank you!
public class SerialNumberMoreAppService : AccountAppService, ISerialNumberMoreAppService
{
public virtual async Task<long> GetNextValueAsync()
{
SerialNumberManager repository = this.LazyServiceProvider.LazyGetRequiredService<SerialNumberManager>();
var netSerial = await repository.CreateAsync("");
await UnitOfWorkManager.Current.SaveChangesAsync();
return netSerial.Id;
}
}
but user.SetProperty only valid for the first user?
I want to reset propertiy for all users.
foreach (var user in users)
{
var number = await serialNumberMoreAppService.GetNextValueAsync();
user.SetProperty(ChangeUserConsts.NumberIdPropertityName, number);
await UnitOfWorkManager.Current.SaveChangesAsync();
}