changed db first style to match pluralized form and again update the deleted namespace and inherited class : xyAcces

This commit is contained in:
Ivan Hörler 2018-07-10 22:33:56 +02:00
parent 0afb70f881
commit 25c4b52ea7
16 changed files with 163 additions and 242 deletions

View File

@ -15,7 +15,7 @@ namespace EHEC_Server.DatabaseAccess
{
using (EHEC_DBEntities ctx = new EHEC_DBEntities())
{
ctx.Doctor.Add(doctor);
ctx.Doctors.Add(doctor);
ctx.SaveChanges();
}
return doctor;
@ -29,7 +29,7 @@ namespace EHEC_Server.DatabaseAccess
{
using (EHEC_DBEntities ctx = new EHEC_DBEntities())
{
return ctx.Doctor.ToList();
return ctx.Doctors.ToList();
}
}
}

View File

@ -15,7 +15,7 @@ namespace EHEC_Server.DatabaseAccess
{
using (EHEC_DBEntities ctx = new EHEC_DBEntities())
{
ctx.Exam.Add(exam);
ctx.Exams.Add(exam);
ctx.SaveChanges();
}
return exam;
@ -29,7 +29,7 @@ namespace EHEC_Server.DatabaseAccess
{
using (EHEC_DBEntities ctx = new EHEC_DBEntities())
{
return ctx.Exam.ToList();
return ctx.Exams.ToList();
}
}
}

View File

@ -14,7 +14,7 @@ namespace EHEC_Server.DatabaseAccess
{
using (EHEC_DBEntities ctx = new EHEC_DBEntities())
{
ctx.Origin.Add(origin);
ctx.Origins.Add(origin);
ctx.SaveChanges();
}
return origin;
@ -28,7 +28,7 @@ namespace EHEC_Server.DatabaseAccess
{
using (EHEC_DBEntities ctx = new EHEC_DBEntities())
{
return ctx.Origin.ToList();
return ctx.Origins.ToList();
}
}

View File

@ -14,7 +14,7 @@ namespace EHEC_Server.DatabaseAccess
{
using (EHEC_DBEntities ctx = new EHEC_DBEntities())
{
ctx.Patient.Add(patient);
ctx.Patients.Add(patient);
ctx.SaveChanges();
}
return patient;
@ -29,7 +29,7 @@ namespace EHEC_Server.DatabaseAccess
{
using (EHEC_DBEntities ctx = new EHEC_DBEntities())
{
return ctx.Patient.ToList();
return ctx.Patients.ToList();
}
}
}

View File

@ -14,7 +14,7 @@ namespace EHEC_Server.DatabaseAccess
{
using (EHEC_DBEntities ctx = new EHEC_DBEntities())
{
ctx.Result.Add(result);
ctx.Results.Add(result);
ctx.SaveChanges();
}
return result;
@ -30,7 +30,7 @@ namespace EHEC_Server.DatabaseAccess
{
ctx.Configuration.ProxyCreationEnabled = false;
List<Result> list = new List<Result>();
return ctx.Result.ToList();
return ctx.Results.ToList();
}
}
}

View File

@ -15,14 +15,15 @@ namespace EHEC_Server
using System;
using System.Collections.Generic;
using EHEC_Server.DatabaseAccess;
public partial class Doctor: DoctorAccess
public partial class Doctor : DoctorAccess
{
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
public Doctor()
{
this.Exam = new HashSet<Exam>();
this.Exams = new HashSet<Exam>();
}
@ -41,7 +42,7 @@ public partial class Doctor: DoctorAccess
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
public virtual ICollection<Exam> Exam { get; set; }
public virtual ICollection<Exam> Exams { get; set; }
}

View File

@ -152,9 +152,6 @@
<Compile Include="Service.svc.cs">
<DependentUpon>Service.svc</DependentUpon>
</Compile>
<Compile Include="sysdiagrams.cs">
<DependentUpon>Model.tt</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<Service Include="{508349B6-6B84-4DF5-91F0-309BEEBAD82D}" />

View File

