add missing classes
This commit is contained in:
parent
cd761d0875
commit
f0eaa2ac62
|
@ -0,0 +1,24 @@
|
||||||
|
using System.Runtime.Serialization;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
|
||||||
|
namespace Plattform.Models
|
||||||
|
{
|
||||||
|
[Table("Customers")]
|
||||||
|
[DataContract]
|
||||||
|
public class Customer : Person
|
||||||
|
{
|
||||||
|
public Customer() { }
|
||||||
|
public Customer(string firstName, string lastName, Gender gender,
|
||||||
|
Salutation salutation, string streetName, string
|
||||||
|
streetNumber, City city)
|
||||||
|
{
|
||||||
|
this.FirstName = firstName;
|
||||||
|
this.LastName = lastName;
|
||||||
|
this.Gender = gender;
|
||||||
|
this.Salutation = salutation;
|
||||||
|
this.StreetName = streetName;
|
||||||
|
this.StreetNumber = streetNumber;
|
||||||
|
this.City = city;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,17 @@
|
||||||
|
using System.Runtime.Serialization;
|
||||||
|
|
||||||
|
namespace Plattform.Models
|
||||||
|
{
|
||||||
|
[DataContract]
|
||||||
|
public class Gender
|
||||||
|
{
|
||||||
|
[DataMember]
|
||||||
|
public int GenderID { get; set; }
|
||||||
|
[DataMember]
|
||||||
|
public string Name { get; set; }
|
||||||
|
public Gender(string name)
|
||||||
|
{
|
||||||
|
this.Name = name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,41 @@
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Runtime.Serialization;
|
||||||
|
|
||||||
|
namespace Plattform.Models
|
||||||
|
{
|
||||||
|
[DataContract]
|
||||||
|
[KnownType(typeof(Customer))]
|
||||||
|
public class Person
|
||||||
|
{
|
||||||
|
[DataMember]
|
||||||
|
public int PersonID { get; set; }
|
||||||
|
[DataMember]
|
||||||
|
public string FirstName { get; set; }
|
||||||
|
[DataMember]
|
||||||
|
public string LastName { get; set; }
|
||||||
|
[DataMember]
|
||||||
|
public virtual Gender Gender { get; set; }
|
||||||
|
[DataMember]
|
||||||
|
public virtual Salutation Salutation { get; set; }
|
||||||
|
[DataMember]
|
||||||
|
public string StreetName { get; set; }
|
||||||
|
[DataMember]
|
||||||
|
public string StreetNumber { get; set; }
|
||||||
|
[DataMember]
|
||||||
|
public virtual City City { get; set; }
|
||||||
|
|
||||||
|
public Person() { }
|
||||||
|
public Person (string firstName, string lastName, Gender gender,
|
||||||
|
Salutation salutation, string streetName, string
|
||||||
|
streetNumber, City city)
|
||||||
|
{
|
||||||
|
this.FirstName = firstName;
|
||||||
|
this.LastName = lastName;
|
||||||
|
this.Gender = gender;
|
||||||
|
this.Salutation = salutation;
|
||||||
|
this.StreetName = streetName;
|
||||||
|
this.StreetNumber = streetNumber;
|
||||||
|
this.City = city;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,17 @@
|
||||||
|
using System.Runtime.Serialization;
|
||||||
|
|
||||||
|
namespace Plattform.Models
|
||||||
|
{
|
||||||
|
[DataContract]
|
||||||
|
public class Salutation
|
||||||
|
{
|
||||||
|
[DataMember]
|
||||||
|
public int SalutationID { get; set; }
|
||||||
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
public Salutation(string name)
|
||||||
|
{
|
||||||
|
this.Name = name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue