diff options
| author | Shlomo Hecht <shlomo@twine-s.com> | 2019-01-02 08:47:29 +0200 |
|---|---|---|
| committer | Shlomo Hecht <shlomo@twine-s.com> | 2019-01-02 08:47:29 +0200 |
| commit | 520e878bf98efcec9c75abcfe483175ff72620a2 (patch) | |
| tree | 62a7221e3c22187821f6a5e399eca0f7bd31168a /Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFile.cshtml | |
| parent | 30574fe4a6e1bb4f60a43e9000acaf919811689a (diff) | |
| parent | 25f5e6ddef7ef2fa0a747305847eeb4ceee5a2c9 (diff) | |
| download | Tango-520e878bf98efcec9c75abcfe483175ff72620a2.tar.gz Tango-520e878bf98efcec9c75abcfe483175ff72620a2.zip | |
Merge branch 'master' of https://twinetfs.visualstudio.com/Tango/_git/Tango
Diffstat (limited to 'Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFile.cshtml')
| -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. |
