//------------------------------------------------------------------------------ // // This code was generated by a tool. // Tango Observables Generator // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. Do not modify! // //------------------------------------------------------------------------------ using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Xml.Serialization; using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; using System.ComponentModel; using Tango.Core.CustomAttributes; namespace Tango.BL.Entities { [Table("ROLES_PERMISSIONS")] public abstract class RolesPermissionBase : ObservableEntity { public event EventHandler PermissionChanged; public event EventHandler RoleChanged; protected String _roleguid; /// /// Gets or sets the rolespermissionbase role guid. /// [Column("ROLE_GUID")] [ForeignKey("Role")] public String RoleGuid { get { return _roleguid; } set { if (_roleguid != value) { _roleguid = value; } } } protected String _permissionguid; /// /// Gets or sets the rolespermissionbase permission guid. /// [Column("PERMISSION_GUID")] [ForeignKey("Permission")] public String PermissionGuid { get { return _permissionguid; } set { if (_permissionguid != value) { _permissionguid = value; } } } protected Permission _permission; /// /// Gets or sets the rolespermissionbase permission. /// [XmlIgnore] [JsonIgnore] public virtual Permission Permission { get { return _permission; } set { if (_permission != value) { _permission = value; if (Permission != null) { PermissionGuid = Permission.Guid; } OnPermissionChanged(value); } } } protected Role _role; /// /// Gets or sets the rolespermissionbase role. /// [XmlIgnore] [JsonIgnore] public virtual Role Role { get { return _role; } set { if (_role != value) { _role = value; if (Role != null) { RoleGuid = Role.Guid; } OnRoleChanged(value); } } } /// /// Called when the Permission has changed. /// protected virtual void OnPermissionChanged(Permission permission) { PermissionChanged?.Invoke(this, permission); RaisePropertyChanged(nameof(Permission)); } /// /// Called when the Role has changed. /// protected virtual void OnRoleChanged(Role role) { RoleChanged?.Invoke(this, role); RaisePropertyChanged(nameof(Role)); } /// /// Initializes a new instance of the class. /// public RolesPermissionBase() : base() { } } }