diff options
Diffstat (limited to 'Software/Visual_Studio/Tango.CodeGeneration')
| -rw-r--r-- | Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFile.cshtml | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFile.cshtml b/Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFile.cshtml index daa4e7d51..dfcceb1dd 100644 --- a/Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFile.cshtml +++ b/Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFile.cshtml @@ -77,15 +77,32 @@ namespace Tango.BL.Entities @if (!prop.Name.EndsWith("Guid")) { <div> - @(prop.Name)Changed?.Invoke(this, value); + On@(prop.Name)Changed(value); </div> - } - RaisePropertyChanged(nameof(@(prop.Name))); + } } } } </div> } + + + @foreach (var prop in Model.Fields) + { + if (!prop.Name.EndsWith("Guid")) + { + <div> + /// <summary> + /// Called when the @(prop.Name) has changed. + /// </summary> + protected virtual void On@(prop.Name)Changed(@(prop.Type) @(prop.Name.ToLower())) + { + @(prop.Name)Changed?.Invoke(this, @(prop.Name.ToLower())); + RaisePropertyChanged(nameof(@(prop.Name))); + } + </div> + } + } /// <summary> /// Initializes a new instance of the <see cref="@(Model.Name)" /> class. |
