Skip to content

Conversation

@zhenlei520
Copy link
Contributor

No description provided.

@zhenlei520 zhenlei520 added the enhancement New feature or request label May 5, 2022
@zhenlei520 zhenlei520 requested a review from doddgu May 5, 2022 01:21
@zhenlei520 zhenlei520 mentioned this pull request May 5, 2022
6 tasks

protected virtual TypeAdapterConfig GetConfigByCache(Type sourceType, Type destinationType, MapOptions? options)
{
TypeAdapterConfig? config = _store.GetOrAdd(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use lazy or ManualMemoryCache?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't quite understand what you mean, here is the configuration that tries to get the mapping relationship when the user is mapped

@zhenlei520 zhenlei520 requested a review from doddgu May 5, 2022 10:27
OrderItem = new OrderItem("Teach you to learn Dapr hand by hand", 49.9m)
};
var order = mapper.Map<Order>(request);// 将request映射到新的对象
var order = mapping.Map<Order>(request);// 将request映射到新的对象, 源对象与目标对象属性名称、类型一致的参数会自动映射、或者目标对象的构造函数参数名称(不区分大小写)、类型与源对象参数一致的,会通过构造函数映射
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mapping rules require a more detailed description, even a new title

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

processed

@zhenlei520 zhenlei520 requested a review from doddgu May 6, 2022 06:17
public void TestAddMultiMapping()
{
_services.AddMapping();
var mappings = _services.BuildServiceProvider().GetServices<IMapper>();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mappings -> mapper

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

processed

@zhenlei520 zhenlei520 requested a review from doddgu May 6, 2022 06:30
Copy link
Contributor

@doddgu doddgu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zhenlei520 zhenlei520 merged commit 4a6689a into main May 6, 2022
@zhenlei520 zhenlei520 deleted the feature/mapping branch May 6, 2022 06:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants