Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add mapping overrides and Bidirectional properties for relationships :S Some tests checking Ids where removed as I can't see the point of them with NH. Add AssemblySetup for ServiceLocator and log4net
- Loading branch information
Showing
27 changed files
with
190 additions
and
70 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,4 +21,5 @@ error-*.xml | |
StyleCop.Cache | ||
SpecificationReports | ||
NugetWorkspace | ||
[Pp]ackages | ||
[Pp]ackages | ||
[Ll]ogs |
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
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
Solutions/Suteki.TardisBank.Infrastructure/NHibernateMaps/AccountMap.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 @@ | ||
namespace Suteki.TardisBank.Infrastructure.NHibernateMaps | ||
{ | ||
using FluentNHibernate.Automapping; | ||
using FluentNHibernate.Automapping.Alterations; | ||
|
||
using Suteki.TardisBank.Model; | ||
|
||
public class AccountMap : IAutoMappingOverride<Account> | ||
{ | ||
public void Override(AutoMapping<Account> mapping) | ||
{ | ||
mapping.HasMany(a => a.PaymentSchedules).Cascade.AllDeleteOrphan().Inverse(); | ||
} | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
Solutions/Suteki.TardisBank.Infrastructure/NHibernateMaps/ChildMap.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 @@ | ||
namespace Suteki.TardisBank.Infrastructure.NHibernateMaps | ||
{ | ||
using FluentNHibernate.Automapping; | ||
using FluentNHibernate.Automapping.Alterations; | ||
|
||
using Suteki.TardisBank.Model; | ||
|
||
public class ChildMap : IAutoMappingOverride<Child> | ||
{ | ||
public void Override(AutoMapping<Child> mapping) | ||
{ | ||
mapping.References(c => c.Account).Cascade.All(); | ||
} | ||
} | ||
} |
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
Solutions/Suteki.TardisBank.Infrastructure/NHibernateMaps/MessageMap.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 @@ | ||
namespace Suteki.TardisBank.Infrastructure.NHibernateMaps | ||
{ | ||
using FluentNHibernate.Automapping; | ||
using FluentNHibernate.Automapping.Alterations; | ||
|
||
using Suteki.TardisBank.Model; | ||
|
||
public class MessageMap : IAutoMappingOverride<Message> | ||
{ | ||
public void Override(AutoMapping<Message> mapping) | ||
{ | ||
mapping.References(m => m.User); | ||
} | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
Solutions/Suteki.TardisBank.Infrastructure/NHibernateMaps/PaymentScheduleMap.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 @@ | ||
namespace Suteki.TardisBank.Infrastructure.NHibernateMaps | ||
{ | ||
using FluentNHibernate.Automapping; | ||
using FluentNHibernate.Automapping.Alterations; | ||
|
||
using Suteki.TardisBank.Model; | ||
|
||
public class PaymentScheduleMap : IAutoMappingOverride<PaymentSchedule> | ||
{ | ||
public void Override(AutoMapping<PaymentSchedule> mapping) | ||
{ | ||
mapping.References(p => p.Account); | ||
} | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
Solutions/Suteki.TardisBank.Infrastructure/NHibernateMaps/UserMap.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 @@ | ||
namespace Suteki.TardisBank.Infrastructure.NHibernateMaps | ||
{ | ||
using FluentNHibernate.Automapping; | ||
using FluentNHibernate.Automapping.Alterations; | ||
|
||
using Suteki.TardisBank.Model; | ||
|
||
public class UserMap : IAutoMappingOverride<User> | ||
{ | ||
public void Override(AutoMapping<User> mapping) | ||
{ | ||
mapping.HasMany(u => u.Messages).Cascade.AllDeleteOrphan().Inverse(); | ||
} | ||
} | ||
} |
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
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 Suteki.TardisBank.Tests | ||
{ | ||
using NUnit.Framework; | ||
|
||
[SetUpFixture] | ||
public class AssemblySetup | ||
{ | ||
[SetUp] | ||
public void RunBeforeAllTests() | ||
{ | ||
log4net.Config.XmlConfigurator.Configure(); | ||
ServiceLocatorInitializer.Init(); | ||
} | ||
} | ||
} |
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
Oops, something went wrong.