├── .editorconfig ├── .gitattributes ├── .gitignore ├── .vscode ├── launch.json ├── solution-explorer │ ├── class.cs-template │ ├── class.ts-template │ ├── class.vb-template │ ├── default.ts-template │ ├── enum.cs-template │ ├── interface.cs-template │ ├── interface.ts-template │ ├── template-list.json │ └── template-parameters.js └── tasks.json ├── Artefacts ├── Documentation │ ├── ExampleConventionDbSchema.png │ ├── Logo.bmp │ ├── Logo_100x100.png │ ├── Makefile │ ├── icon.png │ ├── make.bat │ ├── requirements.txt │ ├── sharp_arch.jpg │ └── source │ │ ├── .vscode │ │ └── settings.json │ │ ├── _static │ │ ├── Logo.bmp │ │ ├── Logo_100x100.png │ │ ├── ProjectArchitecture.PNG │ │ ├── favicon.ico │ │ └── sharp_arch.jpg │ │ ├── additional-resources │ │ └── additional-information.rst │ │ ├── conf.py │ │ ├── general │ │ ├── acknowledgment.rst │ │ ├── architecture.rst │ │ ├── frequently-asked-questions.rst │ │ ├── overview.rst │ │ └── unitofwork.rst │ │ ├── getting started │ │ ├── installation.rst │ │ └── simple-crud-application.rst │ │ ├── index.rst │ │ ├── nhibernate │ │ ├── hilo-generator.rst │ │ ├── multiple-dbs.rst │ │ ├── nhibernate-configuration-cache.rst │ │ ├── nhibernate.rst │ │ ├── transaction.rst │ │ └── using-sharparchitecture-with-nhibernate.search-(lucene.net).rst │ │ ├── ravendb │ │ ├── ravendb.rst │ │ └── unitofwork.rst │ │ └── updating │ │ └── nuget.rst └── ReSharper │ └── Code-Styles │ ├── mspec_member_layout.xml │ └── resharper_style.xml ├── CONTRIBUTING.md ├── Directory.Build.props ├── Docker ├── create_database.sql └── start-mssql.ps1 ├── GitReleaseManager.yaml ├── GitVersion.yml ├── LICENSE ├── README.md ├── Samples ├── PostmanScripts │ └── Samples.postman_collection ├── Samples.sln ├── TardisBank │ ├── Common │ │ ├── AssemblyVersion.cs │ │ └── CommonAssemblyInfo.cs │ ├── Database │ │ ├── UnitTestGeneratedSchema.sql │ │ └── _placeholder.txt │ ├── README.md │ ├── Settings.StyleCop │ ├── Src │ │ ├── Settings.StyleCop │ │ ├── StyleCopCompatibleResharperCodeStyle.xml │ │ ├── Suteki.TardisBank.Api │ │ │ ├── Announcements │ │ │ │ ├── AnnouncementModel.cs │ │ │ │ └── NewAnnouncement.cs │ │ │ └── Suteki.TardisBank.Api.csproj │ │ ├── Suteki.TardisBank.Domain │ │ │ ├── Account.cs │ │ │ ├── Announcement.cs │ │ │ ├── CashWithdrawException.cs │ │ │ ├── Child.cs │ │ │ ├── Events │ │ │ │ ├── NewParentCreatedEvent.cs │ │ │ │ └── SendMessageEvent.cs │ │ │ ├── Interval.cs │ │ │ ├── Message.cs │ │ │ ├── Parent.cs │ │ │ ├── PaymentSchedule.cs │ │ │ ├── Suteki.TardisBank.Domain.csproj │ │ │ ├── TardisBankException.cs │ │ │ ├── Transaction.cs │ │ │ └── User.cs │ │ ├── Suteki.TardisBank.Infrastructure │ │ │ ├── Configuration │ │ │ │ └── AnnouncementMappingProfile.cs │ │ │ ├── NHibernateMaps │ │ │ │ ├── AccountMap.cs │ │ │ │ ├── AnnouncementMap.cs │ │ │ │ ├── AutoPersistenceModelGenerator.cs │ │ │ │ ├── AutomappingConfiguration.cs │ │ │ │ ├── ChildMap.cs │ │ │ │ ├── Conventions │ │ │ │ │ ├── CustomForeignKeyConvention.cs │ │ │ │ │ ├── HasManyConvention.cs │ │ │ │ │ ├── HasOneConvention.cs │ │ │ │ │ ├── JoinedSubClassConvention.cs │ │ │ │ │ ├── PrimaryKeyConvention.cs │ │ │ │ │ ├── ReferenceConvention.cs │ │ │ │ │ └── TableNameConvention.cs │ │ │ │ ├── MessageMap.cs │ │ │ │ ├── PaymentScheduleMap.cs │ │ │ │ ├── TransactionMap.cs │ │ │ │ └── UserMap.cs │ │ │ └── Suteki.TardisBank.Infrastructure.csproj │ │ ├── Suteki.TardisBank.Tasks │ │ │ ├── EmailService.cs │ │ │ ├── EventHandlers │ │ │ │ ├── SendMessageEmailHandler.cs │ │ │ │ └── SendRegistrationEmailHandler.cs │ │ │ ├── IHttpContextService.cs │ │ │ ├── IUserService.cs │ │ │ ├── SchedulerService.cs │ │ │ ├── Suteki.TardisBank.Tasks.csproj │ │ │ ├── TardisConfiguration.cs │ │ │ └── UserService.cs │ │ ├── Suteki.TardisBank.Tests │ │ │ ├── AssemblySetup.cs │ │ │ ├── Functional │ │ │ │ ├── AnnouncementControllerTests.cs │ │ │ │ └── Setup │ │ │ │ │ └── TestServerSetup.cs │ │ │ ├── Helpers │ │ │ │ ├── ActionResultExtensions.cs │ │ │ │ ├── DateFomatterTests.cs │ │ │ │ └── RunnableInDebugOnlyAttribute.cs │ │ │ ├── Hibernate.cfg.xml │ │ │ ├── Model │ │ │ │ ├── ChildTests.cs │ │ │ │ ├── MakePaymentTests.cs │ │ │ │ ├── MessageCountLimitTests.cs │ │ │ │ ├── MessageTests.cs │ │ │ │ ├── ParentTests.cs │ │ │ │ ├── PaymentSchedulingQueryTests.cs │ │ │ │ ├── PaymentSchedulingTests.cs │ │ │ │ ├── TransactionCountLimitTests.cs │ │ │ │ ├── TransientDatabaseSetup.cs │ │ │ │ ├── UserActivationTests.cs │ │ │ │ ├── UserTests.cs │ │ │ │ └── WithdrawlCashTests.cs │ │ │ ├── Services │ │ │ │ └── EmailServiceTests.cs │ │ │ ├── Suteki.TardisBank.Data │ │ │ │ └── NHibernateMaps │ │ │ │ │ └── MappingIntegrationTests.cs │ │ │ └── Suteki.TardisBank.Tests.csproj │ │ └── Suteki.TardisBank.WebApi │ │ │ ├── Controllers │ │ │ └── AnnouncementsController.cs │ │ │ ├── NHibernate.config │ │ │ ├── Program.cs │ │ │ ├── Startup.cs │ │ │ ├── Suteki.TardisBank.WebApi.csproj │ │ │ ├── appsettings.Development.json │ │ │ └── appsettings.json │ └── StyleCopCompatibleResharperCodeStyle.xml ├── TransactionAttribute │ ├── App │ │ ├── Controllers │ │ │ ├── GlobalController.cs │ │ │ └── OverridesController.cs │ │ ├── Program.cs │ │ ├── Startup.cs │ │ ├── Stubs │ │ │ └── TransactionManagerStub.cs │ │ ├── TransactionAttribute.WebApi.csproj │ │ ├── appsettings.Development.json │ │ └── appsettings.json │ └── Tests │ │ ├── Setup │ │ └── TestServerSetup.cs │ │ ├── TransactionAttribute.Tests.csproj │ │ └── UnitOfWorkAttributeOverrideTests.cs ├── _placeholder.txt └── old │ └── TardisBank │ ├── .gitignore │ ├── README │ └── Solutions │ └── Suteki.TardisBank.Web.Mvc │ ├── 404Error.htm │ ├── App_Start │ ├── BundleConfig.cs │ ├── FilterConfig.cs │ ├── MappingConfiguration.cs │ ├── RouteConfig.cs │ └── WebApiConfig.cs │ ├── CastleWindsor │ ├── HandlerInstaller.cs │ ├── HttpControllersInstaller.cs │ ├── MediatorInstaller.cs │ ├── MvcControllersInstaller.cs │ ├── MvcGooInstaller.cs │ ├── MvcServiceLocator.cs │ ├── NHibernateInstaller.cs │ ├── QueriesInstaller.cs │ ├── RepositoriesInstaller.cs │ ├── ServicesInstaller.cs │ └── SharpArchInstaller.cs │ ├── Content │ ├── 960.css │ ├── Site.css │ ├── bootstrap-theme.css │ ├── bootstrap-theme.css.map │ ├── bootstrap-theme.min.css │ ├── bootstrap-theme.min.css.map │ ├── bootstrap.css │ ├── bootstrap.css.map │ ├── bootstrap.min.css │ ├── bootstrap.min.css.map │ ├── font-awesome.css │ ├── font-awesome.min.css │ ├── images │ │ ├── TardisBankLogo_128.png │ │ ├── TardisBankLogo_16.png │ │ ├── TardisBankLogo_32.png │ │ ├── TardisBankLogo_64.png │ │ ├── TardisBankLogo_75.png │ │ ├── TardisBankLogo_Shadow.png │ │ ├── TardisBankLogo_ShadowWhite.png │ │ ├── Thumbs.db │ │ ├── hover.gif │ │ ├── meandleo.jpg │ │ ├── meandleo.png │ │ ├── seperator.gif │ │ └── title_background.png │ ├── img │ │ ├── sharp_arch.jpg │ │ └── sharp_arch_small.gif │ ├── menu_style.css │ ├── reset.css │ ├── text.css │ └── themes │ │ ├── base │ │ ├── accordion.css │ │ ├── all.css │ │ ├── autocomplete.css │ │ ├── base.css │ │ ├── button.css │ │ ├── core.css │ │ ├── datepicker.css │ │ ├── dialog.css │ │ ├── draggable.css │ │ ├── images │ │ │ ├── ui-bg_flat_0_aaaaaa_40x100.png │ │ │ ├── ui-bg_flat_75_ffffff_40x100.png │ │ │ ├── ui-bg_glass_55_fbf9ee_1x400.png │ │ │ ├── ui-bg_glass_65_ffffff_1x400.png │ │ │ ├── ui-bg_glass_75_dadada_1x400.png │ │ │ ├── ui-bg_glass_75_e6e6e6_1x400.png │ │ │ ├── ui-bg_glass_95_fef1ec_1x400.png │ │ │ ├── ui-bg_highlight-soft_75_cccccc_1x100.png │ │ │ ├── ui-icons_222222_256x240.png │ │ │ ├── ui-icons_2e83ff_256x240.png │ │ │ ├── ui-icons_444444_256x240.png │ │ │ ├── ui-icons_454545_256x240.png │ │ │ ├── ui-icons_555555_256x240.png │ │ │ ├── ui-icons_777620_256x240.png │ │ │ ├── ui-icons_777777_256x240.png │ │ │ ├── ui-icons_888888_256x240.png │ │ │ ├── ui-icons_cc0000_256x240.png │ │ │ ├── ui-icons_cd0a0a_256x240.png │ │ │ └── ui-icons_ffffff_256x240.png │ │ ├── jquery-ui.css │ │ ├── jquery-ui.min.css │ │ ├── menu.css │ │ ├── progressbar.css │ │ ├── resizable.css │ │ ├── selectable.css │ │ ├── selectmenu.css │ │ ├── slider.css │ │ ├── sortable.css │ │ ├── spinner.css │ │ ├── tabs.css │ │ ├── theme.css │ │ └── tooltip.css │ │ └── cupertino │ │ ├── images │ │ ├── ui-bg_diagonals-thick_90_eeeeee_40x40.png │ │ ├── ui-bg_flat_15_cd0a0a_40x100.png │ │ ├── ui-bg_glass_100_e4f1fb_1x400.png │ │ ├── ui-bg_glass_50_3baae3_1x400.png │ │ ├── ui-bg_glass_80_d7ebf9_1x400.png │ │ ├── ui-bg_highlight-hard_100_f2f5f7_1x100.png │ │ ├── ui-bg_highlight-hard_70_000000_1x100.png │ │ ├── ui-bg_highlight-soft_100_deedf7_1x100.png │ │ ├── ui-bg_highlight-soft_25_ffef8f_1x100.png │ │ ├── ui-icons_2694e8_256x240.png │ │ ├── ui-icons_2e83ff_256x240.png │ │ ├── ui-icons_3d80b3_256x240.png │ │ ├── ui-icons_72a7cf_256x240.png │ │ └── ui-icons_ffffff_256x240.png │ │ ├── jquery-ui.cupertino.css │ │ └── jquery-ui.cupertino.min.css │ ├── Controllers │ ├── AccountController.cs │ ├── AdminController.cs │ ├── AnalyticsController.cs │ ├── AnnouncementsController.cs │ ├── ChildController.cs │ ├── HomeController.cs │ ├── MenuController.cs │ ├── NewsController.cs │ ├── PasswordController.cs │ ├── ScheduleController.cs │ ├── ScheduleRunnerController.cs │ ├── UserController.cs │ └── ViewModels │ │ ├── AccountSummaryViewModel.cs │ │ ├── AddScheduleViewModel.cs │ │ ├── ChangePasswordViewModel.cs │ │ ├── DeleteChildConfirmViewModel.cs │ │ ├── ForgottenPasswordViewModel.cs │ │ ├── LoginViewModel.cs │ │ ├── MakePaymentViewModel.cs │ │ ├── RegistrationViewModel.cs │ │ ├── UserViewModel.cs │ │ ├── WithdrawCashForChildViewModel.cs │ │ └── WithdrawCashViewModel.cs │ ├── GenericError.htm │ ├── Global.asax │ ├── Global.asax.cs │ ├── Icon.png │ ├── Models │ ├── AnnouncementModel.cs │ └── News │ │ └── NewsListModel.cs │ ├── NHibernate.config │ ├── Properties │ └── AssemblyInfo.cs │ ├── README.txt │ ├── Scripts │ ├── _references.js │ ├── app │ │ ├── common.js │ │ ├── news.edit.js │ │ └── news.view.js │ ├── bootstrap.js │ ├── bootstrap.min.js │ ├── jquery-3.1.1.intellisense.js │ ├── jquery-3.1.1.js │ ├── jquery-3.1.1.min.js │ ├── jquery-3.1.1.min.map │ ├── jquery-3.1.1.slim.js │ ├── jquery-3.1.1.slim.min.js │ ├── jquery-3.1.1.slim.min.map │ ├── jquery-ui-1.12.1.js │ ├── jquery-ui-1.12.1.min.js │ ├── jquery.validate-vsdoc.js │ ├── jquery.validate.js │ ├── jquery.validate.min.js │ ├── jquery.validate.unobtrusive.js │ ├── jquery.validate.unobtrusive.min.js │ ├── jsrender.js │ ├── modernizr-2.8.3.js │ ├── respond.js │ ├── respond.matchmedia.addListener.js │ ├── respond.matchmedia.addListener.min.js │ └── respond.min.js │ ├── Suteki.TardisBank.Web.Mvc.csproj │ ├── Utilities │ ├── Current.cs │ ├── DateFormatter.cs │ ├── FormsAuthenticationService.cs │ ├── HttpContextService.cs │ ├── StatusCode.cs │ ├── StringExtensions.cs │ └── UserLocaleModule.cs │ ├── Views │ ├── Account │ │ ├── MakePayment.cshtml │ │ ├── PaymentConfirmation.cshtml │ │ ├── Summary.cshtml │ │ ├── WithdrawCash.cshtml │ │ ├── WithdrawCashConfirm.cshtml │ │ ├── WithdrawCashForChild.cshtml │ │ └── WithdrawCashForChildConfirm.cshtml │ ├── Admin │ │ ├── ChangePassword.cshtml │ │ ├── DeleteParentConfirm.cshtml │ │ └── Index.cshtml │ ├── Analytics │ │ └── Index.cshtml │ ├── Child │ │ ├── DeleteChild.cshtml │ │ └── Index.cshtml │ ├── Home │ │ ├── About.cshtml │ │ ├── Index.cshtml │ │ └── Legal.cshtml │ ├── Menu │ │ ├── ChildMenu.cshtml │ │ ├── GuestMenu.cshtml │ │ └── ParentMenu.cshtml │ ├── News │ │ ├── Edit.cshtml │ │ └── Index.cshtml │ ├── Openid │ │ ├── Index.cshtml │ │ └── Login.cshtml │ ├── Password │ │ ├── ChildConfirm.cshtml │ │ ├── Forgot.cshtml │ │ └── ParentConfirm.cshtml │ ├── Schedule │ │ ├── AddSchedule.cshtml │ │ └── AddScheduleConfirm.cshtml │ ├── Shared │ │ ├── SiteLayout.cshtml │ │ └── _Layout.cshtml │ ├── User │ │ ├── ActivateConfirm.cshtml │ │ ├── ActivationFailed.cshtml │ │ ├── AddChild.cshtml │ │ ├── Confirm.cshtml │ │ ├── DisplayGreeting.cshtml │ │ ├── Login.cshtml │ │ ├── Messages.cshtml │ │ └── Register.cshtml │ ├── Web.config │ └── _ViewStart.cshtml │ ├── Web.Debug.config │ ├── Web.Release.config │ ├── Web.config │ ├── WebApi │ └── ValidateModel.cs │ ├── favicon.ico │ ├── favicon.png │ ├── fonts │ ├── FontAwesome.otf │ ├── fontawesome-webfont.eot │ ├── fontawesome-webfont.svg │ ├── fontawesome-webfont.ttf │ ├── fontawesome-webfont.woff │ ├── fontawesome-webfont.woff2 │ ├── glyphicons-halflings-regular.eot │ ├── glyphicons-halflings-regular.svg │ ├── glyphicons-halflings-regular.ttf │ ├── glyphicons-halflings-regular.woff │ └── glyphicons-halflings-regular.woff2 │ └── packages.config ├── SharpArch.AutoLoad.DotSettings ├── SharpArchitecture.code-workspace ├── Src ├── Common │ └── NHibernate │ │ └── TestDatabaseSetup.cs ├── Directory.Build.props ├── SharpArch.Domain │ ├── DomainModel │ │ ├── BaseObject.cs │ │ ├── BaseObjectEqualityComparer.cs │ │ ├── DomainSignatureAttribute.cs │ │ ├── Entity.cs │ │ ├── IEntity.cs │ │ ├── IHasAssignedId.cs │ │ ├── ValidatableObject.cs │ │ └── ValueObject.cs │ ├── Enums.cs │ ├── PersistenceSupport │ │ ├── IEntityDuplicateChecker.cs │ │ ├── ILinqRepository.cs │ │ ├── IRepository.cs │ │ ├── ISupportsTransactionStatus.cs │ │ ├── ITransactionManager.cs │ │ └── RepositoryExtensions.cs │ ├── Reflection │ │ ├── ITypePropertyDescriptorCache.cs │ │ ├── TypePropertyDescriptor.cs │ │ └── TypePropertyDescriptorCache.cs │ ├── SharpArch.Domain.csproj │ ├── Specifications │ │ ├── AdHoc.cs │ │ ├── ILinqSpecification.cs │ │ ├── ISpecification.cs │ │ ├── QuerySpecification.cs │ │ └── QuerySpecificationExtensions.cs │ └── Validation │ │ ├── HasUniqueDomainSignatureAttribute.cs │ │ └── HasUniqueDomainSignatureAttributeBase.cs ├── SharpArch.Infrastructure │ ├── CodeBaseLocator.cs │ ├── Logging │ │ ├── EnabledLogLevel.cs │ │ └── EnabledLogger.cs │ └── SharpArch.Infrastructure.csproj ├── SharpArch.NHibernate.DependencyInjection │ ├── NHibernateRegistrationExtensions.cs │ └── SharpArch.NHibernate.Extensions.DependencyInjection.csproj ├── SharpArch.NHibernate │ ├── Contracts │ │ └── Repositories │ │ │ └── INHibernateRepository.cs │ ├── EntityDuplicateChecker.cs │ ├── FluentNHibernate │ │ ├── AutomappingConfiguration.cs │ │ ├── Conventions │ │ │ ├── CustomForeignKeyConvention.cs │ │ │ ├── HasManyConvention.cs │ │ │ ├── PrimaryKeyConvention.cs │ │ │ └── TableNameConvention.cs │ │ ├── FluentNHibernateExtensions.cs │ │ ├── GeneratorHelper.cs │ │ ├── IAutoPersistenceModelGenerator.cs │ │ └── IMapGenerator.cs │ ├── INHibernateTransactionManager.cs │ ├── ISessionFactoryKeyProvider.cs │ ├── LinqRepository.cs │ ├── LockModeConvertExtensions.cs │ ├── NHibernateQuery.cs │ ├── NHibernateRepositoryBase.cs │ ├── NHibernateSessionFactoryBuilder.cs │ ├── NHibernateValidator │ │ └── DataAnnotationsEventListener.cs │ ├── SessionExtensions.cs │ ├── SharpArch.NHibernate.csproj │ └── TransactionManager.cs ├── SharpArch.RavenDb │ ├── Contracts │ │ └── Repositories │ │ │ └── IRavenDbRepository.cs │ ├── RavenDbRepository.cs │ ├── SharpArch.RavenDb.csproj │ └── TransactionManager.cs ├── SharpArch.Testing.NUnit │ ├── NHibernate │ │ ├── DatabaseRepositoryTestsBase.cs │ │ └── RepositoryTestsBase.cs │ └── SharpArch.Testing.NUnit.csproj ├── SharpArch.Testing.Xunit.NHibernate │ ├── LiveDatabaseTests.cs │ ├── SharpArch.Testing.Xunit.NHibernate.csproj │ └── TransientDatabaseTests.cs ├── SharpArch.Testing.Xunit │ ├── SetCultureAttribute.cs │ └── SharpArch.Testing.Xunit.csproj ├── SharpArch.Testing │ ├── Helpers │ │ └── EntityIdSetter.cs │ └── SharpArch.Testing.csproj ├── SharpArch.Web.AspNetCore │ ├── SharpArch.Web.AspNetCore.csproj │ └── Transaction │ │ ├── ApplyTransactionFilterBase.cs │ │ ├── AutoTransactionHandler.cs │ │ └── TransactionAttribute.cs ├── SharpArch.sln ├── SharpArch.sln.DotSettings ├── Tests │ ├── SharpArch.Tests.NHibernate │ │ ├── HasUniqieDomainSignatureTestsBase.cs │ │ ├── HasUniqueDomainSignatureValidatorTests.cs │ │ ├── Mappings │ │ │ └── AutoPersistenceModelGenerator.cs │ │ ├── NHibernateSessionFactoryBuilderTests.cs │ │ ├── PreInsertlistener.cs │ │ ├── RepositoryTests.cs │ │ ├── SharpArch.Tests.NHibernate.csproj │ │ ├── hibernate.cfg.xml │ │ └── sqlite-nhibernate-config.xml │ ├── SharpArch.XunitTests.NHibernate │ │ ├── HasUniqieDomainSignatureTestsBase.cs │ │ ├── HasUniqueDomainSignatureValidatorTests.cs │ │ ├── Mappings │ │ │ └── TestsPersistenceModelGenerator.cs │ │ ├── NHibernateRepositoryTests.cs │ │ ├── NHibernateTestsSetup.cs │ │ ├── PreInsertlistener.cs │ │ ├── RepositoryTests.cs │ │ ├── SharpArch.XunitTests.NHibernate.csproj │ │ └── sqlite-nhibernate-config.xml │ └── SharpArch.XunitTests │ │ ├── Helpers │ │ └── ITestService.cs │ │ ├── SharpArch.Domain │ │ ├── DataAnnotationsValidator │ │ │ └── HasUniqueEntitySignatureValidatorTests.cs │ │ ├── DomainModel │ │ │ ├── BaseObjectEqualityComparerTests.cs │ │ │ ├── EntityTests.cs │ │ │ └── ValueObjectTests.cs │ │ ├── Reflection │ │ │ └── TypePropertyDescriptorCacheTests.cs │ │ └── TestEntities.cs │ │ ├── SharpArch.Infrastructure │ │ └── CodeBaseLocatorTests.cs │ │ └── SharpArch.XunitTests.csproj ├── dupFinder.config └── global.json ├── VersionHistory.txt ├── appveyor.yml ├── build.cake ├── build.sh ├── dotnet-install.ps1 ├── dotnet-install.sh ├── global.json ├── mssql-setup.ps1 └── readthedocs.yml /.gitattributes: -------------------------------------------------------------------------------- 1 | *.DotSettings eol=lf 2 | *.sh text eol=lf 3 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to find out which attributes exist for C# debugging 3 | // Use hover for the description of the existing attributes 4 | // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md 5 | "version": "0.2.0", 6 | "configurations": [ 7 | ] 8 | } -------------------------------------------------------------------------------- /.vscode/solution-explorer/class.cs-template: -------------------------------------------------------------------------------- 1 | namespace {{namespace}} 2 | { 3 | using System; 4 | 5 | /// 6 | /// {{name}} description. 7 | /// 8 | public class {{name}} 9 | { 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /.vscode/solution-explorer/class.ts-template: -------------------------------------------------------------------------------- 1 | export class {{name}} { 2 | 3 | } -------------------------------------------------------------------------------- /.vscode/solution-explorer/class.vb-template: -------------------------------------------------------------------------------- 1 | Imports System 2 | 3 | Namespace {{namespace}} 4 | 5 | Public Class {{name}} 6 | 7 | End Class 8 | 9 | End Namespace 10 | -------------------------------------------------------------------------------- /.vscode/solution-explorer/default.ts-template: -------------------------------------------------------------------------------- 1 | export default {{name}} { 2 | 3 | } -------------------------------------------------------------------------------- /.vscode/solution-explorer/enum.cs-template: -------------------------------------------------------------------------------- 1 | namespace {{namespace}} 2 | { 3 | using System; 4 | 5 | /// 6 | /// {{name}} description. 7 | /// 8 | public enum {{name}} 9 | { 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /.vscode/solution-explorer/interface.cs-template: -------------------------------------------------------------------------------- 1 | namespace {{namespace}} 2 | { 3 | using System; 4 | 5 | /// 6 | /// {{name}} description. 7 | /// 8 | public interface {{name}} 9 | { 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /.vscode/solution-explorer/interface.ts-template: -------------------------------------------------------------------------------- 1 | export interface {{name}} { 2 | 3 | } -------------------------------------------------------------------------------- /.vscode/solution-explorer/template-list.json: -------------------------------------------------------------------------------- 1 | { 2 | "templates": [ 3 | { 4 | "name": "Class", 5 | "extension": "cs", 6 | "file": "./class.cs-template", 7 | "parameters": "./template-parameters.js" 8 | }, 9 | { 10 | "name": "Interface", 11 | "extension": "cs", 12 | "file": "./interface.cs-template", 13 | "parameters": "./template-parameters.js" 14 | }, 15 | { 16 | "name": "Enum", 17 | "extension": "cs", 18 | "file": "./enum.cs-template", 19 | "parameters": "./template-parameters.js" 20 | }, 21 | { 22 | "name": "Class", 23 | "extension": "ts", 24 | "file": "./class.ts-template", 25 | "parameters": "./template-parameters.js" 26 | }, 27 | { 28 | "name": "Interface", 29 | "extension": "ts", 30 | "file": "./interface.ts-template", 31 | "parameters": "./template-parameters.js" 32 | }, 33 | { 34 | "name": "Default", 35 | "extension": "ts", 36 | "file": "./default.ts-template", 37 | "parameters": "./template-parameters.js" 38 | }, 39 | { 40 | "name": "Class", 41 | "extension": "vb", 42 | "file": "./class.vb-template", 43 | "parameters": "./template-parameters.js" 44 | } 45 | ] 46 | } -------------------------------------------------------------------------------- /.vscode/solution-explorer/template-parameters.js: -------------------------------------------------------------------------------- 1 | var path = require("path"); 2 | 3 | module.exports = function(filename, projectPath, folderPath) { 4 | var namespace = "Unknown"; 5 | if (projectPath) { 6 | namespace = path.basename(projectPath, path.extname(projectPath)); 7 | if (folderPath) { 8 | namespace += "." + folderPath.replace(path.dirname(projectPath), "").substring(1).replace(/[\\\/]/g, "."); 9 | } 10 | namespace = namespace.replace(/[\\\-]/g, "_"); 11 | } 12 | 13 | return { 14 | namespace: namespace, 15 | name: path.basename(filename, path.extname(filename)) 16 | } 17 | }; -------------------------------------------------------------------------------- /.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0.0", 3 | "tasks": [ 4 | { 5 | "label": "build", 6 | "command": "dotnet", 7 | "type": "process", 8 | "args": [ 9 | "build", 10 | "${workspaceFolder}/Src/SharpArch.sln", 11 | "/property:GenerateFullPaths=true", 12 | "/consoleloggerparameters:NoSummary" 13 | ], 14 | "problemMatcher": "$msCompile" 15 | }, 16 | { 17 | "label": "test", 18 | "command": "dotnet", 19 | "type": "shell", 20 | "group": "test", 21 | "args": [ 22 | "test", 23 | "${workspaceFolder}/Src/SharpArch.sln" 24 | ], 25 | "presentation": { 26 | "reveal": "silent" 27 | }, 28 | "problemMatcher": "$msCompile" 29 | } 30 | ] 31 | } 32 | -------------------------------------------------------------------------------- /Artefacts/Documentation/ExampleConventionDbSchema.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharparchitecture/Sharp-Architecture/1003810562889c4b79a3f8f00f9dd297c787822e/Artefacts/Documentation/ExampleConventionDbSchema.png -------------------------------------------------------------------------------- /Artefacts/Documentation/Logo.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharparchitecture/Sharp-Architecture/1003810562889c4b79a3f8f00f9dd297c787822e/Artefacts/Documentation/Logo.bmp -------------------------------------------------------------------------------- /Artefacts/Documentation/Logo_100x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharparchitecture/Sharp-Architecture/1003810562889c4b79a3f8f00f9dd297c787822e/Artefacts/Documentation/Logo_100x100.png -------------------------------------------------------------------------------- /Artefacts/Documentation/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharparchitecture/Sharp-Architecture/1003810562889c4b79a3f8f00f9dd297c787822e/Artefacts/Documentation/icon.png -------------------------------------------------------------------------------- /Artefacts/Documentation/requirements.txt: -------------------------------------------------------------------------------- 1 | Pygments==2.3.1 2 | setuptools==41.0.1 3 | docutils==0.14 4 | mock==1.0.1 5 | pillow==5.4.1 6 | alabaster>=0.7,<0.8,!=0.7.5 7 | commonmark==0.8.1 8 | recommonmark==0.5.0 9 | sphinx<2 10 | sphinx-rtd-theme<0.5 11 | readthedocs-sphinx-ext<1.1 12 | sphinx-markdown-builder==0.5.3 13 | -------------------------------------------------------------------------------- /Artefacts/Documentation/sharp_arch.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharparchitecture/Sharp-Architecture/1003810562889c4b79a3f8f00f9dd297c787822e/Artefacts/Documentation/sharp_arch.jpg -------------------------------------------------------------------------------- /Artefacts/Documentation/source/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "restructuredtext.confPath": "d:\\Work\\vk\\Projects\\Sharp-Architecture\\Artefacts\\Documentation\\source" 3 | } -------------------------------------------------------------------------------- /Artefacts/Documentation/source/_static/Logo.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharparchitecture/Sharp-Architecture/1003810562889c4b79a3f8f00f9dd297c787822e/Artefacts/Documentation/source/_static/Logo.bmp -------------------------------------------------------------------------------- /Artefacts/Documentation/source/_static/Logo_100x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharparchitecture/Sharp-Architecture/1003810562889c4b79a3f8f00f9dd297c787822e/Artefacts/Documentation/source/_static/Logo_100x100.png -------------------------------------------------------------------------------- /Artefacts/Documentation/source/_static/ProjectArchitecture.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharparchitecture/Sharp-Architecture/1003810562889c4b79a3f8f00f9dd297c787822e/Artefacts/Documentation/source/_static/ProjectArchitecture.PNG -------------------------------------------------------------------------------- /Artefacts/Documentation/source/_static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharparchitecture/Sharp-Architecture/1003810562889c4b79a3f8f00f9dd297c787822e/Artefacts/Documentation/source/_static/favicon.ico -------------------------------------------------------------------------------- /Artefacts/Documentation/source/_static/sharp_arch.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharparchitecture/Sharp-Architecture/1003810562889c4b79a3f8f00f9dd297c787822e/Artefacts/Documentation/source/_static/sharp_arch.jpg -------------------------------------------------------------------------------- /Artefacts/Documentation/source/general/acknowledgment.rst: -------------------------------------------------------------------------------- 1 | ############### 2 | Acknowledgments 3 | ############### 4 | 5 | Sharp Architecture attempts to represent the combined wisdom of many 6 | software development giants. Included patterns and algorithms reflect 7 | best practices described by the GoF, Martin Fowler, Uncle Bob Martin, 8 | Steve McConnell, many gurus in the blogosphere and other industry 9 | leaders. Many have been personally involved with helping to shape S#arp 10 | Architecture's current form including and in no paticular order: Alec 11 | Whittington, Chris Richards, Seif Attar, Jon George, Howard van Rooijen, 12 | Billy McCafferty, Frank Laub, Kyle "the coding hillbilly" Baley, Simone 13 | Busoli, Jay Oliver, Lee Carter, Luis Abreu, James Gregory, Vitaliy Kryvosheiev 14 | and Martin Hornagold ... along with many others who have asked WTF at all the right 15 | times. A special thanks to Roy Bradley who was brave crazy enough to 16 | commission Billy to develop the first version 0.1. Finally, none of this 17 | would have been possible and/or applicable without the tireless, unpaid 18 | efforts of the teams behind projects such as NHibernate, Fluent 19 | NHibernate, NHibernate Validator, MvcContrib, and Castle. 20 | -------------------------------------------------------------------------------- /Artefacts/Documentation/source/general/unitofwork.rst: -------------------------------------------------------------------------------- 1 | Unit of Work 2 | ============ 3 | 4 | `Unit of work `_ pattern for ASP.NET MVC is implemented 5 | using combination of TransactionAttribute and UnitOfWorkHandler. 6 | 7 | TransactionAttribute is used to configure unit of work for controller action, no actual transaction management 8 | is implemented by it. 9 | 10 | It configures following parameters: 11 | 12 | - isolation level; 13 | - whether transaction is committed or rolled back in case of model validation error; 14 | 15 | UnitOfWorkHandler is a `MVC ActionFilter `_ 16 | which is used to wrap Controller action in transaction. 17 | 18 | Best practices 19 | -------------- 20 | 21 | - Apply TransactionAttribute at *controller* or *action* level. 22 | Applying it globally will cause transaction open on every request. 23 | - Register UnitOfWorkHandler globally. 24 | This class is stateless, using it as a singleton will reduce memory allocation count and improve performance. 25 | 26 | -------------------------------------------------------------------------------- /Artefacts/Documentation/source/index.rst: -------------------------------------------------------------------------------- 1 | .. S#arp Architecture documentation master file, created by 2 | sphinx-quickstart on Thu Oct 04 22:38:57 2012. 3 | You can adapt this file completely to your liking, but it should at least 4 | contain the root `toctree` directive. 5 | 6 | .. image:: _static/sharp_arch.jpg 7 | 8 | S#arp Architecture 9 | ================== 10 | 11 | If you're getting into S#arp Architecture for the first time, there's a bit of 12 | learning and background materials to digest. This is the place to start! Follow the 13 | documentation links below from top to bottom to get a firm understanding of 14 | S#arp Architecture and to get yourself fully qualified to develop your own S#arp project. 15 | 16 | General 17 | ------- 18 | 19 | .. toctree:: 20 | :maxdepth: 3 21 | 22 | general/overview 23 | general/acknowledgment 24 | general/frequently-asked-questions 25 | general/architecture 26 | 27 | Getting started 28 | --------------- 29 | .. toctree:: 30 | :maxdepth: 3 31 | 32 | getting started/installation 33 | getting started/simple-crud-application 34 | 35 | Updating 36 | -------- 37 | .. toctree:: 38 | :maxdepth: 3 39 | 40 | updating/nuget 41 | 42 | Features 43 | -------- 44 | .. toctree:: 45 | :maxdepth: 3 46 | 47 | nhibernate/nhibernate 48 | ravendb/ravendb 49 | 50 | Additional resources 51 | -------------------- 52 | .. toctree:: 53 | :maxdepth: 3 54 | 55 | additional-resources/additional-information 56 | -------------------------------------------------------------------------------- /Artefacts/Documentation/source/nhibernate/hilo-generator.rst: -------------------------------------------------------------------------------- 1 | NHibernate HiLo Generator 2 | ========================= 3 | 4 | Why use HiLo 5 | ------------ 6 | 7 | HiLo identity generators allow NHibernate to generate identity values to map child objects to their parent without having to hit the database as opposed to using the native identity generation causes nhibernate to hit the database on every save, which affects performance and running of batch statements. 8 | 9 | For more information on generator behaviours refer to `this `_ blog post by Fabio Maulo. 10 | 11 | Using HiLo Id generation 12 | ------------------------ 13 | In your Infrastructure project, under NHibernateMaps: 14 | 15 | .. code-block:: C# 16 | 17 | public class PrimaryKeyConvention : IIdConvention 18 | { 19 | public void Apply(FluentNHibernate.Conventions.Instances.IIdentityInstance instance) 20 | { 21 | instance.Column(instance.EntityType.Name + "Id"); 22 | instance.UnsavedValue("0"); 23 | instance.GeneratedBy.HiLo("1000"); 24 | } 25 | } 26 | 27 | Create the following table: 28 | 29 | .. code-block:: sql 30 | 31 | CREATE TABLE [dbo].[hibernate_unique_key]( 32 | [next_hi] [int] NOT NULL 33 | ) ON [PRIMARY] 34 | 35 | Populate the column with a number to seed and you're done. 36 | -------------------------------------------------------------------------------- /Artefacts/Documentation/source/nhibernate/nhibernate.rst: -------------------------------------------------------------------------------- 1 | ########## 2 | NHibernate 3 | ########## 4 | 5 | .. toctree:: 6 | 7 | transaction.rst 8 | hilo-generator.rst 9 | nhibernate-configuration-cache.rst 10 | multiple-dbs.rst 11 | using-sharparchitecture-with-nhibernate.search-(lucene.net).rst -------------------------------------------------------------------------------- /Artefacts/Documentation/source/nhibernate/transaction.rst: -------------------------------------------------------------------------------- 1 | Using Unit of Work with NHibernate 2 | ================================ 3 | 4 | TransactionAttribute implements Unit of work pattern for ASP.NET MVC and ASP.NET WebAPI controller. 5 | 6 | See ::doc:`/../general/unitofwork.rst` 7 | 8 | Please refer to Samples/SharpArch.WebAPI for details. 9 | 10 | **TODO:** update documentation. 11 | -------------------------------------------------------------------------------- /Artefacts/Documentation/source/ravendb/ravendb.rst: -------------------------------------------------------------------------------- 1 | ####### 2 | RavenDB 3 | ####### 4 | 5 | RavenDB support was added in version 2.1, for sample usage checkout the `SharpArch.TardisBank solution `_ which is a fork of `Mike Hadlow's Suteki.TardisBank `_ that was converted to use S#arp Architecture with NHibernate and then converted to work with S#arp Architecture's RavenDB. 6 | 7 | The repostiory shows usage of various features of S#arp Architecture, and is a work in progress for a good sample project. 8 | 9 | You can start with RavenDB by following the installation steps and using the RavenDB templify template from `S#arp Architecture releases `_. 10 | 11 | The RavenDB feature provides generic repositories for use with RavenDB and a UnitOfWork attribute, you can learn more about the UnitOfWorkAttribute by following the link below. 12 | 13 | .. toctree:: 14 | 15 | unitofwork.rst 16 | 17 | -------------------------------------------------------------------------------- /Artefacts/Documentation/source/ravendb/unitofwork.rst: -------------------------------------------------------------------------------- 1 | #################### 2 | UnitOfWork attribute 3 | #################### 4 | 5 | With the RavenDB client, changes are not persisted until SaveChanges is called on the RavenDB session. With S#arp Architecture's implementaion of the RavenDB repository, the changes are not persisted on each call, in order to allow for multiple changes to happen per request with all of them being atomic, so that a later error within the request would not leave you application in an inconsitant state. 6 | 7 | The UnitOfWorkAttribute should be added to all controller actions where changes are being made to RavenDB, otherwise the changes would not be persisted (unless you get hold of the session and call save changed youself). 8 | 9 | RavenDB provides does provide DTC transactions, but the UnitOfWork attribute only uses RavenDB's standard transactions based on the SaveChanges call. 10 | 11 | If you want more information about transactions in RavenDB, refer to `RavenDB transaction support page `_. 12 | -------------------------------------------------------------------------------- /Docker/create_database.sql: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharparchitecture/Sharp-Architecture/1003810562889c4b79a3f8f00f9dd297c787822e/Docker/create_database.sql -------------------------------------------------------------------------------- /Docker/start-mssql.ps1: -------------------------------------------------------------------------------- 1 | docker.exe run --name sharparch-sql -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=Password12!' -p 2433:1433 -d -v./mssql-data:/var/opt/mssql/data mcr.microsoft.com/mssql/server:2017-latest-ubuntu -------------------------------------------------------------------------------- /GitVersion.yml: -------------------------------------------------------------------------------- 1 | # assembly-file-versioning-scheme: MajorMinorPatch 2 | branches: 3 | release: 4 | mode: ContinuousDeployment 5 | tag: rc 6 | develop: 7 | mode: ContinuousDeployment 8 | tag: alpha 9 | ignore: 10 | sha: [] 11 | 12 | -------------------------------------------------------------------------------- /Samples/PostmanScripts/Samples.postman_collection: -------------------------------------------------------------------------------- 1 | { 2 | "info": { 3 | "_postman_id": "ace5c2e3-c477-4f92-99f2-758e4b72a577", 4 | "name": "WebApi", 5 | "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" 6 | }, 7 | "item": [ 8 | { 9 | "name": "ActionLevelOverride", 10 | "request": { 11 | "method": "GET", 12 | "header": [], 13 | "body": {}, 14 | "url": { 15 | "raw": "{{WebApiHost}}/api/overrides/local", 16 | "host": [ 17 | "{{WebApiHost}}" 18 | ], 19 | "path": [ 20 | "api", 21 | "overrides", 22 | "local" 23 | ] 24 | } 25 | }, 26 | "response": [] 27 | }, 28 | { 29 | "name": "ControllerLevelOverride", 30 | "request": { 31 | "method": "GET", 32 | "header": [], 33 | "body": {}, 34 | "url": { 35 | "raw": "{{WebApiHost}}/api/overrides/controller", 36 | "host": [ 37 | "{{WebApiHost}}" 38 | ], 39 | "path": [ 40 | "api", 41 | "overrides", 42 | "controller" 43 | ] 44 | } 45 | }, 46 | "response": [] 47 | }, 48 | { 49 | "name": "Global default attribute", 50 | "request": { 51 | "method": "GET", 52 | "header": [], 53 | "body": {}, 54 | "url": { 55 | "raw": "{{WebApiHost}}/api/global/default", 56 | "host": [ 57 | "{{WebApiHost}}" 58 | ], 59 | "path": [ 60 | "api", 61 | "global", 62 | "default" 63 | ] 64 | } 65 | }, 66 | "response": [] 67 | } 68 | ] 69 | } -------------------------------------------------------------------------------- /Samples/TardisBank/Common/AssemblyVersion.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | [assembly: System.Reflection.AssemblyFileVersion("1.0.0.0")] 12 | [assembly: System.Reflection.AssemblyInformationalVersion("1.0.0")] 13 | [assembly: System.Reflection.AssemblyVersion("1.0.0.0")] 14 | 15 | 16 | -------------------------------------------------------------------------------- /Samples/TardisBank/Common/CommonAssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | [assembly: AssemblyCompany("S#arp Architecture Development Team")] 5 | [assembly: AssemblyProduct("S#arp Architecture Template")] 6 | [assembly: AssemblyCopyright("Copyright � S#arp Architecture Development Team 2010")] 7 | [assembly: AssemblyTrademark("")] 8 | [assembly: AssemblyCulture("")] 9 | 10 | // Setting ComVisible to false makes the types in this assembly not visible 11 | // to COM components. If you need to access a type in this assembly from 12 | // COM, set the ComVisible attribute to true on that type. 13 | [assembly: ComVisible(false)] 14 | -------------------------------------------------------------------------------- /Samples/TardisBank/Database/_placeholder.txt: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /Samples/TardisBank/README.md: -------------------------------------------------------------------------------- 1 | # Tardis Bank 2 | -------------------------------------------------------------------------------- /Samples/TardisBank/Src/Suteki.TardisBank.Api/Announcements/AnnouncementModel.cs: -------------------------------------------------------------------------------- 1 | namespace Suteki.TardisBank.Api.Announcements 2 | { 3 | using System; 4 | using System.ComponentModel.DataAnnotations; 5 | using Newtonsoft.Json; 6 | 7 | 8 | /// 9 | /// Announcement summary model. 10 | /// 11 | public class AnnouncementSummary 12 | { 13 | [JsonProperty("id")] 14 | public int Id { get; set; } 15 | 16 | [JsonProperty("date")] 17 | [DataType(DataType.Date)] 18 | public DateTime Date { get; set; } 19 | 20 | [Required] 21 | [JsonProperty("title")] 22 | public string Title { get; set; } = null!; 23 | } 24 | 25 | 26 | /// 27 | /// Full announcement details. 28 | /// 29 | public class AnnouncementModel : AnnouncementSummary 30 | { 31 | [JsonProperty("content")] 32 | [Required] 33 | public string Content { get; set; } = null!; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Samples/TardisBank/Src/Suteki.TardisBank.Api/Announcements/NewAnnouncement.cs: -------------------------------------------------------------------------------- 1 | namespace Suteki.TardisBank.Api.Announcements 2 | { 3 | using System; 4 | using System.ComponentModel.DataAnnotations; 5 | using Newtonsoft.Json; 6 | 7 | 8 | public class NewAnnouncement 9 | { 10 | [JsonProperty("date")] 11 | [DataType(DataType.Date)] 12 | public DateTime Date { get; set; } 13 | 14 | [Required] 15 | [JsonProperty("title")] 16 | public string Title { get; set; } = null!; 17 | 18 | [JsonProperty("content")] 19 | [Required] 20 | public string Content { get; set; } = null!; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Samples/TardisBank/Src/Suteki.TardisBank.Api/Suteki.TardisBank.Api.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /Samples/TardisBank/Src/Suteki.TardisBank.Domain/Announcement.cs: -------------------------------------------------------------------------------- 1 | namespace Suteki.TardisBank.Domain 2 | { 3 | using System; 4 | using System.ComponentModel.DataAnnotations; 5 | using System.Diagnostics; 6 | using SharpArch.Domain.DomainModel; 7 | 8 | [DebuggerDisplay("{Id}: {Title}")] 9 | public class Announcement: Entity 10 | { 11 | public virtual DateTime Date { get; set; } 12 | 13 | [MaxLength(120)] 14 | public virtual string Title { get; set; } = null!; 15 | 16 | [MaxLength(2000)] 17 | public virtual string? Content { get; set; } 18 | 19 | public virtual DateTime LastModifiedUtc { get; set; } 20 | 21 | 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Samples/TardisBank/Src/Suteki.TardisBank.Domain/CashWithdrawException.cs: -------------------------------------------------------------------------------- 1 | namespace Suteki.TardisBank.Domain 2 | { 3 | using System; 4 | using System.Runtime.Serialization; 5 | 6 | [Serializable] 7 | public class CashWithdrawException : Exception 8 | { 9 | // 10 | // For guidelines regarding the creation of new exception types, see 11 | // http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/cpconerrorraisinghandlingguidelines.asp 12 | // and 13 | // http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncscol/html/csharp07192001.asp 14 | // 15 | 16 | public CashWithdrawException() 17 | { 18 | } 19 | 20 | public CashWithdrawException(string message) : base(message) 21 | { 22 | } 23 | 24 | public CashWithdrawException(string message, Exception inner) : base(message, inner) 25 | { 26 | } 27 | 28 | protected CashWithdrawException( 29 | SerializationInfo info, 30 | StreamingContext context) : base(info, context) 31 | { 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /Samples/TardisBank/Src/Suteki.TardisBank.Domain/Events/NewParentCreatedEvent.cs: -------------------------------------------------------------------------------- 1 | namespace Suteki.TardisBank.Domain.Events 2 | { 3 | using System; 4 | using MediatR; 5 | 6 | public class NewParentCreatedEvent : INotification 7 | { 8 | public NewParentCreatedEvent(Parent parent) 9 | { 10 | if (parent == null) 11 | { 12 | throw new ArgumentNullException("parent"); 13 | } 14 | Parent = parent; 15 | } 16 | 17 | public Parent Parent { get; private set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Samples/TardisBank/Src/Suteki.TardisBank.Domain/Events/SendMessageEvent.cs: -------------------------------------------------------------------------------- 1 | namespace Suteki.TardisBank.Domain.Events 2 | { 3 | using System; 4 | using MediatR; 5 | 6 | public class SendMessageEvent : INotification 7 | { 8 | public SendMessageEvent(User user, string message) 9 | { 10 | if (user == null) 11 | { 12 | throw new ArgumentNullException("user"); 13 | } 14 | if (message == null) 15 | { 16 | throw new ArgumentNullException("message"); 17 | } 18 | 19 | User = user; 20 | Message = message; 21 | } 22 | 23 | public User User { get; private set; } 24 | public string Message { get; private set; } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Samples/TardisBank/Src/Suteki.TardisBank.Domain/Interval.cs: -------------------------------------------------------------------------------- 1 | namespace Suteki.TardisBank.Domain 2 | { 3 | public enum Interval 4 | { 5 | Day = 1, 6 | Week = 2, 7 | Month = 3 8 | } 9 | } -------------------------------------------------------------------------------- /Samples/TardisBank/Src/Suteki.TardisBank.Domain/Message.cs: -------------------------------------------------------------------------------- 1 | namespace Suteki.TardisBank.Domain 2 | { 3 | using System; 4 | 5 | using SharpArch.Domain.DomainModel; 6 | 7 | public class Message : Entity 8 | { 9 | public Message(DateTime date, string text, User user) 10 | { 11 | this.Date = date; 12 | this.Text = text; 13 | this.User = user; 14 | this.HasBeenRead = false; 15 | } 16 | 17 | protected Message() 18 | { 19 | } 20 | 21 | public virtual void Read() 22 | { 23 | this.HasBeenRead = true; 24 | } 25 | 26 | public virtual DateTime Date { get; protected set; } 27 | public virtual string? Text { get; protected set; } 28 | 29 | public virtual User User { get; set; } = null!; 30 | 31 | public virtual bool HasBeenRead { get; protected set; } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Samples/TardisBank/Src/Suteki.TardisBank.Domain/Suteki.TardisBank.Domain.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | $(AppTargetFrameworks) 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /Samples/TardisBank/Src/Suteki.TardisBank.Domain/TardisBankException.cs: -------------------------------------------------------------------------------- 1 | namespace Suteki.TardisBank.Domain 2 | { 3 | using System; 4 | using System.Runtime.Serialization; 5 | 6 | [Serializable] 7 | public class TardisBankException : Exception 8 | { 9 | // 10 | // For guidelines regarding the creation of new exception types, see 11 | // http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/cpconerrorraisinghandlingguidelines.asp 12 | // and 13 | // http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncscol/html/csharp07192001.asp 14 | // 15 | 16 | public TardisBankException() 17 | { 18 | } 19 | 20 | public TardisBankException(string format, params object[] args) : this(string.Format(format, args)) 21 | { 22 | 23 | } 24 | 25 | public TardisBankException(string message) : base(message) 26 | { 27 | } 28 | 29 | public TardisBankException(string message, Exception inner) : base(message, inner) 30 | { 31 | } 32 | 33 | protected TardisBankException( 34 | SerializationInfo info, 35 | StreamingContext context) : base(info, context) 36 | { 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /Samples/TardisBank/Src/Suteki.TardisBank.Domain/Transaction.cs: -------------------------------------------------------------------------------- 1 | namespace Suteki.TardisBank.Domain 2 | { 3 | using System; 4 | 5 | using SharpArch.Domain.DomainModel; 6 | 7 | public class Transaction : Entity 8 | { 9 | public Transaction(string? description, decimal amount, Account account) 10 | { 11 | this.Description = description; 12 | this.Amount = amount; 13 | this.Account = account; 14 | this.Date = DateTime.Now.Date; 15 | } 16 | 17 | protected Transaction() 18 | { 19 | } 20 | 21 | public virtual string? Description { get; protected set; } 22 | public virtual decimal Amount { get; protected set; } 23 | 24 | public virtual Account Account { get; protected set; } = null!; 25 | 26 | public virtual DateTime Date { get; protected set; } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Samples/TardisBank/Src/Suteki.TardisBank.Infrastructure/Configuration/AnnouncementMappingProfile.cs: -------------------------------------------------------------------------------- 1 | namespace Suteki.TardisBank.Infrastructure.Configuration 2 | { 3 | using System; 4 | using Api.Announcements; 5 | using AutoMapper; 6 | using Domain; 7 | 8 | 9 | public class AnnouncementMappingProfile : Profile 10 | { 11 | /// 12 | public AnnouncementMappingProfile() 13 | { 14 | CreateMap(); 15 | CreateMap(); 16 | CreateMap() 17 | .ForMember(d => d.LastModifiedUtc, opt => opt.MapFrom(_ => DateTime.UtcNow)) 18 | .ForMember(d => d.Id, opt => opt.Ignore()) 19 | ; 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Samples/TardisBank/Src/Suteki.TardisBank.Infrastructure/NHibernateMaps/AccountMap.cs: -------------------------------------------------------------------------------- 1 | namespace Suteki.TardisBank.Infrastructure.NHibernateMaps 2 | { 3 | using FluentNHibernate.Automapping; 4 | using FluentNHibernate.Automapping.Alterations; 5 | 6 | using Domain; 7 | 8 | public class AccountMap : IAutoMappingOverride 9 | { 10 | public void Override(AutoMapping mapping) 11 | { 12 | mapping.HasMany(a => a.PaymentSchedules).Cascade.AllDeleteOrphan().Inverse(); 13 | mapping.HasMany(a => a.Transactions).Cascade.AllDeleteOrphan().Inverse(); 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /Samples/TardisBank/Src/Suteki.TardisBank.Infrastructure/NHibernateMaps/AnnouncementMap.cs: -------------------------------------------------------------------------------- 1 | namespace Suteki.TardisBank.Infrastructure.NHibernateMaps 2 | { 3 | using FluentNHibernate.Automapping; 4 | using FluentNHibernate.Automapping.Alterations; 5 | using NHibernate.Type; 6 | using Domain; 7 | using JetBrains.Annotations; 8 | 9 | 10 | [UsedImplicitly] 11 | public class AnnouncementMap : IAutoMappingOverride 12 | { 13 | public void Override(AutoMapping mapping) 14 | { 15 | mapping.Map(x => x.Date).CustomSqlType("date"); 16 | mapping.Map(x => x.LastModifiedUtc).CustomType(typeof (UtcDateTimeType)); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Samples/TardisBank/Src/Suteki.TardisBank.Infrastructure/NHibernateMaps/AutomappingConfiguration.cs: -------------------------------------------------------------------------------- 1 | namespace Suteki.TardisBank.Infrastructure.NHibernateMaps 2 | { 3 | using System.Linq; 4 | using FluentNHibernate; 5 | using FluentNHibernate.Automapping; 6 | using SharpArch.Domain.DomainModel; 7 | 8 | 9 | /// 10 | public class AutomappingConfiguration : DefaultAutomappingConfiguration 11 | { 12 | /// 13 | public override bool ShouldMap(System.Type type) 14 | { 15 | return type.GetInterfaces().Any(x => x == typeof(IEntity)); 16 | } 17 | 18 | /// 19 | public override bool ShouldMap(Member member) 20 | { 21 | // map only writable properties 22 | return base.ShouldMap(member) && member.CanWrite; 23 | } 24 | 25 | /// 26 | public override bool AbstractClassIsLayerSupertype(System.Type type) 27 | { 28 | return type == typeof(Entity<>); 29 | } 30 | 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Samples/TardisBank/Src/Suteki.TardisBank.Infrastructure/NHibernateMaps/ChildMap.cs: -------------------------------------------------------------------------------- 1 | namespace Suteki.TardisBank.Infrastructure.NHibernateMaps 2 | { 3 | using FluentNHibernate.Automapping; 4 | using FluentNHibernate.Automapping.Alterations; 5 | 6 | using Domain; 7 | 8 | public class ChildMap : IAutoMappingOverride 9 | { 10 | public void Override(AutoMapping mapping) 11 | { 12 | mapping.References(c => c.Account).Cascade.All(); 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /Samples/TardisBank/Src/Suteki.TardisBank.Infrastructure/NHibernateMaps/Conventions/CustomForeignKeyConvention.cs: -------------------------------------------------------------------------------- 1 | namespace Suteki.TardisBank.Infrastructure.NHibernateMaps.Conventions 2 | { 3 | #region Using Directives 4 | 5 | using System; 6 | 7 | using FluentNHibernate; 8 | using FluentNHibernate.Conventions; 9 | 10 | #endregion 11 | 12 | public class CustomForeignKeyConvention : ForeignKeyConvention 13 | { 14 | protected override string GetKeyName(Member property, Type type) 15 | { 16 | if (property == null) 17 | { 18 | return type.Name + "Id"; 19 | } 20 | 21 | return property.Name + "Id"; 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /Samples/TardisBank/Src/Suteki.TardisBank.Infrastructure/NHibernateMaps/Conventions/HasManyConvention.cs: -------------------------------------------------------------------------------- 1 | namespace Suteki.TardisBank.Infrastructure.NHibernateMaps.Conventions 2 | { 3 | #region Using Directives 4 | 5 | using FluentNHibernate.Conventions; 6 | using FluentNHibernate.Conventions.Instances; 7 | using Humanizer; 8 | 9 | #endregion 10 | 11 | public class HasManyConvention : IHasManyConvention 12 | { 13 | public void Apply(IOneToManyCollectionInstance instance) 14 | { 15 | instance.Key.Column(instance.EntityType.Name + "Id"); 16 | var parent = instance.Relationship.EntityType.Name.Pluralize(); 17 | instance.Key.ForeignKey( 18 | $"FK_{instance.StringIdentifierForModel.Pluralize()}_For_{parent}"); 19 | 20 | instance.Cascade.AllDeleteOrphan(); 21 | instance.Inverse(); 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /Samples/TardisBank/Src/Suteki.TardisBank.Infrastructure/NHibernateMaps/Conventions/HasOneConvention.cs: -------------------------------------------------------------------------------- 1 | namespace Suteki.TardisBank.Infrastructure.NHibernateMaps.Conventions 2 | { 3 | using FluentNHibernate.Conventions; 4 | using FluentNHibernate.Conventions.Instances; 5 | 6 | public class HasOneConvention : IHasOneConvention 7 | { 8 | public void Apply(IOneToOneInstance instance) 9 | { 10 | instance.ForeignKey($"FK_{instance.EntityType.Name}_To_{instance.Name}"); 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /Samples/TardisBank/Src/Suteki.TardisBank.Infrastructure/NHibernateMaps/Conventions/JoinedSubClassConvention.cs: -------------------------------------------------------------------------------- 1 | namespace Suteki.TardisBank.Infrastructure.NHibernateMaps.Conventions 2 | { 3 | using FluentNHibernate.Conventions; 4 | using FluentNHibernate.Conventions.Instances; 5 | using Humanizer; 6 | 7 | public class JoinedSubClassConvention : IJoinedSubclassConvention 8 | { 9 | public void Apply(IJoinedSubclassInstance instance) 10 | { 11 | // pluralize table names 12 | instance.Table(instance.EntityType.Name.Pluralize()); 13 | 14 | if (instance.Type.BaseType != null) 15 | instance.Key.ForeignKey( 16 | $"FK_{instance.EntityType.Name.Pluralize()}_Join_{instance.Type.BaseType.Name.Pluralize()}"); 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /Samples/TardisBank/Src/Suteki.TardisBank.Infrastructure/NHibernateMaps/Conventions/PrimaryKeyConvention.cs: -------------------------------------------------------------------------------- 1 | namespace Suteki.TardisBank.Infrastructure.NHibernateMaps.Conventions 2 | { 3 | using FluentNHibernate.Conventions; 4 | using FluentNHibernate.Conventions.Instances; 5 | using JetBrains.Annotations; 6 | 7 | 8 | [UsedImplicitly] 9 | public class PrimaryKeyConvention : IIdConvention 10 | { 11 | public void Apply(IIdentityInstance instance) 12 | { 13 | instance.Column(instance.EntityType.Name + "Id"); 14 | instance.GeneratedBy.HiLo("10"); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Samples/TardisBank/Src/Suteki.TardisBank.Infrastructure/NHibernateMaps/Conventions/ReferenceConvention.cs: -------------------------------------------------------------------------------- 1 | namespace Suteki.TardisBank.Infrastructure.NHibernateMaps.Conventions 2 | { 3 | using FluentNHibernate.Conventions; 4 | using FluentNHibernate.Conventions.Instances; 5 | using Humanizer; 6 | 7 | public class ReferenceConvention : IReferenceConvention 8 | { 9 | public void Apply(IManyToOneInstance instance) 10 | { 11 | instance.ForeignKey($"FK_{instance.EntityType.Name.Pluralize()}_Ref_{instance.Name.Pluralize()}"); 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /Samples/TardisBank/Src/Suteki.TardisBank.Infrastructure/NHibernateMaps/Conventions/TableNameConvention.cs: -------------------------------------------------------------------------------- 1 | namespace Suteki.TardisBank.Infrastructure.NHibernateMaps.Conventions 2 | { 3 | using FluentNHibernate.Conventions; 4 | using FluentNHibernate.Conventions.Instances; 5 | using Humanizer; 6 | 7 | /// 8 | /// Pluralize table name. 9 | /// 10 | public class TableNameConvention : IClassConvention 11 | { 12 | public void Apply(IClassInstance instance) 13 | { 14 | instance.Table(instance.EntityType.Name.Pluralize()); 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /Samples/TardisBank/Src/Suteki.TardisBank.Infrastructure/NHibernateMaps/MessageMap.cs: -------------------------------------------------------------------------------- 1 | namespace Suteki.TardisBank.Infrastructure.NHibernateMaps 2 | { 3 | using FluentNHibernate.Automapping; 4 | using FluentNHibernate.Automapping.Alterations; 5 | 6 | using Domain; 7 | 8 | public class MessageMap : IAutoMappingOverride 9 | { 10 | public void Override(AutoMapping mapping) 11 | { 12 | mapping.References(m => m.User); 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /Samples/TardisBank/Src/Suteki.TardisBank.Infrastructure/NHibernateMaps/PaymentScheduleMap.cs: -------------------------------------------------------------------------------- 1 | namespace Suteki.TardisBank.Infrastructure.NHibernateMaps 2 | { 3 | using FluentNHibernate.Automapping; 4 | using FluentNHibernate.Automapping.Alterations; 5 | 6 | using Domain; 7 | 8 | public class PaymentScheduleMap : IAutoMappingOverride 9 | { 10 | public void Override(AutoMapping mapping) 11 | { 12 | mapping.References(p => p.Account); 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /Samples/TardisBank/Src/Suteki.TardisBank.Infrastructure/NHibernateMaps/TransactionMap.cs: -------------------------------------------------------------------------------- 1 | namespace Suteki.TardisBank.Infrastructure.NHibernateMaps 2 | { 3 | using FluentNHibernate.Automapping; 4 | using FluentNHibernate.Automapping.Alterations; 5 | 6 | using Domain; 7 | 8 | public class TransactionMap : IAutoMappingOverride 9 | { 10 | public void Override(AutoMapping mapping) 11 | { 12 | mapping.References(p => p.Account); 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /Samples/TardisBank/Src/Suteki.TardisBank.Infrastructure/NHibernateMaps/UserMap.cs: -------------------------------------------------------------------------------- 1 | namespace Suteki.TardisBank.Infrastructure.NHibernateMaps 2 | { 3 | using FluentNHibernate.Automapping; 4 | using FluentNHibernate.Automapping.Alterations; 5 | 6 | using Domain; 7 | 8 | public class UserMap : IAutoMappingOverride 9 | { 10 | public void Override(AutoMapping mapping) 11 | { 12 | mapping.HasMany(u => u.Messages).Cascade.AllDeleteOrphan().Inverse(); 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /Samples/TardisBank/Src/Suteki.TardisBank.Infrastructure/Suteki.TardisBank.Infrastructure.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | $(AppTargetFrameworks) 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /Samples/TardisBank/Src/Suteki.TardisBank.Tasks/EventHandlers/SendMessageEmailHandler.cs: -------------------------------------------------------------------------------- 1 | namespace Suteki.TardisBank.Tasks.EventHandlers 2 | { 3 | using System; 4 | using System.Threading; 5 | using System.Threading.Tasks; 6 | using Domain; 7 | using Domain.Events; 8 | using JetBrains.Annotations; 9 | using MediatR; 10 | 11 | 12 | [UsedImplicitly] 13 | public class SendMessageEmailHandler : INotificationHandler 14 | { 15 | private readonly IEmailService _emailService; 16 | 17 | public SendMessageEmailHandler(IEmailService emailService) 18 | { 19 | _emailService = emailService; 20 | } 21 | 22 | public Task Handle(SendMessageEvent sendMessageEvent, CancellationToken token) 23 | { 24 | if (sendMessageEvent == null) 25 | { 26 | throw new ArgumentNullException(nameof(sendMessageEvent)); 27 | } 28 | 29 | if (sendMessageEvent.User is Child) 30 | { 31 | // we cannot send email messages to children. 32 | return Task.CompletedTask; 33 | } 34 | 35 | var toAddress = sendMessageEvent.User.UserName; 36 | const string subject = "Message from Tardis Bank"; 37 | var body = sendMessageEvent.Message; 38 | 39 | _emailService.SendEmail(toAddress, subject, body); 40 | return Task.CompletedTask; 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Samples/TardisBank/Src/Suteki.TardisBank.Tasks/IHttpContextService.cs: -------------------------------------------------------------------------------- 1 | namespace Suteki.TardisBank.Tasks 2 | { 3 | public interface IHttpContextService 4 | { 5 | string UserName { get; } 6 | bool UserIsAuthenticated { get; } 7 | 8 | bool UserIsInRole(string role); 9 | } 10 | } -------------------------------------------------------------------------------- /Samples/TardisBank/Src/Suteki.TardisBank.Tasks/IUserService.cs: -------------------------------------------------------------------------------- 1 | namespace Suteki.TardisBank.Tasks 2 | { 3 | using System.Threading; 4 | using System.Threading.Tasks; 5 | using Domain; 6 | 7 | 8 | public interface IUserService 9 | { 10 | Task GetCurrentUser(CancellationToken cancellationToken = default); 11 | Task GetUser(int userId, CancellationToken cancellationToken = default); 12 | Task GetUserByUserName(string userName, CancellationToken cancellationToken = default); 13 | Task GetUserByActivationKey(string activationKey, CancellationToken cancellationToken = default); 14 | Task SaveUser(User user, CancellationToken cancellationToken = default); 15 | Task DeleteUser(int userId, CancellationToken cancellationToken = default); 16 | 17 | bool AreNullOrNotRelated(Parent parent, Child child); 18 | Task IsNotChildOfCurrentUser(Child child, CancellationToken cancellationToken = default); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Samples/TardisBank/Src/Suteki.TardisBank.Tasks/SchedulerService.cs: -------------------------------------------------------------------------------- 1 | namespace Suteki.TardisBank.Tasks 2 | { 3 | using System; 4 | using System.Linq; 5 | 6 | using Domain; 7 | 8 | using NHibernate; 9 | using NHibernate.Linq; 10 | 11 | public interface ISchedulerService 12 | { 13 | void ExecuteUpdates(DateTime now); 14 | } 15 | 16 | public class SchedulerService : ISchedulerService 17 | { 18 | private ISession _session; 19 | 20 | public SchedulerService(ISession session) 21 | { 22 | _session = session; 23 | } 24 | 25 | /// 26 | /// Gets all outstanding scheduled updates and performs the update. 27 | /// 28 | public void ExecuteUpdates(DateTime now) 29 | { 30 | var today = new DateTime(now.Year, now.Month, now.Day, 23, 59, 59); 31 | 32 | var results = _session.Query(). 33 | Where(c => c.Account.PaymentSchedules.Any(p => p.NextRun < today)).Fetch(c => c.Account); 34 | 35 | foreach (var child in results.ToList()) 36 | { 37 | child.Account.TriggerScheduledPayments(now); 38 | } 39 | } 40 | } 41 | } -------------------------------------------------------------------------------- /Samples/TardisBank/Src/Suteki.TardisBank.Tasks/Suteki.TardisBank.Tasks.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | $(AppTargetFrameworks) 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /Samples/TardisBank/Src/Suteki.TardisBank.Tasks/TardisConfiguration.cs: -------------------------------------------------------------------------------- 1 | namespace Suteki.TardisBank.Tasks 2 | { 3 | public class TardisConfiguration 4 | { 5 | public TardisConfiguration() 6 | { 7 | // set some useful defaults here 8 | ScheduleKey = "run"; 9 | 10 | EmailSmtpServer = ""; // if this string is empty emails just don't get sent 11 | EmailEnableSsl = false; 12 | EmailPort = 25; 13 | EmailCredentialsUserName = ""; // if the username or password is blank, default credentials are used. 14 | EmailCredentialsPassword = ""; 15 | EmailFromAddress = ""; 16 | 17 | GoogleAnalyticsUaCode = ""; 18 | } 19 | 20 | public string ScheduleKey { get; set; } 21 | 22 | public string EmailSmtpServer { get; set; } 23 | public bool EmailEnableSsl { get; set; } 24 | public int EmailPort { get; set; } 25 | public string EmailCredentialsUserName { get; set; } 26 | public string EmailCredentialsPassword { get; set; } 27 | public string EmailFromAddress { get; set; } 28 | 29 | public string GoogleAnalyticsUaCode { get; set; } 30 | } 31 | } -------------------------------------------------------------------------------- /Samples/TardisBank/Src/Suteki.TardisBank.Tests/AssemblySetup.cs: -------------------------------------------------------------------------------- 1 | namespace Suteki.TardisBank.Tests 2 | { 3 | 4 | public class AssemblySetup 5 | { 6 | public void RunBeforeAllTests() 7 | { 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /Samples/TardisBank/Src/Suteki.TardisBank.Tests/Functional/Setup/TestServerSetup.cs: -------------------------------------------------------------------------------- 1 | namespace Suteki.TardisBank.Tests.Functional.Setup 2 | { 3 | using System; 4 | using System.Net.Http; 5 | using Microsoft.AspNetCore.Hosting; 6 | using Microsoft.AspNetCore.TestHost; 7 | using WebApi; 8 | 9 | 10 | public class TestServerSetup : IDisposable 11 | { 12 | public HttpClient Client { get; } 13 | public TestServer Server { get; } 14 | 15 | public TestServerSetup() 16 | { 17 | Server = new TestServer(Program.CreateHostBuilder(Array.Empty()) 18 | .UseTestServer() 19 | .UseStartup() 20 | .UseSolutionRelativeContentRoot("TardisBank/Src/Suteki.TardisBank.WebApi/") 21 | ); 22 | Client = Server.CreateClient(); 23 | Client.BaseAddress = Server.BaseAddress; 24 | } 25 | 26 | /// 27 | public void Dispose() 28 | { 29 | Server?.Dispose(); 30 | Client?.Dispose(); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Samples/TardisBank/Src/Suteki.TardisBank.Tests/Helpers/DateFomatterTests.cs: -------------------------------------------------------------------------------- 1 | #if false 2 | using NUnit.Framework; 3 | 4 | namespace Suteki.TardisBank.Tests.Helpers 5 | { 6 | using FluentAssertions; 7 | using global::Suteki.TardisBank.Web.Mvc.Utilities; 8 | using SharpArch.Testing.NUnit; 9 | 10 | [TestFixture] 11 | public class DateFomatterTests 12 | { 13 | [Fact] 14 | public void Should_return_the_correct_date_format() 15 | { 16 | GetJQueryDateFormatFor("en-GB").Should().Be("dd/mm/yy"); 17 | GetJQueryDateFormatFor("en-US").Should().Be("m/d/yy"); 18 | GetJQueryDateFormatFor("fr").Should().Be("dd/mm/yy"); 19 | GetJQueryDateFormatFor("de-CH").Should().Be("dd.mm.yy"); 20 | GetJQueryDateFormatFor("de").Should().Be("dd.mm.yy"); 21 | } 22 | 23 | static string GetJQueryDateFormatFor(string language) 24 | { 25 | var culture = new System.Globalization.CultureInfo(language); 26 | System.Threading.Thread.CurrentThread.CurrentCulture = culture; 27 | 28 | return DateFormatter.CurrentJQuery; 29 | } 30 | } 31 | } 32 | #endif -------------------------------------------------------------------------------- /Samples/TardisBank/Src/Suteki.TardisBank.Tests/Helpers/RunnableInDebugOnlyAttribute.cs: -------------------------------------------------------------------------------- 1 | namespace Suteki.TardisBank.Tests.Helpers 2 | { 3 | using System; 4 | using System.Diagnostics; 5 | using Xunit; 6 | 7 | 8 | /// 9 | /// Run test only if debugger attached. 10 | /// Taken from https://lostechies.com/jimmybogard/2013/06/20/run-tests-explicitly-in-xunit-net/ 11 | /// 12 | [AttributeUsage(AttributeTargets.Method)] 13 | public sealed class RunnableInDebugOnlyAttribute : FactAttribute 14 | { 15 | public RunnableInDebugOnlyAttribute() 16 | { 17 | if (!Debugger.IsAttached) 18 | { 19 | Skip = "Only running in interactive mode."; 20 | } 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Samples/TardisBank/Src/Suteki.TardisBank.Tests/Hibernate.cfg.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | NHibernate.Connection.DriverConnectionProvider 5 | NHibernate.Dialect.SQLiteDialect 6 | NHibernate.Driver.SQLite20Driver 7 | Data Source=:memory:;Version=3;New=True; 8 | on_close 9 | true 10 | 11 | -------------------------------------------------------------------------------- /Samples/TardisBank/Src/Suteki.TardisBank.Tests/Model/MessageCountLimitTests.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using FluentAssertions; 3 | using MediatR; 4 | using Moq; 5 | using Suteki.TardisBank.Domain; 6 | using Xunit; 7 | 8 | namespace Suteki.TardisBank.Tests.Model 9 | { 10 | public class MessageCountLimitTests 11 | { 12 | public MessageCountLimitTests() 13 | { 14 | _mediator = new Mock(); 15 | _user = new Parent("Mike", "mike@mike.com", "xxx"); 16 | } 17 | 18 | readonly User _user; 19 | readonly Mock _mediator; 20 | 21 | [Fact] 22 | public void Number_of_messages_should_be_limited() 23 | { 24 | for (var i = 0; i < User.MaxMessages; i++) 25 | { 26 | _user.SendMessage("Message" + i, _mediator.Object); 27 | } 28 | 29 | _user.Messages.Count.Should().Be(User.MaxMessages); 30 | 31 | _user.SendMessage("New", _mediator.Object); 32 | _user.Messages.Count.Should().Be(User.MaxMessages); 33 | _user.Messages.First().Text.Should().Be("Message1"); 34 | _user.Messages.Last().Text.Should().Be("New"); 35 | 36 | _user.SendMessage("New2", _mediator.Object); 37 | _user.Messages.Count.Should().Be(User.MaxMessages); 38 | _user.Messages.First().Text.Should().Be("Message2"); 39 | _user.Messages.Last().Text.Should().Be("New2"); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Samples/TardisBank/Src/Suteki.TardisBank.Tests/Model/TransientDatabaseSetup.cs: -------------------------------------------------------------------------------- 1 | namespace Suteki.TardisBank.Tests.Model 2 | { 3 | using Infrastructure.NHibernateMaps; 4 | using SharpArch.Testing.NHibernate; 5 | 6 | 7 | public class TransientDatabaseSetup : TestDatabaseSetup 8 | { 9 | /// 10 | public TransientDatabaseSetup() 11 | : base(typeof(TransientDatabaseSetup).Assembly, typeof(AutoPersistenceModelGenerator), new[] 12 | { 13 | typeof(AutoPersistenceModelGenerator).Assembly 14 | }) 15 | { 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Samples/TardisBank/Src/Suteki.TardisBank.Tests/Services/EmailServiceTests.cs: -------------------------------------------------------------------------------- 1 | // see this blog post for sending emails by gmail/google apps 2 | // http://mikehadlow.blogspot.com/2010/08/how-to-send-email-via-gmail-using-net.html 3 | 4 | // ReSharper disable PublicMembersMustHaveComments 5 | 6 | namespace Suteki.TardisBank.Tests.Services 7 | { 8 | using Tasks; 9 | using Xunit; 10 | 11 | 12 | public class EmailServiceTests 13 | { 14 | readonly IEmailService _emailService; 15 | 16 | public EmailServiceTests() 17 | { 18 | var configuration = new TardisConfiguration 19 | { 20 | EmailSmtpServer = "smtp.gmail.com", 21 | EmailPort = 587, 22 | EmailEnableSsl = true, 23 | EmailFromAddress = "info@tardisbank.com", 24 | EmailCredentialsUserName = "____", 25 | EmailCredentialsPassword = "____" 26 | }; 27 | 28 | _emailService = new EmailService(configuration); 29 | } 30 | 31 | [Fact(Skip = "You should setup the configuration above. This test really does send an email!")] 32 | public void Should_be_able_to_send_an_email() 33 | { 34 | const string toAddress = "mike@suteki.co.uk"; 35 | const string subject = "Hello From Tardis Bank!"; 36 | const string body = "This is a body http://tardisbank.com/"; 37 | 38 | _emailService.SendEmail(toAddress, subject, body); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Samples/TardisBank/Src/Suteki.TardisBank.WebApi/NHibernate.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Data Source=localhost,2433;Initial Catalog=TardisBank;Integrated Security=False;User ID=sa;Password=Password12!;Application Name=Suteki.TardisBank;Encrypt=false; 5 | NHibernate.Dialect.MsSql2012Dialect 6 | NHibernate.Connection.DriverConnectionProvider 7 | NHibernate.Driver.MicrosoftDataSqlClientDriver 8 | true 9 | auto 10 | 500 11 | 12 | 14 | update 15 | 16 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Samples/TardisBank/Src/Suteki.TardisBank.WebApi/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Samples/TardisBank/Src/Suteki.TardisBank.WebApi/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | "AllowedHosts": "*" 10 | } 11 | -------------------------------------------------------------------------------- /Samples/TransactionAttribute/App/Controllers/GlobalController.cs: -------------------------------------------------------------------------------- 1 | namespace TransactionAttribute.WebApi.Controllers 2 | { 3 | using Microsoft.AspNetCore.Mvc; 4 | using Serilog; 5 | 6 | 7 | [Route("api/[controller]")] 8 | [ApiController] 9 | public class GlobalController : ControllerBase 10 | { 11 | /// 12 | /// Uses global default isolation level 13 | /// 14 | /// 15 | [HttpGet("default")] 16 | public ActionResult Default() 17 | { 18 | Log.Information("default"); 19 | return "ok"; 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Samples/TransactionAttribute/App/TransactionAttribute.WebApi.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | $(AppTargetFrameworks) 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /Samples/TransactionAttribute/App/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | } 3 | -------------------------------------------------------------------------------- /Samples/TransactionAttribute/App/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "AllowedHosts": "*" 3 | } 4 | -------------------------------------------------------------------------------- /Samples/TransactionAttribute/Tests/Setup/TestServerSetup.cs: -------------------------------------------------------------------------------- 1 | namespace TransactionAttribute.Tests.Setup 2 | { 3 | using System; 4 | using System.Net.Http; 5 | using Microsoft.AspNetCore.Hosting; 6 | using Microsoft.AspNetCore.TestHost; 7 | using WebApi; 8 | 9 | 10 | public class TestServerSetup : IDisposable 11 | { 12 | public HttpClient Client { get; } 13 | public TestServer Server { get; } 14 | 15 | /// 16 | public TestServerSetup() 17 | { 18 | Server = new TestServer(Program.CreateHostBuilder() 19 | .UseStartup() 20 | .UseContentRoot("../../../../App") 21 | //.UseSolutionRelativeContentRoot("../Samples/SharpArch.WebApi/App/") 22 | ); 23 | Client = Server.CreateClient(); 24 | } 25 | 26 | /// 27 | public void Dispose() 28 | { 29 | Server?.Dispose(); 30 | Client?.Dispose(); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Samples/_placeholder.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharparchitecture/Sharp-Architecture/1003810562889c4b79a3f8f00f9dd297c787822e/Samples/_placeholder.txt -------------------------------------------------------------------------------- /Samples/old/TardisBank/.gitignore: -------------------------------------------------------------------------------- 1 | Drops 2 | [Oo]bj 3 | [Bb]in 4 | debug 5 | _Resharper.* 6 | _ReSharper.* 7 | *.csproj.user 8 | *.resharper.user 9 | *.ReSharper.user 10 | *.resharper 11 | *.ReSharper 12 | *.suo 13 | *.cache 14 | *~ 15 | *.swp 16 | *.dbproj.user 17 | *.dbmdl 18 | error-*.xml 19 | *_mm_cache.bin 20 | *.dotCover 21 | StyleCop.Cache 22 | SpecificationReports 23 | NugetWorkspace 24 | [Pp]ackages 25 | [Ll]ogs 26 | *.DotSettings.user -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/App_Start/FilterConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Web; 2 | using System.Web.Mvc; 3 | 4 | namespace Suteki.TardisBank.Web.Mvc 5 | { 6 | public class FilterConfig 7 | { 8 | public static void RegisterGlobalFilters(GlobalFilterCollection filters) 9 | { 10 | filters.Add(new HandleErrorAttribute()); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/App_Start/MappingConfiguration.cs: -------------------------------------------------------------------------------- 1 | namespace Suteki.TardisBank.Web.Mvc 2 | { 3 | using System; 4 | using Domain; 5 | using Models; 6 | 7 | public class ModelMappingProfile: AutoMapper.Profile 8 | { 9 | public ModelMappingProfile() 10 | { 11 | CreateMap(); 12 | 13 | CreateMap() 14 | .ReverseMap() 15 | .ForMember(d => d.Id, opt => opt.Ignore()) 16 | .ForMember(d => d.LastModifiedUtc, opt => opt.ResolveUsing((AnnouncementModel a) => DateTime.UtcNow)); 17 | 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/App_Start/RouteConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | using System.Web.Routing; 7 | 8 | namespace Suteki.TardisBank.Web.Mvc 9 | { 10 | public class RouteConfig 11 | { 12 | public static void RegisterRoutes(RouteCollection routes) 13 | { 14 | routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); 15 | 16 | routes.MapRoute( 17 | name: "Default", 18 | url: "{controller}/{action}/{id}", 19 | defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } 20 | ); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/App_Start/WebApiConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web.Http; 5 | 6 | namespace Suteki.TardisBank.Web.Mvc 7 | { 8 | using Castle.Windsor; 9 | using SharpArch.Domain.Reflection; 10 | using SharpArch.Web.Http.Castle; 11 | 12 | public static class WebApiConfig 13 | { 14 | public static void Register(HttpConfiguration config, IWindsorContainer container, TypePropertyDescriptorCache propertyDescriptorCache) 15 | { 16 | // Web API configuration and services 17 | config.UseWindsor(container, propertyDescriptorCache); 18 | 19 | 20 | // Web API routes 21 | config.MapHttpAttributeRoutes(); 22 | 23 | config.Routes.MapHttpRoute( 24 | name: "DefaultApi", 25 | routeTemplate: "api/{controller}/{id}", 26 | defaults: new { id = RouteParameter.Optional } 27 | ); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/CastleWindsor/HandlerInstaller.cs: -------------------------------------------------------------------------------- 1 | namespace Suteki.TardisBank.Web.Mvc.CastleWindsor 2 | { 3 | using Castle.MicroKernel.Registration; 4 | using Castle.MicroKernel.SubSystems.Configuration; 5 | using Castle.Windsor; 6 | using MediatR; 7 | using Suteki.TardisBank.Tasks.EventHandlers; 8 | 9 | /// 10 | /// Installs Command and Query handlers. 11 | /// 12 | public class HandlersInstaller : IWindsorInstaller 13 | { 14 | public void Install(IWindsorContainer container, IConfigurationStore store) 15 | { 16 | container.Register( 17 | Classes.FromAssemblyContaining() 18 | .BasedOn(typeof (IRequestHandler<,>)) 19 | .WithService.AllInterfaces() 20 | .LifestylePerWebRequest()); 21 | 22 | container.Register( 23 | Classes.FromAssemblyContaining() 24 | .BasedOn(typeof (INotificationHandler<>)) 25 | .WithService.AllInterfaces() 26 | .LifestylePerWebRequest()); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/CastleWindsor/HttpControllersInstaller.cs: -------------------------------------------------------------------------------- 1 | namespace Suteki.TardisBank.Web.Mvc.CastleWindsor 2 | { 3 | using Castle.MicroKernel.Registration; 4 | using Castle.MicroKernel.SubSystems.Configuration; 5 | using Castle.Windsor; 6 | using Controllers; 7 | using SharpArch.Web.Http.Castle; 8 | 9 | public class HttpControllersInstaller : IWindsorInstaller 10 | { 11 | public void Install(IWindsorContainer container, IConfigurationStore store) 12 | { 13 | container.RegisterHttpControllers(typeof (AnnouncementsController).Assembly); 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/CastleWindsor/MvcControllersInstaller.cs: -------------------------------------------------------------------------------- 1 | namespace Suteki.TardisBank.Web.Mvc.CastleWindsor 2 | { 3 | using Castle.MicroKernel.Registration; 4 | using Castle.MicroKernel.SubSystems.Configuration; 5 | using Castle.Windsor; 6 | using Controllers; 7 | using SharpArch.Web.Mvc.Castle; 8 | 9 | public class MvcControllersInstaller : IWindsorInstaller 10 | { 11 | public void Install(IWindsorContainer container, IConfigurationStore store) 12 | { 13 | container.RegisterMvcControllers(typeof(HomeController).Assembly); 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/CastleWindsor/MvcGooInstaller.cs: -------------------------------------------------------------------------------- 1 | namespace Suteki.TardisBank.Web.Mvc.CastleWindsor 2 | { 3 | using Castle.MicroKernel.Registration; 4 | using Castle.MicroKernel.SubSystems.Configuration; 5 | using Castle.Windsor; 6 | 7 | using Suteki.TardisBank.Tasks; 8 | using Suteki.TardisBank.Web.Mvc.Utilities; 9 | 10 | public class MvcGooInstaller : IWindsorInstaller 11 | { 12 | public void Install(IWindsorContainer container, IConfigurationStore store) 13 | { 14 | container.Register( 15 | Component.For().Named("TardisConfiguration").LifeStyle.Singleton 16 | ); 17 | 18 | container.Register( 19 | Component.For().ImplementedBy().LifeStyle.Transient 20 | ); 21 | 22 | container.Register( 23 | Component.For().ImplementedBy().LifeStyle.Transient 24 | ); 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/CastleWindsor/QueriesInstaller.cs: -------------------------------------------------------------------------------- 1 | namespace Suteki.TardisBank.Web.Mvc.CastleWindsor 2 | { 3 | using Castle.MicroKernel.Registration; 4 | using Castle.MicroKernel.SubSystems.Configuration; 5 | using Castle.Windsor; 6 | 7 | using SharpArch.NHibernate; 8 | 9 | public class QueriesInstaller : IWindsorInstaller 10 | { 11 | public void Install(IWindsorContainer container, IConfigurationStore store) 12 | { 13 | container.Register( 14 | Classes.FromAssemblyNamed("Suteki.TardisBank.Web.Mvc") 15 | .BasedOn() 16 | .WithService.DefaultInterfaces() 17 | .LifestyleTransient() 18 | ); 19 | 20 | 21 | container.Register( 22 | Classes.FromAssemblyNamed("Suteki.TardisBank.Infrastructure") 23 | .BasedOn(typeof (NHibernateQuery)) 24 | .WithService.DefaultInterfaces() 25 | .LifestyleTransient() 26 | ); 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/CastleWindsor/ServicesInstaller.cs: -------------------------------------------------------------------------------- 1 | namespace Suteki.TardisBank.Web.Mvc.CastleWindsor 2 | { 3 | using Castle.MicroKernel.Registration; 4 | using Castle.MicroKernel.SubSystems.Configuration; 5 | using Castle.Windsor; 6 | 7 | using Tasks; 8 | 9 | public class TasksInstaller : IWindsorInstaller 10 | { 11 | public void Install(IWindsorContainer container, IConfigurationStore store) 12 | { 13 | container.Register( 14 | Classes 15 | .FromAssemblyContaining() 16 | .Where(Component.IsInSameNamespaceAs()) 17 | .WithService.DefaultInterfaces() 18 | .LifestyleTransient() 19 | ); 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/CastleWindsor/SharpArchInstaller.cs: -------------------------------------------------------------------------------- 1 | namespace Suteki.TardisBank.Web.Mvc.CastleWindsor 2 | { 3 | using Castle.MicroKernel.Registration; 4 | using Castle.MicroKernel.SubSystems.Configuration; 5 | using Castle.Windsor; 6 | using SharpArch.Domain.PersistenceSupport; 7 | using SharpArch.NHibernate; 8 | 9 | /// 10 | /// Installs S#Arch 11 | /// 12 | public class SharpArchInstaller : IWindsorInstaller 13 | { 14 | public void Install(IWindsorContainer container, IConfigurationStore store) 15 | { 16 | container.Register( 17 | Component.For(typeof (IEntityDuplicateChecker)) 18 | .ImplementedBy(typeof (EntityDuplicateChecker)) 19 | .Named("entityDuplicateChecker") 20 | .LifestyleTransient()); 21 | 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/images/TardisBankLogo_128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharparchitecture/Sharp-Architecture/1003810562889c4b79a3f8f00f9dd297c787822e/Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/images/TardisBankLogo_128.png -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/images/TardisBankLogo_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharparchitecture/Sharp-Architecture/1003810562889c4b79a3f8f00f9dd297c787822e/Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/images/TardisBankLogo_16.png -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/images/TardisBankLogo_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharparchitecture/Sharp-Architecture/1003810562889c4b79a3f8f00f9dd297c787822e/Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/images/TardisBankLogo_32.png -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/images/TardisBankLogo_64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharparchitecture/Sharp-Architecture/1003810562889c4b79a3f8f00f9dd297c787822e/Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/images/TardisBankLogo_64.png -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/images/TardisBankLogo_75.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharparchitecture/Sharp-Architecture/1003810562889c4b79a3f8f00f9dd297c787822e/Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/images/TardisBankLogo_75.png -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/images/TardisBankLogo_Shadow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharparchitecture/Sharp-Architecture/1003810562889c4b79a3f8f00f9dd297c787822e/Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/images/TardisBankLogo_Shadow.png -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/images/TardisBankLogo_ShadowWhite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharparchitecture/Sharp-Architecture/1003810562889c4b79a3f8f00f9dd297c787822e/Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/images/TardisBankLogo_ShadowWhite.png -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/images/Thumbs.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharparchitecture/Sharp-Architecture/1003810562889c4b79a3f8f00f9dd297c787822e/Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/images/Thumbs.db -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/images/hover.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharparchitecture/Sharp-Architecture/1003810562889c4b79a3f8f00f9dd297c787822e/Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/images/hover.gif -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/images/meandleo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharparchitecture/Sharp-Architecture/1003810562889c4b79a3f8f00f9dd297c787822e/Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/images/meandleo.jpg -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/images/meandleo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharparchitecture/Sharp-Architecture/1003810562889c4b79a3f8f00f9dd297c787822e/Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/images/meandleo.png -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/images/seperator.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharparchitecture/Sharp-Architecture/1003810562889c4b79a3f8f00f9dd297c787822e/Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/images/seperator.gif -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/images/title_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharparchitecture/Sharp-Architecture/1003810562889c4b79a3f8f00f9dd297c787822e/Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/images/title_background.png -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/img/sharp_arch.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharparchitecture/Sharp-Architecture/1003810562889c4b79a3f8f00f9dd297c787822e/Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/img/sharp_arch.jpg -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/img/sharp_arch_small.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharparchitecture/Sharp-Architecture/1003810562889c4b79a3f8f00f9dd297c787822e/Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/img/sharp_arch_small.gif -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/menu_style.css: -------------------------------------------------------------------------------- 1 | #menu { 2 | background: #333; 3 | float: left; 4 | list-style: none; 5 | margin: 0; 6 | padding: 0; 7 | width: 100%; 8 | } 9 | #menu li { 10 | float: left; 11 | margin: 0; 12 | padding: 0; 13 | } 14 | #menu a { 15 | background: #333 url("images/seperator.gif") bottom right no-repeat; 16 | color: #ccc; 17 | display: block; 18 | float: left; 19 | margin: 0; 20 | padding: 8px 12px; 21 | text-decoration: none; 22 | } 23 | #menu a:hover { 24 | background: #2580a2 url("images/hover.gif") bottom center no-repeat; 25 | color: #fff; 26 | padding-bottom: 8px; 27 | } 28 | -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/reset.css: -------------------------------------------------------------------------------- 1 | html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,font,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td{margin:0;padding:0;border:0;outline:0;font-size:100%;vertical-align:baseline;background:transparent}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:'';content:none}:focus{outline:0}ins{text-decoration:none}del{text-decoration:line-through}table{border-collapse:collapse;border-spacing:0} -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/text.css: -------------------------------------------------------------------------------- 1 | body{font:13px/1.5 'Helvetica Neue',Arial,'Liberation Sans',FreeSans,sans-serif}a:focus{outline:1px dotted}hr{border:0 #ccc solid;border-top-width:1px;clear:both;height:0}h1{font-size:25px}h2{font-size:23px}h3{font-size:21px}h4{font-size:19px}h5{font-size:17px}h6{font-size:15px}ol{list-style:decimal}ul{list-style:disc}li{margin-left:30px}p,dl,hr,h1,h2,h3,h4,h5,h6,ol,ul,pre,table,address,fieldset{margin-bottom:20px} -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/themes/base/accordion.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * jQuery UI Accordion 1.11.4 3 | * http://jqueryui.com 4 | * 5 | * Copyright jQuery Foundation and other contributors 6 | * Released under the MIT license. 7 | * http://jquery.org/license 8 | * 9 | * http://api.jqueryui.com/accordion/#theming 10 | */ 11 | .ui-accordion .ui-accordion-header { 12 | display: block; 13 | cursor: pointer; 14 | position: relative; 15 | margin: 2px 0 0 0; 16 | padding: .5em .5em .5em .7em; 17 | min-height: 0; /* support: IE7 */ 18 | font-size: 100%; 19 | } 20 | .ui-accordion .ui-accordion-icons { 21 | padding-left: 2.2em; 22 | } 23 | .ui-accordion .ui-accordion-icons .ui-accordion-icons { 24 | padding-left: 2.2em; 25 | } 26 | .ui-accordion .ui-accordion-header .ui-accordion-header-icon { 27 | position: absolute; 28 | left: .5em; 29 | top: 50%; 30 | margin-top: -8px; 31 | } 32 | .ui-accordion .ui-accordion-content { 33 | padding: 1em 2.2em; 34 | border-top: 0; 35 | overflow: auto; 36 | } 37 | -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/themes/base/all.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * jQuery UI CSS Framework 1.11.4 3 | * http://jqueryui.com 4 | * 5 | * Copyright jQuery Foundation and other contributors 6 | * Released under the MIT license. 7 | * http://jquery.org/license 8 | * 9 | * http://api.jqueryui.com/category/theming/ 10 | */ 11 | @import "base.css"; 12 | @import "theme.css"; 13 | -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/themes/base/autocomplete.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * jQuery UI Autocomplete 1.11.4 3 | * http://jqueryui.com 4 | * 5 | * Copyright jQuery Foundation and other contributors 6 | * Released under the MIT license. 7 | * http://jquery.org/license 8 | * 9 | * http://api.jqueryui.com/autocomplete/#theming 10 | */ 11 | .ui-autocomplete { 12 | position: absolute; 13 | top: 0; 14 | left: 0; 15 | cursor: default; 16 | } 17 | -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/themes/base/base.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * jQuery UI CSS Framework 1.11.4 3 | * http://jqueryui.com 4 | * 5 | * Copyright jQuery Foundation and other contributors 6 | * Released under the MIT license. 7 | * http://jquery.org/license 8 | * 9 | * http://api.jqueryui.com/category/theming/ 10 | */ 11 | @import url("core.css"); 12 | 13 | @import url("accordion.css"); 14 | @import url("autocomplete.css"); 15 | @import url("button.css"); 16 | @import url("datepicker.css"); 17 | @import url("dialog.css"); 18 | @import url("draggable.css"); 19 | @import url("menu.css"); 20 | @import url("progressbar.css"); 21 | @import url("resizable.css"); 22 | @import url("selectable.css"); 23 | @import url("selectmenu.css"); 24 | @import url("sortable.css"); 25 | @import url("slider.css"); 26 | @import url("spinner.css"); 27 | @import url("tabs.css"); 28 | @import url("tooltip.css"); 29 | -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/themes/base/draggable.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * jQuery UI Draggable 1.11.4 3 | * http://jqueryui.com 4 | * 5 | * Copyright jQuery Foundation and other contributors 6 | * Released under the MIT license. 7 | * http://jquery.org/license 8 | */ 9 | .ui-draggable-handle { 10 | -ms-touch-action: none; 11 | touch-action: none; 12 | } 13 | -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/themes/base/images/ui-bg_flat_0_aaaaaa_40x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharparchitecture/Sharp-Architecture/1003810562889c4b79a3f8f00f9dd297c787822e/Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/themes/base/images/ui-bg_flat_0_aaaaaa_40x100.png -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/themes/base/images/ui-bg_flat_75_ffffff_40x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharparchitecture/Sharp-Architecture/1003810562889c4b79a3f8f00f9dd297c787822e/Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/themes/base/images/ui-bg_flat_75_ffffff_40x100.png -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/themes/base/images/ui-bg_glass_55_fbf9ee_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharparchitecture/Sharp-Architecture/1003810562889c4b79a3f8f00f9dd297c787822e/Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/themes/base/images/ui-bg_glass_55_fbf9ee_1x400.png -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/themes/base/images/ui-bg_glass_65_ffffff_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharparchitecture/Sharp-Architecture/1003810562889c4b79a3f8f00f9dd297c787822e/Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/themes/base/images/ui-bg_glass_65_ffffff_1x400.png -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/themes/base/images/ui-bg_glass_75_dadada_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharparchitecture/Sharp-Architecture/1003810562889c4b79a3f8f00f9dd297c787822e/Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/themes/base/images/ui-bg_glass_75_dadada_1x400.png -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/themes/base/images/ui-bg_glass_75_e6e6e6_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharparchitecture/Sharp-Architecture/1003810562889c4b79a3f8f00f9dd297c787822e/Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/themes/base/images/ui-bg_glass_75_e6e6e6_1x400.png -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/themes/base/images/ui-bg_glass_95_fef1ec_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharparchitecture/Sharp-Architecture/1003810562889c4b79a3f8f00f9dd297c787822e/Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/themes/base/images/ui-bg_glass_95_fef1ec_1x400.png -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/themes/base/images/ui-bg_highlight-soft_75_cccccc_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharparchitecture/Sharp-Architecture/1003810562889c4b79a3f8f00f9dd297c787822e/Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/themes/base/images/ui-bg_highlight-soft_75_cccccc_1x100.png -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/themes/base/images/ui-icons_222222_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharparchitecture/Sharp-Architecture/1003810562889c4b79a3f8f00f9dd297c787822e/Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/themes/base/images/ui-icons_222222_256x240.png -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/themes/base/images/ui-icons_2e83ff_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharparchitecture/Sharp-Architecture/1003810562889c4b79a3f8f00f9dd297c787822e/Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/themes/base/images/ui-icons_2e83ff_256x240.png -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/themes/base/images/ui-icons_444444_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharparchitecture/Sharp-Architecture/1003810562889c4b79a3f8f00f9dd297c787822e/Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/themes/base/images/ui-icons_444444_256x240.png -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/themes/base/images/ui-icons_454545_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharparchitecture/Sharp-Architecture/1003810562889c4b79a3f8f00f9dd297c787822e/Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/themes/base/images/ui-icons_454545_256x240.png -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/themes/base/images/ui-icons_555555_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharparchitecture/Sharp-Architecture/1003810562889c4b79a3f8f00f9dd297c787822e/Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/themes/base/images/ui-icons_555555_256x240.png -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/themes/base/images/ui-icons_777620_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharparchitecture/Sharp-Architecture/1003810562889c4b79a3f8f00f9dd297c787822e/Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/themes/base/images/ui-icons_777620_256x240.png -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/themes/base/images/ui-icons_777777_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharparchitecture/Sharp-Architecture/1003810562889c4b79a3f8f00f9dd297c787822e/Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/themes/base/images/ui-icons_777777_256x240.png -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/themes/base/images/ui-icons_888888_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharparchitecture/Sharp-Architecture/1003810562889c4b79a3f8f00f9dd297c787822e/Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/themes/base/images/ui-icons_888888_256x240.png -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/themes/base/images/ui-icons_cc0000_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharparchitecture/Sharp-Architecture/1003810562889c4b79a3f8f00f9dd297c787822e/Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/themes/base/images/ui-icons_cc0000_256x240.png -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/themes/base/images/ui-icons_cd0a0a_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharparchitecture/Sharp-Architecture/1003810562889c4b79a3f8f00f9dd297c787822e/Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/themes/base/images/ui-icons_cd0a0a_256x240.png -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/themes/base/images/ui-icons_ffffff_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharparchitecture/Sharp-Architecture/1003810562889c4b79a3f8f00f9dd297c787822e/Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/themes/base/images/ui-icons_ffffff_256x240.png -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/themes/base/menu.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * jQuery UI Menu 1.11.4 3 | * http://jqueryui.com 4 | * 5 | * Copyright jQuery Foundation and other contributors 6 | * Released under the MIT license. 7 | * http://jquery.org/license 8 | * 9 | * http://api.jqueryui.com/menu/#theming 10 | */ 11 | .ui-menu { 12 | list-style: none; 13 | padding: 0; 14 | margin: 0; 15 | display: block; 16 | outline: none; 17 | } 18 | .ui-menu .ui-menu { 19 | position: absolute; 20 | } 21 | .ui-menu .ui-menu-item { 22 | position: relative; 23 | margin: 0; 24 | padding: 3px 1em 3px .4em; 25 | cursor: pointer; 26 | min-height: 0; /* support: IE7 */ 27 | /* support: IE10, see #8844 */ 28 | list-style-image: url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"); 29 | } 30 | .ui-menu .ui-menu-divider { 31 | margin: 5px 0; 32 | height: 0; 33 | font-size: 0; 34 | line-height: 0; 35 | border-width: 1px 0 0 0; 36 | } 37 | .ui-menu .ui-state-focus, 38 | .ui-menu .ui-state-active { 39 | margin: -1px; 40 | } 41 | 42 | /* icon support */ 43 | .ui-menu-icons { 44 | position: relative; 45 | } 46 | .ui-menu-icons .ui-menu-item { 47 | padding-left: 2em; 48 | } 49 | 50 | /* left-aligned */ 51 | .ui-menu .ui-icon { 52 | position: absolute; 53 | top: 0; 54 | bottom: 0; 55 | left: .2em; 56 | margin: auto 0; 57 | } 58 | 59 | /* right-aligned */ 60 | .ui-menu .ui-menu-icon { 61 | left: auto; 62 | right: 0; 63 | } 64 | -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/themes/base/selectable.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * jQuery UI Selectable 1.11.4 3 | * http://jqueryui.com 4 | * 5 | * Copyright jQuery Foundation and other contributors 6 | * Released under the MIT license. 7 | * http://jquery.org/license 8 | */ 9 | .ui-selectable { 10 | -ms-touch-action: none; 11 | touch-action: none; 12 | } 13 | .ui-selectable-helper { 14 | position: absolute; 15 | z-index: 100; 16 | border: 1px dotted black; 17 | } 18 | -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/themes/base/selectmenu.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * jQuery UI Selectmenu 1.11.4 3 | * http://jqueryui.com 4 | * 5 | * Copyright jQuery Foundation and other contributors 6 | * Released under the MIT license. 7 | * http://jquery.org/license 8 | * 9 | * http://api.jqueryui.com/selectmenu/#theming 10 | */ 11 | .ui-selectmenu-menu { 12 | padding: 0; 13 | margin: 0; 14 | position: absolute; 15 | top: 0; 16 | left: 0; 17 | display: none; 18 | } 19 | .ui-selectmenu-menu .ui-menu { 20 | overflow: auto; 21 | /* Support: IE7 */ 22 | overflow-x: hidden; 23 | padding-bottom: 1px; 24 | } 25 | .ui-selectmenu-menu .ui-menu .ui-selectmenu-optgroup { 26 | font-size: 1em; 27 | font-weight: bold; 28 | line-height: 1.5; 29 | padding: 2px 0.4em; 30 | margin: 0.5em 0 0 0; 31 | height: auto; 32 | border: 0; 33 | } 34 | .ui-selectmenu-open { 35 | display: block; 36 | } 37 | .ui-selectmenu-button { 38 | display: inline-block; 39 | overflow: hidden; 40 | position: relative; 41 | text-decoration: none; 42 | cursor: pointer; 43 | } 44 | .ui-selectmenu-button span.ui-icon { 45 | right: 0.5em; 46 | left: auto; 47 | margin-top: -8px; 48 | position: absolute; 49 | top: 50%; 50 | } 51 | .ui-selectmenu-button span.ui-selectmenu-text { 52 | text-align: left; 53 | padding: 0.4em 2.1em 0.4em 1em; 54 | display: block; 55 | line-height: 1.4; 56 | overflow: hidden; 57 | text-overflow: ellipsis; 58 | white-space: nowrap; 59 | } 60 | -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/themes/base/sortable.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * jQuery UI Sortable 1.11.4 3 | * http://jqueryui.com 4 | * 5 | * Copyright jQuery Foundation and other contributors 6 | * Released under the MIT license. 7 | * http://jquery.org/license 8 | */ 9 | .ui-sortable-handle { 10 | -ms-touch-action: none; 11 | touch-action: none; 12 | } 13 | -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/themes/base/spinner.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * jQuery UI Spinner 1.11.4 3 | * http://jqueryui.com 4 | * 5 | * Copyright jQuery Foundation and other contributors 6 | * Released under the MIT license. 7 | * http://jquery.org/license 8 | * 9 | * http://api.jqueryui.com/spinner/#theming 10 | */ 11 | .ui-spinner { 12 | position: relative; 13 | display: inline-block; 14 | overflow: hidden; 15 | padding: 0; 16 | vertical-align: middle; 17 | } 18 | .ui-spinner-input { 19 | border: none; 20 | background: none; 21 | color: inherit; 22 | padding: 0; 23 | margin: .2em 0; 24 | vertical-align: middle; 25 | margin-left: .4em; 26 | margin-right: 22px; 27 | } 28 | .ui-spinner-button { 29 | width: 16px; 30 | height: 50%; 31 | font-size: .5em; 32 | padding: 0; 33 | margin: 0; 34 | text-align: center; 35 | position: absolute; 36 | cursor: default; 37 | display: block; 38 | overflow: hidden; 39 | right: 0; 40 | } 41 | /* more specificity required here to override default borders */ 42 | .ui-spinner a.ui-spinner-button { 43 | border-top: none; 44 | border-bottom: none; 45 | border-right: none; 46 | } 47 | /* vertically center icon */ 48 | .ui-spinner .ui-icon { 49 | position: absolute; 50 | margin-top: -8px; 51 | top: 50%; 52 | left: 0; 53 | } 54 | .ui-spinner-up { 55 | top: 0; 56 | } 57 | .ui-spinner-down { 58 | bottom: 0; 59 | } 60 | 61 | /* TR overrides */ 62 | .ui-spinner .ui-icon-triangle-1-s { 63 | /* need to fix icons sprite */ 64 | background-position: -65px -16px; 65 | } 66 | -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/themes/base/tabs.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * jQuery UI Tabs 1.11.4 3 | * http://jqueryui.com 4 | * 5 | * Copyright jQuery Foundation and other contributors 6 | * Released under the MIT license. 7 | * http://jquery.org/license 8 | * 9 | * http://api.jqueryui.com/tabs/#theming 10 | */ 11 | .ui-tabs { 12 | position: relative;/* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */ 13 | padding: .2em; 14 | } 15 | .ui-tabs .ui-tabs-nav { 16 | margin: 0; 17 | padding: .2em .2em 0; 18 | } 19 | .ui-tabs .ui-tabs-nav li { 20 | list-style: none; 21 | float: left; 22 | position: relative; 23 | top: 0; 24 | margin: 1px .2em 0 0; 25 | border-bottom-width: 0; 26 | padding: 0; 27 | white-space: nowrap; 28 | } 29 | .ui-tabs .ui-tabs-nav .ui-tabs-anchor { 30 | float: left; 31 | padding: .5em 1em; 32 | text-decoration: none; 33 | } 34 | .ui-tabs .ui-tabs-nav li.ui-tabs-active { 35 | margin-bottom: -1px; 36 | padding-bottom: 1px; 37 | } 38 | .ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor, 39 | .ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor, 40 | .ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor { 41 | cursor: text; 42 | } 43 | .ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor { 44 | cursor: pointer; 45 | } 46 | .ui-tabs .ui-tabs-panel { 47 | display: block; 48 | border-width: 0; 49 | padding: 1em 1.4em; 50 | background: none; 51 | } 52 | -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/themes/base/tooltip.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * jQuery UI Tooltip 1.11.4 3 | * http://jqueryui.com 4 | * 5 | * Copyright jQuery Foundation and other contributors 6 | * Released under the MIT license. 7 | * http://jquery.org/license 8 | * 9 | * http://api.jqueryui.com/tooltip/#theming 10 | */ 11 | .ui-tooltip { 12 | padding: 8px; 13 | position: absolute; 14 | z-index: 9999; 15 | max-width: 300px; 16 | -webkit-box-shadow: 0 0 5px #aaa; 17 | box-shadow: 0 0 5px #aaa; 18 | } 19 | body .ui-tooltip { 20 | border-width: 2px; 21 | } 22 | -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/themes/cupertino/images/ui-bg_diagonals-thick_90_eeeeee_40x40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharparchitecture/Sharp-Architecture/1003810562889c4b79a3f8f00f9dd297c787822e/Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/themes/cupertino/images/ui-bg_diagonals-thick_90_eeeeee_40x40.png -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/themes/cupertino/images/ui-bg_flat_15_cd0a0a_40x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharparchitecture/Sharp-Architecture/1003810562889c4b79a3f8f00f9dd297c787822e/Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/themes/cupertino/images/ui-bg_flat_15_cd0a0a_40x100.png -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/themes/cupertino/images/ui-bg_glass_100_e4f1fb_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharparchitecture/Sharp-Architecture/1003810562889c4b79a3f8f00f9dd297c787822e/Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/themes/cupertino/images/ui-bg_glass_100_e4f1fb_1x400.png -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/themes/cupertino/images/ui-bg_glass_50_3baae3_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharparchitecture/Sharp-Architecture/1003810562889c4b79a3f8f00f9dd297c787822e/Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/themes/cupertino/images/ui-bg_glass_50_3baae3_1x400.png -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/themes/cupertino/images/ui-bg_glass_80_d7ebf9_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharparchitecture/Sharp-Architecture/1003810562889c4b79a3f8f00f9dd297c787822e/Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/themes/cupertino/images/ui-bg_glass_80_d7ebf9_1x400.png -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/themes/cupertino/images/ui-bg_highlight-hard_100_f2f5f7_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharparchitecture/Sharp-Architecture/1003810562889c4b79a3f8f00f9dd297c787822e/Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/themes/cupertino/images/ui-bg_highlight-hard_100_f2f5f7_1x100.png -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/themes/cupertino/images/ui-bg_highlight-hard_70_000000_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharparchitecture/Sharp-Architecture/1003810562889c4b79a3f8f00f9dd297c787822e/Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/themes/cupertino/images/ui-bg_highlight-hard_70_000000_1x100.png -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/themes/cupertino/images/ui-bg_highlight-soft_100_deedf7_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharparchitecture/Sharp-Architecture/1003810562889c4b79a3f8f00f9dd297c787822e/Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/themes/cupertino/images/ui-bg_highlight-soft_100_deedf7_1x100.png -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/themes/cupertino/images/ui-bg_highlight-soft_25_ffef8f_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharparchitecture/Sharp-Architecture/1003810562889c4b79a3f8f00f9dd297c787822e/Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/themes/cupertino/images/ui-bg_highlight-soft_25_ffef8f_1x100.png -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/themes/cupertino/images/ui-icons_2694e8_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharparchitecture/Sharp-Architecture/1003810562889c4b79a3f8f00f9dd297c787822e/Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/themes/cupertino/images/ui-icons_2694e8_256x240.png -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/themes/cupertino/images/ui-icons_2e83ff_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharparchitecture/Sharp-Architecture/1003810562889c4b79a3f8f00f9dd297c787822e/Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/themes/cupertino/images/ui-icons_2e83ff_256x240.png -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/themes/cupertino/images/ui-icons_3d80b3_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharparchitecture/Sharp-Architecture/1003810562889c4b79a3f8f00f9dd297c787822e/Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/themes/cupertino/images/ui-icons_3d80b3_256x240.png -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/themes/cupertino/images/ui-icons_72a7cf_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharparchitecture/Sharp-Architecture/1003810562889c4b79a3f8f00f9dd297c787822e/Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/themes/cupertino/images/ui-icons_72a7cf_256x240.png -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/themes/cupertino/images/ui-icons_ffffff_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharparchitecture/Sharp-Architecture/1003810562889c4b79a3f8f00f9dd297c787822e/Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Content/themes/cupertino/images/ui-icons_ffffff_256x240.png -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Controllers/AnalyticsController.cs: -------------------------------------------------------------------------------- 1 | namespace Suteki.TardisBank.Web.Mvc.Controllers 2 | { 3 | using System.Web.Mvc; 4 | 5 | using Suteki.TardisBank.Tasks; 6 | 7 | public class AnalyticsController : Controller 8 | { 9 | readonly TardisConfiguration configuration; 10 | 11 | public AnalyticsController(TardisConfiguration configuration) 12 | { 13 | this.configuration = configuration; 14 | } 15 | 16 | [ChildActionOnly] 17 | public PartialViewResult Index() 18 | { 19 | return this.PartialView(this.configuration); 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Controllers/HomeController.cs: -------------------------------------------------------------------------------- 1 | namespace Suteki.TardisBank.Web.Mvc.Controllers 2 | { 3 | using System.Web.Mvc; 4 | 5 | using Suteki.TardisBank.Domain; 6 | 7 | public class HomeController : Controller 8 | { 9 | public ViewResult Index() 10 | { 11 | return this.View("Index"); 12 | } 13 | 14 | public ViewResult Error() 15 | { 16 | // throw an error for testing 17 | throw new TardisBankException("Something really bad happened!"); 18 | } 19 | 20 | public ActionResult NotFound() 21 | { 22 | return new HttpStatusCodeResult(404); 23 | } 24 | 25 | public ViewResult About() 26 | { 27 | return this.View(); 28 | } 29 | 30 | public ViewResult Legal() 31 | { 32 | return this.View(); 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Controllers/MenuController.cs: -------------------------------------------------------------------------------- 1 | namespace Suteki.TardisBank.Web.Mvc.Controllers 2 | { 3 | using System.Web.Mvc; 4 | 5 | using Suteki.TardisBank.Domain; 6 | using Suteki.TardisBank.Tasks; 7 | 8 | public class MenuController : Controller 9 | { 10 | readonly IUserService userService; 11 | 12 | public MenuController(IUserService userService) 13 | { 14 | this.userService = userService; 15 | } 16 | 17 | [ChildActionOnly] 18 | public PartialViewResult Index() 19 | { 20 | var user = this.userService.CurrentUser; 21 | 22 | if (user == null) return this.PartialView("GuestMenu"); 23 | if (user is Parent) return this.PartialView("ParentMenu", user as Parent); 24 | if (user is Child) return this.PartialView("ChildMenu", user as Child); 25 | 26 | throw new TardisBankException("Unknown User type"); 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Controllers/NewsController.cs: -------------------------------------------------------------------------------- 1 | namespace Suteki.TardisBank.Web.Mvc.Controllers 2 | { 3 | using System; 4 | using System.Web.Mvc; 5 | using Suteki.TardisBank.Domain; 6 | using Suteki.TardisBank.Tasks; 7 | using Suteki.TardisBank.Web.Mvc.Models.News; 8 | 9 | public class NewsController : Controller 10 | { 11 | readonly IHttpContextService context; 12 | 13 | 14 | /// 15 | /// Initializes a new instance of the class. 16 | /// 17 | /// is . 18 | public NewsController(IHttpContextService context) 19 | { 20 | if (context == null) throw new ArgumentNullException("context"); 21 | this.context = context; 22 | } 23 | 24 | 25 | // GET: News 26 | public ActionResult Index() 27 | { 28 | var vm = new NewsListModel 29 | { 30 | IsParent = context.UserIsInRole(UserRoles.Parent), 31 | }; 32 | 33 | return View(vm); 34 | } 35 | 36 | [Authorize(Roles = UserRoles.Parent)] 37 | public ActionResult Edit() 38 | { 39 | return View(); 40 | } 41 | } 42 | } -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Controllers/ScheduleRunnerController.cs: -------------------------------------------------------------------------------- 1 | namespace Suteki.TardisBank.Web.Mvc.Controllers 2 | { 3 | using System; 4 | using System.Web.Mvc; 5 | 6 | using Suteki.TardisBank.Tasks; 7 | using Suteki.TardisBank.Web.Mvc.Utilities; 8 | 9 | public class ScheduleRunnerController : Controller 10 | { 11 | readonly ISchedulerService schedulerService; 12 | readonly TardisConfiguration configuration; 13 | 14 | public ScheduleRunnerController(ISchedulerService schedulerService, TardisConfiguration configuration) 15 | { 16 | this.schedulerService = schedulerService; 17 | this.configuration = configuration; 18 | } 19 | 20 | [HttpGet, SharpArch.Web.Mvc.Transaction] 21 | public ActionResult Execute(string id) 22 | { 23 | if (id == null || this.configuration.ScheduleKey != id) return StatusCode.NotFound; 24 | 25 | this.schedulerService.ExecuteUpdates(DateTime.Now); 26 | return StatusCode.Ok; 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Controllers/ViewModels/AccountSummaryViewModel.cs: -------------------------------------------------------------------------------- 1 | namespace Suteki.TardisBank.Web.Mvc.Controllers.ViewModels 2 | { 3 | using Suteki.TardisBank.Domain; 4 | 5 | public class AccountSummaryViewModel 6 | { 7 | public Child Child { get; set; } 8 | public Parent Parent { get; set; } 9 | 10 | public bool IsParentView 11 | { 12 | get { return this.Parent != null; } 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Controllers/ViewModels/AddScheduleViewModel.cs: -------------------------------------------------------------------------------- 1 | namespace Suteki.TardisBank.Web.Mvc.Controllers.ViewModels 2 | { 3 | using System; 4 | using System.ComponentModel.DataAnnotations; 5 | 6 | using Suteki.TardisBank.Domain; 7 | 8 | public class AddScheduleViewModel 9 | { 10 | [Required] 11 | public int ChildId{ get; set; } 12 | 13 | [Required] 14 | [Range(-1000000, 1000000)] 15 | public decimal Amount { get; set; } 16 | 17 | [Required] 18 | [StringLength(140, ErrorMessage = "Sorry maximum of 140 chars, just like Twitter :)")] 19 | public string Description { get; set; } 20 | 21 | [Required] 22 | public Interval Interval { get; set; } 23 | 24 | [Required] 25 | public DateTime StartDate { get; set; } 26 | } 27 | } -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Controllers/ViewModels/ChangePasswordViewModel.cs: -------------------------------------------------------------------------------- 1 | namespace Suteki.TardisBank.Web.Mvc.Controllers.ViewModels 2 | { 3 | using System.ComponentModel.DataAnnotations; 4 | 5 | public class ChangePasswordViewModel 6 | { 7 | [DataType(DataType.Password)] 8 | [Required(ErrorMessage = "You must enter your old password")] 9 | [StringLength(140, ErrorMessage = "Sorry maximum of 140 chars, just like Twitter :)")] 10 | public string OldPassword { get; set; } 11 | 12 | [DataType(DataType.Password)] 13 | [Required(ErrorMessage = "You must enter your new password")] 14 | [StringLength(140, ErrorMessage = "Sorry maximum of 140 chars, just like Twitter :)")] 15 | public string NewPassword { get; set; } 16 | 17 | [DataType(DataType.Password)] 18 | [Compare("NewPassword", ErrorMessage = "The password is different than in the other field. They must be identical")] 19 | [Required(ErrorMessage = "You must re-enter your password to make sure you didn't mistype it the first time")] 20 | [StringLength(140, ErrorMessage = "Sorry maximum of 140 chars, just like Twitter :)")] 21 | public string NewPasswordRepeat { get; set; } 22 | } 23 | } -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Controllers/ViewModels/DeleteChildConfirmViewModel.cs: -------------------------------------------------------------------------------- 1 | namespace Suteki.TardisBank.Web.Mvc.Controllers.ViewModels 2 | { 3 | public class DeleteChildConfirmViewModel 4 | { 5 | public int ChildId { get; set; } 6 | public string ChildName { get; set; } 7 | } 8 | } -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Controllers/ViewModels/ForgottenPasswordViewModel.cs: -------------------------------------------------------------------------------- 1 | namespace Suteki.TardisBank.Web.Mvc.Controllers.ViewModels 2 | { 3 | using System.ComponentModel.DataAnnotations; 4 | 5 | public class ForgottenPasswordViewModel 6 | { 7 | [Required(ErrorMessage = "You must enter a User Name or Password")] 8 | public string UserName { get; set; } 9 | } 10 | } -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Controllers/ViewModels/LoginViewModel.cs: -------------------------------------------------------------------------------- 1 | namespace Suteki.TardisBank.Web.Mvc.Controllers.ViewModels 2 | { 3 | using System.ComponentModel.DataAnnotations; 4 | 5 | public class LoginViewModel 6 | { 7 | [Required(ErrorMessage = "You must enter your user name")] 8 | [StringLength(140, ErrorMessage = "Sorry maximum of 140 chars, just like Twitter :)")] 9 | public string Name { get; set; } 10 | 11 | [Required(ErrorMessage = "You must enter your password")] 12 | [StringLength(140, ErrorMessage = "Sorry maximum of 140 chars, just like Twitter :)")] 13 | public string Password { get; set; } 14 | } 15 | } -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Controllers/ViewModels/MakePaymentViewModel.cs: -------------------------------------------------------------------------------- 1 | namespace Suteki.TardisBank.Web.Mvc.Controllers.ViewModels 2 | { 3 | using System.ComponentModel.DataAnnotations; 4 | 5 | public class MakePaymentViewModel 6 | { 7 | [Required] 8 | public int ChildId{ get; set; } 9 | 10 | [Required] 11 | public string ChildName { get; set; } 12 | 13 | [Required] 14 | [StringLength(140, ErrorMessage = "Sorry maximum of 140 chars, just like Twitter :)")] 15 | public string Description { get; set; } 16 | 17 | [Required] 18 | [Range(0, 1000000)] 19 | public decimal Amount { get; set; } 20 | } 21 | } -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Controllers/ViewModels/RegistrationViewModel.cs: -------------------------------------------------------------------------------- 1 | namespace Suteki.TardisBank.Web.Mvc.Controllers.ViewModels 2 | { 3 | using System.ComponentModel.DataAnnotations; 4 | 5 | public class RegistrationViewModel 6 | { 7 | [Required(ErrorMessage = "You must supply an email address")] 8 | [StringLength(140, ErrorMessage = "Sorry maximum of 140 chars, just like Twitter :)")] 9 | public string Email { get; set; } 10 | 11 | [Required(ErrorMessage = "You must supply a name")] 12 | [StringLength(140, ErrorMessage = "Sorry maximum of 140 chars, just like Twitter :)")] 13 | public string Name { get; set; } 14 | 15 | [Required(ErrorMessage = "You must supply a password")] 16 | public string Password { get; set; } 17 | } 18 | } -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Controllers/ViewModels/UserViewModel.cs: -------------------------------------------------------------------------------- 1 | namespace Suteki.TardisBank.Web.Mvc.Controllers.ViewModels 2 | { 3 | public class UserViewModel 4 | { 5 | public string UserName { get; set; } 6 | public bool IsLoggedIn { get; set; } 7 | } 8 | } -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Controllers/ViewModels/WithdrawCashForChildViewModel.cs: -------------------------------------------------------------------------------- 1 | namespace Suteki.TardisBank.Web.Mvc.Controllers.ViewModels 2 | { 3 | using System.ComponentModel.DataAnnotations; 4 | 5 | public class WithdrawCashForChildViewModel 6 | { 7 | public int ChildId{ get; set; } 8 | public string ChildName { get; set; } 9 | 10 | [Required] 11 | public string Description { get; set; } 12 | 13 | [Required] 14 | [Range(0, 1000000)] 15 | public decimal Amount { get; set; } 16 | } 17 | } -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Controllers/ViewModels/WithdrawCashViewModel.cs: -------------------------------------------------------------------------------- 1 | namespace Suteki.TardisBank.Web.Mvc.Controllers.ViewModels 2 | { 3 | using System.ComponentModel.DataAnnotations; 4 | 5 | public class WithdrawCashViewModel 6 | { 7 | [Required] 8 | [StringLength(140, ErrorMessage = "Sorry maximum of 140 chars, just like Twitter :)")] 9 | public string Description { get; set; } 10 | 11 | [Required] 12 | [Range(0, 1000000)] 13 | public decimal Amount { get; set; } 14 | } 15 | } -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Global.asax: -------------------------------------------------------------------------------- 1 | <%@ Application Codebehind="Global.asax.cs" Inherits="Suteki.TardisBank.Web.Mvc.MvcApplication" Language="C#" %> 2 | -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharparchitecture/Sharp-Architecture/1003810562889c4b79a3f8f00f9dd297c787822e/Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Icon.png -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Models/AnnouncementModel.cs: -------------------------------------------------------------------------------- 1 | namespace Suteki.TardisBank.Web.Mvc.Models 2 | { 3 | using System; 4 | using System.ComponentModel.DataAnnotations; 5 | using Newtonsoft.Json; 6 | 7 | /// 8 | /// Announcement summary model. 9 | /// 10 | public class AnnouncementSummary 11 | { 12 | [JsonProperty("id")] 13 | public int Id { get; set; } 14 | 15 | [JsonProperty("date")] 16 | [DataType(DataType.Date)] 17 | public DateTime Date { get; set; } 18 | 19 | [Required] 20 | [JsonProperty("title")] 21 | public string Title { get; set; } 22 | } 23 | 24 | /// 25 | /// Full announcement details. 26 | /// 27 | public class AnnouncementModel : AnnouncementSummary 28 | { 29 | [JsonProperty("content")] 30 | [Required] 31 | public string Content { get; set; } 32 | } 33 | } -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Models/News/NewsListModel.cs: -------------------------------------------------------------------------------- 1 | namespace Suteki.TardisBank.Web.Mvc.Models.News 2 | { 3 | public class NewsListModel 4 | { 5 | public bool IsParent { get; set; } 6 | } 7 | } -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/NHibernate.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Data Source=.;Initial Catalog=TardisBank;Integrated Security=True;Application Name=Suteki.TardisBank; 5 | NHibernate.Dialect.MsSql2008Dialect 6 | NHibernate.Connection.DriverConnectionProvider 7 | NHibernate.Driver.SqlClientDriver 8 | true 9 | auto 10 | 500 11 | 12 | 14 | update 15 | 16 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | 3 | // General Information about an assembly is controlled through the following 4 | // set of attributes. Change these attribute values to modify the information 5 | // associated with an assembly. 6 | [assembly: AssemblyTitle("Suteki.TardisBank.Web")] 7 | [assembly: AssemblyDescription("")] 8 | [assembly: AssemblyConfiguration("")] 9 | -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Scripts/_references.js: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | /// 4 | /// 5 | /// 6 | /// 7 | /// 8 | /// 9 | /// 10 | /// 11 | /// 12 | /// 13 | /// 14 | /// 15 | -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Scripts/app/common.js: -------------------------------------------------------------------------------- 1 | var app = function(me, $) { 2 | me.common = function(commonModule) { 3 | 4 | var rootUrl; 5 | 6 | commonModule.toLocalDate = function(aDate) { 7 | var date = new Date(aDate); 8 | return date.toLocaleDateString(); 9 | }; 10 | 11 | // navigation 12 | commonModule.nav = { 13 | setRootUrl : function(url) { 14 | rootUrl = url; 15 | }, 16 | getFullUrl : function(path) { 17 | return rootUrl + path; 18 | }, 19 | toLoginPage: function() { 20 | location.replace(app.common.nav.getFullUrl("User/Login")); 21 | } 22 | }; 23 | 24 | 25 | // redirect unauthorized user requests to login page 26 | $(document).ajaxError(function(event, jqxhr, settings, thrownError) { 27 | if (jqxhr.status == 401) { 28 | app.common.nav.toLoginPage(); 29 | } 30 | }); 31 | 32 | return commonModule; 33 | }(me.common || {}); 34 | return me; 35 | }(app || {}, jQuery); -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Utilities/Current.cs: -------------------------------------------------------------------------------- 1 | namespace Suteki.TardisBank.Web.Mvc.Utilities 2 | { 3 | using System.Threading; 4 | 5 | public class Current 6 | { 7 | public static string CurrencySymbol 8 | { 9 | get { return Thread.CurrentThread.CurrentCulture.NumberFormat.CurrencySymbol; } 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Utilities/DateFormatter.cs: -------------------------------------------------------------------------------- 1 | namespace Suteki.TardisBank.Web.Mvc.Utilities 2 | { 3 | public static class DateFormatter 4 | { 5 | public static string CurrentJQuery 6 | { 7 | get 8 | { 9 | var systemPattern = System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.ShortDatePattern; 10 | // change to a style that jQuery UI understands 11 | return systemPattern.Replace("M", "m").Replace("yyyy", "yy"); 12 | } 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Utilities/HttpContextService.cs: -------------------------------------------------------------------------------- 1 | namespace Suteki.TardisBank.Web.Mvc.Utilities 2 | { 3 | using System.Web; 4 | 5 | using Suteki.TardisBank.Domain; 6 | using Suteki.TardisBank.Tasks; 7 | 8 | public class HttpContextService : IHttpContextService 9 | { 10 | public string UserName 11 | { 12 | get { return CurrentHttpContext.User.Identity.Name; } 13 | } 14 | 15 | public bool UserIsAuthenticated 16 | { 17 | get { return CurrentHttpContext.User.Identity.IsAuthenticated; } 18 | } 19 | 20 | public bool UserIsInRole(string role) 21 | { 22 | return CurrentHttpContext.User.IsInRole(role); 23 | } 24 | 25 | static HttpContext CurrentHttpContext 26 | { 27 | get 28 | { 29 | var context = HttpContext.Current; 30 | if (context == null) 31 | { 32 | throw new TardisBankException("HttpContext.Current is null"); 33 | } 34 | return context; 35 | } 36 | } 37 | } 38 | } -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Utilities/StatusCode.cs: -------------------------------------------------------------------------------- 1 | namespace Suteki.TardisBank.Web.Mvc.Utilities 2 | { 3 | using System.Web.Mvc; 4 | 5 | public static class StatusCode 6 | { 7 | public static ActionResult NotFound 8 | { 9 | get { return new HttpStatusCodeResult(404); } 10 | } 11 | 12 | public static ActionResult Ok 13 | { 14 | get { return new HttpStatusCodeResult(200); } 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Utilities/UserLocaleModule.cs: -------------------------------------------------------------------------------- 1 | namespace Suteki.TardisBank.Web.Mvc.Utilities 2 | { 3 | using System; 4 | using System.Globalization; 5 | using System.Threading; 6 | using System.Web; 7 | 8 | public class UserLocaleModule : IHttpModule 9 | { 10 | public void Init(HttpApplication httpApplication) 11 | { 12 | httpApplication.BeginRequest += (sender, eventArgs) => 13 | { 14 | var app = sender as HttpApplication; 15 | if (app == null) 16 | { 17 | throw new ApplicationException("Sender is null or not an HttpApplication"); 18 | } 19 | var request = app.Context.Request; 20 | if (request.UserLanguages == null || request.UserLanguages.Length == 0) return; 21 | 22 | var language = request.UserLanguages[0]; 23 | if (language == null) return; 24 | 25 | try 26 | { 27 | Thread.CurrentThread.CurrentCulture = new CultureInfo(language); 28 | } 29 | catch 30 | {} 31 | }; 32 | } 33 | 34 | public void Dispose() 35 | { 36 | 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Views/Account/MakePayment.cshtml: -------------------------------------------------------------------------------- 1 | @using Suteki.TardisBank.Web.Mvc.Utilities 2 | @model Suteki.TardisBank.Web.Mvc.Controllers.ViewModels.MakePaymentViewModel 3 | 4 | @{ 5 | Layout = "~/Views/Shared/SiteLayout.cshtml"; 6 | } 7 |

