Inspecting property maps for validation and copying of metadata
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 25/100
Hướng nghiên cứu
Bắt đầu bằng việc xem xét cơ chế kiểm tra metadata mapping ở mức thấp hơn của thư viện và cách cơ chế này cung cấp các thuộc tính nguồn và đích. Điều tra xem các mapping có thể được đối chiếu với dbContext.Model của EF Core cho các mapping trực tiếp và ngược hay không. Được xem là hoàn tất khi có câu trả lời rõ ràng về tính khả thi hoặc một API được xác định để truy xuất metadata thuộc tính liên quan.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- C#
- Star
- 5.2k
- Fork
- 409
- Merge trung bình
- 3 ngày 4 giờ
- Pull request đã merge (30 ngày)
- 3
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của MapsterMapper/Mapster
-
.NET MatrixĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
MapsterMapper/Mapster#1003 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 58/100
MapsterMapper/Mapster#1024 · 1 bình luận ·
-
[Mapster Tool] Add support for global:: to disambiguate type names in generated mappersCó thể đã có người làm @DocSvartz đã nhận 1 ngày trước. Đang mởimprovement
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 65/100
MapsterMapper/Mapster#1020 · 3 bình luận ·
-
Mapster.Tool - PropertySettingBuilder.Map(member, mapFunc, targetPropertyName) method is not working as expected!Có thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
MapsterMapper/Mapster#1017 · 6 bình luận ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 57/100
MapsterMapper/Mapster#1007 · 5 bình luận ·
Tất cả issue của MapsterMapper/Mapster
Issue tương tự
-
Format request: .wbpzĐang mởenhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
KnifeLemon/Filee#294 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
gavin-wolfe/wolfden#104 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[BUG] Still libmicrohttpd dependency is not removed properly from External-Dependency-Info.txt fileĐang mởtype/bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
area:framework
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 72/100
nunit/docs#1262 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[辞書] かんそうりつ->乾燥率Đang mở辞書
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 1 ngày