Mouhssine tahri

Mouhssine tahri

  • NA
  • 201
  • 9.8k

Delete record in abstract table using webapi

Mar 30 2021 11:11 AM
hello
i have 2 table  Permission and Profile :
 
public partial class Profile
{
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
public Profile()
{
this.Permissions = new HashSet<Permission>();
}
public int ProfileID { get; set; }
public string ProfileName { get; set; }
public Nullable<System.DateTime> DateCreation { get; set; }
public Nullable<System.DateTime> DateModification { get; set; }
public string ProfileDescription { 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.Profile = new HashSet<Profile>();
}
public int PermissionID { get; set; }
public string PermissionName { get; set; }
public string PermissionDescription { get; set; }
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
public virtual ICollection<Profile> Profile { get; set; }
}
}
 
there is relation one to one between  Profile and Permission
in sql server i have ProfilePermission table but in MVC this table is abstract
now i dont know how  delete a record in my abstract table ,please help me