Make a Payment to @Model.ChildName

8 |

@Html.ValidationSummary()

9 |
10 | @{ Html.BeginForm(); } 11 | @Html.HiddenFor(x => x.ChildId) 12 | @Html.HiddenFor(x => x.ChildName) 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 |
@Html.TextBoxFor(x => x.Description)
@Html.TextBoxFor(x => x.Amount)
 
27 | @{ Html.EndForm(); } 28 |
29 | -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Views/Account/PaymentConfirmation.cshtml: -------------------------------------------------------------------------------- 1 | @model Suteki.TardisBank.Web.Mvc.Controllers.ViewModels.MakePaymentViewModel 2 | 3 | @{ 4 | Layout = "~/Views/Shared/SiteLayout.cshtml"; 5 | } 6 | 7 |

Payment Confirmed

8 |

You have transferred @Model.Amount.ToString("c") to @Model.ChildName's account with the description "@Model.Description".

9 |

@Html.ActionLink(Model.ChildName + "'s Account", "ParentView", "Account", new { id = @Model.ChildId }, null)

10 | 11 | 12 | -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Views/Account/WithdrawCash.cshtml: -------------------------------------------------------------------------------- 1 | @using Suteki.TardisBank.Web.Mvc.Utilities 2 | @model Suteki.TardisBank.Web.Mvc.Controllers.ViewModels.WithdrawCashViewModel 3 | 4 | @{ 5 | Layout = "~/Views/Shared/SiteLayout.cshtml"; 6 | } 7 |

