-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
214 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
src/Church/Church.Components.Core/Repository/ModelMappings/AddressMappings.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using System.Data.Entity.ModelConfiguration; | ||
using Church.Model.Core; | ||
|
||
namespace Church.Components.Core.Repository.ModelMappings | ||
{ | ||
public class AddressMappings : EntityTypeConfiguration<Address> | ||
{ | ||
public AddressMappings() | ||
{ | ||
ToTable("Address", "Core"); | ||
HasKey(x => x.Id); | ||
//HasRequired(x => x.Street1); | ||
} | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
src/Church/Church.Components.Core/Repository/ModelMappings/LocationMappings.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using System.Data.Entity.ModelConfiguration; | ||
using Church.Model.Core; | ||
|
||
namespace Church.Components.Core.Repository.ModelMappings | ||
{ | ||
public class LocationMappings : EntityTypeConfiguration<Location> | ||
{ | ||
public LocationMappings() | ||
{ | ||
ToTable("Location", "Core"); | ||
HasKey(x => x.Id); | ||
//HasRequired(x => x.Name); | ||
|
||
HasRequired(x => x.Address) | ||
.WithMany() | ||
.HasForeignKey(x => x.AddressId); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
src/Church/Church.Host.Core/ViewModels/AddressViewModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
namespace Church.Host.Core.ViewModels | ||
{ | ||
public class AddressViewModel | ||
{ | ||
public int Id { get; set; } | ||
public string Street1 { get; set; } | ||
public string Street2 { get; set; } | ||
public string City { get; set; } | ||
public string State { get; set; } | ||
public string PostCode { get; set; } | ||
public string Country { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
namespace Church.Host.Core.ViewModels | ||
{ | ||
public class ChurchViewModel | ||
{ | ||
public int Id { get; set; } | ||
public string Name { get; set; } | ||
public Model.Core.TimeZone TimeZone { get; set; } | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
src/Church/Church.Host.Core/ViewModels/LocationViewModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using System.Collections.Generic; | ||
|
||
namespace Church.Host.Core.ViewModels | ||
{ | ||
public class LocationViewModel | ||
{ | ||
public int Id { get; set; } | ||
public string Name { get; set; } | ||
public AddressViewModel Address { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
namespace Church.Model.Core | ||
{ | ||
public class Address | ||
{ | ||
public int Id { get; set; } | ||
public string Street1 { get; set; } | ||
public string Street2 { get; set; } | ||
public string City { get; set; } | ||
public string State { get; set; } | ||
public string PostCode { get; set; } | ||
public string Country { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
namespace Church.Model.Core | ||
{ | ||
public class Location | ||
{ | ||
public int Id { get; set; } | ||
public string Name { get; set; } | ||
|
||
|
||
public int ChurchId { get; set; } | ||
public virtual Church Church { get; set; } | ||
|
||
public int AddressId { get; set; } | ||
public Address Address { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<packages> | ||
<package id="Newtonsoft.Json" version="4.5.11" targetFramework="net451" /> | ||
</packages> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
src/Church/Church.SQL/_PostDeployment/Core.Address.Populate.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
IF NOT EXISTS (SELECT 1 FROM Core.[Address] a WHERE a.Id = 1) | ||
BEGIN | ||
INSERT INTO [Core].[Address] (Street1, Street2, City, Postcode, Country) | ||
VALUES | ||
( | ||
'55 Erskineville Rd', | ||
'Erskineville', | ||
'Sydney', | ||
'2043', | ||
'Australia' | ||
) | ||
END | ||
|
||
IF NOT EXISTS (SELECT 1 FROM Core.[Address] a WHERE a.Id = 2) | ||
BEGIN | ||
INSERT INTO [Core].[Address] (Street1, Street2, City, Postcode, Country) | ||
VALUES | ||
( | ||
'189 Church St', | ||
'Newtown', | ||
'Sydney', | ||
'2042', | ||
'Australia' | ||
) | ||
END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,5 +2,5 @@ | |
BEGIN | ||
INSERT INTO [Core].Church (Name, TimeZoneId) | ||
VALUES | ||
('Erko', 85) | ||
('NEAC', 85) | ||
END |
13 changes: 13 additions & 0 deletions
13
src/Church/Church.SQL/_PostDeployment/Core.Location.Populate.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
IF NOT EXISTS (SELECT 1 FROM Core.Location WHERE Id = 1) | ||
BEGIN | ||
INSERT INTO Core.[Location] (Name, ChurchId, AddressId) | ||
VALUES | ||
('55 Erskineville Rd', 1,1) | ||
END | ||
|
||
IF NOT EXISTS (SELECT 1 FROM Core.Location WHERE Id = 2) | ||
BEGIN | ||
INSERT INTO Core.[Location] (Name, ChurchId, AddressId) | ||
VALUES | ||
('189 Church St', 1,2) | ||
END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters