-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
support Mapper entity to dto extentions #4
- Loading branch information
Showing
3 changed files
with
88 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
using Biwen.AutoClassGen; | ||
using Biwen.AutoClassGen.TestConsole.Entitys; | ||
|
||
|
||
// See https://aka.ms/new-console-template for more information | ||
|
@@ -11,13 +12,26 @@ | |
KeyWord = "biwen" | ||
}; | ||
|
||
Biwen.AutoClassGen.TestConsole.Dtos.UserDto userDto = new() | ||
Biwen.AutoClassGen.TestConsole.Dtos.UserDto userDto2 = new() | ||
{ | ||
FirstName = "biwen", | ||
LastName = "wan", | ||
Age = 18, | ||
}; | ||
|
||
var user = new User | ||
{ | ||
Age = 18, | ||
Email = "[email protected]", | ||
FirstName = "biwen", | ||
LastName = "wan", | ||
Id = "001", | ||
Remark = "this is a test", | ||
}; | ||
|
||
//mapper to UserDto | ||
var userDto = user.MapperToDto(); | ||
|
||
|
||
Console.WriteLine($"{queryRequest.KeyWord}"); | ||
Console.WriteLine($"I`m {userDto.FirstName} {userDto.LastName} I`m {userDto.Age} years old"); | ||
|