diff options
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> } |
