read

Exams have a foreign key of patients, if I delete a patient that have exams related to, the exams will be deleted too.

<pre style="background-color: #f0f0f0; background-position: initial initial; background-repeat: initial initial; border: 1px dashed rgb(204, 204, 204); font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"> public class Patient
{
public int ID { get; set; }

// [StringLength(50)]
[Required]
public string Name { get; set; }

//[StringLength(10)]
[Required]
public string Gender { get; set; }

[DataType(DataType.Date)]
public DateTime Birthdate { get; set; }

//[StringLength(500)]
[Required]
public string Notes { get; set; }

[DataType(DataType.Date)]
public DateTime RegistrationDate { get; set; }
}

public class Exam
{
[Required]
[Key]
public string ID { get; set; }

[DataType(DataType.Date)]
public DateTime IssueDate { get; set; }

[Required]
public string Doctor { get; set; }

[Required]
public string Type { get; set; }

[Required]
public string Notes { get; set; }

[Required]
public string Report { get; set; }

[Required]
public int PatientId { get; set; }

[ForeignKey("PatientId")]
public virtual Patient Patient { get; set; }

}


</pre>

Blog Logo

Daniel Gomez Rico


Published

Image

MakinGIANTS

The findings and tips records of an Android-iOS-TheWholeShabang group

Back to Overview