@ -15,8 +15,7 @@ namespace EHEC_Server
using System;
using System.Collections.Generic;
using EHEC_Server.DatabaseAccess;
public partial class Exam : ExamAccess
public partial class Exam : ExamAccess
{
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
@ -34,22 +33,20 @@ public partial class Exam : ExamAccess
public int PatientId { get; set; }
public int OriginOriginId { get; set; }
public int Result_ResultId { get; set; }
public virtual Doctor Doctor { get; set; }
public virtual Patient Patient { get; set; }
public virtual Result Result { get; set; }
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
public virtual ICollection<Origin_Exam> Origin_Exam { get; set; }
public virtual Patient Patient { get; set; }
public virtual Result Result { get; set; }
}
}

View File

@ -32,19 +32,17 @@ public partial class EHEC_DBEntities : DbContext
}
public virtual DbSet<Doctor> Doctor { get; set; }
public virtual DbSet<Doctor> Doctors { get; set; }
public virtual DbSet<Exam> Exam { get; set; }
public virtual DbSet<Exam> Exams { get; set; }
public virtual DbSet<Origin> Origin { get; set; }
public virtual DbSet<Patient> Patient { get; set; }
public virtual DbSet<Result> Result { get; set; }
public virtual DbSet<Origin> Origins { get; set; }
public virtual DbSet<Origin_Exam> Origin_Exam { get; set; }
public virtual DbSet<sysdiagrams> sysdiagrams { get; set; }
public virtual DbSet<Patient> Patients { get; set; }
public virtual DbSet<Result> Results { get; set; }
}

View File

@ -9,4 +9,3 @@
// </auto-generated>
//------------------------------------------------------------------------------
using EHEC_Server.DatabaseAccess;

View File

