❔ AutoMapper Mapping Profiles Configuration
Hello, I'm trying to obtain the "Groups" with the users included. I'm however experiencing various Auto Mapper-related issues.
GetGroupsAsync
Any help we much appreciated. Thanks
28 Replies
Groups
Users
Mapping Profiles
Error
I want to provide a help but i just get confused, why did you named that class with
Groups
I mean why you don't name it to Group
?Sorry for the confusion. My IDE just recommend it maybe I'll change it later. Your help is much appreciated
Well I think I get the issue
you need to change this
to
Unfortunate still getting the issue
Did you rebuilt your project, try it and let me know if it get fixed
yes I'll already rebuilt the project but still getting the error
Is
Domain
a spearated project ??No its on the same project
Domain is a Folder containing my Entities
GitHub
GitHub - aldrin0408av/MineralWaterMonitoringSystem
Contribute to aldrin0408av/MineralWaterMonitoringSystem development by creating an account on GitHub.
Please give me a bit of time, I'm trying to investigate about the issue in your code
Sure Sir, Take your time.
Thank you!
First of you need to change the
to
But you will still get a runtime error : because of the
Id
in GroupsAsyncQueryResult
is Guid
and the FullName
in Users
is string
Can you just tell me what you want to do in the MappingProfile
??I want the result would be like this
{
"success": true,
"data": [
{
"id": "780c5114-4e55-4878-0218-08db6648b3a6",
"groupCode": "3FCOR",
"groupName": "3rd Floor Corporate",
"users": []
}
],
"messages": []
}
I want to get the groups including the user in that group
Alright the
GroupsAsyncQueryResult
's Users
should be lke this :
Then the mapping should be :
This is the version of your project that I modified
Let me know if you the issue get fixed and the goal get achieved
The error is fixed and this is the output.
I want to get the user will be the Name only
is that possible?
So you want to get all
Groups
and every group should include the Name
of the user ???Yes Sir,
hmmm, give me a bit of time I will change somethings in your project
Okay sir, Thanks
I did a bit change in your code, you can take a look at it here an tell me if this good for design you follow? and is it works ?
Sir i get some error
Can you start the project in debug mode and do a screenshot to the Exception ?
Hi, just tweaking the code and it works as expected
Thank You for your help
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.