Withdraw Cash

8 |

@Html.ValidationSummary()

9 |
10 | @{ Html.BeginForm(); } 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 |
@Html.TextBoxFor(x => x.Description)
@Html.TextBoxFor(x => x.Amount)
 
25 | @{ Html.EndForm(); } 26 |
27 | 28 | -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Views/Account/WithdrawCashConfirm.cshtml: -------------------------------------------------------------------------------- 1 | @model Suteki.TardisBank.Web.Mvc.Controllers.ViewModels.WithdrawCashViewModel 2 | 3 | @{ 4 | Layout = "~/Views/Shared/SiteLayout.cshtml"; 5 | } 6 | 7 |

Withdrawl Confirmed

8 |

A message has been sent to your parent asking for the amount of @Model.Amount.ToString("c"). Ask them to check their messages.

9 |

@Html.ActionLink("Back to your account", "ChildView", "Account")

10 | 11 | -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Views/Account/WithdrawCashForChild.cshtml: -------------------------------------------------------------------------------- 1 | @using Suteki.TardisBank.Web.Mvc.Utilities 2 | @model Suteki.TardisBank.Web.Mvc.Controllers.ViewModels.WithdrawCashForChildViewModel 3 | 4 | @{ 5 | Layout = "~/Views/Shared/SiteLayout.cshtml"; 6 | } 7 |

