Inspecting property maps for validation and copying of metadata
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
Direzione di ricerca
Inizia esaminando l’ispezione dei metadati di mapping di livello inferiore della libreria e il modo in cui espone le proprietà di origine e destinazione. Verifica se i mapping possono essere correlati con dbContext.Model di EF Core per i mapping diretti e inversi. Il lavoro sarà considerato completato quando sarà disponibile una risposta chiara sulla fattibilità oppure un’API definita per recuperare i metadati delle proprietà rilevanti.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- C#
- Stelle
- 5.2k
- Fork
- 409
- Merge medio
- 3g 4h
- PR unite (30g)
- 3
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di MapsterMapper/Mapster
-
.NET MatrixAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
MapsterMapper/Mapster#1003 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 58/100
MapsterMapper/Mapster#1024 · 1 commento ·
-
[Mapster Tool] Add support for global:: to disambiguate type names in generated mappersForse già presa @DocSvartz l’ha presa 1 giorno fa. Apertaimprovement
Difficoltà 3/5 1-2 giorni Idoneità per principianti 65/100
MapsterMapper/Mapster#1020 · 3 commenti ·
-
Mapster.Tool - PropertySettingBuilder.Map(member, mapFunc, targetPropertyName) method is not working as expected!Forse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
MapsterMapper/Mapster#1017 · 6 commenti ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 57/100
MapsterMapper/Mapster#1007 · 5 commenti ·
Tutte le issue di MapsterMapper/Mapster
Issue simili
-
Format request: .wbpzApertaenhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
KnifeLemon/Filee#294 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
gavin-wolfe/wolfden#104 ·
I maintainer di solito rispondono entro 1 giorno
-
[BUG] Still libmicrohttpd dependency is not removed properly from External-Dependency-Info.txt fileForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertatype/bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
area:framework
Difficoltà 1/5 1-3 ore Idoneità per principianti 72/100
nunit/docs#1262 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
validate_environment_path strips executable extensions from directory names, not only from the end of the pathForse già presa @auraseb l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
Unity-Technologies/ml-agents#6332 ·