stf
This commit is contained in:
parent
2bcc521bfa
commit
771adf22ef
|
@ -22,12 +22,12 @@ namespace MapTo.Sources
|
||||||
.WriteOpeningBracket();
|
.WriteOpeningBracket();
|
||||||
|
|
||||||
// Class body
|
// Class body
|
||||||
if (model.GenerateSecondaryConstructor)
|
/*if (model.GenerateSecondaryConstructor)
|
||||||
{
|
{
|
||||||
builder
|
builder
|
||||||
.GenerateSecondaryConstructor(model)
|
.GenerateSecondaryConstructor(model)
|
||||||
.WriteLine();
|
.WriteLine();
|
||||||
}
|
}*/
|
||||||
|
|
||||||
builder
|
builder
|
||||||
.GeneratePrivateConstructor(model)
|
.GeneratePrivateConstructor(model)
|
||||||
|
@ -72,15 +72,15 @@ namespace MapTo.Sources
|
||||||
var sourceClassParameterName = model.SourceTypeIdentifierName.ToCamelCase();
|
var sourceClassParameterName = model.SourceTypeIdentifierName.ToCamelCase();
|
||||||
const string mappingContextParameterName = "context";
|
const string mappingContextParameterName = "context";
|
||||||
|
|
||||||
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}({MappingContextSource.ClassName} {mappingContextParameterName}, {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}));")
|
||||||
.WriteLine()
|
//.WriteLine()
|
||||||
.WriteLine($"{mappingContextParameterName}.{MappingContextSource.RegisterMethodName}({sourceClassParameterName}, this);")
|
//.WriteLine($"{mappingContextParameterName}.{MappingContextSource.RegisterMethodName}({sourceClassParameterName}, this);")
|
||||||
.WriteLine().
|
.WriteLine().
|
||||||
|
|
||||||
WriteProperties( model, sourceClassParameterName, mappingContextParameterName);
|
WriteProperties( model, sourceClassParameterName, mappingContextParameterName);
|
||||||
|
|
Loading…
Reference in New Issue