@ -22,7 +22,6 @@
<Property Name="ExamId" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
<Property Name="DoctorId" Type="int" Nullable="false" />
<Property Name="PatientId" Type="int" Nullable="false" />
<Property Name="OriginOriginId" Type="int" Nullable="false" />
<Property Name="Result_ResultId" Type="int" Nullable="false" />
</EntityType>
<EntityType Name="Origin">
@ -62,16 +61,6 @@
<Property Name="ResultId" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
<Property Name="Name" Type="nvarchar(max)" Nullable="false" />
</EntityType>
<EntityType Name="sysdiagrams">
<Key>
<PropertyRef Name="diagram_id" />
</Key>
<Property Name="name" Type="nvarchar" MaxLength="128" Nullable="false" />
<Property Name="principal_id" Type="int" Nullable="false" />
<Property Name="diagram_id" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
<Property Name="version" Type="int" />
<Property Name="definition" Type="varbinary(max)" />
</EntityType>
<Association Name="FK_DoctorExam">
<End Role="Doctor" Type="Self.Doctor" Multiplicity="1" />
<End Role="Exam" Type="Self.Exam" Multiplicity="*" />
@ -139,7 +128,6 @@
<EntitySet Name="Origin_Exam" EntityType="Self.Origin_Exam" Schema="dbo" store:Type="Tables" />
<EntitySet Name="Patient" EntityType="Self.Patient" Schema="dbo" store:Type="Tables" />
<EntitySet Name="Result" EntityType="Self.Result" Schema="dbo" store:Type="Tables" />
<EntitySet Name="sysdiagrams" EntityType="Self.sysdiagrams" Schema="dbo" store:Type="Tables" />
<AssociationSet Name="FK_DoctorExam" Association="Self.FK_DoctorExam">
<End Role="Doctor" EntitySet="Doctor" />
<End Role="Exam" EntitySet="Exam" />
@ -165,16 +153,44 @@
<!-- CSDL content -->
<edmx:ConceptualModels>
<Schema Namespace="EHEC_DBModel" Alias="Self" annotation:UseStrongSpatialTypes="false" xmlns:annotation="http://schemas.microsoft.com/ado/2009/02/edm/annotation" xmlns:customannotation="http://schemas.microsoft.com/ado/2013/11/edm/customannotation" xmlns="http://schemas.microsoft.com/ado/2009/11/edm">
<EntityContainer Name="EHEC_DBEntities" annotation:LazyLoadingEnabled="true">
<EntitySet Name="Doctors" EntityType="EHEC_DBModel.Doctor" />
<EntitySet Name="Exams" EntityType="EHEC_DBModel.Exam" />
<EntitySet Name="Origins" EntityType="EHEC_DBModel.Origin" />
<EntitySet Name="Origin_Exam" EntityType="EHEC_DBModel.Origin_Exam" />
<EntitySet Name="Patients" EntityType="EHEC_DBModel.Patient" />
<EntitySet Name="Results" EntityType="EHEC_DBModel.Result" />
<AssociationSet Name="FK_DoctorExam" Association="EHEC_DBModel.FK_DoctorExam">
<End Role="Doctor" EntitySet="Doctors" />
<End Role="Exam" EntitySet="Exams" />
</AssociationSet>
<AssociationSet Name="FK_Exam" Association="EHEC_DBModel.FK_Exam">
<End Role="Exam" EntitySet="Exams" />
<End Role="Origin_Exam" EntitySet="Origin_Exam" />
</AssociationSet>
<AssociationSet Name="FK_PatientExam" Association="EHEC_DBModel.FK_PatientExam">
<End Role="Patient" EntitySet="Patients" />
<End Role="Exam" EntitySet="Exams" />
</AssociationSet>
<AssociationSet Name="FK_ResultExam" Association="EHEC_DBModel.FK_ResultExam">
<End Role="Result" EntitySet="Results" />
<End Role="Exam" EntitySet="Exams" />
</AssociationSet>
<AssociationSet Name="FK_Origin" Association="EHEC_DBModel.FK_Origin">
<End Role="Origin" EntitySet="Origins" />
<End Role="Origin_Exam" EntitySet="Origin_Exam" />
</AssociationSet>
</EntityContainer>
<EntityType Name="Doctor">
<Key>
<PropertyRef Name="DoctorId" />
</Key>
<Property Name="DoctorId" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
<Property Name="FirstName" Type="String" MaxLength="Max" FixedLength="false" Unicode="true" Nullable="false" />
<Property Name="LastName" Type="String" MaxLength="Max" FixedLength="false" Unicode="true" Nullable="false" />
<Property Name="DoctorOrigin" Type="String" MaxLength="Max" FixedLength="false" Unicode="true" Nullable="false" />
<NavigationProperty Name="Exam" Relationship="Self.FK_DoctorExam" FromRole="Doctor" ToRole="Exam" />
<Property Name="FirstName" Type="String" Nullable="false" MaxLength="Max" FixedLength="false" Unicode="true" />
<Property Name="LastName" Type="String" Nullable="false" MaxLength="Max" FixedLength="false" Unicode="true" />
<Property Name="DoctorOrigin" Type="String" Nullable="false" MaxLength="Max" FixedLength="false" Unicode="true" />
<Property Name="Region" Type="String" Nullable="false" MaxLength="Max" FixedLength="false" Unicode="true" />
<NavigationProperty Name="Exams" Relationship="EHEC_DBModel.FK_DoctorExam" FromRole="Doctor" ToRole="Exam" />
</EntityType>
<EntityType Name="Exam">
<Key>
@ -183,110 +199,23 @@
<Property Name="ExamId" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
<Property Name="DoctorId" Type="Int32" Nullable="false" />
<Property Name="PatientId" Type="Int32" Nullable="false" />
<Property Name="OriginOriginId" Type="Int32" Nullable="false" />
<Property Name="Result_ResultId" Type="Int32" Nullable="false" />
<NavigationProperty Name="Doctor" Relationship="Self.FK_DoctorExam" FromRole="Exam" ToRole="Doctor" />
<NavigationProperty Name="Patient" Relationship="Self.FK_PatientExam" FromRole="Exam" ToRole="Patient" />
<NavigationProperty Name="Result" Relationship="Self.FK_ResultExam" FromRole="Exam" ToRole="Result" />
<NavigationProperty Name="Doctor" Relationship="EHEC_DBModel.FK_DoctorExam" FromRole="Exam" ToRole="Doctor" />
<NavigationProperty Name="Origin_Exam" Relationship="EHEC_DBModel.FK_Exam" FromRole="Exam" ToRole="Origin_Exam" />
<NavigationProperty Name="Patient" Relationship="EHEC_DBModel.FK_PatientExam" FromRole="Exam" ToRole="Patient" />
<NavigationProperty Name="Result" Relationship="EHEC_DBModel.FK_ResultExam" FromRole="Exam" ToRole="Result" />
</EntityType>
<EntityType Name="Origin">
<Key>
<PropertyRef Name="OriginId" />
</Key>
<Property Name="OriginId" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
<Property Name="Name" Type="String" MaxLength="Max" FixedLength="false" Unicode="true" Nullable="false" />
<Property Name="Street" Type="String" MaxLength="Max" FixedLength="false" Unicode="true" Nullable="false" />
<Property Name="City" Type="String" MaxLength="Max" FixedLength="false" Unicode="true" Nullable="false" />
<Property Name="Name" Type="String" Nullable="false" MaxLength="Max" FixedLength="false" Unicode="true" />
<Property Name="Food" Type="String" Nullable="false" MaxLength="Max" FixedLength="false" Unicode="true" />
<Property Name="Street" Type="String" Nullable="false" MaxLength="Max" FixedLength="false" Unicode="true" />
<Property Name="City" Type="String" Nullable="false" MaxLength="Max" FixedLength="false" Unicode="true" />
<NavigationProperty Name="Origin_Exam" Relationship="EHEC_DBModel.FK_Origin" FromRole="Origin" ToRole="Origin_Exam" />
</EntityType>
<EntityType Name="Patient">
<Key>
<PropertyRef Name="PatientId" />
</Key>
<Property Name="PatientId" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
<Property Name="FirstName" Type="String" MaxLength="Max" FixedLength="false" Unicode="true" Nullable="false" />
<Property Name="LastName" Type="String" MaxLength="Max" FixedLength="false" Unicode="true" Nullable="false" />
<Property Name="BirthDate" Type="DateTime" Nullable="false" Precision="3" />
<Property Name="Street" Type="String" MaxLength="Max" FixedLength="false" Unicode="true" Nullable="false" />
<Property Name="City" Type="String" MaxLength="Max" FixedLength="false" Unicode="true" Nullable="false" />
<NavigationProperty Name="Exam" Relationship="Self.FK_PatientExam" FromRole="Patient" ToRole="Exam" />
<Property Name="Region" Type="String" Nullable="false" MaxLength="Max" FixedLength="false" Unicode="true" />
</EntityType>
<EntityType Name="Result">
<Key>
<PropertyRef Name="ResultId" />
</Key>
<Property Name="ResultId" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
<Property Name="Name" Type="String" MaxLength="Max" FixedLength="false" Unicode="true" Nullable="false" />
<NavigationProperty Name="Exam" Relationship="Self.FK_ResultExam" FromRole="Result" ToRole="Exam" />
</EntityType>
<Association Name="FK_DoctorExam">
<End Role="Doctor" Type="Self.Doctor" Multiplicity="1" />
<End Role="Exam" Type="Self.Exam" Multiplicity="*" />
<ReferentialConstraint>
<Principal Role="Doctor">
<PropertyRef Name="DoctorId" />
</Principal>
<Dependent Role="Exam">
<PropertyRef Name="DoctorId" />
</Dependent>
</ReferentialConstraint>
</Association>
<Association Name="FK_PatientExam">
<End Role="Patient" Type="Self.Patient" Multiplicity="1" />
<End Role="Exam" Type="Self.Exam" Multiplicity="*" />
<ReferentialConstraint>
<Principal Role="Patient">
<PropertyRef Name="PatientId" />
</Principal>
<Dependent Role="Exam">
<PropertyRef Name="PatientId" />
</Dependent>
</ReferentialConstraint>
</Association>
<Association Name="FK_ResultExam">
<End Role="Result" Type="Self.Result" Multiplicity="1" />
<End Role="Exam" Type="Self.Exam" Multiplicity="*" />
<ReferentialConstraint>
<Principal Role="Result">
<PropertyRef Name="ResultId" />
</Principal>
<Dependent Role="Exam">
<PropertyRef Name="Result_ResultId" />
</Dependent>
</ReferentialConstraint>
</Association>
<EntityContainer Name="EHEC_DBEntities" annotation:LazyLoadingEnabled="true">
<EntitySet Name="Doctor" EntityType="Self.Doctor" />
<EntitySet Name="Exam" EntityType="Self.Exam" />
<EntitySet Name="Origin" EntityType="Self.Origin" />
<EntitySet Name="Patient" EntityType="Self.Patient" />
<EntitySet Name="Result" EntityType="Self.Result" />
<AssociationSet Name="FK_DoctorExam" Association="Self.FK_DoctorExam">
<End Role="Doctor" EntitySet="Doctor" />
<End Role="Exam" EntitySet="Exam" />
</AssociationSet>
<AssociationSet Name="FK_PatientExam" Association="Self.FK_PatientExam">
<End Role="Patient" EntitySet="Patient" />
<End Role="Exam" EntitySet="Exam" />
</AssociationSet>
<AssociationSet Name="FK_ResultExam" Association="Self.FK_ResultExam">
<End Role="Result" EntitySet="Result" />
<End Role="Exam" EntitySet="Exam" />
</AssociationSet>
<EntitySet Name="Origin_Exam" EntityType="EHEC_DBModel.Origin_Exam" />
<EntitySet Name="sysdiagrams" EntityType="EHEC_DBModel.sysdiagrams" />
<AssociationSet Name="FK_Exam" Association="EHEC_DBModel.FK_Exam">
<End Role="Exam" EntitySet="Exam" />
<End Role="Origin_Exam" EntitySet="Origin_Exam" />
</AssociationSet>
<AssociationSet Name="FK_Origin" Association="EHEC_DBModel.FK_Origin">
<End Role="Origin" EntitySet="Origin" />
<End Role="Origin_Exam" EntitySet="Origin_Exam" />
</AssociationSet>
</EntityContainer>
<EntityType Name="Origin_Exam">
<Key>
<PropertyRef Name="Origin_ExamId" />
@ -297,16 +226,39 @@
<NavigationProperty Name="Exam" Relationship="EHEC_DBModel.FK_Exam" FromRole="Origin_Exam" ToRole="Exam" />
<NavigationProperty Name="Origin" Relationship="EHEC_DBModel.FK_Origin" FromRole="Origin_Exam" ToRole="Origin" />
</EntityType>
<EntityType Name="sysdiagrams">
<EntityType Name="Patient">
<Key>
<PropertyRef Name="diagram_id" />
<PropertyRef Name="PatientId" />
</Key>
<Property Name="name" Type="String" Nullable="false" MaxLength="128" FixedLength="false" Unicode="true" />
<Property Name="principal_id" Type="Int32" Nullable="false" />
<Property Name="diagram_id" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
<Property Name="version" Type="Int32" />
<Property Name="definition" Type="Binary" MaxLength="Max" FixedLength="false" />
<Property Name="PatientId" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
<Property Name="FirstName" Type="String" Nullable="false" MaxLength="Max" FixedLength="false" Unicode="true" />
<Property Name="LastName" Type="String" Nullable="false" MaxLength="Max" FixedLength="false" Unicode="true" />
<Property Name="BirthDate" Type="DateTime" Nullable="false" Precision="3" />
<Property Name="Street" Type="String" Nullable="false" MaxLength="Max" FixedLength="false" Unicode="true" />
<Property Name="City" Type="String" Nullable="false" MaxLength="Max" FixedLength="false" Unicode="true" />
<Property Name="Region" Type="String" Nullable="false" MaxLength="Max" FixedLength="false" Unicode="true" />
<NavigationProperty Name="Exams" Relationship="EHEC_DBModel.FK_PatientExam" FromRole="Patient" ToRole="Exam" />
</EntityType>
<EntityType Name="Result">
<Key>
<PropertyRef Name="ResultId" />
</Key>
<Property Name="ResultId" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
<Property Name="Name" Type="String" Nullable="false" MaxLength="Max" FixedLength="false" Unicode="true" />
<NavigationProperty Name="Exams" Relationship="EHEC_DBModel.FK_ResultExam" FromRole="Result" ToRole="Exam" />
</EntityType>
<Association Name="FK_DoctorExam">
<End Type="EHEC_DBModel.Doctor" Role="Doctor" Multiplicity="1" />
<End Type="EHEC_DBModel.Exam" Role="Exam" Multiplicity="*" />
<ReferentialConstraint>
<Principal Role="Doctor">
<PropertyRef Name="DoctorId" />
</Principal>
<Dependent Role="Exam">
<PropertyRef Name="DoctorId" />
</Dependent>
</ReferentialConstraint>
</Association>
<Association Name="FK_Exam">
<End Type="EHEC_DBModel.Exam" Role="Exam" Multiplicity="1" />
<End Type="EHEC_DBModel.Origin_Exam" Role="Origin_Exam" Multiplicity="*" />
@ -319,6 +271,30 @@
</Dependent>
</ReferentialConstraint>
</Association>
<Association Name="FK_PatientExam">
<End Type="EHEC_DBModel.Patient" Role="Patient" Multiplicity="1" />
<End Type="EHEC_DBModel.Exam" Role="Exam" Multiplicity="*" />
<ReferentialConstraint>
<Principal Role="Patient">
<PropertyRef Name="PatientId" />
</Principal>
<Dependent Role="Exam">
<PropertyRef Name="PatientId" />
</Dependent>
</ReferentialConstraint>
</Association>
<Association Name="FK_ResultExam">
<End Type="EHEC_DBModel.Result" Role="Result" Multiplicity="1" />
<End Type="EHEC_DBModel.Exam" Role="Exam" Multiplicity="*" />
<ReferentialConstraint>
<Principal Role="Result">
<PropertyRef Name="ResultId" />
</Principal>
<Dependent Role="Exam">
<PropertyRef Name="Result_ResultId" />
</Dependent>
</ReferentialConstraint>
</Association>
<Association Name="FK_Origin">
<End Type="EHEC_DBModel.Origin" Role="Origin" Multiplicity="1" />
<End Type="EHEC_DBModel.Origin_Exam" Role="Origin_Exam" Multiplicity="*" />
@ -331,63 +307,41 @@
</Dependent>
</ReferentialConstraint>
</Association>
</Schema>
</Schema>
</edmx:ConceptualModels>
<!-- C-S mapping content -->
<edmx:Mappings>
<Mapping Space="C-S" xmlns="http://schemas.microsoft.com/ado/2009/11/mapping/cs">
<EntityContainerMapping StorageEntityContainer="EHEC_DBModelStoreContainer" CdmEntityContainer="EHEC_DBEntities">
<EntitySetMapping Name="Doctor">
<EntitySetMapping Name="Doctors">
<EntityTypeMapping TypeName="EHEC_DBModel.Doctor">
<MappingFragment StoreEntitySet="Doctor">
<ScalarProperty Name="Region" ColumnName="Region" />
<ScalarProperty Name="DoctorId" ColumnName="DoctorId" />
<ScalarProperty Name="FirstName" ColumnName="FirstName" />
<ScalarProperty Name="LastName" ColumnName="LastName" />
<ScalarProperty Name="DoctorOrigin" ColumnName="DoctorOrigin" />
<ScalarProperty Name="LastName" ColumnName="LastName" />
<ScalarProperty Name="FirstName" ColumnName="FirstName" />
<ScalarProperty Name="DoctorId" ColumnName="DoctorId" />
</MappingFragment>
</EntityTypeMapping>
</EntitySetMapping>
<EntitySetMapping Name="Exam">
<EntitySetMapping Name="Exams">
<EntityTypeMapping TypeName="EHEC_DBModel.Exam">
<MappingFragment StoreEntitySet="Exam">
<ScalarProperty Name="ExamId" ColumnName="ExamId" />
<ScalarProperty Name="DoctorId" ColumnName="DoctorId" />
<ScalarProperty Name="PatientId" ColumnName="PatientId" />
<ScalarProperty Name="OriginOriginId" ColumnName="OriginOriginId" />
<ScalarProperty Name="Result_ResultId" ColumnName="Result_ResultId" />
<ScalarProperty Name="PatientId" ColumnName="PatientId" />
<ScalarProperty Name="DoctorId" ColumnName="DoctorId" />
<ScalarProperty Name="ExamId" ColumnName="ExamId" />
</MappingFragment>
</EntityTypeMapping>
</EntitySetMapping>
<EntitySetMapping Name="Origin">
<EntitySetMapping Name="Origins">
<EntityTypeMapping TypeName="EHEC_DBModel.Origin">
<MappingFragment StoreEntitySet="Origin">
<ScalarProperty Name="City" ColumnName="City" />
<ScalarProperty Name="Street" ColumnName="Street" />
<ScalarProperty Name="Food" ColumnName="Food" />
<ScalarProperty Name="Name" ColumnName="Name" />
<ScalarProperty Name="OriginId" ColumnName="OriginId" />
<ScalarProperty Name="Name" ColumnName="Name" />
<ScalarProperty Name="Street" ColumnName="Street" />
<ScalarProperty Name="City" ColumnName="City" />
</MappingFragment>
</EntityTypeMapping>
</EntitySetMapping>
<EntitySetMapping Name="Patient">
<EntityTypeMapping TypeName="EHEC_DBModel.Patient">
<MappingFragment StoreEntitySet="Patient">
<ScalarProperty Name="Region" ColumnName="Region" />
<ScalarProperty Name="PatientId" ColumnName="PatientId" />
<ScalarProperty Name="FirstName" ColumnName="FirstName" />
<ScalarProperty Name="LastName" ColumnName="LastName" />
<ScalarProperty Name="BirthDate" ColumnName="BirthDate" />
<ScalarProperty Name="Street" ColumnName="Street" />
<ScalarProperty Name="City" ColumnName="City" />
</MappingFragment>
</EntityTypeMapping>
</EntitySetMapping>
<EntitySetMapping Name="Result">
<EntityTypeMapping TypeName="EHEC_DBModel.Result">
<MappingFragment StoreEntitySet="Result">
<ScalarProperty Name="ResultId" ColumnName="ResultId" />
<ScalarProperty Name="Name" ColumnName="Name" />
</MappingFragment>
</EntityTypeMapping>
</EntitySetMapping>
@ -400,14 +354,24 @@
</MappingFragment>
</EntityTypeMapping>
</EntitySetMapping>
<EntitySetMapping Name="sysdiagrams">
<EntityTypeMapping TypeName="EHEC_DBModel.sysdiagrams">
<MappingFragment StoreEntitySet="sysdiagrams">
<ScalarProperty Name="definition" ColumnName="definition" />
<ScalarProperty Name="version" ColumnName="version" />
<ScalarProperty Name="diagram_id" ColumnName="diagram_id" />
<ScalarProperty Name="principal_id" ColumnName="principal_id" />
<ScalarProperty Name="name" ColumnName="name" />
<EntitySetMapping Name="Patients">
<EntityTypeMapping TypeName="EHEC_DBModel.Patient">
<MappingFragment StoreEntitySet="Patient">
<ScalarProperty Name="Region" ColumnName="Region" />
<ScalarProperty Name="City" ColumnName="City" />
<ScalarProperty Name="Street" ColumnName="Street" />
<ScalarProperty Name="BirthDate" ColumnName="BirthDate" />
<ScalarProperty Name="LastName" ColumnName="LastName" />
<ScalarProperty Name="FirstName" ColumnName="FirstName" />
<ScalarProperty Name="PatientId" ColumnName="PatientId" />
</MappingFragment>
</EntityTypeMapping>
</EntitySetMapping>
<EntitySetMapping Name="Results">
<EntityTypeMapping TypeName="EHEC_DBModel.Result">
<MappingFragment StoreEntitySet="Result">
<ScalarProperty Name="Name" ColumnName="Name" />
<ScalarProperty Name="ResultId" ColumnName="ResultId" />
</MappingFragment>
</EntityTypeMapping>
</EntitySetMapping>

