The only question that I found most similar to my question is here, But It didn't answer my question. I have this model:
public class Profile
{
public int Id { get; set; }
public string Name { get; set; }
public bool IsActive { get; set; }
public bool IsDeleted {get; set; }
public virtual ICollection<Program> AllowedPrograms { get; set; }
public virtual ICollection<Program> DisAllowedPrograms { get; set; }
}
and this :
public class Program
{
public int Id { get; set; }
public string DisplayName { get; set; }
public bool IsActive { get; set; }
public bool IsDeleted {get; set; }
public virtual ICollection<Profile> AllowedProfiles { get; set; }
public virtual ICollection<Profile> DisAllowedProfiles { get; set; }
}
If I implement soft delete by help of IsDeleted
field, What happens to entries in ProfileProgram
table ? Are they deleted too implicitly? (There is two many-to-many relationships in this model I guess ). If I use entity framework filters which is located in here.
Or should I create the intermediate table by myself and add IsDeleted
field to that? Also this approach seems to change my code a lot which I am really looking for alternate method.