-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support DTO auto Gen #4
Labels
Comments
vipwan
added
enhancement
New feature or request
documentation
Improvements or additions to documentation
labels
Nov 4, 2023
提供简单的Mapper映射: #pragma warning disable
namespace Biwen.AutoClassGen.TestConsole.Entitys
{
using Biwen.AutoClassGen.TestConsole.Dtos;
public static partial class UserToUserDtoExtentions
{
/// <summary>
/// mapper to UserDto
/// </summary>
/// <returns></returns>
public static UserDto MapperToDto(this User model)
{
return new UserDto()
{
FirstName = model.FirstName,
LastName = model.LastName,
Age = model.Age,
FullName = model.FullName,
Email = model.Email,
Remark = model.Remark,
};
}
}
}
#pragma warning restore |
vipwan
added a commit
that referenced
this issue
Nov 5, 2023
C#11+(NET7+) 支持使用泛型特性标注(support Generic Attribute) usage : [AutoDto<T>(params string?[])] [AutoDto<User>(nameof(User.Email), "TestCol")]
public partial class User3Dto
{
} |
vipwan
added a commit
that referenced
this issue
Nov 7, 2023
vipwan
added a commit
that referenced
this issue
Nov 8, 2023
vipwan
added a commit
that referenced
this issue
Nov 12, 2024
提供MapperToPartial 用于自定义Mapper实现 namespace Biwen.AutoClassGen.TestConsole.Entitys
{
public static partial class UserToUserDtoExtentions
{
static partial void MapperToPartial(User from, UserDto to)
{
to.FirstName = "重写了FirstName";
}
}
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
nuget add:
Entitys define:
usage :
generated :
The text was updated successfully, but these errors were encountered: