Added constructors to the entities
This commit is contained in:
@@ -16,8 +16,25 @@ namespace BrightGlimmer.Domain
|
||||
public string County { get; set; }
|
||||
public string ZipCode { get; set; }
|
||||
[JsonIgnore]
|
||||
public decimal Latitude { get; set; }
|
||||
public decimal Latitude { get; private set; }
|
||||
[JsonIgnore]
|
||||
public decimal Longitude { get; set; }
|
||||
public decimal Longitude { get; private set; }
|
||||
|
||||
private Address() { }
|
||||
|
||||
public Address(string streetAddress1,
|
||||
string streetAddress2,
|
||||
string city,
|
||||
string stateCode,
|
||||
string county,
|
||||
string zipCode)
|
||||
{
|
||||
StreetAddress1 = streetAddress1;
|
||||
StreetAddress2 = streetAddress2;
|
||||
City = city;
|
||||
StateCode = stateCode;
|
||||
County = county;
|
||||
ZipCode = zipCode;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,5 +14,14 @@ namespace BrightGlimmer.Domain
|
||||
|
||||
public Student Student { get; set; }
|
||||
public Course Course { get; set; }
|
||||
|
||||
private AssignedCourse() { }
|
||||
|
||||
public AssignedCourse(decimal grade, bool isActive, string term)
|
||||
{
|
||||
Grade = grade;
|
||||
IsActive = isActive;
|
||||
Term = term;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,8 +8,17 @@ namespace BrightGlimmer.Domain
|
||||
[Table("Courses")]
|
||||
public class Course : Entity
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public string Description { get; set; }
|
||||
public string Code { get; set; }
|
||||
public string Name { get; private set; }
|
||||
public string Description { get; private set; }
|
||||
public string Code { get; private set; }
|
||||
|
||||
private Course() { }
|
||||
|
||||
public Course(string name, string description, string code)
|
||||
{
|
||||
Name = name;
|
||||
Description = description;
|
||||
Code = code;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,8 +8,17 @@ namespace BrightGlimmer.Domain
|
||||
[Table("Phones")]
|
||||
public class Phone : Entity
|
||||
{
|
||||
public PhoneType Type { get; set; }
|
||||
public int AreaCode { get; set; }
|
||||
public int Number { get; set; }
|
||||
public PhoneType Type { get; private set; }
|
||||
public int AreaCode { get; private set; }
|
||||
public int Number { get; private set; }
|
||||
|
||||
private Phone() { }
|
||||
|
||||
public Phone(PhoneType type, int areaCode, int number)
|
||||
{
|
||||
Type = type;
|
||||
AreaCode = areaCode;
|
||||
Number = number;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user