There are 3 tables:

ActionType: Action_id, Name

Premission: Permission_id, Name

ActionTypePermission: Action_id, Permission_id, DateDel

With the DataBase first approach, the studio generated 2 classes for me. Question:

1) Can I somehow get access to the data of the UserPermission entity?

2) I can access DateDel and select, for example, Login, where Datedel == null?

3) How can I get UserPermission generated by me besides the introduction of another key attribute UserPermission_id?

Classes themselves:

public partial class ActionType { [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] public ActionType() { this.Queues = new HashSet<Queue>(); this.UserChangeHistories = new HashSet<UserChangeHistory>(); this.Permissions = new HashSet<Permission>(); } public int Action_id { get; set; } public string Name { get; set; } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] public virtual ICollection<Queue> Queues { get; set; } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] public virtual ICollection<UserChangeHistory> UserChangeHistories { get; set; } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] public virtual ICollection<Permission> Permissions { get; set; } } public partial class Permission { [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] public Permission() { this.UserPermissions = new HashSet<UserPermission>(); this.ActionTypes = new HashSet<ActionType>(); } public int Permission_id { get; set; } public string Name { get; set; } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] public virtual ICollection<UserPermission> UserPermissions { get; set; } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] public virtual ICollection<ActionType> ActionTypes { get; set; } } 
  • Where are the generated classes? - Monk
  • @Monk, I added. - iluxa1810
  • and you tried to access the navigation properties: Permissions , as far as I can tell it should have permissions for the type of action - Bald
  • Yes, but datedel, I did not find it ... - iluxa1810
  • Do not forget to put the @ symbol + Nick of the person to whom you write, what would be the notification. I don’t see the datadel properties in your Permission class (at least in the part you mentioned) - Bald

0