Skip to content

Commit 5141682

Browse files
committed
order blind code
1 parent aaa6a8e commit 5141682

File tree

177 files changed

+11164
-79
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

177 files changed

+11164
-79
lines changed
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
16998934528146873
1+
16998929391389788

DataAccess/DTO/AccountDTO.cs

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
namespace DataAccess.DTO;
2+
3+
using BusinessObject.Models;
4+
5+
public class AccountDTO
6+
{
7+
public int AccountId { get; set; }
8+
public string? Email { get; set; }
9+
public string? Password { get; set; }
10+
public string? CustomerId { get; set; }
11+
public int? EmployeeId { get; set; }
12+
public int? Role { get; set; }
13+
public Customer Customer { get; set; }
14+
public Employee Employee { get; set; }
15+
16+
public object[]? PrimaryKey => new object[] { this.AccountId };
17+
}

DataAccess/DataAccess.csproj

+4
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,8 @@
1010
<ProjectReference Include="..\BusinessObject\BusinessObject.csproj" />
1111
</ItemGroup>
1212

13+
<ItemGroup>
14+
<PackageReference Include="AutoMapper" Version="12.0.1" />
15+
</ItemGroup>
16+
1317
</Project>

DataAccess/Helpers/MapperConfig.cs

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
namespace DataAccess.Helpers;
2+
3+
using AutoMapper;
4+
using BusinessObject.Models;
5+
using DataAccess.DAO;
6+
using DataAccess.DTO;
7+
8+
public class MapperConfig
9+
{
10+
public static MapperConfiguration GetAccountDTOMapperConfig()
11+
{
12+
return new MapperConfiguration(cfg =>
13+
cfg.CreateMap<Account, AccountDTO>().ForMember(
14+
dest => dest.Customer,
15+
opt => opt.MapFrom(src => CustomerDao.Get(new object[] { src.CustomerId })))
16+
.ForMember(
17+
dest => dest.Employee,
18+
opt => opt.MapFrom(
19+
src => EmployeeDao.Get(new Object []{src.EmployeeId}))
20+
)
21+
);
22+
}
23+
}

DataAccess/Repository/AccountRepo.cs

+12
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
namespace DataAccess.Repository;
22

3+
using AutoMapper;
34
using BusinessObject.Models;
45
using DataAccess.DAO;
6+
using DataAccess.DTO;
7+
using DataAccess.Helpers;
58
using DataAccess.Repository.Base;
69

710
public class AccountRepo : Repository<Account,AccountDao>
@@ -10,4 +13,13 @@ public Account Get(string email, string password)
1013
{
1114
return AccountDao.Get(email, password);
1215
}
16+
17+
public AccountDTO GetAccountDTO(int id)
18+
{
19+
var account = AccountDao.Get(new object[] { id });
20+
var mapperConfig = MapperConfig.GetAccountDTOMapperConfig();
21+
var mapper = new Mapper(mapperConfig);
22+
var accountDto = mapper.Map<AccountDTO>(account);
23+
return accountDto;
24+
}
1325
}

DataAccess/bin/Debug/net7.0/DataAccess.deps.json