Withdraw Cash For Your Child

8 |

Use this form if you want to give your child some cash, or if you have bought something on their behalf. The amount will be deducted from their account.

9 |

@Html.ValidationSummary()

10 |
11 | @{ Html.BeginForm(); } 12 | @Html.HiddenFor(x => x.ChildId) 13 | @Html.HiddenFor(x => x.ChildName) 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 |
@Html.TextBoxFor(x => x.Description)
@Html.TextBoxFor(x => x.Amount)
 
28 | @{ Html.EndForm(); } 29 |
30 | 31 | 32 | -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Views/Account/WithdrawCashForChildConfirm.cshtml: -------------------------------------------------------------------------------- 1 | @model Suteki.TardisBank.Web.Mvc.Controllers.ViewModels.WithdrawCashForChildViewModel 2 | 3 | @{ 4 | Layout = "~/Views/Shared/SiteLayout.cshtml"; 5 | } 6 |

Withdrawl Confirmed

7 |

@Model.Amount has been withdrawn from @Model.ChildName's account.

8 |

@Html.ActionLink(Model.ChildName + "'s Account", "ParentView", "Account", new { id = @Model.ChildId }, null)

9 | 10 | 11 | -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Views/Admin/DeleteParentConfirm.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | @{ 4 | Layout = "~/Views/Shared/SiteLayout.cshtml"; 5 | } 6 | 7 |

