The more examples we have, the better and faster we understand framework in general
What a pity, it would be so elegant.
Made it with separate query:
foreach (var ticket in tickets)
{
var linkedUsers = _ticketLinkedUsersRepository.GetAllIncluding(lu => lu.TicketLinkType, lu => lu.User)
.Where(p => p.TicketId == ticket.Ticket.Id).ToList();
ticket.LinkedUsers = ObjectMapper.Map<List<TicketLinkedUserDto>>(linkedUsers);
}
Thanks for your help
You are right, it should be J7.
However I get different error in log:
INFO 2018-08-24 13:30:05,375 [21 ] ore.Mvc.Internal.ControllerActionInvoker - Executing action method Fansy.IdentityServer.Tickets.TicketsAppService.GetAll (Fansy.IdentityServer.Application) with arguments (Fansy.IdentityServer.Tickets.Dtos.GetAllTicketsInput) - Validation state: Valid
ERROR 2018-08-24 13:30:24,275 [3 ] Mvc.ExceptionHandling.AbpExceptionFilter - Incorrect number of arguments supplied for call to method 'System.Threading.Tasks.Task`1[System.Boolean] MoveNext(System.Threading.CancellationToken)'
Parameter name: method
System.ArgumentException: Incorrect number of arguments supplied for call to method 'System.Threading.Tasks.Task`1[System.Boolean] MoveNext(System.Threading.CancellationToken)'
Parameter name: method
at System.Dynamic.Utils.ExpressionUtils.ValidateArgumentCount(MethodBase method, ExpressionType nodeKind, Int32 count, ParameterInfo[] pis)
at System.Linq.Expressions.Expression.Call(Expression instance, MethodInfo method)
at AutoMapper.Internal.ExpressionFactory.ForEach(Expression collection, ParameterExpression loopVar, Expression loopContent)
at AutoMapper.Mappers.Internal.CollectionMapperExpressionFactory.MapCollectionExpression(IConfigurationProvider configurationProvider, ProfileMap profileMap, PropertyMap propertyMap, Expression sourceExpression, Expression destExpression, Expression contextExpression, Type ifInterfaceType, MapItem mapItem)
at AutoMapper.Mappers.CollectionMapper.MapExpression(IConfigurationProvider configurationProvider, ProfileMap profileMap, PropertyMap propertyMap, Expression sourceExpression, Expression destExpression, Expression contextExpression)
at AutoMapper.MapperConfiguration.GenerateObjectMapperExpression(MapRequest mapRequest, IObjectMapper mapperToUse, MapperConfiguration mapperConfiguration)
at AutoMapper.MapperConfiguration.BuildExecutionPlan(MapRequest mapRequest)
at AutoMapper.MapperConfiguration.CreateMapperFuncs(MapRequest mapRequest)
at AutoMapper.LockingConcurrentDictionary`2.<>c__DisplayClass2_1.<.ctor>b__1()
at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
at System.Lazy`1.CreateValue()
at AutoMapper.MapperConfiguration.GetUntypedMapperFunc(MapRequest mapRequest)
at AutoMapper.Mapper.AutoMapper.IMapper.Map[TDestination](Object source)
at lambda_method(Closure , TransparentIdentifier`2 )
at System.Linq.AsyncEnumerable.SelectEnumerableAsyncIterator`2.MoveNextCore(CancellationToken cancellationToken)
at System.Linq.AsyncEnumerable.AsyncIterator`1.MoveNext(CancellationToken cancellationToken)
at System.Linq.AsyncEnumerable.Aggregate_[TSource,TAccumulate,TResult](IAsyncEnumerable`1 source, TAccumulate seed, Func`3 accumulator, Func`2 resultSelector, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Query.Internal.AsyncLinqOperatorProvider.TaskResultAsyncEnumerable`1.Enumerator.MoveNext(CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Query.Internal.AsyncLinqOperatorProvider.ExceptionInterceptor`1.EnumeratorExceptionInterceptor.MoveNext(CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.ExecuteSingletonAsyncQuery[TResult](QueryContext queryContext, Func`2 compiledQuery, IDiagnosticsLogger`1 logger, Type contextType)
at Fansy.IdentityServer.Tickets.TicketsAppService.GetAll(GetAllTicketsInput input) in D:\Work\Web\FansySystems\IdentityServer\src\Fansy.IdentityServer.Application\Tickets\TicketsAppService.cs:line 142
at lambda_method(Closure , Object )
at Microsoft.AspNetCore.Mvc.Internal.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeActionMethodAsync()
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeNextActionFilterAsync()
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context)
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeInnerFilterAsync()
at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextExceptionFilterAsync()
INFO 2018-08-24 13:30:24,284 [3 ] .Mvc.Infrastructure.ObjectResultExecutor - Executing ObjectResult, writing value of type 'Abp.Web.Models.AjaxResponse'.
Thank you, I subscribed on notifications
Hi,
Thank you for screencast, sorry, I didnt make my problem clear.
Here are my steps:
Thank you
I have all described cookies, domain is "localhost" everywhere.
So different ports = different domains?
According to SQL profiler, costructed query has __IsMayHaveTenantFilterEnabled_7 parameter.
It setted to 1, that is why the data were empty
INNER JOIN (
SELECT [u].*
FROM [AbpUsers] AS [u]
WHERE (([u].[IsDeleted] = 0) OR ([u].[IsDeleted] <> 1 /*@__IsSoftDeleteFilterEnabled_4*/)) AND ([u].[TenantId] IS NULL OR (CASE
WHEN CASE
WHEN [u].[TenantId] IS NULL
THEN CAST(1 AS BIT) ELSE CAST(0 AS BIT)
END = 1
THEN CAST(1 AS BIT) ELSE CAST(0 AS BIT)
END = @__IsMayHaveTenantFilterEnabled_7 ))
) AS [t0] ON [t].[AbpUserId] = [t0].[Id]
<cite>ismcagdas: </cite> Hi @Ice2burn,
You souldn't use Entities in your Dtos. Probably there is a serialization problem while sending your list to client. Can you replace entities with their related Dtos in your TicketListDto class ? You can also check Logs.txt file under your web project to see if there is an error.
Hi, all Entities were replaces by related Dtos. An issue still exists. If i uncomment
.Include(p => p.User)
line, ticketRepository returns empty list.
Also, there is no errors or warnings in the Log.
Edited the code above according to my changes.
<cite>alirizaadiyahsi: </cite> Hi @Ice2burn,
Are you getting only users? What about other relations (tenant, product, etc...)?
Hi, I'm gettin no data at all if users included.