컴퓨터를 제거 할 때 삭제 작업을 계단식으로 수행 할 수 있습니까? 기본적으로 컴퓨터를 삭제할 때 환경 및 제품을 제외한 모든 참조를 제거하려고합니다.EF5 코드 첫 번째 계단식 삭제시
컴퓨터 엔티티 :
public class Computer
{
[Key]
public int Id { get; set; }
public string IpAddress { get; set; }
public string Name { get; set; }
public string UserFriendlyName { get; set; }
public string Description { get; set; }
}
인스턴스 법인 : 많은 relationship.is에
public class Instance
{
public Instance()
{
TestResults = new HashSet<TestResult>();
Environments = new HashSet<Environment>();
}
[Key]
public int Id { get; set; }
public string Name { get; set; }
public string Version { get; set; }
public string UserFriendlyName { get; set; }
public virtual Product Product { get; set; }
public virtual Profile LastKnownProfile { get; set; }
public virtual Computer Computer { get; set; }
public virtual ICollection<TestResult> TestResults { get; set; }
public virtual ICollection<Environment> Environments { get; set; }
}
고맙습니다. 나는 그 링크를 북마크했다. – twreid