Closed ThaStealth closed 1 year ago
This one caused me a few headaches to figure out:
Source type
public class ExampleInput { public long ID { get; set; } public string Name { get; set; } public int Order { get; set; } }
Dest type
public record ExampleOutput ( long ID, string Name, int Order );
Mapping code:
ExampleInput input = new ExampleInput() { ID = 5, Name = "Sample", Order = 1 }; string output = input.BuildAdapter() .CreateMapExpression<ExampleOutput>().ToScript();
(I didn't configure any other settings or created mappingconfigs)
Results in the following expression:
public ExampleOutput Main(ExampleInput p1) { return p1 == null ? null : new ExampleOutput(0l, p1.Name, p1.Order); }
But when changing both ID fields in the input/output types to Id we get the following result:
ID
Id
public ExampleOutput Main(ExampleInput p1) { return p1 == null ? null : new ExampleOutput(p1.Id, p1.Name, p1.Order); }
Not sure why this is happening, I couldn't find anything in the documentation that ID is a reserved keyword which states the field should be ignored.
Duplicate of #388. Really need to get that fixed soon! :)
Fixed in #590
This one caused me a few headaches to figure out:
Source type
Dest type
Mapping code:
(I didn't configure any other settings or created mappingconfigs)
Results in the following expression:
But when changing both
ID
fields in the input/output types toId
we get the following result:Not sure why this is happening, I couldn't find anything in the documentation that ID is a reserved keyword which states the field should be ignored.