Are you sure you want to delete your account?

8 |

This action can not be undone.

9 |

@Html.ActionLink("Yes I'm sure. Delete my account", "DeleteParent", null, new { @class = "warning" })

10 | 11 | 12 | -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Views/Admin/Index.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | @{ 4 | Layout = "~/Views/Shared/SiteLayout.cshtml"; 5 | } 6 | 7 |

Administer your account

8 |

To delete your account, including your children's accounts, click the button below.

9 |

@Html.ActionLink("Delete My Account", "DeleteParentConfirm")

10 | 11 |

To change your password, click the button below.

12 |

@Html.ActionLink("Change my password", "ChangePassword")

13 | 14 | 15 | -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Views/Analytics/Index.cshtml: -------------------------------------------------------------------------------- 1 | @model Suteki.TardisBank.Tasks.TardisConfiguration 2 | 3 | 16 | -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Views/Child/DeleteChild.cshtml: -------------------------------------------------------------------------------- 1 | @model Suteki.TardisBank.Web.Mvc.Controllers.ViewModels.DeleteChildConfirmViewModel 2 | 3 | @{ 4 | Layout = "~/Views/Shared/SiteLayout.cshtml"; 5 | } 6 | 7 |

Are you sure you want to delete @Model.ChildName's account?

8 |
9 | @{ Html.BeginForm(); } 10 | @Html.HiddenFor(x => x.ChildId) 11 | @Html.HiddenFor(x => x.ChildName) 12 | 13 | 14 | 15 | 16 | 17 |
 