View File

@ -5,17 +5,16 @@
<!-- Diagram content (shape and connector positions) -->
<edmx:Diagrams>
<Diagram DiagramId="09c9d242de5f41b186b4e8e8af51e2a7" Name="Diagram1">
<EntityTypeShape EntityType="EHEC_DBModel.Doctor" Width="1.5" PointX="0.5" PointY="0.5" IsExpanded="true" />
<EntityTypeShape EntityType="EHEC_DBModel.Exam" Width="1.5" PointX="2.5" PointY="0.5" IsExpanded="true" />
<EntityTypeShape EntityType="EHEC_DBModel.Origin" Width="1.5" PointX="4.5" PointY="3" IsExpanded="true" />
<EntityTypeShape EntityType="EHEC_DBModel.Patient" Width="1.5" PointX="0.5" PointY="2.75" IsExpanded="true" />
<EntityTypeShape EntityType="EHEC_DBModel.Result" Width="1.5" PointX="2.5" PointY="3.625" IsExpanded="true" />
<AssociationConnector Association="EHEC_DBModel.FK_DoctorExam" ManuallyRouted="false" />
<AssociationConnector Association="EHEC_DBModel.FK_PatientExam" ManuallyRouted="false" />
<AssociationConnector Association="EHEC_DBModel.FK_ResultExam" ManuallyRouted="false" />
<EntityTypeShape EntityType="EHEC_DBModel.Origin_Exam" Width="1.5" PointX="4.5" PointY="0.5" />
<EntityTypeShape EntityType="EHEC_DBModel.sysdiagrams" Width="1.5" PointX="0.5" PointY="5.5" />
<EntityTypeShape EntityType="EHEC_DBModel.Doctor" Width="1.5" PointX="0.5" PointY="0.5" />
<EntityTypeShape EntityType="EHEC_DBModel.Exam" Width="1.5" PointX="2.875" PointY="0.5" />
<EntityTypeShape EntityType="EHEC_DBModel.Origin" Width="1.5" PointX="5" PointY="3.25" />
<EntityTypeShape EntityType="EHEC_DBModel.Origin_Exam" Width="1.5" PointX="5" PointY="0.75" />
<EntityTypeShape EntityType="EHEC_DBModel.Patient" Width="1.5" PointX="0.5" PointY="2.75" />
<EntityTypeShape EntityType="EHEC_DBModel.Result" Width="1.5" PointX="2.875" PointY="3.5" />
<AssociationConnector Association="EHEC_DBModel.FK_DoctorExam" />
<AssociationConnector Association="EHEC_DBModel.FK_Exam" />
<AssociationConnector Association="EHEC_DBModel.FK_PatientExam" />
<AssociationConnector Association="EHEC_DBModel.FK_ResultExam" />
<AssociationConnector Association="EHEC_DBModel.FK_Origin" />
</Diagram>
</edmx:Diagrams>

