wish to add the ability to ignore a copy of a property when it has a specific value. For example, null, empty string, empty collection
まだ誰も着手していません。
評価
調査の方向性
まず、null プロパティをコピーしない Mapster の既存の動作と、issue に示されている IgnoreMember API を確認します。null、空の文字列、空のコレクションなどの設定値がコピーにどのような影響を与えるべきかを定義し、要求された値を網羅するマッピングケースで動作を検証します。
索引モデルが issue の本文から書いたものです。
説明
mapster has provided the function of not copying the property when the value of the property is null. Can we extend this function to stop copying the property when the value of the property is a series of specific values? It is better to provide a general method (I am not sure which property and which type, but I am sure that the value cannot be these)? Determine whether a property field can be copied before it is copied
// Can you provide such a method
// Another framework, automapper, already provides similar functionality
// I don't care about the attribute name, but I care about the attribute value, and providing the attribute name is best when determining the attribute value
IgnoreMember((srcMember, destMember, srcValue, destValue) =>
{
if (srcValue is string srcValueTxt)
{
return string.IsNullOrWhiteSpace(srcValueTxt);
}
if (srcValue == destValue)
{
return true;
}
return false;
})
- 主要言語
- C#
- スター
- 5.2k
- フォーク
- 411
- 平均マージ
- 1日 8時間
- マージ済み PR(30日)
- 4
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
MapsterMapper/Mapster のほかの issue
-
.NET Matrixオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
MapsterMapper/Mapster#1003 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 58/100
MapsterMapper/Mapster#1024 · コメント 1 件 ·
-
[Mapster Tool] Add support for global:: to disambiguate type names in generated mappers対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンimprovement
難易度 3/5 1〜2日 初心者へのやさしさ 65/100
MapsterMapper/Mapster#1020 · コメント 5 件 ·
-
Mapster.Tool - PropertySettingBuilder.Map(member, mapFunc, targetPropertyName) method is not working as expected!対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
MapsterMapper/Mapster#1017 · コメント 6 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 57/100
MapsterMapper/Mapster#1007 · コメント 5 件 ·
MapsterMapper/Mapster の issue をすべて見る
似ている issue
-
area:jobads-cv BE P3
難易度 1/5 1〜3時間 初心者へのやさしさ 74/100
klasolsson81/jobbliggaren#2240 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
k2-fsa/sherpa-onnx#4100 ·
メンテナーはふだん 2 日以内に返信
-
:watch: Not Triaged
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
unoplatform/uno.check#591 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
weaviate/csharp-client#378 ·