Inspecting property maps for validation and copying of metadata
まだ誰も着手していません。
評価
調査の方向性
まず、ライブラリの低レベルなマッピングメタデータ検査と、そこからソースおよびデスティネーションのプロパティがどのように公開されるかを確認します。マッピングを EF Core の dbContext.Model と関連付けて、直接マッピングと逆マッピングに対応できるかを調査します。完了の基準は、明確な実現可能性の回答、または関連するプロパティメタデータを取得するための定義済み API が得られることです。
索引モデルが issue の本文から書いたものです。
説明
My problem is that I want to be able to propagate metadata managed by EF Core (for example, MaxLength which can be looked up through IModel) all the way to the frontend, including DTO validation (I mean adding metadata to properties, just like DataAnnotations, but automatically), and up until the swagger schema. I haven't seen anyone ever do this in a project, but it feels like the only right way to go about this.
This should be in fact pretty easy to implement, given the mapping library offers a way to inspect the mapping metadata at a lower level. Basically, in the simplest case, you need to look at what property in the entity a given property of the dto maps to, and then query its metadata via dbContext.Model, then apply this metadata to the corresponding property of the DTO in some way (that's really less important).
I know there are cases when the properties are not mapped one-to-one, but the thing I described will cover 99% of cases. The things that don't map directly (two properties could be concatenated, or an int might end up as a string) can be validated after the mapping of the dto to the entity, and the errors reported via a backwards map (by looking up which properties the property of the entity was mapped from). This kind of advanced errors isn't expressible in either swagger or data annotations anyway.
So, my question is, does this library offer the sort of metadata mapping that could help one implement this? I mean looking up which property a given property maps to, and looking up which set of properties a property maps from if it's not mapped directly.
- 主要言語
- 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
-
devtools
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
clawsweeper:fix-shape-clear clawsweeper:needs-maintainer-review clawsweeper:no-new-fix-pr clawsweeper:not-repro-on-main impact:ux-release-blocker issue-rating: 🦪 silver shellfish P0
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
openclaw/openclaw-windows-node#1843 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
-
kind:ux size:S type:bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
elsa-workflows/elsa-foundation#3256 ·
メンテナーはふだん 1 日以内に返信
-
[Bug]: Revit selector reads process ids 2000-2099 as years (flaky AgentClientTests.AYearOrAProcessIdSelectsTheHost)対応中かも @Wurschdhaud が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
pyrevitlabs/pyRevit#3817 ·
メンテナーはふだん 1 日以内に返信