Riok.Mapperly: 3.1.0 : CS8795 Partial method 'xxx' must have an implementation part because it has accessibility modifiers. #663
-
Dears, I'm trying out mapperly in one of my projects.
} Any feedback/comment is appreciated. Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 1 reply
-
Hey, have you tried restarting your ide? Source generators sometimes need a restart before working Edit: I reread your code and it looks like your // map nested props (Engine)
[MapProperty(nameof(ExternalVehicle.Engine.Engine_Liters), nameof(Vehicle.Engine.Liters))]
// map nested props (Registration)
[MapProperty(nameof(ExternalVehicle.Registration.Registration_Status), nameof(Vehicle.Registration.Status))] // map nested props (Engine)
[MapProperty("Engine.Engine_Liters", "Engine.Liters")]
// map nested props (Registration)
[MapProperty("Registration.Registration_Status", "Registration.Status")] Your error is due to a common misconception around You should have some other warnings about Mapperly being unable to find various properties. |
Beta Was this translation helpful? Give feedback.
-
Did you add the |
Beta Was this translation helpful? Give feedback.
-
Use Try this: [Mapper]
public static partial class VehicleMapper
{
// map properties with different names
[MapProperty("Make_Year", "MakeYear")]
// map nested props (Engine)
[MapProperty("Engine.Engine_Liters", "Engine.Liters")]
[MapProperty("Engine.Engine_Cylinders", "Engine.Cylinders")]
[MapProperty("Engine.Engine_Number", "Engine.Number")]
// map nested props (Registration)
[MapProperty("Registration.Registration_Status", "Registration.Status")]
[MapProperty("Registration.Registration_State", "Registration.State")]
public static partial Vehicle MapExternalVehicleToVehicle(ExternalVehicle externalVehicle);
} i removed the unneeded types from the start of |
Beta Was this translation helpful? Give feedback.
-
@TimothyMakkison , Below is how the mapping and the Also, I have a question about
Vehicle class
Thanks |
Beta Was this translation helpful? Give feedback.
Use
3.1.0
instead,3.0.0
is broken for VS users 😞Try this: