Remove mapping context from constructor

This commit is contained in:
Wvader 2021-12-07 11:58:58 +00:00
parent 771adf22ef
commit 55f735006e
1 changed files with 3 additions and 3 deletions

View File

@ -32,7 +32,7 @@ namespace MapTo.Sources
builder builder
.GeneratePrivateConstructor(model) .GeneratePrivateConstructor(model)
.WriteLine() .WriteLine()
.GenerateFactoryMethod(model) //.GenerateFactoryMethod(model)
.GenerateUpdateMethod(model) .GenerateUpdateMethod(model)
// End class declaration // End class declaration
@ -40,7 +40,7 @@ namespace MapTo.Sources
.WriteLine() .WriteLine()
// Extension class declaration // Extension class declaration
.GenerateSourceTypeExtensionClass(model) //.GenerateSourceTypeExtensionClass(model)
// End namespace declaration // End namespace declaration
.WriteClosingBracket(); .WriteClosingBracket();
@ -75,7 +75,7 @@ namespace MapTo.Sources
var baseConstructor = /*model.HasMappedBaseClass ? $" : base({mappingContextParameterName}, {sourceClassParameterName})" :*/ string.Empty; var baseConstructor = /*model.HasMappedBaseClass ? $" : base({mappingContextParameterName}, {sourceClassParameterName})" :*/ string.Empty;
builder builder
.WriteLine($"public {model.TypeIdentifierName}({MappingContextSource.ClassName} {mappingContextParameterName}, {model.SourceType} {sourceClassParameterName}){baseConstructor}") .WriteLine($"public {model.TypeIdentifierName}({model.SourceType} {sourceClassParameterName}){baseConstructor}")
.WriteOpeningBracket() .WriteOpeningBracket()
//.WriteLine($"if ({mappingContextParameterName} == null) throw new ArgumentNullException(nameof({mappingContextParameterName}));") //.WriteLine($"if ({mappingContextParameterName} == null) throw new ArgumentNullException(nameof({mappingContextParameterName}));")
//.WriteLine($"if ({sourceClassParameterName} == null) throw new ArgumentNullException(nameof({sourceClassParameterName}));") //.WriteLine($"if ({sourceClassParameterName} == null) throw new ArgumentNullException(nameof({sourceClassParameterName}));")