18 | @{ Html.EndForm(); } 19 |
20 | 21 | -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Views/Child/Index.cshtml: -------------------------------------------------------------------------------- 1 | @model Suteki.TardisBank.Domain.Parent 2 | 3 | @{ 4 | Layout = "~/Views/Shared/SiteLayout.cshtml"; 5 | } 6 | 7 |

Your Childrens' Accounts

8 | 9 | @if(Model.Children.Count == 0){ 10 |

Please click on the button below to create accounts for your children.

11 | } else { 12 |

This is list of your childrens' accounts. To view the account, click 'View Account'.

13 | } 14 |
15 | 16 | @foreach(var child in Model.Children) { 17 | 18 | 19 | 20 | 21 | 22 | } 23 |
@child.Name@Html.ActionLink("View Account", "ParentView", "Account", new { id = child.Id }, null)@Html.ActionLink("Delete", "DeleteChild", "Child", new { id = child.Id }, new { @class = "warning" })
24 |
25 |

26 | @Html.ActionLink("Add A Child", "AddChild", "User") 27 |

28 | -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Views/Home/Legal.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | @{ 4 | Layout = "~/Views/Shared/SiteLayout.cshtml"; 5 | } 6 | 7 |
8 |

Legal Stuff

9 |

Tardis Bank is for educational use only.