View File

@ -31,12 +31,12 @@ using System;
public string Name { get; set; }
public string Food { get; set; }
public string Street { get; set; }
public string City { get; set; }
public string Food { get; set; }
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]

View File

@ -15,9 +15,8 @@ namespace EHEC_Server
using System;
using System.Collections.Generic;
using EHEC_Server.DatabaseAccess;
public partial class Origin_Exam : Origin_ExamAccess
{
public partial class Origin_Exam : OriginAccess
{
public int Origin_ExamId { get; set; }

View File

@ -22,7 +22,7 @@ using System;
public Patient()
{
this.Exam = new HashSet<Exam>();
this.Exams = new HashSet<Exam>();
}
@ -45,7 +45,7 @@ using System;
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
public virtual ICollection<Exam> Exam { get; set; }
public virtual ICollection<Exam> Exams { get; set; }
}

View File

@ -1,33 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated from a template.
//
// Manual changes to this file may cause unexpected behavior in your application.
// Manual changes to this file will be overwritten if the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace EHEC_Server
{
using System;
using System.Collections.Generic;
using EHEC_Server.DatabaseAccess;
public partial class sysdiagrams
{
public string name { get; set; }
public int principal_id { get; set; }
public int diagram_id { get; set; }
public Nullable<int> version { get; set; }
public byte[] definition { get; set; }
}
}