Inspecting property maps for validation and copying of metadata
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 25/100
Línea de trabajo
Comienza revisando la inspección de metadatos de asignaciones de nivel inferior de la biblioteca y cómo expone las propiedades de origen y destino. Investiga si las asignaciones pueden correlacionarse con dbContext.Model de EF Core para asignaciones directas e inversas. Se considerará terminado cuando exista una respuesta clara sobre la viabilidad o una API definida para recuperar los metadatos de propiedad relevantes.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- C#
- Estrellas
- 5.2k
- Forks
- 411
- Merge medio
- 1 d 8 h
- PR fusionados (30 d)
- 4
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de MapsterMapper/Mapster
-
.NET MatrixAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
MapsterMapper/Mapster#1003 ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 58/100
MapsterMapper/Mapster#1024 · 1 comentario ·
-
[Mapster Tool] Add support for global:: to disambiguate type names in generated mappersPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertoimprovement
Dificultad 3/5 1-2 días Aptitud para principiantes 65/100
MapsterMapper/Mapster#1020 · 5 comentarios ·
-
Mapster.Tool - PropertySettingBuilder.Map(member, mapFunc, targetPropertyName) method is not working as expected!Posiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 68/100
MapsterMapper/Mapster#1017 · 6 comentarios ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 57/100
MapsterMapper/Mapster#1007 · 5 comentarios ·
Todos los issues de MapsterMapper/Mapster
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
Los mantenedores suelen responder en 1 día
-
enhancement no-stack-trace
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
greenshot/greenshot#1618 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
squad/utforming status/triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Altinn/altinn-studio#21565 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
Tyrrrz/YoutubeDownloader#912 ·
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día