10 |

While we do our best to make sure it works properly, We make no guarantees about either the integrity or the safety of your data.

11 |

We a not liable for any loss or inconvenience you may experience as a consequence of using this site.

12 |
13 | 14 |
 
15 | 16 | -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Views/Menu/ChildMenu.cshtml: -------------------------------------------------------------------------------- 1 | @model Suteki.TardisBank.Domain.Child 2 | 3 | 9 | 10 | -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Views/Menu/GuestMenu.cshtml: -------------------------------------------------------------------------------- 1 |  7 | -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Views/Menu/ParentMenu.cshtml: -------------------------------------------------------------------------------- 1 | @model Suteki.TardisBank.Domain.Parent 2 | 3 | 11 | 12 | -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Views/News/Edit.cshtml: -------------------------------------------------------------------------------- 1 | @using Suteki.TardisBank.Web.Mvc 2 | @model dynamic 3 | 4 | @{ 5 | ViewBag.Title = "Edit news"; 6 | } 7 |

Edit news

8 | 9 |
10 | Add Annoouncement 11 |
Title
12 |
13 | 14 |
15 | 16 |
Contents
17 |
18 | 19 |
20 |
21 | 22 | 23 | 24 |
25 |

26 | 27 |

Published announcements

28 |
    29 |
30 | 31 | 32 | @section scripts 33 | { 34 | 37 | 38 | @Scripts.Render(BundleConfig.NewsScript) 39 | 40 | 48 | 49 | 50 | } -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Views/News/Index.cshtml: -------------------------------------------------------------------------------- 1 | @using Suteki.TardisBank.Web.Mvc 2 | @model Suteki.TardisBank.Web.Mvc.Models.News.NewsListModel 3 | 4 | @{ 5 | ViewBag.Title = "News"; 6 | Layout = "~/Views/Shared/SiteLayout.cshtml"; 7 | } 8 | 9 | @if (Model.IsParent) 10 | { 11 |

12 | @Html.ActionLink("Click here to edit news list", "Edit", "News") 13 |

14 | } 15 | 16 |

Latest news