+25-6
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,25 @@
88
".NETCoreApp,Version=v7.0": {
99
"DataAccess/1.0.0": {
1010
"dependencies": {
11+
"AutoMapper": "12.0.1",
1112
"BusinessObject": "1.0.0"
1213
},
1314
"runtime": {
1415
"DataAccess.dll": {}
1516
}
1617
},
17-
"Microsoft.CSharp/4.5.0": {},
18+
"AutoMapper/12.0.1": {
19+
"dependencies": {
20+
"Microsoft.CSharp": "4.7.0"
21+
},
22+
"runtime": {
23+
"lib/netstandard2.1/AutoMapper.dll": {
24+
"assemblyVersion": "12.0.0.0",
25+
"fileVersion": "12.0.1.0"
26+
}
27+
}
28+
},
29+
"Microsoft.CSharp/4.7.0": {},
1830
"Microsoft.Data.SqlClient/2.1.4": {
1931
"dependencies": {
2032
"Microsoft.Data.SqlClient.SNI.runtime": "2.1.1",
@@ -353,7 +365,7 @@
353365
},
354366
"Microsoft.IdentityModel.Tokens/6.8.0": {
355367
"dependencies": {
356-
"Microsoft.CSharp": "4.5.0",
368+
"Microsoft.CSharp": "4.7.0",
357369
"Microsoft.IdentityModel.Logging": "6.8.0",
358370
"System.Security.Cryptography.Cng": "4.5.0"
359371
},
@@ -559,12 +571,19 @@
559571
"serviceable": false,
560572
"sha512": ""
561573
},
562-
"Microsoft.CSharp/4.5.0": {
574+
"AutoMapper/12.0.1": {
575+
"type": "package",
576+
"serviceable": true,
577+
"sha512": "sha512-hvV62vl6Hp/WfQ24yzo3Co9+OPl8wH8hApwVtgWpiAynVJkUcs7xvehnSftawL8Pe8FrPffBRM3hwzLQqWDNjA==",
578+
"path": "automapper/12.0.1",
579+
"hashPath": "automapper.12.0.1.nupkg.sha512"
580+
},
581+
"Microsoft.CSharp/4.7.0": {
563582
"type": "package",
564583
"serviceable": true,
565-
"sha512": "sha512-kaj6Wb4qoMuH3HySFJhxwQfe8R/sJsNJnANrvv8WdFPMoNbKY5htfNscv+LHCu5ipz+49m2e+WQXpLXr9XYemQ==",
566-
"path": "microsoft.csharp/4.5.0",
567-
"hashPath": "microsoft.csharp.4.5.0.nupkg.sha512"
584+
"sha512": "sha512-pTj+D3uJWyN3My70i2Hqo+OXixq3Os2D1nJ2x92FFo6sk8fYS1m1WLNTs0Dc1uPaViH0YvEEwvzddQ7y4rhXmA==",
585+
"path": "microsoft.csharp/4.7.0",
586+
"hashPath": "microsoft.csharp.4.7.0.nupkg.sha512"
568587
},
569588
"Microsoft.Data.SqlClient/2.1.4": {
570589
"type": "package",
4 KB
Binary file not shown.
1.02 KB
Binary file not shown.

DataAccess/obj/DataAccess.csproj.nuget.dgspec.json

+6
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,12 @@
118118
"frameworks": {
119119
"net7.0": {
120120
"targetAlias": "net7.0",
121+
"dependencies": {
122+
"AutoMapper": {
123+
"target": "Package",
124+
"version": "[12.0.1, )"
125+
}
126+
},
121127
"imports": [
122128
"net461",
123129
"net462",
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2a0dcac8d139881e4119e3020d675d5fbe3dacba
1+
08be832ce43b3050a5e7f2ee69436365cc7c29ab
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
C:\Users\DELL\RiderProjects\FinalProject_PRN231\DataAccess\bin\Debug\net7.0\DataAccess.deps.json
2+
C:\Users\DELL\RiderProjects\FinalProject_PRN231\DataAccess\bin\Debug\net7.0\DataAccess.dll
3+
C:\Users\DELL\RiderProjects\FinalProject_PRN231\DataAccess\bin\Debug\net7.0\DataAccess.pdb
4+
C:\Users\DELL\RiderProjects\FinalProject_PRN231\DataAccess\bin\Debug\net7.0\BusinessObject.dll
5+
C:\Users\DELL\RiderProjects\FinalProject_PRN231\DataAccess\bin\Debug\net7.0\BusinessObject.pdb
6+
C:\Users\DELL\RiderProjects\FinalProject_PRN231\DataAccess\obj\Debug\net7.0\DataAccess.csproj.AssemblyReference.cache
7+
C:\Users\DELL\RiderProjects\FinalProject_PRN231\DataAccess\obj\Debug\net7.0\DataAccess.GeneratedMSBuildEditorConfig.editorconfig
8+
C:\Users\DELL\RiderProjects\FinalProject_PRN231\DataAccess\obj\Debug\net7.0\DataAccess.AssemblyInfoInputs.cache
9+
C:\Users\DELL\RiderProjects\FinalProject_PRN231\DataAccess\obj\Debug\net7.0\DataAccess.AssemblyInfo.cs
10+
C:\Users\DELL\RiderProjects\FinalProject_PRN231\DataAccess\obj\Debug\net7.0\DataAccess.csproj.CoreCompileInputs.cache
11+
C:\Users\DELL\RiderProjects\FinalProject_PRN231\DataAccess\obj\Debug\net7.0\DataAccess.csproj.CopyComplete
12+
C:\Users\DELL\RiderProjects\FinalProject_PRN231\DataAccess\obj\Debug\net7.0\DataAccess.dll
13+
C:\Users\DELL\RiderProjects\FinalProject_PRN231\DataAccess\obj\Debug\net7.0\refint\DataAccess.dll
14+
C:\Users\DELL\RiderProjects\FinalProject_PRN231\DataAccess\obj\Debug\net7.0\DataAccess.pdb
15+
C:\Users\DELL\RiderProjects\FinalProject_PRN231\DataAccess\obj\Debug\net7.0\ref\DataAccess.dll
4 KB
Binary file not shown.
1.02 KB
Binary file not shown.
1.5 KB
Binary file not shown.
Binary file not shown.

DataAccess/obj/project.assets.json

+44-5
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,23 @@
22
"version": 3,
33
"targets": {
44
"net7.0": {
5-
"Microsoft.CSharp/4.5.0": {
5+
"AutoMapper/12.0.1": {
6+
"type": "package",
7+
"dependencies": {
8+
"Microsoft.CSharp": "4.7.0"
9+
},
10+
"compile": {
11+
"lib/netstandard2.1/AutoMapper.dll": {
12+
"related": ".xml"
13+
}
14+
},
15+
"runtime": {
16+
"lib/netstandard2.1/AutoMapper.dll": {
17+
"related": ".xml"
18+
}
19+
}
20+
},
21+
"Microsoft.CSharp/4.7.0": {
622
"type": "package",
723
"compile": {
824
"ref/netcoreapp2.0/_._": {}
@@ -914,10 +930,25 @@
914930
}
915931
},
916932
"libraries": {
917-
"Microsoft.CSharp/4.5.0": {
918-
"sha512": "kaj6Wb4qoMuH3HySFJhxwQfe8R/sJsNJnANrvv8WdFPMoNbKY5htfNscv+LHCu5ipz+49m2e+WQXpLXr9XYemQ==",
933+
"AutoMapper/12.0.1": {
934+
"sha512": "hvV62vl6Hp/WfQ24yzo3Co9+OPl8wH8hApwVtgWpiAynVJkUcs7xvehnSftawL8Pe8FrPffBRM3hwzLQqWDNjA==",
935+
"type": "package",
936+
"path": "automapper/12.0.1",
937+
"files": [
938+
".nupkg.metadata",
939+
".signature.p7s",
940+
"README.md",
941+
"automapper.12.0.1.nupkg.sha512",
942+
"automapper.nuspec",
943+
"icon.png",
944+
"lib/netstandard2.1/AutoMapper.dll",
945+
"lib/netstandard2.1/AutoMapper.xml"
946+
]
947+
},
948+
"Microsoft.CSharp/4.7.0": {
949+
"sha512": "pTj+D3uJWyN3My70i2Hqo+OXixq3Os2D1nJ2x92FFo6sk8fYS1m1WLNTs0Dc1uPaViH0YvEEwvzddQ7y4rhXmA==",
919950
"type": "package",
920-
"path": "microsoft.csharp/4.5.0",
951+
"path": "microsoft.csharp/4.7.0",
921952
"files": [
922953
".nupkg.metadata",
923954
".signature.p7s",
@@ -930,6 +961,7 @@
930961
"lib/netcoreapp2.0/_._",
931962
"lib/netstandard1.3/Microsoft.CSharp.dll",
932963
"lib/netstandard2.0/Microsoft.CSharp.dll",
964+
"lib/netstandard2.0/Microsoft.CSharp.xml",
933965
"lib/portable-net45+win8+wp8+wpa81/_._",
934966
"lib/uap10.0.16299/_._",
935967
"lib/win8/_._",
@@ -939,7 +971,7 @@
939971
"lib/xamarinmac20/_._",
940972
"lib/xamarintvos10/_._",
941973
"lib/xamarinwatchos10/_._",
942-
"microsoft.csharp.4.5.0.nupkg.sha512",
974+
"microsoft.csharp.4.7.0.nupkg.sha512",
943975
"microsoft.csharp.nuspec",
944976
"ref/MonoAndroid10/_._",
945977
"ref/MonoTouch10/_._",
@@ -2293,6 +2325,7 @@
22932325
},
22942326
"projectFileDependencyGroups": {
22952327
"net7.0": [
2328+
"AutoMapper >= 12.0.1",
22962329
"BusinessObject >= 1.0.0"
22972330
]
22982331
},
@@ -2338,6 +2371,12 @@
23382371
"frameworks": {
23392372
"net7.0": {
23402373
"targetAlias": "net7.0",
2374+
"dependencies": {
2375+
"AutoMapper": {
2376+
"target": "Package",
2377+
"version": "[12.0.1, )"
2378+
}
2379+
},
23412380
"imports": [
23422381
"net461",
23432382
"net462",

0 commit comments

Comments
 (0)