diff options
| author | Shlomo Hecht <shlomo@twine-s.com> | 2018-11-15 14:55:08 +0200 |
|---|---|---|
| committer | Shlomo Hecht <shlomo@twine-s.com> | 2018-11-15 14:55:08 +0200 |
| commit | aac4f633ac04ac5b1d134ce35981e8b898f5687e (patch) | |
| tree | da21e713aec69e5d6cfc6d64f617a736e34da4a4 /Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFile.cshtml | |
| parent | aeacbdabd448b2e7455e16460b996c8090731d9d (diff) | |
| parent | b0909a133eaba5223ca397c8186ba6b96fdaa647 (diff) | |
| download | Tango-aac4f633ac04ac5b1d134ce35981e8b898f5687e.tar.gz Tango-aac4f633ac04ac5b1d134ce35981e8b898f5687e.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 | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFile.cshtml b/Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFile.cshtml index 2231c30f1..daa4e7d51 100644 --- a/Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFile.cshtml +++ b/Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFile.cshtml @@ -34,6 +34,16 @@ namespace Tango.BL.Entities { @foreach (var prop in Model.Fields) { + if (!prop.Name.EndsWith("Guid")) + { + <div> + public event EventHandler<@(prop.Type)> @(prop.Name)Changed; + </div> + } + } + + @foreach (var prop in Model.Fields) + { <div> protected @(prop.Type) _@(prop.Name.ToLower()); @if (prop.DbDescription != null) @@ -59,7 +69,20 @@ namespace Tango.BL.Entities public @(prop.Construct || prop.Complex ? "virtual" : "") @(prop.Type) @(prop.Name) { get { return _@(prop.Name.ToLower()); } - set { _@(prop.Name.ToLower()) = value; RaisePropertyChanged(nameof(@(prop.Name))); } + set + { + if (_@(prop.Name.ToLower()) != value) + { + _@(prop.Name.ToLower()) = value; + @if (!prop.Name.EndsWith("Guid")) + { + <div> + @(prop.Name)Changed?.Invoke(this, value); + </div> + } + RaisePropertyChanged(nameof(@(prop.Name))); + } + } } </div> } |
