diff options
| author | Shlomo Hecht <shlomo@twine-s.com> | 2018-11-25 10:44:37 +0200 |
|---|---|---|
| committer | Shlomo Hecht <shlomo@twine-s.com> | 2018-11-25 10:44:37 +0200 |
| commit | beff6af103bb0ae9b9147a907c6567bdb33abd00 (patch) | |
| tree | 375eefd654c25f3b68c0cf5b3612df844a140d8e /Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFile.cshtml | |
| parent | 57f20269fbb4c591aa73c9f5e50118310cc4892e (diff) | |
| parent | dff24e56a8906b8c9b355cf407f25f4b793beafe (diff) | |
| download | Tango-beff6af103bb0ae9b9147a907c6567bdb33abd00.tar.gz Tango-beff6af103bb0ae9b9147a907c6567bdb33abd00.zip | |
merge
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> } |