17 | 18 |
19 |
    20 |
    21 | 22 |
    23 | 24 |
    25 |
    26 | 27 | @section scripts 28 | { 29 | 35 | 36 | 39 | 40 | @Scripts.Render(BundleConfig.NewsScript) 41 | 42 | 50 | } -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Views/Openid/Index.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "~/Views/Shared/SiteLayout.cshtml"; 3 | } 4 | 5 |

    Members Only Area

    6 |

    Congratulations,
    7 | You have completed the OpenID login process. 8 |

    9 |

    10 | Logout 11 |

    12 | 13 | -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Views/Openid/Login.cshtml: -------------------------------------------------------------------------------- 1 |  @if (ViewData["Message"] != null) { 2 |
    3 | @Html.Encode(ViewData["Message"].ToString()) 4 |
    5 | } 6 |

    You must log in before entering the Members Area:

    7 |
    8 | 9 | 10 | 11 |
    12 | 13 | -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Views/Password/ChildConfirm.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | @{ 4 | Layout = "~/Views/Shared/SiteLayout.cshtml"; 5 | } 6 | 7 |

    Password Reset Sucessfully

    8 |

    We have sent your new password to your parent. Ask them to check their email.

    9 | 10 | 11 | -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Views/Password/Forgot.cshtml: -------------------------------------------------------------------------------- 1 | @model Suteki.TardisBank.Web.Mvc.Controllers.ViewModels.ForgottenPasswordViewModel 2 | 3 | @{ 4 | Layout = "~/Views/Shared/SiteLayout.cshtml"; 5 | } 6 | 7 |

    Reset Your Password

    8 |

    If you are a child, enter your user name below. If you are a parent, enter your email address.

    9 |

    @Html.ValidationSummary()

    10 |
    11 | @{ Html.BeginForm(); } 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 |
    @Html.TextBoxFor(x => x.UserName)
     
    22 | @{ Html.EndForm(); } 23 |
    24 | 25 | 26 | -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Views/Password/ParentConfirm.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | @{ 4 | Layout = "~/Views/Shared/SiteLayout.cshtml"; 5 | } 6 | 7 |

    Password Reset Sucessfully

    8 |

    We have sent your new password to your email address.

    9 | 10 | -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Views/Schedule/AddScheduleConfirm.cshtml: -------------------------------------------------------------------------------- 1 | @model Suteki.TardisBank.Web.Mvc.Controllers.ViewModels.AddScheduleViewModel 2 | 3 | @{ 4 | Layout = "~/Views/Shared/SiteLayout.cshtml"; 5 | } 6 | 7 |

    Schedule Created

    8 |

    Your child's regular pocket money schedule has been created.

    9 |

    The first payment of @Model.Amount.ToString("c") will be paid on @Model.StartDate.ToLongDateString(), and then every @Model.Interval after that.

    10 |

    @Html.ActionLink("Return to your child's account", "ParentView", "Account", new { id = Model.ChildId }, null)

    11 | 12 | -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Views/User/ActivateConfirm.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | @{ 4 | Layout = "~/Views/Shared/SiteLayout.cshtml"; 5 | } 6 | 7 |

    Congratulations!

    8 |

    You are now registered at Tardis Bank. Please Log in.

    9 |

    @Html.ActionLink("Login", "Login")

    10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Views/User/ActivationFailed.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | @{ 4 | Layout = "~/Views/Shared/SiteLayout.cshtml"; 5 | } 6 | 7 |

    Activation Failed

    8 |

    We are very sorry, but we didn't recognise your activation key.

    9 |

    Please try again, making sure you copy the URL exactly into your browser.

    10 |

    it still doesn't work, contact us at 11 | info@tardisbank.com

    12 | 13 | 14 | -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Views/User/AddChild.cshtml: -------------------------------------------------------------------------------- 1 | @model Suteki.TardisBank.Web.Mvc.Controllers.ViewModels.RegistrationViewModel 2 | 3 | @{ 4 | Layout = "~/Views/Shared/SiteLayout.cshtml"; 5 | } 6 |

    Add a Child Account

    7 |

    Complete the form below to create an account for your child.

    8 |

    @Html.ValidationSummary()

    9 |
    10 | @{ Html.BeginForm(); } 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 |
    @Html.TextBoxFor(x => x.Email)This needs to be unique, for example 'tomrobinson04'
    @Html.TextBoxFor(x => x.Name)This is just for display, for example 'Tom'
    @Html.PasswordFor(x => x.Password)So that your child can sign in.
      
    33 | @{ Html.EndForm(); } 34 |
    35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Views/User/Confirm.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "~/Views/Shared/SiteLayout.cshtml"; 3 | } 4 | 5 |

    Now check your email (or just login if no smtp server is configured)

    6 |

    You should have recieved an email from us with a link to an activation page. Just click on the link to activate your account

    7 |

    If you don't get the email, please contact us at info@tardisbank.com

    8 | 9 | -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Views/User/DisplayGreeting.cshtml: -------------------------------------------------------------------------------- 1 | @model Suteki.TardisBank.Web.Mvc.Controllers.ViewModels.UserViewModel 2 | 3 | @Model.UserName  4 | @if(Model.IsLoggedIn) { 5 | @Html.ActionLink("Logout", "Logout") 6 | } else { 7 | @Html.ActionLink("Login", "Login") 8 | } 9 | -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Views/User/Login.cshtml: -------------------------------------------------------------------------------- 1 | @model Suteki.TardisBank.Web.Mvc.Controllers.ViewModels.LoginViewModel 2 | 3 | @{ 4 | Layout = "~/Views/Shared/SiteLayout.cshtml"; 5 | } 6 |

    Log In

    7 |

    @Html.ValidationSummary()

    8 |
    9 | @{ Html.BeginForm(); } 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 |
    @Html.TextBoxFor(x => x.Name)
    @Html.PasswordFor(x => x.Password)
     
    24 | @{ Html.EndForm(); } 25 |
    26 |
    27 |

    Forgotten your password? Just click this link...

    28 | @Html.ActionLink("I've forgotten my password", "Forgot", "Password") 29 |
    30 | 31 | -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Views/User/Messages.cshtml: -------------------------------------------------------------------------------- 1 | @model Suteki.TardisBank.Domain.User 2 | 3 | @{ 4 | Layout = "~/Views/Shared/SiteLayout.cshtml"; 5 | } 6 | 7 |

    Your Messages

    8 | @if(Model.Messages.Count == 0) { 9 |

    You have no messages

    10 | } else { 11 | 12 | 13 | @foreach(var message in Model.Messages.Reverse()) { 14 | 15 | 16 | 17 | @if(message.HasBeenRead) { 18 | 19 | } else { 20 | 21 | } 22 | 23 | } 24 | 25 |
    @message.Date.ToShortDateString()@message.TextDone@Html.ActionLink("OK", "ReadMessage", new { id = @message.Id })
    26 |

    (Note: we only keep the last @Suteki.TardisBank.Domain.User.MaxMessages messages)

    27 | } 28 | 29 | -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "~/Views/Shared/SiteLayout.cshtml"; 3 | } 4 | -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Web.Debug.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 17 | 18 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/Web.Release.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 17 | 18 | 19 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/WebApi/ValidateModel.cs: -------------------------------------------------------------------------------- 1 | namespace Suteki.TardisBank.Web.Mvc.WebApi 2 | { 3 | using System.Net; 4 | using System.Net.Http; 5 | using System.Web.Http.Controllers; 6 | using System.Web.Http.Filters; 7 | 8 | /// 9 | /// Automatically validate model. 10 | /// 11 | /// 12 | /// Taken from article http://www.asp.net/web-api/overview/formats-and-model-binding/model-validation-in-aspnet-web-api 13 | /// 14 | public sealed class ValidateModelAttribute : ActionFilterAttribute 15 | { 16 | public override void OnActionExecuting(HttpActionContext actionContext) 17 | { 18 | if (actionContext.ModelState.IsValid == false) 19 | { 20 | actionContext.Response = actionContext.Request.CreateErrorResponse( 21 | HttpStatusCode.BadRequest, actionContext.ModelState); 22 | } 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharparchitecture/Sharp-Architecture/1003810562889c4b79a3f8f00f9dd297c787822e/Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/favicon.ico -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharparchitecture/Sharp-Architecture/1003810562889c4b79a3f8f00f9dd297c787822e/Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/favicon.png -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharparchitecture/Sharp-Architecture/1003810562889c4b79a3f8f00f9dd297c787822e/Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharparchitecture/Sharp-Architecture/1003810562889c4b79a3f8f00f9dd297c787822e/Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharparchitecture/Sharp-Architecture/1003810562889c4b79a3f8f00f9dd297c787822e/Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharparchitecture/Sharp-Architecture/1003810562889c4b79a3f8f00f9dd297c787822e/Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharparchitecture/Sharp-Architecture/1003810562889c4b79a3f8f00f9dd297c787822e/Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharparchitecture/Sharp-Architecture/1003810562889c4b79a3f8f00f9dd297c787822e/Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharparchitecture/Sharp-Architecture/1003810562889c4b79a3f8f00f9dd297c787822e/Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharparchitecture/Sharp-Architecture/1003810562889c4b79a3f8f00f9dd297c787822e/Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharparchitecture/Sharp-Architecture/1003810562889c4b79a3f8f00f9dd297c787822e/Samples/old/TardisBank/Solutions/Suteki.TardisBank.Web.Mvc/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /SharpArchitecture.code-workspace: -------------------------------------------------------------------------------- 1 | { 2 | "folders": [ 3 | { 4 | "path": "." 5 | } 6 | ] 7 | } -------------------------------------------------------------------------------- /Src/Directory.Build.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | runtime; build; native; contentfiles; analyzers; buildtransitive 9 | all 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /Src/SharpArch.Domain/DomainModel/DomainSignatureAttribute.cs: -------------------------------------------------------------------------------- 1 | namespace SharpArch.Domain.DomainModel 2 | { 3 | using System; 4 | using JetBrains.Annotations; 5 | 6 | /// 7 | /// Facilitates indicating which property(s) describe the unique signature of an 8 | /// entity. See for when this is leveraged. 9 | /// 10 | /// 11 | /// This is intended for use with . It may NOT be used on a . 12 | /// 13 | [Serializable] 14 | [AttributeUsage(AttributeTargets.Property)] 15 | [PublicAPI] 16 | [BaseTypeRequired(typeof(IEntity<>))] 17 | public sealed class DomainSignatureAttribute : Attribute 18 | { } 19 | } 20 | -------------------------------------------------------------------------------- /Src/SharpArch.Domain/DomainModel/IHasAssignedId.cs: -------------------------------------------------------------------------------- 1 | namespace SharpArch.Domain.DomainModel 2 | { 3 | using System; 4 | using JetBrains.Annotations; 5 | 6 | /// 7 | /// Defines the public members of a class that supports setting an assigned ID of an object. 8 | /// 9 | /// The type of the ID. 10 | [PublicAPI] 11 | public interface IHasAssignedId 12 | where TId : IEquatable 13 | { 14 | /// 15 | /// Sets the assigned ID of an object. 16 | /// 17 | /// 18 | /// This is not part of since most entities do not have assigned 19 | /// IDs and since business rules will certainly vary as to what constitutes a valid, 20 | /// assigned ID for one object but not for another. 21 | /// 22 | void SetAssignedIdTo(TId assignedId); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Src/SharpArch.Domain/PersistenceSupport/IEntityDuplicateChecker.cs: -------------------------------------------------------------------------------- 1 | namespace SharpArch.Domain.PersistenceSupport 2 | { 3 | using DomainModel; 4 | using JetBrains.Annotations; 5 | 6 | /// 7 | /// Defines the public members of a class that checks an entity for duplicates. 8 | /// 9 | [PublicAPI] 10 | public interface IEntityDuplicateChecker 11 | { 12 | /// Returns a value indicating whether a duplicate of the specified exists. 13 | /// The entity. 14 | /// is null. 15 | /// 16 | /// true if a duplicate exists, false otherwise. 17 | /// 18 | bool DoesDuplicateExistWithTypedIdOf(IEntity entity); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Src/SharpArch.Domain/PersistenceSupport/ISupportsTransactionStatus.cs: -------------------------------------------------------------------------------- 1 | namespace SharpArch.Domain.PersistenceSupport 2 | { 3 | using JetBrains.Annotations; 4 | 5 | 6 | /// 7 | /// Returns transaction status. 8 | /// 9 | [PublicAPI] 10 | public interface ISupportsTransactionStatus 11 | { 12 | /// 13 | /// Checks whether transaction is active or not. 14 | /// 15 | bool IsActive { get; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Src/SharpArch.Domain/PersistenceSupport/RepositoryExtensions.cs: -------------------------------------------------------------------------------- 1 | namespace SharpArch.Domain.PersistenceSupport 2 | { 3 | using System; 4 | using System.Threading; 5 | using System.Threading.Tasks; 6 | using DomainModel; 7 | using JetBrains.Annotations; 8 | 9 | 10 | /// 11 | /// Repository extension methods. 12 | /// 13 | [PublicAPI] 14 | public static class RepositoryExtensions 15 | { 16 | /// 17 | /// Saves the specified object to the repository and evicts it from the session. 18 | /// 19 | /// 20 | /// or is 21 | /// . 22 | /// 23 | public static async Task SaveAndEvictAsync( 24 | this IRepository repository, TEntity entity, CancellationToken cancellationToken = default) 25 | where TEntity : class, IEntity 26 | where TId : IEquatable 27 | { 28 | if (repository == null) throw new ArgumentNullException(nameof(repository)); 29 | if (entity == null) throw new ArgumentNullException(nameof(entity)); 30 | var saved = await repository.SaveAsync(entity, CancellationToken.None).ConfigureAwait(false); 31 | await repository.EvictAsync(saved, cancellationToken).ConfigureAwait(false); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Src/SharpArch.Domain/Reflection/ITypePropertyDescriptorCache.cs: -------------------------------------------------------------------------------- 1 | namespace SharpArch.Domain.Reflection 2 | { 3 | using System; 4 | using JetBrains.Annotations; 5 | 6 | /// 7 | /// Property descriptors cache. 8 | /// 9 | /// 10 | /// Implementation is thread-safe. 11 | /// 12 | [PublicAPI] 13 | public interface ITypePropertyDescriptorCache 14 | { 15 | /// 16 | /// Returns number of entries in the cache. 17 | /// 18 | int Count { get; } 19 | 20 | /// 21 | /// Find cached property descriptor. 22 | /// 23 | /// The type. 24 | /// or null if does not exists. 25 | TypePropertyDescriptor? Find(Type type); 26 | 27 | /// 28 | /// Get existing property descriptor or create and cache it. 29 | /// 30 | /// The type. 31 | /// The factory to create descriptor. 32 | /// 33 | TypePropertyDescriptor GetOrAdd(Type type, Func factory); 34 | 35 | /// 36 | /// Clears the cache. 37 | /// 38 | void Clear(); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Src/SharpArch.Domain/SharpArch.Domain.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | Provides the core interfaces and classes needed by a Sharp Architecture application. It is persistence ignorant and would be used with other packages that provide persistance support. 9 | $(PackageTags);domain 10 | icon.png 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /Src/SharpArch.Domain/Specifications/AdHoc.cs: -------------------------------------------------------------------------------- 1 | namespace SharpArch.Domain.Specifications 2 | { 3 | using System; 4 | using System.Linq.Expressions; 5 | using JetBrains.Annotations; 6 | 7 | /// 8 | /// An ad hoc query specification. 9 | /// 10 | /// The entity type. 11 | [PublicAPI] 12 | public class AdHoc : QuerySpecification 13 | { 14 | /// 15 | /// Initializes a new instance of the class. 16 | /// 17 | /// The expression. 18 | public AdHoc(Expression>? expression) 19 | { 20 | MatchingCriteria = expression; 21 | } 22 | 23 | /// 24 | /// Gets the matching criteria. 25 | /// 26 | public override Expression>? MatchingCriteria { get; } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Src/SharpArch.Domain/Specifications/ILinqSpecification.cs: -------------------------------------------------------------------------------- 1 | namespace SharpArch.Domain.Specifications 2 | { 3 | using System.Linq; 4 | 5 | /// 6 | /// Defines a contract for the behaviour of a LINQ Specification design pattern. 7 | /// 8 | /// The type to be used for Input / Output. 9 | public interface ILinqSpecification 10 | { 11 | /// 12 | /// Returns the elements from the specified candidates that are satisfying the 13 | /// specification. 14 | /// 15 | /// The candidates. 16 | /// A list of satisfying elements. 17 | IQueryable SatisfyingElementsFrom(IQueryable candidates); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Src/SharpArch.Infrastructure/CodeBaseLocator.cs: -------------------------------------------------------------------------------- 1 | namespace SharpArch.Infrastructure 2 | { 3 | using System; 4 | using System.IO; 5 | using System.Reflection; 6 | using JetBrains.Annotations; 7 | 8 | 9 | /// 10 | /// Resolves assembly code base directory. 11 | /// 12 | [PublicAPI] 13 | public class CodeBaseLocator 14 | { 15 | /// 16 | /// Returns directory of assembly code base. 17 | /// 18 | /// Assembly 19 | /// Directory path 20 | /// is 21 | public static string GetAssemblyCodeBasePath(Assembly assembly) 22 | { 23 | if (assembly == null) throw new ArgumentNullException(nameof(assembly)); 24 | 25 | #if NET5_0_OR_GREATER 26 | return Path.GetDirectoryName(assembly.Location) 27 | ?? Directory.GetCurrentDirectory(); 28 | 29 | #else 30 | var uri = new UriBuilder(assembly.CodeBase); 31 | var uriPath = Uri.UnescapeDataString(uri.Path); 32 | return Path.GetDirectoryName(uriPath)!; 33 | #endif 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Src/SharpArch.Infrastructure/SharpArch.Infrastructure.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Provides infrastrucure components for Sharp Architecture application. 5 | $(PackageTags);infrastructure 6 | icon.png 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /Src/SharpArch.NHibernate/FluentNHibernate/Conventions/CustomForeignKeyConvention.cs: -------------------------------------------------------------------------------- 1 | namespace SharpArch.NHibernate.FluentNHibernate.Conventions 2 | { 3 | using System; 4 | using global::FluentNHibernate; 5 | using global::FluentNHibernate.Conventions; 6 | using JetBrains.Annotations; 7 | 8 | 9 | /// 10 | /// Foreign key convention. 11 | /// 12 | /// 13 | [PublicAPI] 14 | public class CustomForeignKeyConvention : ForeignKeyConvention 15 | { 16 | /// 17 | /// Generates Foreign Key name. 18 | /// 19 | protected override string GetKeyName(Member property, Type type) 20 | { 21 | if (property == null) { 22 | return type.Name + "Id"; 23 | } 24 | 25 | return property.Name + "Id"; 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Src/SharpArch.NHibernate/FluentNHibernate/Conventions/PrimaryKeyConvention.cs: -------------------------------------------------------------------------------- 1 | namespace SharpArch.NHibernate.FluentNHibernate.Conventions 2 | { 3 | using global::FluentNHibernate.Conventions; 4 | using global::FluentNHibernate.Conventions.Instances; 5 | using JetBrains.Annotations; 6 | 7 | 8 | /// 9 | /// Primary Key convention. 10 | /// 11 | /// 12 | /// Defines Primary Key name as EntityType+Id. E.c. ColorId 13 | /// 14 | /// 15 | [PublicAPI] 16 | public class PrimaryKeyConvention : IIdConvention 17 | { 18 | /// 19 | /// Applies convention. 20 | /// 21 | public void Apply(IIdentityInstance instance) 22 | { 23 | instance.Column(instance.EntityType.Name + "Id"); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Src/SharpArch.NHibernate/FluentNHibernate/Conventions/TableNameConvention.cs: -------------------------------------------------------------------------------- 1 | namespace SharpArch.NHibernate.FluentNHibernate.Conventions 2 | { 3 | using global::FluentNHibernate.Conventions; 4 | using global::FluentNHibernate.Conventions.Instances; 5 | using JetBrains.Annotations; 6 | 7 | 8 | /// 9 | /// Table name convention. 10 | /// 11 | /// Defines table name to match entity name. E.g.: Color. 12 | /// 13 | [PublicAPI] 14 | public class TableNameConvention : IClassConvention 15 | { 16 | /// 17 | /// Applies convention. 18 | /// 19 | public void Apply(IClassInstance instance) 20 | { 21 | instance.Table(instance.EntityType.Name); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Src/SharpArch.NHibernate/FluentNHibernate/GeneratorHelper.cs: -------------------------------------------------------------------------------- 1 | namespace SharpArch.NHibernate.FluentNHibernate 2 | { 3 | using System; 4 | using System.Linq; 5 | using JetBrains.Annotations; 6 | 7 | 8 | /// 9 | /// An optional helper class used to view the mapping file generated from a fluent nhibernate class mapper 10 | /// 11 | /// 12 | /// This is not necessary for Fluent Nhibernate to function properly. 13 | /// 14 | [PublicAPI] 15 | public class GeneratorHelper 16 | { 17 | const string GeneratorInterface = nameof(IMapGenerator); 18 | 19 | /// 20 | /// Scans assembly for IMapGenerator implementers. 21 | /// 22 | /// 23 | public static IMapGenerator[] GetMapGenerators() 24 | { 25 | var assembly = typeof(IMapGenerator).Assembly; 26 | 27 | return (from type in assembly.GetTypes() 28 | where null != type.GetInterface(GeneratorInterface) 29 | select Activator.CreateInstance(type)).OfType().ToArray(); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Src/SharpArch.NHibernate/FluentNHibernate/IAutoPersistenceModelGenerator.cs: -------------------------------------------------------------------------------- 1 | namespace SharpArch.NHibernate.FluentNHibernate 2 | { 3 | using global::FluentNHibernate.Automapping; 4 | using JetBrains.Annotations; 5 | 6 | 7 | /// 8 | /// Fluent NHibernate auto-mapping model generator. 9 | /// 10 | /// 11 | /// Interface implementors will be automatically executed by TestDatabaseInitializer during test database 12 | /// initialization. 13 | /// 14 | [PublicAPI] 15 | public interface IAutoPersistenceModelGenerator 16 | { 17 | /// 18 | /// Generates persistence model. 19 | /// 20 | 21 | AutoPersistenceModel Generate(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Src/SharpArch.NHibernate/FluentNHibernate/IMapGenerator.cs: -------------------------------------------------------------------------------- 1 | namespace SharpArch.NHibernate.FluentNHibernate 2 | { 3 | using System.Xml; 4 | using JetBrains.Annotations; 5 | 6 | 7 | /// 8 | /// Facilitates the visitor pattern for to spit out the NHibernate 9 | /// XML for the class. 10 | /// To use, have your mapper implement this interface. Then, simply include the following line within 11 | /// Generate(): return CreateMapping(new MappingVisitor()); 12 | /// Now you can call Generate on your mapper class to view the generated XML. 13 | /// 14 | /// 15 | /// This is not necessary for Fluent Nhibernate to function properly. 16 | /// 17 | [PublicAPI] 18 | public interface IMapGenerator 19 | { 20 | /// 21 | /// File name. 22 | /// 23 | string FileName { get; } 24 | 25 | /// 26 | /// Generates XML mapping document. 27 | /// 28 | 29 | XmlDocument Generate(); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Src/SharpArch.NHibernate/INHibernateTransactionManager.cs: -------------------------------------------------------------------------------- 1 | namespace SharpArch.NHibernate 2 | { 3 | using System.Threading; 4 | using System.Threading.Tasks; 5 | using Domain.PersistenceSupport; 6 | using global::NHibernate; 7 | 8 | 9 | /// 10 | /// NHibernate transaction support. 11 | /// 12 | public interface INHibernateTransactionManager : ITransactionManager 13 | { 14 | /// 15 | /// Returns NHibernate session. 16 | /// 17 | ISession Session { get; } 18 | 19 | /// 20 | /// Flushes everything that has been changed since the last commit. 21 | /// 22 | Task FlushChangesAsync(CancellationToken cancellationToken = default); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Src/SharpArch.NHibernate/ISessionFactoryKeyProvider.cs: -------------------------------------------------------------------------------- 1 | namespace SharpArch.NHibernate 2 | { 3 | using JetBrains.Annotations; 4 | 5 | 6 | /// 7 | /// Provides the key to retrieve session factory from IoC. 8 | /// 9 | [PublicAPI] 10 | public interface ISessionFactoryKeyProvider 11 | { 12 | /// 13 | /// Gets the session factory key. 14 | /// 15 | /// 16 | 17 | string GetKey(); 18 | 19 | /// 20 | /// Gets the session factory key. 21 | /// 22 | /// An optional object that may have an attribute used to determine the session factory key. 23 | /// 24 | 25 | string GetKeyFrom(object anObject); 26 | } 27 | } -------------------------------------------------------------------------------- /Src/SharpArch.NHibernate/NHibernateQuery.cs: -------------------------------------------------------------------------------- 1 | namespace SharpArch.NHibernate 2 | { 3 | using System; 4 | using global::NHibernate; 5 | using JetBrains.Annotations; 6 | 7 | /// 8 | /// Base class for NHibernate query objects. 9 | /// 10 | [PublicAPI] 11 | public abstract class NHibernateQuery 12 | { 13 | /// 14 | /// Initializes a new instance of the class. 15 | /// 16 | /// The session. 17 | /// is null. 18 | protected NHibernateQuery(ISession session) 19 | { 20 | if (session == null) throw new ArgumentNullException(nameof(session)); 21 | 22 | this.Session = session; 23 | } 24 | 25 | /// 26 | /// NHibernate . 27 | /// 28 | 29 | protected virtual ISession Session { get; } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Src/SharpArch.NHibernate/SharpArch.NHibernate.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | Provides NHibernate persistance support for a Sharp Architecture application, providing NHibernate session managment and initialisation, and implementations of core SharpArch data access interfaces. 9 | $(PackageTags);nhibernate;persistance 10 | icon.png 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /Src/SharpArch.RavenDb/SharpArch.RavenDb.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | Provides RavenDB persistance support for a Sharp Architecture application, providing implementations of core SharpArch data access interfaces. 9 | $(PackageTags);raven-db;persistance 10 | icon.png 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Src/SharpArch.Testing.NUnit/SharpArch.Testing.NUnit.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Provides base classes to help with testing applications written with Sharp Architecture and NHibernate. 10 | This is legacy package, for future development xUnit is recommended. 11 | $(PackageTags);testing;nunit 12 | icon.png 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /Src/SharpArch.Testing.Xunit.NHibernate/SharpArch.Testing.Xunit.NHibernate.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Provides base classes to help with testing applications written with Sharp Architecture using xUnit. 10 | $(PackageTags);testing;xunit;db-testing;nhibernate 11 | false 12 | icon.png 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | false 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /Src/SharpArch.Testing.Xunit/SharpArch.Testing.Xunit.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | Provides base classes to help with testing applications written with Sharp Architecture using xUnit. 9 | $(PackageTags);testing;xunit 10 | icon.png 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | false 24 | 25 | 26 | -------------------------------------------------------------------------------- /Src/SharpArch.Testing/SharpArch.Testing.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | Provides base classes and extension methods to help with testing applications written with Sharp Architecture library. 9 | $(PackageTags);testing 10 | icon.png 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /Src/SharpArch.Web.AspNetCore/SharpArch.Web.AspNetCore.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | $(AppTargetFrameworks) 10 | 11 | 12 | 13 | Provides AspNet.Core MVC extensions. 14 | $(PackageTags);aspnet-core;web-api;aspnet-core-mvc 15 | icon.png 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Src/Tests/SharpArch.Tests.NHibernate/PreInsertlistener.cs: -------------------------------------------------------------------------------- 1 | namespace Tests.SharpArch.NHibernate 2 | { 3 | using System; 4 | using System.Threading; 5 | using System.Threading.Tasks; 6 | using global::NHibernate.Event; 7 | 8 | 9 | [Serializable] 10 | class PreInsertListener : IPreInsertEventListener 11 | { 12 | public Task OnPreInsertAsync(PreInsertEvent @event, CancellationToken cancellationToken) 13 | { 14 | return PreUpdateListener.True; 15 | } 16 | 17 | public bool OnPreInsert(PreInsertEvent @event) 18 | { 19 | return true; 20 | } 21 | } 22 | 23 | 24 | [Serializable] 25 | public class PreUpdateListener : IPreUpdateEventListener 26 | { 27 | internal static readonly Task True = Task.FromResult(true); 28 | 29 | public Task OnPreUpdateAsync(PreUpdateEvent @event, CancellationToken cancellationToken) 30 | { 31 | return True; 32 | } 33 | 34 | public bool OnPreUpdate(PreUpdateEvent @event) 35 | { 36 | return true; 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Src/Tests/SharpArch.Tests.NHibernate/RepositoryTests.cs: -------------------------------------------------------------------------------- 1 | // ReSharper disable UnusedMember.Local 2 | namespace Tests.SharpArch.NHibernate 3 | { 4 | using FluentAssertions; 5 | using global::NHibernate; 6 | using global::SharpArch.Domain.DomainModel; 7 | using global::SharpArch.Domain.PersistenceSupport; 8 | using global::SharpArch.NHibernate; 9 | using Moq; 10 | using NUnit.Framework; 11 | 12 | 13 | [TestFixture] 14 | // ReSharper disable once TestFileNameWarning 15 | class RepositoryTests 16 | { 17 | [Test] 18 | public void CanCastConcreteLinqRepositoryToInterfaceILinqRepository() 19 | { 20 | var session = new Mock(); 21 | var transactionManager = new Mock(); 22 | transactionManager.SetupGet(t => t.Session).Returns(session.Object); 23 | var concreteRepository = new LinqRepository(transactionManager.Object); 24 | 25 | concreteRepository.Should().BeAssignableTo>(); 26 | } 27 | } 28 | 29 | 30 | public class MyEntity: Entity 31 | { 32 | string? Name { get; set; } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Src/Tests/SharpArch.Tests.NHibernate/hibernate.cfg.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | NHibernate.Connection.DriverConnectionProvider 7 | 8 | 9 | NHibernate.Dialect.SQLiteDialect 10 | 11 | 12 | NHibernate.Driver.SQLite20Driver 13 | 14 | 15 | Data Source=:memory:;Version=3;New=True; 16 | 17 | on_close 18 | create 19 | 20 | -------------------------------------------------------------------------------- /Src/Tests/SharpArch.Tests.NHibernate/sqlite-nhibernate-config.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | NHibernate.Dialect.SQLiteDialect 8 | 9 | 10 | NHibernate.Driver.SQLite20Driver 11 | 12 | 13 | Data Source=:memory:;Version=3;New=True; 14 | 15 | on_close 16 | true 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Src/Tests/SharpArch.XunitTests.NHibernate/HasUniqieDomainSignatureTestsBase.cs: -------------------------------------------------------------------------------- 1 | namespace Tests.SharpArch.NHibernate 2 | { 3 | using System; 4 | using System.ComponentModel.DataAnnotations; 5 | using global::SharpArch.Domain.PersistenceSupport; 6 | using global::SharpArch.NHibernate; 7 | using global::SharpArch.Testing.Xunit.NHibernate; 8 | using Mappings; 9 | using Moq; 10 | 11 | 12 | public abstract class HasUniqueDomainSignatureTestsBase : TransientDatabaseTests 13 | { 14 | protected readonly Mock ServiceProviderMock; 15 | protected ValidationContext? ValidationContext; 16 | 17 | public HasUniqueDomainSignatureTestsBase() 18 | : base(new NHibernateTestsSetup()) 19 | { 20 | ServiceProviderMock = new Mock(); 21 | ServiceProviderMock.Setup(sp => sp.GetService(typeof(IEntityDuplicateChecker))) 22 | .Returns(new EntityDuplicateChecker(Session)); 23 | } 24 | 25 | /// 26 | /// Create validation context for given object. 27 | /// 28 | /// 29 | /// 30 | protected ValidationContext ValidationContextFor(object objectToValidate) 31 | { 32 | return new(objectToValidate, ServiceProviderMock.Object, null); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Src/Tests/SharpArch.XunitTests.NHibernate/NHibernateTestsSetup.cs: -------------------------------------------------------------------------------- 1 | namespace Tests.SharpArch.NHibernate 2 | { 3 | using System.Collections.Generic; 4 | using System.Reflection; 5 | using Domain; 6 | using FluentNHibernate.Cfg.Db; 7 | using global::NHibernate.Cfg; 8 | using global::SharpArch.NHibernate; 9 | using global::SharpArch.Testing.NHibernate; 10 | using Mappings; 11 | 12 | 13 | public class NHibernateTestsSetup : TestDatabaseSetup 14 | { 15 | public NHibernateTestsSetup() 16 | : base(Assembly.GetExecutingAssembly().Location, 17 | typeof(TestsPersistenceModelGenerator), 18 | new[] 19 | { 20 | typeof(ObjectWithGuidId).Assembly, 21 | //typeof(TestsPersistenceModelGenerator).Assembly 22 | }) 23 | { 24 | } 25 | 26 | /// 27 | protected override void Customize(NHibernateSessionFactoryBuilder builder) 28 | { 29 | base.Customize(builder); 30 | builder.UsePersistenceConfigurer(new SQLiteConfiguration().InMemory()); 31 | builder.UseProperties(new SortedList 32 | { 33 | [Environment.ReleaseConnections] = "on_close", 34 | [Environment.Hbm2ddlAuto] = "create" 35 | }); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Src/Tests/SharpArch.XunitTests.NHibernate/PreInsertlistener.cs: -------------------------------------------------------------------------------- 1 | namespace Tests.SharpArch.NHibernate 2 | { 3 | using System; 4 | using System.Threading; 5 | using System.Threading.Tasks; 6 | using global::NHibernate.Event; 7 | 8 | 9 | [Serializable] 10 | internal class PreInsertListener : IPreInsertEventListener 11 | { 12 | public Task OnPreInsertAsync(PreInsertEvent @event, CancellationToken cancellationToken) 13 | { 14 | return PreUpdateListener.True; 15 | } 16 | 17 | public bool OnPreInsert(PreInsertEvent @event) 18 | { 19 | return true; 20 | } 21 | } 22 | 23 | 24 | [Serializable] 25 | public class PreUpdateListener : IPreUpdateEventListener 26 | { 27 | internal static readonly Task True = Task.FromResult(true); 28 | 29 | public Task OnPreUpdateAsync(PreUpdateEvent @event, CancellationToken cancellationToken) 30 | { 31 | return True; 32 | } 33 | 34 | public bool OnPreUpdate(PreUpdateEvent @event) 35 | { 36 | return true; 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Src/Tests/SharpArch.XunitTests.NHibernate/RepositoryTests.cs: -------------------------------------------------------------------------------- 1 | // ReSharper disable UnusedMember.Global 2 | namespace Tests.SharpArch.NHibernate 3 | { 4 | using FluentAssertions; 5 | using global::NHibernate; 6 | using global::SharpArch.Domain.DomainModel; 7 | using global::SharpArch.Domain.PersistenceSupport; 8 | using global::SharpArch.NHibernate; 9 | using Moq; 10 | using Xunit; 11 | 12 | 13 | public class RepositoryTests 14 | { 15 | [Fact] 16 | public void CanCastConcreteLinqRepositoryToInterfaceILinqRepository() 17 | { 18 | var session = new Mock(); 19 | var transactionManager = new Mock(); 20 | transactionManager.SetupGet(t => t.Session).Returns(session.Object); 21 | var concreteRepository = new LinqRepository(transactionManager.Object); 22 | 23 | concreteRepository.Should().BeAssignableTo>(); 24 | } 25 | } 26 | 27 | 28 | public class MyEntity: Entity 29 | { 30 | public string? Name { get; set; } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Src/Tests/SharpArch.XunitTests.NHibernate/sqlite-nhibernate-config.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | NHibernate.Dialect.SQLiteDialect 8 | 9 | 10 | NHibernate.Driver.SQLite20Driver 11 | 12 | 13 | Data Source=:memory:;Version=3;New=True; 14 | 15 | on_close 16 | true 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Src/Tests/SharpArch.XunitTests/Helpers/ITestService.cs: -------------------------------------------------------------------------------- 1 | namespace Tests.Helpers 2 | { 3 | internal interface ITestService 4 | { 5 | void Do(); 6 | } 7 | 8 | 9 | internal class TestService : ITestService 10 | { 11 | public void Do() 12 | { 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Src/Tests/SharpArch.XunitTests/SharpArch.Domain/Reflection/TypePropertyDescriptorCacheTests.cs: -------------------------------------------------------------------------------- 1 | namespace Tests.SharpArch.Domain.Reflection 2 | { 3 | using System; 4 | using FluentAssertions; 5 | using global::SharpArch.Domain.Reflection; 6 | using Xunit; 7 | 8 | 9 | public class TypePropertyDescriptorCacheTests 10 | { 11 | readonly TypePropertyDescriptorCache _cache; 12 | 13 | public TypePropertyDescriptorCacheTests() 14 | { 15 | _cache = new TypePropertyDescriptorCache(); 16 | } 17 | 18 | [Fact] 19 | public void Clear_Should_ClearTheCache() 20 | { 21 | _cache.GetOrAdd(GetType(), t => new TypePropertyDescriptor(t, null)); 22 | _cache.Clear(); 23 | _cache.Find(GetType()).Should().BeNull(); 24 | } 25 | 26 | [Fact] 27 | public void Find_Should_ReturnNullForMissingDescriptor() 28 | { 29 | _cache.Find(typeof(TypePropertyDescriptorCache)).Should().BeNull(); 30 | } 31 | 32 | [Fact] 33 | public void GetOrAdd_Should_AddMissingItemToCache() 34 | { 35 | Type type = GetType(); 36 | var descriptor = new TypePropertyDescriptor(type, null); 37 | _cache.GetOrAdd(type, _ => descriptor).Should().BeSameAs(descriptor); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Src/Tests/SharpArch.XunitTests/SharpArch.Infrastructure/CodeBaseLocatorTests.cs: -------------------------------------------------------------------------------- 1 | namespace Tests.SharpArch.Infrastructure 2 | { 3 | using System; 4 | using System.IO; 5 | using System.Reflection; 6 | using FluentAssertions; 7 | using global::SharpArch.Infrastructure; 8 | using Xunit; 9 | using Xunit.Abstractions; 10 | 11 | 12 | public class CodeBaseLocatorTests 13 | { 14 | readonly ITestOutputHelper _output; 15 | 16 | public CodeBaseLocatorTests(ITestOutputHelper output) 17 | { 18 | _output = output ?? throw new ArgumentNullException(nameof(output)); 19 | } 20 | 21 | [Fact] 22 | public void CanResolveAssemblyPath() 23 | { 24 | var path = CodeBaseLocator.GetAssemblyCodeBasePath(Assembly.GetExecutingAssembly()); 25 | _output.WriteLine("Assembly path: '{0}'", path); 26 | path.Should().NotBeNullOrEmpty(); 27 | Directory.Exists(path).Should().BeTrue(); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Src/Tests/SharpArch.XunitTests/SharpArch.XunitTests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Tests 5 | $(NoWarn);1701;1702;EPS06 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | all 16 | runtime; build; native; contentfiles; analyzers 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /Src/dupFinder.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | false 4 | 70 5 | false 6 | false 7 | false 8 | false 9 | false 10 | 11 | 12 | 13 | SharpArch.sln 14 | 15 | 16 | **\obj\**\*.cs 17 | 18 | 19 | false 20 | ..\Drops\Inspections\DuplicateReport.xml 21 | false 22 | true 23 | -------------------------------------------------------------------------------- /Src/global.json: -------------------------------------------------------------------------------- 1 | { 2 | "sdk": { 3 | "version": "6.0.100-rc.1.21463.6" 4 | } 5 | } -------------------------------------------------------------------------------- /VersionHistory.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharparchitecture/Sharp-Architecture/1003810562889c4b79a3f8f00f9dd297c787822e/VersionHistory.txt -------------------------------------------------------------------------------- /global.json: -------------------------------------------------------------------------------- 1 | { 2 | "sdk": { 3 | "version": "6.0.100-rc.2.21505.57" 4 | } 5 | } -------------------------------------------------------------------------------- /readthedocs.yml: -------------------------------------------------------------------------------- 1 | # .readthedocs.yml 2 | # Read the Docs configuration file 3 | # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details 4 | 5 | # Required 6 | version: 2 7 | 8 | # Build documentation in the docs/ directory with Sphinx 9 | sphinx: 10 | configuration: Artefacts/Documentation/source/conf.py 11 | 12 | # Build documentation with MkDocs 13 | #mkdocs: 14 | # configuration: mkdocs.yml 15 | 16 | # Optionally build your docs in additional formats such as PDF and ePub 17 | formats: all 18 | 19 | # Optionally set the version of Python and requirements required to build your docs 20 | python: 21 | version: 3.7 22 | install: 23 | - requirements: Artefacts/Documentation/requirements.txt 24 | --------------------------------------------------------------------------------