Restructured query repositries to move ef logic from handlers
This commit is contained in:
@@ -36,5 +36,30 @@ namespace BrightGlimmer.Domain
|
||||
County = county;
|
||||
ZipCode = zipCode;
|
||||
}
|
||||
|
||||
public Address(string streetAddress1,
|
||||
string streetAddress2,
|
||||
string city,
|
||||
string stateCode,
|
||||
string county,
|
||||
string zipCode,
|
||||
decimal latitude,
|
||||
decimal longitude)
|
||||
{
|
||||
StreetAddress1 = streetAddress1;
|
||||
StreetAddress2 = streetAddress2;
|
||||
City = city;
|
||||
StateCode = stateCode;
|
||||
County = county;
|
||||
ZipCode = zipCode;
|
||||
Latitude = latitude;
|
||||
Longitude = longitude;
|
||||
}
|
||||
|
||||
public void SetLatitudeAndLongitude(decimal latitude, decimal longitude)
|
||||
{
|
||||
Latitude = latitude;
|
||||
Longitude = longitude;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,15 +8,21 @@ namespace BrightGlimmer.Domain
|
||||
[Table("AssignedCourses")]
|
||||
public class AssignedCourse : Entity
|
||||
{
|
||||
public decimal Grade { get; set; }
|
||||
public decimal? Grade { get; set; }
|
||||
public bool IsActive { get; set; }
|
||||
public string Term { get; set; }
|
||||
|
||||
public Student Student { get; set; }
|
||||
public Course Course { get; set; }
|
||||
public Student Student { get; private set; }
|
||||
public Course Course { get; private set; }
|
||||
|
||||
private AssignedCourse() { }
|
||||
|
||||
public AssignedCourse(bool isActive, string term)
|
||||
{
|
||||
IsActive = isActive;
|
||||
Term = term;
|
||||
}
|
||||
|
||||
public AssignedCourse(decimal grade, bool isActive, string term)
|
||||
{
|
||||
Grade = grade;
|
||||
|
||||
@@ -8,9 +8,9 @@ namespace BrightGlimmer.Domain
|
||||
[Table("Phones")]
|
||||
public class Phone : Entity
|
||||
{
|
||||
public PhoneType Type { get; private set; }
|
||||
public int AreaCode { get; private set; }
|
||||
public int Number { get; private set; }
|
||||
public PhoneType Type { get; set; }
|
||||
public int AreaCode { get; set; }
|
||||
public int Number { get; set; }
|
||||
|
||||
private Phone() { }
|
||||
|
||||
|
||||
@@ -15,8 +15,8 @@ namespace BrightGlimmer.Domain
|
||||
public string FirstName { get; set; }
|
||||
public string MiddleName { get; set; }
|
||||
public string LastName { get; set; }
|
||||
public string Email { get; private set; }
|
||||
public Address Address { get; set; }
|
||||
public string Email { get; set; }
|
||||
public Address Address { get; private set; }
|
||||
public string ProfilePictureUrl { get; set; }
|
||||
|
||||
private readonly List<Phone> phones = new List<Phone>();
|
||||
|
||||
Reference in New Issue
Block a user