Well, this is not an ordinary duplicate question. Because the duplication in certain fields (UserId and Name) in the row and I need create only one object for each UserId and still collects the other associated unique information in the row.
It's not my first question about the same issue, please refer to My First Question About This Issue
This is the database structure that I use
Users Table
UsedId UserName
-------- ----------
1 Mike
2 Raul
3 Nick
HasPrivileges Table
UsedId PrivilegeId
-------- --------------
1 1
1 2
1 3
2 2
2 3
Privileges Table
PrivilegeId Privilege
------------- ------------
1 Create
2 Edit
3 Delete
HasMedals Table
UsedId MedalsId
-------- --------------
1 1
1 2
2 2
3 1
Medals Table
MedalsId Medal
------------- ------------
1 C#
2 VB.NET
Now I'm having a DAL that query my database
and a BLL that has two proprties int for the id and string for the name and two list properties List and List and two more classes for the privileges and medals types
and my asp.net page (as my presentation layer) which uses ObjectDataSource as a data source for binding.
I use a method in my DAL to join all the previous table and select the UserId, UserName, Privellege, Medal and return a List of all the users.
The Problem Is the sql will need to duplicate the user id and name more than one time, each time with the value of the privilege, and again the id and user plus the privilege with every medal value. and I need to just have only ONE object to hold a user.
Example result for the query if I just selected UserId = 1
1 Mike Create C#
1 Mike Edit C#
1 Mike Delete C#
1 Mike Create VB.NET
1 Mike Edit VB.NET
1 Mike Delete VB.NET
Any ideas how to handle this situation the best way (architecture and performance wise) and Where to handle it -I mean on which layer- .
P.S : If I have other options than DataSet then I'd prefer to avoid them!
Thanks for your time guys =)