├── .gitignore ├── .semver ├── Gemfile ├── Gemfile.lock ├── README.md ├── Rakefile ├── init_app_pool_login.sql ├── nuget.config └── src ├── .nuget ├── NuGet.Config ├── NuGet.exe ├── NuGet.targets └── packages.config ├── __NAME__.AcceptanceTests ├── Api │ ├── Diagnostics │ │ └── DiagnosticsTester.cs │ └── Examples │ │ └── ExampleTester.cs ├── Config │ ├── AppSettings.config │ └── QA │ │ └── AppSettings.config ├── Properties │ └── AssemblyInfo.cs ├── RefitStubs.cs ├── __NAME__.AcceptanceTests.csproj ├── app.config └── packages.config ├── __NAME__.Api.Client ├── ApiClientBootstrapper.cs ├── ApiClientFactory.cs ├── Diagnostics │ └── IDiagnosticsClient.cs ├── Examples │ └── IExampleClient.cs ├── Properties │ └── AssemblyInfo.cs ├── RefitStubs.cs ├── __NAME__.Api.Client.csproj └── packages.config ├── __NAME__.Api ├── App │ └── Example │ │ ├── ExampleMapper.cs │ │ ├── ExampleModule.cs │ │ └── ExampleValidator.cs ├── App_Data │ └── Config │ │ ├── ConnectionStrings.config │ │ ├── Prod │ │ ├── ConnectionStrings.config │ │ └── UnicastBus.config │ │ ├── QA │ │ ├── ConnectionStrings.config │ │ └── UnicastBus.config │ │ └── UnicastBus.config ├── Infrastructure │ ├── Bootstrapping │ │ ├── NancyBootstrapper.cs │ │ └── Registries │ │ │ ├── AppRegistry.cs │ │ │ └── NHibernateRegistry.cs │ ├── Diagnostics │ │ ├── DiagnosticsModule.cs │ │ ├── IReportStatus.cs │ │ ├── MessageBusPingReporter.cs │ │ ├── PersistenceStatusReporter.cs │ │ └── PingModule.cs │ └── Pipelines │ │ └── UnitOfWorkPipeline.cs ├── PreDeploy.ps1 ├── Properties │ └── AssemblyInfo.cs ├── Startup.cs ├── Web.config ├── __NAME__.Api.csproj └── packages.config ├── __NAME__.Database ├── Deploy.ps1 ├── Examples │ └── 20150412194400_ExampleEntity.cs ├── Properties │ └── AssemblyInfo.cs ├── _Scripts │ ├── create.sql │ ├── drop.sql │ └── seed.sql ├── __NAME__.Database.csproj └── packages.config ├── __NAME__.Domain.Persistence ├── Diagnostics │ ├── MigrationRecord.cs │ ├── MigrationRecordMap.cs │ └── MigrationsRepository.cs ├── Examples │ └── ExampleEntityMap.cs ├── NHibernateRepository.cs ├── Properties │ └── AssemblyInfo.cs ├── SessionFactoryConfig.cs ├── __NAME__.Domain.Persistence.csproj └── packages.config ├── __NAME__.Domain ├── Defaults.cs ├── Examples │ └── ExampleEntity.cs ├── Properties │ └── AssemblyInfo.cs ├── __NAME__.Domain.csproj └── packages.config ├── __NAME__.Example.Api.Client ├── App.config ├── Config │ └── AppSettings.config ├── Program.cs ├── Properties │ └── AssemblyInfo.cs ├── __NAME__.Example.Api.Client.csproj └── packages.config ├── __NAME__.IntegrationTests ├── App.config ├── Infrastructure │ ├── BaseDomainPersistenceTester.cs │ ├── BaseStatelessPersistenceTester.cs │ ├── DefaultCompareConfig.cs │ ├── TestConnectionProvider.cs │ └── TestSessionFactoryConfig.cs ├── Persistence │ └── Examples │ │ └── ExamplePersistenceTester.cs ├── Properties │ └── AssemblyInfo.cs ├── __NAME__.IntegrationTests.csproj └── packages.config ├── __NAME__.MessageBus.Client ├── Diagnostics │ └── DiagnosticsSender.cs ├── Examples │ └── ExampleSender.cs ├── MessageBusClientBootstrapper.cs ├── Properties │ └── AssemblyInfo.cs ├── __NAME__.MessageBus.Client.csproj ├── app.config └── packages.config ├── __NAME__.MessageBus ├── App.config ├── App │ └── Examples │ │ └── CloseExampleHandler.cs ├── Config │ ├── ConnectionStrings.config │ ├── Log4Net.config │ ├── Production │ │ └── Log4Net.config │ ├── QA │ │ └── Log4Net.config │ └── UnicastBus.config ├── Infrastructure │ ├── Bootstrapping │ │ ├── EndpointConfig.cs │ │ ├── NHibernateRegistry.cs │ │ └── ServiceRegistry.cs │ ├── Diagnostics │ │ └── PingHandler.cs │ └── UnitOfWorkManager.cs ├── PostDeploy.ps1 ├── PreDeploy.ps1 ├── Properties │ └── AssemblyInfo.cs ├── __NAME__.MessageBus.csproj └── packages.config ├── __NAME__.Messages ├── ConventionExtensions.cs ├── Diagnostics │ └── PingCommand.cs ├── Examples │ └── CloseExampleCommand.cs ├── Properties │ └── AssemblyInfo.cs └── __NAME__.Messages.csproj ├── __NAME__.Models ├── Diagnostics │ └── StatusItem.cs ├── Examples │ ├── CloseExampleModel.cs │ ├── ExampleModel.cs │ └── NewExampleModel.cs ├── Properties │ └── AssemblyInfo.cs └── __NAME__.Models.csproj ├── __NAME__.UnitTests ├── Domain │ └── Examples │ │ └── ExampleEntityTester.cs ├── Properties │ └── AssemblyInfo.cs ├── __NAME__.UnitTests.csproj ├── app.config └── packages.config └── __NAME__.sln /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.sln.docstates 8 | 9 | # Build results 10 | [Dd]ebug/ 11 | [Dd]ebugPublic/ 12 | [Rr]elease/ 13 | x64/ 14 | build/ 15 | bld/ 16 | [Bb]in/ 17 | [Oo]bj/ 18 | 19 | # MSTest test Results 20 | [Tt]est[Rr]esult*/ 21 | [Bb]uild[Ll]og.* 22 | 23 | #NUNIT 24 | *.VisualState.xml 25 | TestResult.xml 26 | 27 | *_i.c 28 | *_p.c 29 | *_i.h 30 | *.ilk 31 | *.meta 32 | *.obj 33 | *.pch 34 | *.pdb 35 | *.pgc 36 | *.pgd 37 | *.rsp 38 | *.sbr 39 | *.tlb 40 | *.tli 41 | *.tlh 42 | *.tmp 43 | *.tmp_proj 44 | *.log 45 | *.vspscc 46 | *.vssscc 47 | .builds 48 | *.pidb 49 | *.svclog 50 | *.scc 51 | 52 | # Chutzpah Test files 53 | _Chutzpah* 54 | 55 | # Visual C++ cache files 56 | ipch/ 57 | *.aps 58 | *.ncb 59 | *.opensdf 60 | *.sdf 61 | *.cachefile 62 | 63 | # Visual Studio profiler 64 | *.psess 65 | *.vsp 66 | *.vspx 67 | 68 | # TFS 2012 Local Workspace 69 | $tf/ 70 | 71 | # Guidance Automation Toolkit 72 | *.gpState 73 | 74 | # ReSharper is a .NET coding add-in 75 | _ReSharper*/ 76 | *.[Rr]e[Ss]harper 77 | *.DotSettings.user 78 | 79 | # JustCode is a .NET coding addin-in 80 | .JustCode 81 | 82 | # TeamCity is a build add-in 83 | _TeamCity* 84 | 85 | # DotCover is a Code Coverage Tool 86 | *.dotCover 87 | 88 | # NCrunch 89 | *.ncrunch* 90 | _NCrunch_* 91 | .*crunch*.local.xml 92 | 93 | # MightyMoose 94 | *.mm.* 95 | AutoTest.Net/ 96 | 97 | # Web workbench (sass) 98 | .sass-cache/ 99 | 100 | # Installshield output folder 101 | [Ee]xpress/ 102 | 103 | # DocProject is a documentation generator add-in 104 | DocProject/buildhelp/ 105 | DocProject/Help/*.HxT 106 | DocProject/Help/*.HxC 107 | DocProject/Help/*.hhc 108 | DocProject/Help/*.hhk 109 | DocProject/Help/*.hhp 110 | DocProject/Help/Html2 111 | DocProject/Help/html 112 | 113 | # Click-Once directory 114 | publish/ 115 | 116 | # Publish Web Output 117 | *.[Pp]ublish.xml 118 | *.azurePubxml 119 | 120 | # NuGet Packages Directory 121 | ## TODO: If you have NuGet Package Restore enabled, uncomment the next line 122 | packages/* 123 | ## TODO: If the tool you use requires repositories.config, also uncomment the next line 124 | !packages/repositories.config 125 | 126 | # Enable "build/" folder in the NuGet Packages folder since NuGet packages use it for MSBuild targets 127 | # This line needs to be after the ignore of the build folder (and the packages folder if the line above has been uncommented) 128 | !packages/build/ 129 | 130 | # Windows Azure Build Output 131 | csx/ 132 | *.build.csdef 133 | 134 | # Windows Store app package directory 135 | AppPackages/ 136 | 137 | # Others 138 | sql/ 139 | *.Cache 140 | ClientBin/ 141 | [Ss]tyle[Cc]op.* 142 | ~$* 143 | *~ 144 | *.dbmdl 145 | *.dbproj.schemaview 146 | *.pfx 147 | *.publishsettings 148 | node_modules/ 149 | 150 | # RIA/Silverlight projects 151 | Generated_Code/ 152 | 153 | # Backup & report files from converting an old project file to a newer 154 | # Visual Studio version. Backup files are not needed, because we have git ;-) 155 | _UpgradeReport_Files/ 156 | Backup*/ 157 | UpgradeLog*.XML 158 | UpgradeLog*.htm 159 | 160 | # SQL Server files 161 | App_Data/*.mdf 162 | App_Data/*.ldf 163 | 164 | # Business Intelligence projects 165 | *.rdl.data 166 | *.bim.layout 167 | *.bim_*.settings 168 | 169 | # Microsoft Fakes 170 | FakesAssemblies/ 171 | 172 | # ========================= 173 | # Windows detritus 174 | # ========================= 175 | 176 | # Windows image file caches 177 | Thumbs.db 178 | ehthumbs.db 179 | 180 | # Folder config file 181 | Desktop.ini 182 | 183 | # Recycle Bin used on file shares 184 | $RECYCLE.BIN/ 185 | 186 | # Ignore FluentMigrator change scripts 187 | migrate-output.sql 188 | 189 | #Nuget packages 190 | packages/ 191 | src/packages 192 | .bundle/ 193 | .idea/ 194 | 195 | #created files 196 | /src/SouthFloridaVision.Web/apps/userfiles 197 | /src/SouthFloridaVision.Web/apps/userfiles_temp 198 | 199 | working/* 200 | working* 201 | 202 | src/SouthFloridaVision.userprefs 203 | 204 | # Ignore NancyFx keyStore 205 | keyStore/ 206 | src/__NAME__.Api/App_Data/nsb_log*.txt 207 | -------------------------------------------------------------------------------- /.semver: -------------------------------------------------------------------------------- 1 | --- 2 | :major: 0 3 | :minor: 1 4 | :patch: 0 5 | :special: "" -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source "https://rubygems.org" 2 | 3 | gem 'physique', '~> 0.3' 4 | gem 'warmup', '~> 0.6' -------------------------------------------------------------------------------- /Gemfile.lock: -------------------------------------------------------------------------------- 1 | GEM 2 | remote: https://rubygems.org/ 3 | specs: 4 | activesupport (4.2.1) 5 | i18n (~> 0.7) 6 | json (~> 1.7, >= 1.7.7) 7 | minitest (~> 5.1) 8 | thread_safe (~> 0.3, >= 0.3.4) 9 | tzinfo (~> 1.1) 10 | albacore (2.3.22) 11 | map (~> 6.5) 12 | nokogiri (~> 1.5) 13 | rake (~> 10) 14 | semver2 (~> 3.4) 15 | i18n (0.7.0) 16 | json (1.8.2) 17 | map (6.5.5) 18 | mini_portile (0.6.2) 19 | minitest (5.6.0) 20 | nokogiri (1.6.6.2-x64-mingw32) 21 | mini_portile (~> 0.6.0) 22 | nokogiri (1.6.6.2-x86-mingw32) 23 | mini_portile (~> 0.6.0) 24 | physique (0.3.10) 25 | activesupport (~> 4.1) 26 | albacore (~> 2.3) 27 | map (~> 6.5) 28 | rake (~> 10) 29 | semver2 (~> 3.4) 30 | rake (10.4.2) 31 | semver2 (3.4.2) 32 | thread_safe (0.3.5) 33 | tzinfo (1.2.2) 34 | thread_safe (~> 0.1) 35 | warmup (0.6.6.0) 36 | 37 | PLATFORMS 38 | x64-mingw32 39 | x86-mingw32 40 | 41 | DEPENDENCIES 42 | physique (~> 0.3) 43 | warmup (~> 0.6) 44 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | *This top section of the README describes how to get started with the template and should be deleted after the template has been generated.* 2 | 3 | *** 4 | # Microservice.Template 5 | 6 | A solution template for quickly creating a microservice using the following technologies: 7 | 8 | * [NancyFx](http://nancyfx.org) 9 | * [NServiceBus](http://particular.net/nservicebus) 10 | * [StructureMap](http://structuremap.github.io/) 11 | * [NHibernate](http://nhibernate.info/) / [Fluent NHibernate](http://www.fluentnhibernate.org/) 12 | * [Crux](https://github.com/scardetto/Crux) 13 | * [FluentMigrator](https://github.com/schambers/fluentmigrator) 14 | * [AutoMapper](http://automapper.org/) 15 | * [FluentValidation](https://github.com/JeremySkinner/FluentValidation) 16 | * [Refit](https://github.com/paulcbetts/refit) 17 | 18 | At [Third Wave Technology](http://www.thirdwave.it), we use this template as a starting point when we create a new service layer application for our clients. 19 | 20 | ## Getting Started 21 | 22 | This template is designed to be used with [WarmuP](https://github.com/chucknorris/warmup), a command-line utility that substitutes a single replacement token across file and folder names, as well as within the individual files within a Git repo or local directory. 23 | 24 | ### Prerequisites 25 | 26 | To use WarmuP, you will need to install some prerequisites: 27 | 28 | * [Ruby 2.1](https://github.com/scardetto/physique/blob/master/RUBY_SETUP.md) or later 29 | * Install the WarmuP gem by running the following: 30 | 31 | ``` 32 | $ gem install warmup 33 | ``` 34 | 35 | ### Generating the Solution 36 | 37 | * Open a command prompt and `cd` into the directory where you want to create the new repository. 38 | * Using an administrative command prompt, type the following: 39 | 40 | ``` 41 | $ warmup https://github.com/ThirdWaveTech/Microservice.Template <> 42 | ``` 43 | 44 | For example, let's say you were creating a microservice to manage users. You might enter something like this: 45 | 46 | ``` 47 | $ warmup https://github.com/ThirdWaveTech/Microservice.Template MyCompany.UserService 48 | $ cd MyCompany.UserService 49 | ``` 50 | 51 | ## What's in the Template? 52 | 53 | The solution contains several projects. At first glance it might seem like a lot, but this is by design. While it's certainly possible to combine them into fewer more coarse-grained projects, we decided to keep them separate to emphasize the separation of concerns behind the architecture. This template is only a starting point so feel free to modify it as you see fit. :) 54 | 55 | ### Project Breakdown 56 | 57 | *NOTE: The \_\_NAME\_\_ token will be replaced with your solution name by WarmuP.* 58 | 59 | #### \_\_NAME\_\_.Api 60 | 61 | A NancyFx application which provides an HTTP API to your clients. This app is where you will implement the synchronous communication to your service. 62 | 63 | #### \_\_NAME\_\_.MessageBus 64 | 65 | An NServiceBus host application. This app provides asynchronous, durable communication into your service. 66 | 67 | #### \_\_NAME\_\_.Domain 68 | 69 | This library is where you implement your domain logic using [Domain Driven Design](http://en.wikipedia.org/wiki/Domain-driven_design) principles. Common implementations of the DDD patterns are provided by the Crux library. 70 | 71 | #### \_\_NAME\_\_.Domain.Persistence 72 | 73 | This library is where you implement your NHibernate ORM mappings and configuration. 74 | 75 | #### \_\_NAME\_\_.Database 76 | 77 | This library contains your FluentMigrator migrations. It also has some SQL scripts that can be used with Physique to create an efficient [developer workflow](https://github.com/scardetto/physique/blob/master/FLUENT_MIGRATOR.md). 78 | 79 | #### \_\_NAME\_\_.Api.Client 80 | 81 | A library that can be used by .NET clients to call your HTTP service. It uses Refit to create lightweight interfaces. 82 | 83 | #### \_\_NAME\_\_.MessageBus.Client 84 | 85 | A library that can be used by .NET clients to call your service via message queueing. 86 | 87 | #### \_\_NAME\_\_.Models 88 | 89 | A library containing the strongly-typed model objects used by the API. 90 | 91 | #### \_\_NAME\_\_.Messages 92 | 93 | A library containing the messages that will be consumed and published by the message bus. 94 | 95 | ### Unit Test Assemblies 96 | 97 | The solution contiains three NUnit assemblies: 98 | 99 | #### \_\_NAME\_\_.UnitTests 100 | 101 | For unit tests, unsurprisingly. 102 | 103 | #### \_\_NAME\_\_.IntegrationTests 104 | 105 | For integration tests that talk to a database, an external API, or any other external component. 106 | 107 | #### \_\_NAME\_\_.AcceptanceTests 108 | 109 | For acceptance tests that communicate with the service layer via it's public interface. These tests are not run when invoking the default `test` task. Instead you run them via: 110 | 111 | ``` 112 | $ bundle exec rake acceptance 113 | ``` 114 | 115 | ### Continuous Integration and Deployment Support 116 | 117 | The `rake` tasks provided by Physique allow you to easily create a continuous integration build on your favorite CI server. Simply configure the following task to be run on every commit. You can customize which tasks are run as part of the CI build in your `Rakefile`. 118 | 119 | ``` 120 | $ bundle exec rake ci 121 | ``` 122 | 123 | The build scripts are also pre-configured to package and publish the applications to [Octopus Deploy](https://octopusdeploy.com) for deployment. You should never check in your API key, but instead specify it as an environment variable of your build server. 124 | 125 | ``` 126 | $ OCTOPUS_API_KEY=<> bundle exec rake publish 127 | ``` 128 | 129 | If you are not using Octopus to deploy your apps, you can simply remove that configuration from your `Rakefile`. 130 | 131 | ### Example Use Cases 132 | 133 | The template comes with an ExampleEntity domain entity which is manipulated by different parts of the service. This entity is provided for illustrative purposes only and you may delete it and any of its supporting classes at any time. 134 | 135 | ## Known Issues 136 | 137 | There is an issue in the database drop, create, and seed scripts when providing a dotted replacement token (i.e. "MyCompany.MyService"). SQLCMD.exe, which runs the scripts, doesn't like dotted parameters. If you use a dotted name, remember to remove the dots in the database name in the generated connection strings and Rakefile. 138 | 139 | ## Support 140 | 141 | Feel free to contact me [@scardetto](https://twitter.com/scardetto) if you have any questions. 142 | 143 | If you are looking for professional consulting services to help you build your service layer, [contact us](http://www.thirdwave.it/schedule-a-consultation/) for a free consultation. 144 | 145 | ## Contributing 146 | 147 | 1. Fork it ( https://github.com/thirdwavetech/microservice.template/fork ) 148 | 2. Create your feature branch (`git checkout -b my-new-feature`) 149 | 3. Commit your changes (`git commit -am 'Add some feature'`) 150 | 4. Push to the branch (`git push origin my-new-feature`) 151 | 5. Create a new Pull Request 152 | 153 | *The following is the actual README that you should include in the solution generated by the template.* 154 | 155 | *** 156 | # __NAME__ 157 | 158 | Describe this service. 159 | 160 | ## Prerequisites 161 | 162 | * [Ruby 2.1](https://github.com/scardetto/physique/blob/master/RUBY_SETUP.md) or later. 163 | * Microsoft SQL Server or SQL Server Express Edition. 164 | * IIS (not Express) 165 | 166 | ## Building the Solution 167 | 168 | This solution uses the [Physique](https://github.com/scardetto/physique) Ruby gem to build and deploy the solution. To build and run the tests included in the template, type the following: 169 | 170 | ``` 171 | $ gem install bundler # Install the required bundler gem. 172 | $ bundle install # This will install the gems required for the build. 173 | $ bundle exec rake test # This will build the solution and run all of the unit and integration tests. 174 | ``` 175 | 176 | ## Building the Database 177 | 178 | To rebuild the database locally using the migrations, run the following from the command-prompt: 179 | 180 | ``` 181 | $ bundle exec db:rebuild 182 | ``` 183 | 184 | This solution uses Physique and FluentMigrator to create and run database migrations locally, on the continuous integration server and during deployments. The __NAME__.Database project contains the migrations which are used to build and share database changes across the team. For more information on how to use Physique and FluentMigrator, refer to [this guide](https://github.com/scardetto/physique/blob/master/FLUENT_MIGRATOR.md). 185 | 186 | ## Running the Acceptance Tests 187 | 188 | This solution also includes a suite of acceptance tests that perform black-box testing against the service interface. 189 | 190 | However, before running the acceptance suite, we must first ensure that the IIS Application Pool's identity can access your local SQL server. By default, the app pools are configured to run as `IIS APPPOOL\DefaultAppPool`. The following script will create a login for that user and grant them access to your local database. 191 | 192 | ``` 193 | $ bundle exec rake init_app_pool_login 194 | ``` 195 | 196 | With that out of the way, the easiest way to run the acceptance tests is to run the solution in the Visual Studio debugger and the type the following: 197 | 198 | ``` 199 | $ bundle exec rake acceptance 200 | ``` 201 | 202 | ## Other Build Tasks 203 | 204 | The solution comes with several other build tasks, to see the list of tasks available to you, type the following at the command-line: 205 | 206 | ``` 207 | $ bundle exec rake --tasks 208 | ``` 209 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | require 'physique' 2 | 3 | # Reports version information about the build to TeamCity. If you are not 4 | # using TeamCity, you should delete this line. 5 | require 'albacore/ext/teamcity' 6 | 7 | Physique::Solution.new do |s| 8 | s.file = 'src/__NAME__.sln' 9 | 10 | s.run_tests do |t| 11 | # Find all assemblies ending in 'Tests' excluding 'AcceptanceTests'. 12 | t.files = FileList["**/*Tests/bin/Release/*Tests.dll"].exclude(/AcceptanceTests.dll$/) 13 | end 14 | 15 | # Sets up the FluentMigrator workflow tasks for your database project. 16 | s.database do |db| 17 | db.instance = ENV['DATABASE_SERVER'] || 'localhost' 18 | db.name = ENV['DATABASE_NAME'] || '__NAME__' 19 | db.project = '__NAME__.Database' 20 | end 21 | 22 | # Publish the Api, MessageBus, and Database projects to Octopus Deploy. If 23 | # you are not using Octopus Deploy you should delete this section. 24 | s.octopus_deploy do |octo| 25 | octo.server = 'http://build/nuget/packages' 26 | octo.api_key = ENV['OCTOPUS_API_KEY'] 27 | 28 | octo.deploy_app do |app| 29 | app.name = 'database' 30 | app.type = :console 31 | app.project = '__NAME__.Database' 32 | 33 | app.with_metadata do |m| 34 | m.description = '__NAME__ Database Migrations' 35 | m.authors = 'Third Wave Technology' 36 | end 37 | end 38 | 39 | octo.deploy_app do |app| 40 | app.name = 'web' 41 | app.type = :website 42 | app.project = '__NAME__.Api' 43 | 44 | app.with_metadata do |m| 45 | m.description = '__NAME__ Api' 46 | m.authors = 'Third Wave Technology' 47 | end 48 | end 49 | 50 | octo.deploy_app do |app| 51 | app.name = 'messagebus' 52 | app.type = :console 53 | app.project = '__NAME__.MessageBus' 54 | 55 | app.with_metadata do |m| 56 | m.description = '__NAME__ Message Bus' 57 | m.authors = 'Third Wave Technology' 58 | end 59 | end 60 | end 61 | end 62 | 63 | desc 'Runs the continuous integration build' 64 | task :ci => [:versionizer, :test] # Add any steps you want included in your CI 65 | # build here. 66 | 67 | desc 'Runs the acceptance tests' 68 | test_runner :acceptance do |t| 69 | t.files = FileList["**/*.AcceptanceTests/bin/Release/*.AcceptanceTests.dll"] 70 | t.exe = 'src/packages/NUnit.Runners.2.6.3/tools/nunit-console.exe' 71 | %w(/labels /trace=Verbose).each { |p| t.parameters.add p } 72 | end 73 | 74 | self.extend Physique::DSL 75 | 76 | desc 'Create SQL login for IIS app pool' 77 | sqlcmd :init_app_pool_login do |c| 78 | c.server_name = ENV['DATABASE_SERVER'] || 'localhost' 79 | c.database_name = ENV['DATABASE_NAME'] || '__NAME__' 80 | c.file = 'init_app_pool_login.sql' 81 | end 82 | -------------------------------------------------------------------------------- /init_app_pool_login.sql: -------------------------------------------------------------------------------- 1 | /****** Object: User [IIS APPPOOL\DefaultAppPool] Script Date: 7/18/2014 4:57:37 PM ******/ 2 | CREATE USER [IIS APPPOOL\DefaultAppPool] FOR LOGIN [IIS APPPOOL\DefaultAppPool] 3 | GO 4 | 5 | EXEC sp_addrolemember N'db_owner', N'IIS APPPOOL\DefaultAppPool' 6 | GO 7 | 8 | -------------------------------------------------------------------------------- /nuget.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/.nuget/NuGet.Config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/.nuget/NuGet.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThirdWaveTech/microservice-template/1f89b920ff7d85dd5d162057f65ce583460dec70/src/.nuget/NuGet.exe -------------------------------------------------------------------------------- /src/.nuget/NuGet.targets: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $(MSBuildProjectDirectory)\..\ 5 | 6 | 7 | false 8 | 9 | 10 | false 11 | 12 | 13 | true 14 | 15 | 16 | false 17 | 18 | 19 | 20 | 21 | 22 | 26 | 27 | 28 | 29 | 30 | $([System.IO.Path]::Combine($(SolutionDir), ".nuget")) 31 | 32 | 33 | 34 | 35 | $(SolutionDir).nuget 36 | 37 | 38 | 39 | $(MSBuildProjectDirectory)\packages.$(MSBuildProjectName.Replace(' ', '_')).config 40 | $(MSBuildProjectDirectory)\packages.$(MSBuildProjectName).config 41 | 42 | 43 | 44 | $(MSBuildProjectDirectory)\packages.config 45 | $(PackagesProjectConfig) 46 | 47 | 48 | 49 | 50 | $(NuGetToolsPath)\NuGet.exe 51 | @(PackageSource) 52 | 53 | "$(NuGetExePath)" 54 | mono --runtime=v4.0.30319 $(NuGetExePath) 55 | 56 | $(TargetDir.Trim('\\')) 57 | 58 | -RequireConsent 59 | -NonInteractive 60 | 61 | "$(SolutionDir) " 62 | "$(SolutionDir)" 63 | 64 | 65 | $(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(NonInteractiveSwitch) $(RequireConsentSwitch) -solutionDir $(PaddedSolutionDir) 66 | $(NuGetCommand) pack "$(ProjectPath)" -Properties "Configuration=$(Configuration);Platform=$(Platform)" $(NonInteractiveSwitch) -OutputDirectory "$(PackageOutputDir)" -symbols 67 | 68 | 69 | 70 | RestorePackages; 71 | $(BuildDependsOn); 72 | 73 | 74 | 75 | 76 | $(BuildDependsOn); 77 | BuildPackage; 78 | 79 | 80 | 81 | 82 | 83 | 84 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 99 | 100 | 103 | 104 | 105 | 106 | 108 | 109 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 141 | 142 | 143 | 144 | 145 | -------------------------------------------------------------------------------- /src/.nuget/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /src/__NAME__.AcceptanceTests/Api/Diagnostics/DiagnosticsTester.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using FluentAssertions; 3 | using NUnit.Framework; 4 | using __NAME__.Api.Client; 5 | using __NAME__.Api.Client.Diagnostics; 6 | 7 | namespace __NAME__.AcceptanceTests.Api.Diagnostics 8 | { 9 | [TestFixture] 10 | public class DiagnosticsTester 11 | { 12 | private readonly IDiagnosticsClient _client; 13 | 14 | public DiagnosticsTester() 15 | { 16 | _client = ApiClientFactory.GetClient(); 17 | } 18 | 19 | [Test] 20 | public async void should_report_all_status_as_ok() 21 | { 22 | var models = await _client.ListStatus(); 23 | 24 | models.Select(m => m.Status).All(s => s == "OK") 25 | .Should().BeTrue("The api should report all statuses as 'OK'"); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/__NAME__.AcceptanceTests/Api/Examples/ExampleTester.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Net; 5 | using System.Threading; 6 | using System.Threading.Tasks; 7 | using FluentAssertions; 8 | using NUnit.Framework; 9 | using Refit; 10 | using __NAME__.Api.Client; 11 | using __NAME__.Api.Client.Examples; 12 | using __NAME__.Models.Examples; 13 | 14 | namespace __NAME__.AcceptanceTests.Api.Examples 15 | { 16 | [TestFixture] 17 | public class ExampleTester 18 | { 19 | private readonly IExampleClient _client; 20 | 21 | public ExampleTester() 22 | { 23 | _client = ApiClientFactory.GetClient(); 24 | } 25 | 26 | [Test] 27 | public async void should_list_examples() 28 | { 29 | var models = await _client.List(); 30 | models.Should().NotBeEmpty(); 31 | } 32 | 33 | [Test] 34 | public async void should_create_example() 35 | { 36 | var model = new NewExampleModel {Name = "test"}; 37 | var createdModel = await _client.Create(model); 38 | 39 | createdModel.Id.Should().BePositive(); 40 | } 41 | 42 | [Test] 43 | public void should_validate_new_exmaple() 44 | { 45 | var model = new NewExampleModel { Name = null }; 46 | 47 | Func task = async () => { await _client.Create(model); }; 48 | task.ShouldThrow().Where(ex => ContainsNameEmptyValidationError(ex)); 49 | 50 | } 51 | 52 | private static bool ContainsNameEmptyValidationError(ApiException ex) 53 | { 54 | ex.StatusCode.Should().Be(HttpStatusCode.BadRequest); 55 | 56 | var validationErrors = ex.GetContentAs>>(); 57 | validationErrors.Should().HaveCount(1); 58 | validationErrors.First().Key.Should().Be("errors"); 59 | validationErrors.First().Value.Should().HaveCount(1); 60 | validationErrors.First().Value.Should().ContainKey("name"); 61 | validationErrors.First().Value.First().Value.Should().Contain("'Name' should not be empty."); 62 | 63 | return true; 64 | } 65 | 66 | [Test] 67 | public async void should_close_created_example() 68 | { 69 | var model = new NewExampleModel { Name = "test" }; 70 | var createdModel = await _client.Create(model); 71 | await _client.Close(new CloseExampleModel { Id = createdModel.Id }); 72 | Thread.Sleep(5000); 73 | 74 | var newModel = await _client.Get(createdModel.Id); 75 | newModel.Status.Should().Be(20000); 76 | } 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /src/__NAME__.AcceptanceTests/Config/AppSettings.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/__NAME__.AcceptanceTests/Config/QA/AppSettings.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/__NAME__.AcceptanceTests/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("__NAME__.AcceptanceTests")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("__NAME__.AcceptanceTests")] 12 | [assembly: AssemblyCopyright("Copyright © 2015")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("62a6deb5-451a-40db-97bc-ebf7cf184984")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /src/__NAME__.AcceptanceTests/RefitStubs.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Net.Http; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | 6 | /* ******** Hey You! ********* 7 | * 8 | * This is a generated file, and gets rewritten every time you build the 9 | * project. If you want to edit it, you need to edit the mustache template 10 | * in the Refit package */ 11 | 12 | namespace RefitInternalGenerated 13 | { 14 | [AttributeUsage (AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Interface | AttributeTargets.Delegate)] 15 | sealed class PreserveAttribute : Attribute 16 | { 17 | #pragma warning disable 0649 18 | // 19 | // Fields 20 | // 21 | public bool AllMembers; 22 | 23 | public bool Conditional; 24 | #pragma warning restore 0649 25 | } 26 | } 27 | 28 | 29 | -------------------------------------------------------------------------------- /src/__NAME__.AcceptanceTests/__NAME__.AcceptanceTests.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {3FE003CC-4F00-463E-BDC7-AD55DA676E30} 8 | Library 9 | Properties 10 | __NAME__.AcceptanceTests 11 | __NAME__.AcceptanceTests 12 | v4.5.1 13 | 512 14 | 15 | ..\ 16 | true 17 | 6739dfaf 18 | 19 | 20 | true 21 | full 22 | false 23 | bin\Debug\ 24 | DEBUG;TRACE 25 | prompt 26 | 4 27 | 28 | 29 | pdbonly 30 | true 31 | bin\Release\ 32 | TRACE 33 | prompt 34 | 4 35 | 36 | 37 | 38 | ..\packages\FluentAssertions.3.3.0\lib\net45\FluentAssertions.dll 39 | 40 | 41 | ..\packages\FluentAssertions.3.3.0\lib\net45\FluentAssertions.Core.dll 42 | 43 | 44 | False 45 | ..\packages\Newtonsoft.Json.6.0.5\lib\net45\Newtonsoft.Json.dll 46 | 47 | 48 | ..\packages\NUnit.2.6.4\lib\nunit.framework.dll 49 | 50 | 51 | False 52 | ..\packages\refit.2.2.1\lib\Net45\Refit.dll 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | PreserveNewest 73 | 74 | 75 | PreserveNewest 76 | 77 | 78 | 79 | 80 | 81 | {362c291f-0977-4329-882c-0562ea5fc5cd} 82 | __NAME__.Api.Client 83 | 84 | 85 | {71a42623-f570-45fc-b7cf-b8cf4ebca747} 86 | __NAME__.Models 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. 95 | 96 | 97 | 98 | 99 | 100 | 107 | -------------------------------------------------------------------------------- /src/__NAME__.AcceptanceTests/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /src/__NAME__.AcceptanceTests/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/__NAME__.Api.Client/ApiClientBootstrapper.cs: -------------------------------------------------------------------------------- 1 | using StructureMap; 2 | using __NAME__.Api.Client.Diagnostics; 3 | using __NAME__.Api.Client.Examples; 4 | 5 | namespace __NAME__.Api.Client 6 | { 7 | public static class ApiClientBootstrapper 8 | { 9 | public static void Bootstrap(IContainer container) 10 | { 11 | container.Configure(c => { 12 | c.ForSingletonOf().Use(ApiClientFactory.GetClient()); 13 | c.ForSingletonOf().Use(ApiClientFactory.GetClient()); 14 | }); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/__NAME__.Api.Client/ApiClientFactory.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Configuration; 3 | using Refit; 4 | 5 | namespace __NAME__.Api.Client 6 | { 7 | /// 8 | /// This class creates implementations for your Api interfaces. 9 | /// 10 | public class ApiClientFactory 11 | { 12 | private const string ERROR_STRING = "Configuration section is missing. {0} to your app settings and provide a valid URL"; 13 | private static readonly string ApiConfigKey = "__NAME__.api.path".ToLower(); 14 | 15 | /// 16 | /// Creates a client API implementation with the URL defined in the 17 | /// __NAME__.api.path appSetting. 18 | /// 19 | public static T GetClient() 20 | { 21 | return GetClient(GetServiceUrlFromConfig()); 22 | } 23 | 24 | /// 25 | /// Creates a client API implementation with the provided URL. 26 | /// 27 | public static T GetClient(string apiUrl) 28 | { 29 | AssertValidConfiguration(() => apiUrl != null); 30 | 31 | return RestService.For(apiUrl); 32 | } 33 | 34 | private static string GetServiceUrlFromConfig() 35 | { 36 | return ConfigurationManager.AppSettings.Get(ApiConfigKey); 37 | } 38 | 39 | private static void AssertValidConfiguration(Func valueIsTrue) 40 | { 41 | if (!valueIsTrue()) 42 | { 43 | throw new Exception(string.Format(ERROR_STRING, ApiConfigKey)); 44 | } 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/__NAME__.Api.Client/Diagnostics/IDiagnosticsClient.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | using Refit; 4 | using __NAME__.Models.Diagnostics; 5 | 6 | namespace __NAME__.Api.Client.Diagnostics 7 | { 8 | /**** 9 | * Group functionality in the API via interfaces. All maintenance and info related 10 | * api's should be added to this file. 11 | ****/ 12 | [Headers( 13 | "Accept: application/json", 14 | "User-Agent: __NAME__ Web Client")] 15 | public interface IDiagnosticsClient 16 | { 17 | [Get("/ping")] 18 | Task Ping(); 19 | 20 | [Get("/status")] 21 | Task> ListStatus(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/__NAME__.Api.Client/Examples/IExampleClient.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | using Refit; 4 | using __NAME__.Models.Examples; 5 | 6 | namespace __NAME__.Api.Client.Examples 7 | { 8 | /// 9 | /// This is a sample interface to the Api built using Restfit. This file 10 | /// is provided for illustrative purposes only. 11 | /// 12 | [Headers( 13 | "Accept: application/json", 14 | "User-Agent: __NAME__ Web Client")] 15 | public interface IExampleClient 16 | { 17 | [Get("/examples")] 18 | Task> List(); 19 | 20 | [Get("/example/{id}")] 21 | Task Get(int id); 22 | 23 | [Post("/examples")] 24 | Task Create([Body] NewExampleModel model); 25 | 26 | [Post("/examples/close")] 27 | Task Close([Body] CloseExampleModel model); 28 | 29 | [Delete("/example/{id}")] 30 | Task Delete(int id); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/__NAME__.Api.Client/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("__NAME__.Api.Messages")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("__NAME__.Api.Messages")] 12 | [assembly: AssemblyCopyright("Copyright © 2014")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("d0cd1d5f-184a-4672-8e46-08c76134321c")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /src/__NAME__.Api.Client/RefitStubs.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Net.Http; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | using Refit; 7 | using __NAME__.Models.Diagnostics; 8 | using __NAME__.Models.Examples; 9 | 10 | /* ******** Hey You! ********* 11 | * 12 | * This is a generated file, and gets rewritten every time you build the 13 | * project. If you want to edit it, you need to edit the mustache template 14 | * in the Refit package */ 15 | 16 | namespace RefitInternalGenerated 17 | { 18 | [AttributeUsage (AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Interface | AttributeTargets.Delegate)] 19 | sealed class PreserveAttribute : Attribute 20 | { 21 | #pragma warning disable 0649 22 | // 23 | // Fields 24 | // 25 | public bool AllMembers; 26 | 27 | public bool Conditional; 28 | #pragma warning restore 0649 29 | } 30 | } 31 | 32 | namespace __NAME__.Api.Client.Diagnostics 33 | { 34 | using RefitInternalGenerated; 35 | 36 | [Preserve] 37 | public partial class AutoGeneratedIDiagnosticsClient : IDiagnosticsClient 38 | { 39 | public HttpClient Client { get; protected set; } 40 | readonly Dictionary> methodImpls; 41 | 42 | public AutoGeneratedIDiagnosticsClient(HttpClient client, IRequestBuilder requestBuilder) 43 | { 44 | methodImpls = requestBuilder.InterfaceHttpMethods.ToDictionary(k => k, v => requestBuilder.BuildRestResultFuncForMethod(v)); 45 | Client = client; 46 | } 47 | 48 | public virtual Task Ping() 49 | { 50 | var arguments = new object[] { }; 51 | return (Task) methodImpls["Ping"](Client, arguments); 52 | } 53 | 54 | public virtual Task> ListStatus() 55 | { 56 | var arguments = new object[] { }; 57 | return (Task>) methodImpls["ListStatus"](Client, arguments); 58 | } 59 | 60 | } 61 | } 62 | 63 | namespace __NAME__.Api.Client.Examples 64 | { 65 | using RefitInternalGenerated; 66 | 67 | [Preserve] 68 | public partial class AutoGeneratedIExampleClient : IExampleClient 69 | { 70 | public HttpClient Client { get; protected set; } 71 | readonly Dictionary> methodImpls; 72 | 73 | public AutoGeneratedIExampleClient(HttpClient client, IRequestBuilder requestBuilder) 74 | { 75 | methodImpls = requestBuilder.InterfaceHttpMethods.ToDictionary(k => k, v => requestBuilder.BuildRestResultFuncForMethod(v)); 76 | Client = client; 77 | } 78 | 79 | public virtual Task> List() 80 | { 81 | var arguments = new object[] { }; 82 | return (Task>) methodImpls["List"](Client, arguments); 83 | } 84 | 85 | public virtual Task Get(int id) 86 | { 87 | var arguments = new object[] { id }; 88 | return (Task) methodImpls["Get"](Client, arguments); 89 | } 90 | 91 | public virtual Task Create(NewExampleModel model) 92 | { 93 | var arguments = new object[] { model }; 94 | return (Task) methodImpls["Create"](Client, arguments); 95 | } 96 | 97 | public virtual Task Close(CloseExampleModel model) 98 | { 99 | var arguments = new object[] { model }; 100 | return (Task) methodImpls["Close"](Client, arguments); 101 | } 102 | 103 | public virtual Task Delete(int id) 104 | { 105 | var arguments = new object[] { id }; 106 | return (Task) methodImpls["Delete"](Client, arguments); 107 | } 108 | 109 | } 110 | } 111 | 112 | 113 | -------------------------------------------------------------------------------- /src/__NAME__.Api.Client/__NAME__.Api.Client.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {362C291F-0977-4329-882C-0562EA5FC5CD} 8 | Library 9 | Properties 10 | __NAME__.Api.Client 11 | __NAME__.Api.Client 12 | v4.5.1 13 | 512 14 | ..\ 15 | true 16 | 17 | 18 | 19 | true 20 | full 21 | false 22 | bin\Debug\ 23 | DEBUG;TRACE 24 | prompt 25 | 4 26 | 27 | 28 | pdbonly 29 | true 30 | bin\Release\ 31 | TRACE 32 | prompt 33 | 4 34 | 35 | 36 | 37 | False 38 | ..\packages\Crux.StructureMap.0.2.1\lib\net40\Crux.StructureMap.dll 39 | 40 | 41 | ..\packages\CommonServiceLocator.1.3\lib\portable-net4+sl5+netcore45+wpa81+wp8\Microsoft.Practices.ServiceLocation.dll 42 | 43 | 44 | ..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll 45 | 46 | 47 | ..\packages\refit.2.2.1\lib\Net45\Refit.dll 48 | 49 | 50 | ..\packages\structuremap.3.1.5.154\lib\net40\StructureMap.dll 51 | 52 | 53 | ..\packages\structuremap.3.1.5.154\lib\net40\StructureMap.Net4.dll 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | {71a42623-f570-45fc-b7cf-b8cf4ebca747} 79 | __NAME__.Models 80 | 81 | 82 | 83 | 84 | 85 | 92 | -------------------------------------------------------------------------------- /src/__NAME__.Api.Client/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/__NAME__.Api/App/Example/ExampleMapper.cs: -------------------------------------------------------------------------------- 1 | using AutoMapper; 2 | using Crux.Core.Bootstrapping; 3 | using __NAME__.Domain.Examples; 4 | using __NAME__.Models.Examples; 5 | 6 | namespace __NAME__.Api.App.Example 7 | { 8 | public class ExampleMapper : IRunAtStartup 9 | { 10 | public void Init() 11 | { 12 | Mapper.CreateMap() 13 | .ForMember(x => x.Id, m => m.MapFrom(x => x.ID)) 14 | .ForMember(x => x.Status, m => m.MapFrom(x => (int)x.Status)) 15 | .ForMember(x => x.DateCreated, m => m.MapFrom(x => x.Timestamp.DateCreated)) 16 | .ForMember(x => x.DateUpdated, m => m.MapFrom(x => x.Timestamp.DateUpdated)) 17 | ; 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /src/__NAME__.Api/App/Example/ExampleModule.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using AutoMapper; 3 | using AutoMapper.QueryableExtensions; 4 | using Crux.Domain.Entities; 5 | using Crux.NancyFx.Infrastructure.Extensions; 6 | using Nancy; 7 | using __NAME__.Domain.Examples; 8 | using __NAME__.MessageBus.Client.Examples; 9 | using __NAME__.Models.Examples; 10 | 11 | namespace __NAME__.Api.App.Example 12 | { 13 | public class ExampleModule : NancyModule 14 | { 15 | public ExampleModule(IRepositoryOfId repository, IMappingEngine engine, ExampleSender sender) 16 | { 17 | Get["/examples"] = _ => repository.Query() 18 | .Project().To() 19 | .ToList(); 20 | 21 | Get["/example/{id:int}"] = _ => { 22 | var entity = repository.Load(_.id); 23 | return engine.Map(entity); 24 | }; 25 | 26 | Post["/examples"] = _ => { 27 | var model = this.BindAndValidateModel(); 28 | var entity = new ExampleEntity(model.Name); 29 | repository.Save(entity); 30 | 31 | return new NewExampleCreatedModel { Id = entity.ID }; 32 | }; 33 | 34 | Post["/examples/close"] = _ => { 35 | var model = this.BindAndValidateModel(); 36 | 37 | sender.CloseExample(model.Id); 38 | 39 | return HttpStatusCode.OK; 40 | }; 41 | 42 | Delete["/example/{id:int}"] = _ => { 43 | repository.Delete(_.id); 44 | return HttpStatusCode.OK; 45 | }; 46 | } 47 | } 48 | } -------------------------------------------------------------------------------- /src/__NAME__.Api/App/Example/ExampleValidator.cs: -------------------------------------------------------------------------------- 1 | using FluentValidation; 2 | using __NAME__.Models.Examples; 3 | 4 | namespace __NAME__.Api.App.Example 5 | { 6 | public class NewExampleValidator : AbstractValidator 7 | { 8 | public NewExampleValidator() 9 | { 10 | RuleFor(x => x.Name).NotEmpty(); 11 | } 12 | } 13 | 14 | public class CloseExampleValidator : AbstractValidator 15 | { 16 | public CloseExampleValidator() 17 | { 18 | RuleFor(x => x.Id).NotEmpty().GreaterThan(0); 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /src/__NAME__.Api/App_Data/Config/ConnectionStrings.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /src/__NAME__.Api/App_Data/Config/Prod/ConnectionStrings.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /src/__NAME__.Api/App_Data/Config/Prod/UnicastBus.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/__NAME__.Api/App_Data/Config/QA/ConnectionStrings.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /src/__NAME__.Api/App_Data/Config/QA/UnicastBus.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/__NAME__.Api/App_Data/Config/UnicastBus.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/__NAME__.Api/Infrastructure/Bootstrapping/NancyBootstrapper.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using AutoMapper; 3 | using Crux.Core.Bootstrapping; 4 | using Crux.NancyFx.Infrastructure.Pipelines; 5 | using Nancy; 6 | using Nancy.Authentication.Token; 7 | using Nancy.Bootstrapper; 8 | using Nancy.Bootstrappers.StructureMap; 9 | using Nancy.Diagnostics; 10 | using StructureMap; 11 | using StructureMap.Graph; 12 | using __NAME__.Api.Infrastructure.Pipelines; 13 | using __NAME__.MessageBus.Client; 14 | 15 | namespace __NAME__.Api.Infrastructure.Bootstrapping 16 | { 17 | public class NancyBootstrapper : StructureMapNancyBootstrapper 18 | { 19 | protected override DiagnosticsConfiguration DiagnosticsConfiguration 20 | { 21 | get { return new DiagnosticsConfiguration {Password = "1234"}; } 22 | } 23 | 24 | static NancyBootstrapper() 25 | { 26 | InitializeLogging(); 27 | } 28 | 29 | protected override void ConfigureApplicationContainer(IContainer existingContainer) 30 | { 31 | // Setup container 32 | existingContainer.Configure(c => c.Scan(s => { 33 | s.TheCallingAssembly(); 34 | s.WithDefaultConventions(); 35 | s.LookForRegistries(); 36 | })); 37 | 38 | // Setup MessageBus Client 39 | MessageBusClientBootstrapper.Bootstrap(existingContainer); 40 | 41 | // Initialize all IRunAtStartup classes 42 | InitializeStartupRunners(existingContainer); 43 | } 44 | 45 | protected override void RequestStartup(IContainer requestContainer, IPipelines pipelines, NancyContext context) 46 | { 47 | // Enable token authentication 48 | TokenAuthentication.Enable(pipelines, new TokenAuthenticationConfiguration(requestContainer.GetInstance())); 49 | 50 | // Set up unit of work 51 | pipelines.BeforeRequest += UnitOfWorkPipeline.BeforeRequest(requestContainer); 52 | pipelines.AfterRequest += UnitOfWorkPipeline.AfterRequest(); 53 | 54 | // Set up validation exception handling 55 | pipelines.OnError += HttpBadRequestPipeline.OnHttpBadRequest; 56 | } 57 | 58 | private static void InitializeLogging() 59 | { 60 | log4net.Config.XmlConfigurator.Configure(); 61 | } 62 | 63 | private static void InitializeStartupRunners(IContainer existingContainer) 64 | { 65 | var mappingDefinitions = existingContainer.GetAllInstances().ToList(); 66 | mappingDefinitions.ForEach(mappingDefinition => mappingDefinition.Init()); 67 | 68 | Mapper.AssertConfigurationIsValid(); 69 | } 70 | } 71 | } -------------------------------------------------------------------------------- /src/__NAME__.Api/Infrastructure/Bootstrapping/Registries/AppRegistry.cs: -------------------------------------------------------------------------------- 1 | using AutoMapper; 2 | using Crux.Core.Bootstrapping; 3 | using Crux.NancyFx.Infrastructure.Serialization; 4 | using Nancy.Authentication.Token; 5 | using Newtonsoft.Json; 6 | using StructureMap.Configuration.DSL; 7 | using StructureMap.Graph; 8 | using __NAME__.Api.Infrastructure.Diagnostics; 9 | using __NAME__.MessageBus.Client.Diagnostics; 10 | 11 | namespace __NAME__.Api.Infrastructure.Bootstrapping.Registries 12 | { 13 | public class AppRegistry : Registry 14 | { 15 | public AppRegistry() 16 | { 17 | Scan(s => 18 | { 19 | s.TheCallingAssembly(); 20 | s.AssemblyContainingType(); 21 | s.WithDefaultConventions(); 22 | s.AddAllTypesOf(); 23 | s.AddAllTypesOf(); 24 | s.LookForRegistries(); 25 | }); 26 | 27 | For().Use(new Tokenizer()); 28 | For().Use(); 29 | 30 | ForSingletonOf().Use(c => Mapper.Engine); 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /src/__NAME__.Api/Infrastructure/Bootstrapping/Registries/NHibernateRegistry.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Crux.Domain.Entities; 3 | using Crux.Domain.Persistence; 4 | using Crux.Domain.Persistence.NHibernate; 5 | using NHibernate; 6 | using StructureMap.Configuration.DSL; 7 | using __NAME__.Domain; 8 | using __NAME__.Domain.Persistence; 9 | 10 | namespace __NAME__.Api.Infrastructure.Bootstrapping.Registries 11 | { 12 | public class NHibernateRegistry : Registry 13 | { 14 | public NHibernateRegistry() 15 | { 16 | // Session factory 17 | ForSingletonOf() 18 | .Use(c => new SessionFactoryConfig().CreateSessionFactory()); 19 | 20 | // Session factory 21 | ForSingletonOf() 22 | .Use(c => SqlConnectionProvider.FromConnectionStringKey("__NAME__")); 23 | 24 | // Unit of Work 25 | For().Use(); 26 | 27 | // Repositories 28 | For>().Use>(); 29 | For>().Use>(); 30 | For().Use(); 31 | 32 | // Stateless session 33 | For() 34 | .Use(c => c.GetInstance().OpenStatelessSession()); 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /src/__NAME__.Api/Infrastructure/Diagnostics/DiagnosticsModule.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using Nancy; 3 | using StructureMap; 4 | 5 | namespace __NAME__.Api.Infrastructure.Diagnostics 6 | { 7 | public class DiagnosticsModule: NancyModule 8 | { 9 | public DiagnosticsModule(IContainer container) 10 | { 11 | Get["status"] = _ => container.GetAllInstances() 12 | .SelectMany(r => r.ReportStatus()) 13 | .ToList(); 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /src/__NAME__.Api/Infrastructure/Diagnostics/IReportStatus.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using __NAME__.Models.Diagnostics; 3 | 4 | namespace __NAME__.Api.Infrastructure.Diagnostics 5 | { 6 | public interface IReportStatus 7 | { 8 | IList ReportStatus(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/__NAME__.Api/Infrastructure/Diagnostics/MessageBusPingReporter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using StructureMap; 4 | using __NAME__.MessageBus.Client.Diagnostics; 5 | using __NAME__.Models.Diagnostics; 6 | 7 | namespace __NAME__.Api.Infrastructure.Diagnostics 8 | { 9 | public class MessageBusPingReporter : IReportStatus 10 | { 11 | private readonly IContainer _container; 12 | 13 | public MessageBusPingReporter(IContainer container) 14 | { 15 | _container = container; 16 | } 17 | 18 | public IList ReportStatus() 19 | { 20 | var statusItem = new StatusItem("__NAME__.MessageBus.Client"); 21 | var client = _container.GetInstance(); 22 | 23 | // Try sending a message 24 | try 25 | { 26 | client.Ping("__NAME__.Api"); 27 | statusItem.Status = StatusItem.OK; 28 | } 29 | catch (Exception e) 30 | { 31 | statusItem.Status = StatusItem.Error; 32 | statusItem.Comment = e.Message; 33 | } 34 | 35 | return new []{statusItem}; 36 | } 37 | } 38 | } -------------------------------------------------------------------------------- /src/__NAME__.Api/Infrastructure/Diagnostics/PersistenceStatusReporter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using Crux.Domain.Persistence.NHibernate; 4 | using __NAME__.Domain.Persistence.Diagnostics; 5 | using __NAME__.Models.Diagnostics; 6 | 7 | namespace __NAME__.Api.Infrastructure.Diagnostics 8 | { 9 | public class PersistenceStatusReporter : IReportStatus 10 | { 11 | private readonly INHibernateUnitOfWork _unitOfWork; 12 | 13 | public PersistenceStatusReporter(INHibernateUnitOfWork unitOfWork) 14 | { 15 | _unitOfWork = unitOfWork; 16 | } 17 | 18 | public IList ReportStatus() 19 | { 20 | var statusItem = new StatusItem("__NAME__.Domain.Persistence"); 21 | var repo = new MigrationsRepository(_unitOfWork); 22 | 23 | //Try sending a messages 24 | try 25 | { 26 | var lastMigration = repo.LastMigration; 27 | statusItem.Comment = String.Format("Last migration {0}", lastMigration); 28 | statusItem.Status = StatusItem.OK; 29 | } 30 | catch (Exception e) 31 | { 32 | statusItem.Status = StatusItem.Error; 33 | statusItem.Comment = e.Message; 34 | } 35 | 36 | return new[] { statusItem }; 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /src/__NAME__.Api/Infrastructure/Diagnostics/PingModule.cs: -------------------------------------------------------------------------------- 1 | using Nancy; 2 | using Nancy.Responses; 3 | 4 | namespace __NAME__.Api.Infrastructure.Diagnostics 5 | { 6 | public class PingModule : NancyModule 7 | { 8 | public PingModule() 9 | { 10 | Get["ping"] = _ => new TextResponse("__NAME__.Api\nStatus=active"); 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /src/__NAME__.Api/Infrastructure/Pipelines/UnitOfWorkPipeline.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using Crux.Core.Extensions; 5 | using Crux.Domain.Persistence.NHibernate; 6 | using Crux.Domain.UoW; 7 | using Nancy; 8 | using StructureMap; 9 | 10 | namespace __NAME__.Api.Infrastructure.Pipelines 11 | { 12 | public class UnitOfWorkPipeline 13 | { 14 | private const string UNIT_OF_WORK_SCOPE = "__NAME__.UnitOfWorkScope"; 15 | private const string UNIT_OF_WORK_OPTIONS = "__NAME__.UnitOfWorkOptions"; 16 | 17 | private static readonly IEnumerable Exclusions = new[] { 18 | "/ping" 19 | }; 20 | 21 | public static Func BeforeRequest(IContainer container) 22 | { 23 | return ctx => { 24 | if (IsHttpOptions(ctx) || ShouldExclude(ctx.Request.Path)) return null; 25 | 26 | var unitOfWork = container.GetInstance(); 27 | ctx.Items[UNIT_OF_WORK_SCOPE] = unitOfWork.CreateTransactionalScope(GetUnitOfWorkOptions(ctx)); 28 | 29 | return ctx.Response; 30 | }; 31 | } 32 | 33 | private static bool IsHttpOptions(NancyContext ctx) 34 | { 35 | return ctx.Request.Method.EqualsIgnoreCase("OPTIONS"); 36 | } 37 | 38 | public static Action AfterRequest() 39 | { 40 | return ctx => { 41 | var scope = GetUnitOfWorkScope(ctx); 42 | if (scope != null) scope.Complete(); 43 | }; 44 | } 45 | 46 | private static UnitOfWorkTransactionOptions GetUnitOfWorkOptions(NancyContext ctx) 47 | { 48 | object val; 49 | if (!ctx.Items.TryGetValue(UNIT_OF_WORK_OPTIONS, out val)) { 50 | return UnitOfWorkTransactionOptions.Default(); 51 | } 52 | 53 | return val as UnitOfWorkTransactionOptions ?? UnitOfWorkTransactionOptions.Default(); 54 | } 55 | 56 | private static ITransactionalUnitOfWorkScope GetUnitOfWorkScope(NancyContext ctx) 57 | { 58 | object val; 59 | ctx.Items.TryGetValue(UNIT_OF_WORK_SCOPE, out val); 60 | return val as ITransactionalUnitOfWorkScope; 61 | } 62 | 63 | private static bool ShouldExclude(string path) 64 | { 65 | return Exclusions.Any(path.Equals); 66 | } 67 | } 68 | } -------------------------------------------------------------------------------- /src/__NAME__.Api/PreDeploy.ps1: -------------------------------------------------------------------------------- 1 | $path = "App_Data\Config\" + $OctopusParameters['Octopus.Environment.Name'] 2 | cd $path 3 | cp *.* ..\ -------------------------------------------------------------------------------- /src/__NAME__.Api/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("__NAME__.Host")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("__NAME__.Host")] 12 | [assembly: AssemblyCopyright("Copyright © 2014")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("bc7188d7-66fa-4eed-aca0-b875ebf02de0")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Revision and Build Numbers 32 | // by using the '*' as shown below: 33 | [assembly: AssemblyVersion("1.0.0.0")] 34 | [assembly: AssemblyFileVersion("1.0.0.0")] 35 | -------------------------------------------------------------------------------- /src/__NAME__.Api/Startup.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Owin.Extensions; 2 | using Owin; 3 | 4 | namespace __NAME__.Api 5 | { 6 | // OWIN startup 7 | public class Startup 8 | { 9 | public void Configuration(IAppBuilder app) 10 | { 11 | app.UseNancy(); 12 | app.UseStageMarker(PipelineStage.MapHandler); 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /src/__NAME__.Api/Web.config: -------------------------------------------------------------------------------- 1 |  2 | 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 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /src/__NAME__.Api/__NAME__.Api.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | 8 | 9 | 2.0 10 | {042305AF-78BB-465B-A56B-BAAB48055EEC} 11 | {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} 12 | Library 13 | Properties 14 | __NAME__.Api 15 | __NAME__.Api 16 | v4.5.1 17 | false 18 | 19 | 20 | 21 | 22 | ..\ 23 | true 24 | 25 | 26 | 27 | true 28 | full 29 | false 30 | bin\ 31 | DEBUG;TRACE 32 | prompt 33 | 4 34 | 35 | 36 | pdbonly 37 | true 38 | bin\ 39 | TRACE 40 | prompt 41 | 4 42 | 43 | 44 | 45 | ..\packages\AutoMapper.3.3.0\lib\net40\AutoMapper.dll 46 | 47 | 48 | ..\packages\AutoMapper.3.3.0\lib\net40\AutoMapper.Net4.dll 49 | 50 | 51 | False 52 | ..\packages\Crux.Core.0.2.1\lib\net40\Crux.Core.dll 53 | 54 | 55 | False 56 | ..\packages\Crux.Domain.0.2.1\lib\net40\Crux.Domain.dll 57 | 58 | 59 | False 60 | ..\packages\Crux.Domain.Persistence.0.2.1\lib\net40\Crux.Domain.Persistence.dll 61 | 62 | 63 | False 64 | ..\packages\Crux.NancyFx.0.2.1\lib\net40\Crux.NancyFx.dll 65 | 66 | 67 | ..\packages\FluentNHibernate.2.0.1.0\lib\net40\FluentNHibernate.dll 68 | True 69 | 70 | 71 | ..\packages\FluentValidation.5.5.0.0\lib\Net40\FluentValidation.dll 72 | 73 | 74 | ..\packages\Iesi.Collections.4.0.1.4000\lib\net40\Iesi.Collections.dll 75 | True 76 | 77 | 78 | ..\packages\log4net.2.0.3\lib\net40-full\log4net.dll 79 | 80 | 81 | 82 | ..\packages\Microsoft.Owin.3.0.0\lib\net45\Microsoft.Owin.dll 83 | 84 | 85 | ..\packages\Microsoft.Owin.Host.SystemWeb.3.0.0\lib\net45\Microsoft.Owin.Host.SystemWeb.dll 86 | 87 | 88 | ..\packages\CommonServiceLocator.1.3\lib\portable-net4+sl5+netcore45+wpa81+wp8\Microsoft.Practices.ServiceLocation.dll 89 | True 90 | 91 | 92 | ..\packages\Nancy.1.1\lib\net40\Nancy.dll 93 | True 94 | 95 | 96 | False 97 | ..\packages\Nancy.Authentication.Token.1.1\lib\net40\Nancy.Authentication.Token.dll 98 | 99 | 100 | False 101 | ..\packages\Nancy.BootStrappers.StructureMap.1.1\lib\net40\Nancy.Bootstrappers.StructureMap.dll 102 | 103 | 104 | ..\packages\Nancy.Hosting.Aspnet.1.1\lib\net40\Nancy.Hosting.Aspnet.dll 105 | 106 | 107 | ..\packages\Nancy.Owin.1.1\lib\net40\Nancy.Owin.dll 108 | True 109 | 110 | 111 | False 112 | ..\packages\Nancy.Serialization.JsonNet.1.1\lib\net40\Nancy.Serialization.JsonNet.dll 113 | 114 | 115 | False 116 | ..\packages\Nancy.Validation.FluentValidation.1.1\lib\net40\Nancy.Validation.FluentValidation.dll 117 | 118 | 119 | ..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll 120 | True 121 | 122 | 123 | ..\packages\NHibernate.4.0.3.4000\lib\net40\NHibernate.dll 124 | True 125 | 126 | 127 | False 128 | ..\packages\NServiceBus.5.2.0\lib\net45\NServiceBus.Core.dll 129 | 130 | 131 | False 132 | ..\packages\NServiceBus.StructureMap.5.0.1\lib\net45\NServiceBus.ObjectBuilder.StructureMap.dll 133 | 134 | 135 | ..\packages\Owin.1.0\lib\net40\Owin.dll 136 | 137 | 138 | ..\packages\structuremap.3.1.5.154\lib\net40\StructureMap.dll 139 | 140 | 141 | ..\packages\structuremap.3.1.5.154\lib\net40\StructureMap.Net4.dll 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | Designer 150 | 151 | 152 | 153 | 154 | Designer 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | {e444ff50-c834-44a0-b97e-657beb5affc8} 186 | __NAME__.Domain.Persistence 187 | 188 | 189 | {386b7c40-6861-4e03-b94b-81d624bb4ca6} 190 | __NAME__.Domain 191 | 192 | 193 | {bf52672c-cd40-41d7-a4a8-58c978f4cc72} 194 | __NAME__.MessageBus.Client 195 | 196 | 197 | {d1d380b5-f384-4dba-86bf-9ecaea8b6fed} 198 | __NAME__.Messages 199 | 200 | 201 | {71a42623-f570-45fc-b7cf-b8cf4ebca747} 202 | __NAME__.Models 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 10.0 212 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | True 222 | True 223 | 62678 224 | / 225 | http://localhost/__NAME__.Api 226 | False 227 | False 228 | 229 | 230 | False 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. 239 | 240 | 241 | 242 | 249 | -------------------------------------------------------------------------------- /src/__NAME__.Api/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 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 | -------------------------------------------------------------------------------- /src/__NAME__.Database/Deploy.ps1: -------------------------------------------------------------------------------- 1 | # Run the migrations against the target database 2 | $dbServer = $OctopusParameters['db.server'] 3 | $dbName = $OctopusParameters['db.name'] 4 | 5 | .\Migrate.exe --connectionString "Server=$($dbServer);Database=$($dbName);Integrated Security=True" ` 6 | --provider sqlserver2012 ` 7 | --target "__NAME__.Database.dll" ` 8 | --output --outputFilename migrate-output.sql --verbose=true ` 9 | --task migrate ` 10 | --timeout=600 -------------------------------------------------------------------------------- /src/__NAME__.Database/Examples/20150412194400_ExampleEntity.cs: -------------------------------------------------------------------------------- 1 | using FluentMigrator; 2 | 3 | namespace __NAME__.Database.Examples 4 | { 5 | [Migration(20150412194400, "Create ExampleEntities table")] 6 | public class ExampleEntity : Migration 7 | { 8 | /// 9 | /// The migration for our example domain entity. 10 | /// 11 | /// We are creating a ExampleEntity table and a ExampleStatuses lookup table. 12 | /// 13 | public override void Up() 14 | { 15 | Create.Table("ExampleStatuses") 16 | .WithColumn("Id").AsInt32().NotNullable().PrimaryKey() 17 | .WithColumn("Name").AsString(50).NotNullable() 18 | .WithColumn("Description").AsString(1000).NotNullable() 19 | ; 20 | 21 | Insert.IntoTable("ExampleStatuses") 22 | .Row(new { Id = 10000, Name = "Open", Description = "Open Status" }) 23 | .Row(new { Id = 20000, Name = "Closed", Description = "Closed Status" }) 24 | ; 25 | 26 | Create.Table("ExampleEntities") 27 | .WithColumn("Id").AsInt32().PrimaryKey().Identity() 28 | .WithColumn("Name").AsString(50).NotNullable() 29 | .WithColumn("ExampleStatusID").AsInt32().NotNullable() 30 | .WithColumn("DateCreated").AsDateTime().NotNullable().WithDefault(SystemMethods.CurrentDateTime) 31 | .WithColumn("DateUpdated").AsDateTime().NotNullable().WithDefault(SystemMethods.CurrentDateTime) 32 | ; 33 | 34 | Create.ForeignKey("FK_ExampleStatuses_ExampleEntities") 35 | .FromTable("ExampleEntities").ForeignColumn("ExampleStatusID") 36 | .ToTable("ExampleStatuses").PrimaryColumn("Id") 37 | ; 38 | } 39 | 40 | public override void Down() 41 | { 42 | Delete.Table("ExampleEntities"); 43 | Delete.Table("ExampleStatuses"); 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/__NAME__.Database/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("__NAME__.Database")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("__NAME__.Database")] 12 | [assembly: AssemblyCopyright("Copyright © 2014")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("ec23d5db-0aa3-465c-acaa-edf344ca8797")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /src/__NAME__.Database/_Scripts/create.sql: -------------------------------------------------------------------------------- 1 | CREATE DATABASE $(DATABASE_NAME) 2 | GO -------------------------------------------------------------------------------- /src/__NAME__.Database/_Scripts/drop.sql: -------------------------------------------------------------------------------- 1 | use [master] 2 | 3 | if EXISTS(select name from master.dbo.sysdatabases where name = '$(DATABASE_NAME)') begin 4 | drop database $(DATABASE_NAME) 5 | end 6 | GO -------------------------------------------------------------------------------- /src/__NAME__.Database/_Scripts/seed.sql: -------------------------------------------------------------------------------- 1 | use $(DATABASE_NAME) 2 | 3 | set nocount on 4 | 5 | print 'Inserting some Example records...' 6 | set identity_insert dbo.ExampleEntities on 7 | insert dbo.ExampleEntities (Id, Name, ExampleStatusID, DateCreated, DateUpdated) 8 | values (10000, 'Test Open', 10000, GETDATE(), GETDATE()) 9 | insert dbo.ExampleEntities (Id, Name, ExampleStatusID, DateCreated, DateUpdated) 10 | values (10001, 'Test Closed', 20000, GETDATE(), GETDATE()) 11 | set identity_insert ExampleEntities off 12 | 13 | set nocount off 14 | -------------------------------------------------------------------------------- /src/__NAME__.Database/__NAME__.Database.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {03F78D69-A903-4A5D-89BD-2D0BAAC21D1D} 8 | Library 9 | Properties 10 | __NAME__.Database 11 | __NAME__.Database 12 | v4.5.1 13 | 512 14 | ..\ 15 | true 16 | 17 | 18 | 19 | true 20 | full 21 | false 22 | bin\Debug\ 23 | DEBUG;TRACE 24 | prompt 25 | 4 26 | 27 | 28 | pdbonly 29 | true 30 | bin\Release\ 31 | TRACE 32 | prompt 33 | 4 34 | 35 | 36 | 37 | ..\packages\FluentMigrator.1.5.0.0\lib\40\FluentMigrator.dll 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | Always 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. 70 | 71 | 72 | 73 | 80 | -------------------------------------------------------------------------------- /src/__NAME__.Database/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /src/__NAME__.Domain.Persistence/Diagnostics/MigrationRecord.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace __NAME__.Domain.Persistence.Diagnostics 4 | { 5 | public class MigrationRecord 6 | { 7 | public virtual long Version { get; set; } 8 | public virtual DateTime? AppliedOn { get; set; } 9 | public virtual string Description { get; set; } 10 | 11 | public override string ToString() 12 | { 13 | return String.Format("Version {0} applied on {1}: {2}", Version, AppliedOn, Description); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/__NAME__.Domain.Persistence/Diagnostics/MigrationRecordMap.cs: -------------------------------------------------------------------------------- 1 | using FluentNHibernate.Mapping; 2 | 3 | namespace __NAME__.Domain.Persistence.Diagnostics 4 | { 5 | class MigrationRecordMap: ClassMap 6 | { 7 | public MigrationRecordMap() 8 | { 9 | Table("VersionInfo"); 10 | Schema("dbo"); 11 | LazyLoad(); 12 | ReadOnly(); 13 | Id(x => x.Version).Column("Version").Not.Nullable(); 14 | Map(x => x.AppliedOn).Column("AppliedOn"); 15 | Map(x => x.Description).Column("Description").Length(1024); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/__NAME__.Domain.Persistence/Diagnostics/MigrationsRepository.cs: -------------------------------------------------------------------------------- 1 | using Crux.Domain.Persistence.NHibernate; 2 | using NHibernate; 3 | 4 | namespace __NAME__.Domain.Persistence.Diagnostics 5 | { 6 | public class MigrationsRepository 7 | { 8 | private readonly INHibernateUnitOfWork _unitOfWork; 9 | 10 | private ISession Session 11 | { 12 | get 13 | { 14 | return _unitOfWork.CurrentSession; 15 | } 16 | } 17 | 18 | public MigrationsRepository(INHibernateUnitOfWork unitOfWork) 19 | { 20 | _unitOfWork = unitOfWork; 21 | } 22 | 23 | public MigrationRecord LastMigration 24 | { 25 | get 26 | { 27 | var lastMigration = Session.QueryOver() 28 | .OrderBy(x => x.AppliedOn) 29 | .Desc 30 | .Take(1) 31 | .SingleOrDefault(); 32 | 33 | return lastMigration; 34 | } 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/__NAME__.Domain.Persistence/Examples/ExampleEntityMap.cs: -------------------------------------------------------------------------------- 1 | using FluentNHibernate.Mapping; 2 | using __NAME__.Domain.Examples; 3 | 4 | namespace __NAME__.Domain.Persistence.Examples 5 | { 6 | public class ExampleEntityMap : ClassMap 7 | { 8 | public ExampleEntityMap() 9 | { 10 | Table("ExampleEntities"); 11 | 12 | Id(x => x.ID).GeneratedBy.Identity(); 13 | 14 | Map(x => x.Name).Not.Nullable(); 15 | Map(x => x.Status).Column("ExampleStatusId") 16 | .CustomType().Not.Nullable(); 17 | 18 | Component(x => x.Timestamp, c => { 19 | c.Map(x => x.DateCreated).Not.Nullable(); 20 | c.Map(x => x.DateUpdated).Not.Nullable(); 21 | }); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/__NAME__.Domain.Persistence/NHibernateRepository.cs: -------------------------------------------------------------------------------- 1 | using Crux.Domain.Persistence.NHibernate; 2 | 3 | namespace __NAME__.Domain.Persistence 4 | { 5 | public class NHibernateRepository : NHibernateRepositoryOfId, IRepository 6 | { 7 | public NHibernateRepository(INHibernateUnitOfWork unitOfWork) : base(unitOfWork) {} 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/__NAME__.Domain.Persistence/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("__NAME__.Domain.Persistence")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("__NAME__.Domain.Persistence")] 12 | [assembly: AssemblyCopyright("Copyright © 2014")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("213febe7-d19f-46df-8d50-16d7eb7fd0b5")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /src/__NAME__.Domain.Persistence/SessionFactoryConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using Crux.Domain.Persistence.NHibernate.Config; 3 | using FluentNHibernate.Cfg; 4 | using FluentNHibernate.Cfg.Db; 5 | using NHibernate; 6 | using NHibernate.Cfg; 7 | 8 | namespace __NAME__.Domain.Persistence 9 | { 10 | public class SessionFactoryConfig 11 | { 12 | protected virtual IPersistenceConfigurer GetDatabaseConfiguration() 13 | { 14 | return MsSqlConfiguration.MsSql2012 15 | .ConnectionString(b => b.FromConnectionStringWithKey("__NAME__")); 16 | } 17 | 18 | public virtual ISessionFactory CreateSessionFactory() 19 | { 20 | return CreateSessionFactory(GetType().Assembly); 21 | } 22 | 23 | protected ISessionFactory CreateSessionFactory(Assembly classMapAssembly) 24 | { 25 | return Fluently.Configure() 26 | .Database(GetDatabaseConfiguration()) 27 | .ExposeConfiguration(config => config.SetProperty(Environment.SqlExceptionConverter, typeof(SqlExceptionConverter).AssemblyQualifiedName)) 28 | .Mappings(m => 29 | m.FluentMappings 30 | .AddFromAssembly(classMapAssembly) 31 | .Conventions.Add() 32 | ).BuildSessionFactory(); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/__NAME__.Domain.Persistence/__NAME__.Domain.Persistence.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {E444FF50-C834-44A0-B97E-657BEB5AFFC8} 8 | Library 9 | Properties 10 | __NAME__.Domain.Persistence 11 | __NAME__.Domain.Persistence 12 | v4.5.1 13 | 512 14 | ..\ 15 | true 16 | 17 | 18 | 19 | true 20 | full 21 | false 22 | bin\Debug\ 23 | DEBUG;TRACE 24 | prompt 25 | 4 26 | 27 | 28 | pdbonly 29 | true 30 | bin\Release\ 31 | TRACE 32 | prompt 33 | 4 34 | 35 | 36 | 37 | False 38 | ..\packages\Crux.Core.0.2.1\lib\net40\Crux.Core.dll 39 | 40 | 41 | False 42 | ..\packages\Crux.Domain.0.2.1\lib\net40\Crux.Domain.dll 43 | 44 | 45 | False 46 | ..\packages\Crux.Domain.Persistence.0.2.1\lib\net40\Crux.Domain.Persistence.dll 47 | 48 | 49 | False 50 | ..\packages\FluentNHibernate.2.0.1.0\lib\net40\FluentNHibernate.dll 51 | 52 | 53 | False 54 | ..\packages\Iesi.Collections.4.0.1.4000\lib\net40\Iesi.Collections.dll 55 | 56 | 57 | False 58 | ..\packages\CommonServiceLocator.1.3\lib\portable-net4+sl5+netcore45+wpa81+wp8\Microsoft.Practices.ServiceLocation.dll 59 | 60 | 61 | ..\packages\NHibernate.4.0.3.4000\lib\net40\NHibernate.dll 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | {386b7c40-6861-4e03-b94b-81d624bb4ca6} 83 | __NAME__.Domain 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. 94 | 95 | 96 | 97 | 104 | -------------------------------------------------------------------------------- /src/__NAME__.Domain.Persistence/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/__NAME__.Domain/Defaults.cs: -------------------------------------------------------------------------------- 1 | using Crux.Domain.Entities; 2 | 3 | namespace __NAME__.Domain 4 | { 5 | public class DomainEntity : DomainEntityOfId { } 6 | 7 | public interface IRepository : IRepositoryOfId { } 8 | 9 | public interface IDomainQuery : IDomainQueryOfId { } 10 | } 11 | -------------------------------------------------------------------------------- /src/__NAME__.Domain/Examples/ExampleEntity.cs: -------------------------------------------------------------------------------- 1 | using Crux.Domain.Component; 2 | 3 | namespace __NAME__.Domain.Examples 4 | { 5 | public enum ExampleStatus 6 | { 7 | Open = 10000, 8 | Closed = 20000 9 | } 10 | 11 | public class ExampleEntity : DomainEntity 12 | { 13 | public virtual string Name { get; protected set; } 14 | public virtual ExampleStatus Status { get; protected set; } 15 | public virtual Timestamp Timestamp { get; protected set; } 16 | 17 | protected ExampleEntity() { } 18 | 19 | public ExampleEntity(string name) 20 | { 21 | Name = name; 22 | Status = ExampleStatus.Open; 23 | Timestamp = Timestamp.Now(); 24 | } 25 | 26 | public virtual void Close() 27 | { 28 | Status = ExampleStatus.Closed; 29 | Timestamp = Timestamp.Touch(); 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /src/__NAME__.Domain/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("__NAME__.Domain")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("__NAME__.Domain")] 12 | [assembly: AssemblyCopyright("Copyright © 2014")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("17db7e04-5f24-44f4-93b3-8616168b324e")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /src/__NAME__.Domain/__NAME__.Domain.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {386B7C40-6861-4E03-B94B-81D624BB4CA6} 8 | Library 9 | Properties 10 | __NAME__.Domain 11 | __NAME__.Domain 12 | v4.5.1 13 | 512 14 | ..\ 15 | true 16 | 17 | 18 | 19 | true 20 | full 21 | false 22 | bin\Debug\ 23 | DEBUG;TRACE 24 | prompt 25 | 4 26 | 27 | 28 | pdbonly 29 | true 30 | bin\Release\ 31 | TRACE 32 | prompt 33 | 4 34 | 35 | 36 | 37 | False 38 | ..\packages\Crux.Core.0.2.1\lib\net40\Crux.Core.dll 39 | 40 | 41 | False 42 | ..\packages\Crux.Domain.0.2.1\lib\net40\Crux.Domain.dll 43 | 44 | 45 | False 46 | ..\packages\CommonServiceLocator.1.3\lib\portable-net4+sl5+netcore45+wpa81+wp8\Microsoft.Practices.ServiceLocation.dll 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | Designer 64 | 65 | 66 | 67 | 68 | 69 | 70 | This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. 71 | 72 | 73 | 74 | 81 | -------------------------------------------------------------------------------- /src/__NAME__.Domain/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/__NAME__.Example.Api.Client/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/__NAME__.Example.Api.Client/Config/AppSettings.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /src/__NAME__.Example.Api.Client/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using StructureMap; 3 | using __NAME__.Api.Client; 4 | using __NAME__.Api.Client.Bootstrap; 5 | using __NAME__.Api.Client.ResourceClients; 6 | using __NAME__.Models.ClientInfo; 7 | 8 | namespace __NAME__.Example.Api.Client 9 | { 10 | class Program 11 | { 12 | static void Main(string[] args) 13 | { 14 | // ReSharper disable once CSharpWarnings::CS0618 15 | ObjectFactory.Initialize(x => x.AddRegistry<__NAME__ApiClientRegistry>()); 16 | 17 | TestApi(); 18 | } 19 | 20 | public static async void TestApi() 21 | { 22 | // ReSharper disable once CSharpWarnings::CS0618 23 | var client = ObjectFactory.GetInstance(); 24 | 25 | var clientConnect = client.Post(new RegisterClientModel(), Guid.NewGuid().ToString()); 26 | 27 | clientConnect.Wait(); 28 | 29 | var ping = await client.Get(); 30 | 31 | Console.WriteLine(ping); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/__NAME__.Example.Api.Client/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("__NAME__.Example.Api.Client")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("__NAME__.Example.Api.Client")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2015")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("ebfceaf6-a964-4bd8-b518-408b0ffe89f3")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /src/__NAME__.Example.Api.Client/__NAME__.Example.Api.Client.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {4080D184-73B1-4709-BDD4-3194F9008F5F} 8 | Exe 9 | Properties 10 | __NAME__.Example.Api.Client 11 | __NAME__.Example.Api.Client 12 | v4.5.1 13 | 512 14 | 15 | ..\ 16 | true 17 | 18 | 19 | AnyCPU 20 | true 21 | full 22 | false 23 | bin\Debug\ 24 | DEBUG;TRACE 25 | prompt 26 | 4 27 | 28 | 29 | AnyCPU 30 | pdbonly 31 | true 32 | bin\Release\ 33 | TRACE 34 | prompt 35 | 4 36 | 37 | 38 | 39 | False 40 | ..\packages\structuremap.3.1.5.154\lib\net40\StructureMap.dll 41 | 42 | 43 | ..\packages\structuremap.3.1.5.154\lib\net40\StructureMap.Net4.dll 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | Always 61 | 62 | 63 | 64 | 65 | 66 | {362c291f-0977-4329-882c-0562ea5fc5cd} 67 | __NAME__.Api.Client 68 | 69 | 70 | {71a42623-f570-45fc-b7cf-b8cf4ebca747} 71 | __NAME__.Models 72 | 73 | 74 | 75 | 76 | 77 | 84 | -------------------------------------------------------------------------------- /src/__NAME__.Example.Api.Client/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /src/__NAME__.IntegrationTests/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/__NAME__.IntegrationTests/Infrastructure/BaseDomainPersistenceTester.cs: -------------------------------------------------------------------------------- 1 | using Crux.Domain.Persistence; 2 | using NHibernate; 3 | using NUnit.Framework; 4 | 5 | namespace __NAME__.IntegrationTests.Infrastructure 6 | { 7 | [TestFixture] 8 | public abstract class DomainPersistenceTester : Crux.Domain.Testing.Persistence.DomainPersistenceTester 9 | { 10 | public override ISessionFactory SessionFactory 11 | { 12 | get { return new TestSessionFactoryConfig().CreateSessionFactory(); } 13 | } 14 | 15 | public override IDbConnectionProvider ConnectionProvider 16 | { 17 | get { return new TestConnectionProvider("__NAME__"); } 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/__NAME__.IntegrationTests/Infrastructure/BaseStatelessPersistenceTester.cs: -------------------------------------------------------------------------------- 1 | using NHibernate; 2 | using NUnit.Framework; 3 | 4 | namespace __NAME__.IntegrationTests.Infrastructure 5 | { 6 | public abstract class BaseStatelessPersistenceTester 7 | { 8 | protected BaseStatelessPersistenceTester() 9 | { 10 | StatelessSession = GetStatelessSession(); 11 | } 12 | 13 | public IStatelessSession GetStatelessSession() 14 | { 15 | var sessionFactory = new TestSessionFactoryConfig().CreateSessionFactory(); 16 | var connectionProvider = new TestConnectionProvider("__NAME__"); 17 | return sessionFactory.OpenStatelessSession(connectionProvider.GetConnection()); 18 | } 19 | 20 | protected IStatelessSession StatelessSession { get; private set; } 21 | 22 | [TearDown] 23 | public void TearDown() 24 | { 25 | StatelessSession.Dispose(); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/__NAME__.IntegrationTests/Infrastructure/DefaultCompareConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using FluentAssertions; 5 | using FluentAssertions.Equivalency; 6 | 7 | namespace __NAME__.IntegrationTests.Infrastructure 8 | { 9 | class DefaultCompareConfig 10 | { 11 | public static EquivalencyAssertionOptions Compare(EquivalencyAssertionOptions equivalencyAssertionOptions) 12 | { 13 | equivalencyAssertionOptions 14 | .Using(new DefaultMemberSelectionRule(typeof(T).Name)); 15 | 16 | equivalencyAssertionOptions 17 | .Using(ctx => ctx.Subject.Should().BeCloseTo(ctx.Expectation, (int)1.Minutes().TotalMilliseconds)) 18 | .WhenTypeIs(); 19 | 20 | equivalencyAssertionOptions 21 | .IgnoringCyclicReferences(); 22 | 23 | return equivalencyAssertionOptions; 24 | } 25 | } 26 | 27 | class DefaultMemberSelectionRule : IMemberSelectionRule 28 | { 29 | private readonly string _type; 30 | 31 | public DefaultMemberSelectionRule(string type) 32 | { 33 | _type = type; 34 | } 35 | 36 | public IEnumerable SelectMembers(IEnumerable selectedMembers, ISubjectInfo context, IEquivalencyAssertionOptions config) 37 | { 38 | var path = context.SelectedMemberPath.Split('.').ToList(); 39 | var ignore = path.Contains(_type); 40 | 41 | return ignore 42 | ? new SelectedMemberInfo[] { } 43 | : selectedMembers; 44 | } 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /src/__NAME__.IntegrationTests/Infrastructure/TestConnectionProvider.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Configuration; 3 | using System.Data; 4 | using System.Data.SqlClient; 5 | using Crux.Core.Extensions; 6 | using Crux.Domain.Persistence; 7 | 8 | namespace __NAME__.IntegrationTests.Infrastructure 9 | { 10 | public class TestConnectionProvider : IDbConnectionProvider 11 | { 12 | private const string DEFAULT_DB_SERVER = "(local)"; 13 | private const string DEFAULT_DB_NAME = "__NAME__"; 14 | 15 | private readonly string _connectionStringKey; 16 | 17 | public TestConnectionProvider(string connectionStringKey) 18 | { 19 | _connectionStringKey = connectionStringKey; 20 | } 21 | 22 | public IDbConnection GetConnection() 23 | { 24 | var connection = new SqlConnection(GetConnectionString()); 25 | connection.Open(); 26 | return connection; 27 | } 28 | 29 | public string GetConnectionString() 30 | { 31 | var connectionString = ConfigurationManager.ConnectionStrings[_connectionStringKey]; 32 | 33 | if (connectionString == null) { 34 | throw new ArgumentException("Invalid connection string {0}".ToFormat(_connectionStringKey)); 35 | } 36 | 37 | return ReplaceTokens(connectionString.ConnectionString); 38 | } 39 | 40 | private string ReplaceTokens(string connectionString) 41 | { 42 | return connectionString 43 | .Replace("#{db.server}", GetDbServer()) 44 | .Replace("#{db.name}", GetDbName()); 45 | } 46 | 47 | private string GetDbServer() 48 | { 49 | return GetEnvOrDefault("DATABASE_SERVER", DEFAULT_DB_SERVER); 50 | } 51 | 52 | private string GetDbName() 53 | { 54 | return GetEnvOrDefault("DATABASE_NAME", DEFAULT_DB_NAME); 55 | } 56 | 57 | private string GetEnvOrDefault(string envVarName, string defaultValue) 58 | { 59 | var envVar = Environment.GetEnvironmentVariable(envVarName); 60 | return String.IsNullOrEmpty(envVar) ? defaultValue : envVar; 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /src/__NAME__.IntegrationTests/Infrastructure/TestSessionFactoryConfig.cs: -------------------------------------------------------------------------------- 1 | using FluentNHibernate.Cfg.Db; 2 | using NHibernate; 3 | using __NAME__.Domain.Persistence; 4 | 5 | namespace __NAME__.IntegrationTests.Infrastructure 6 | { 7 | public class TestSessionFactoryConfig : SessionFactoryConfig 8 | { 9 | protected override IPersistenceConfigurer GetDatabaseConfiguration() 10 | { 11 | var provider = new TestConnectionProvider("__NAME__"); 12 | 13 | return MsSqlConfiguration.MsSql2012 14 | .ConnectionString(provider.GetConnectionString()); 15 | } 16 | 17 | public override ISessionFactory CreateSessionFactory() 18 | { 19 | return CreateSessionFactory(typeof(SessionFactoryConfig).Assembly); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/__NAME__.IntegrationTests/Persistence/Examples/ExamplePersistenceTester.cs: -------------------------------------------------------------------------------- 1 | using FluentAssertions; 2 | using NUnit.Framework; 3 | using __NAME__.Domain.Examples; 4 | using __NAME__.IntegrationTests.Infrastructure; 5 | 6 | namespace __NAME__.IntegrationTests.Persistence.Examples 7 | { 8 | public class ExamplePersistenceTester : DomainPersistenceTester 9 | { 10 | [Test] 11 | public void should_save_and_load() 12 | { 13 | var entity = new ExampleEntity("test"); 14 | var newEntity = VerifyPersistence(entity); 15 | 16 | newEntity.ShouldBeEquivalentTo(entity, DefaultCompareConfig.Compare); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/__NAME__.IntegrationTests/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("__NAME__.IntegrationTests")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("__NAME__.IntegrationTests")] 12 | [assembly: AssemblyCopyright("Copyright © 2015")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("217b318a-77f8-4da9-b039-37bcc2f9eada")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /src/__NAME__.IntegrationTests/__NAME__.IntegrationTests.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {11A056E7-6BA8-45A3-AF3F-7E369A8FC5C2} 8 | Library 9 | Properties 10 | __NAME__.IntegrationTests 11 | __NAME__.IntegrationTests 12 | v4.5.1 13 | 512 14 | 15 | ..\ 16 | true 17 | 18 | 19 | true 20 | full 21 | false 22 | bin\Debug\ 23 | DEBUG;TRACE 24 | prompt 25 | 4 26 | 27 | 28 | pdbonly 29 | true 30 | bin\Release\ 31 | TRACE 32 | prompt 33 | 4 34 | 35 | 36 | 37 | False 38 | ..\packages\Crux.Core.0.2.1\lib\net40\Crux.Core.dll 39 | 40 | 41 | False 42 | ..\packages\Crux.Domain.0.2.1\lib\net40\Crux.Domain.dll 43 | True 44 | 45 | 46 | ..\packages\Crux.Domain.Persistence.0.2.1\lib\net40\Crux.Domain.Persistence.dll 47 | True 48 | 49 | 50 | False 51 | ..\packages\Crux.Domain.Testing.0.2.1\lib\net40\Crux.Domain.Testing.dll 52 | 53 | 54 | ..\packages\FluentAssertions.3.3.0\lib\net45\FluentAssertions.dll 55 | 56 | 57 | ..\packages\FluentAssertions.3.3.0\lib\net45\FluentAssertions.Core.dll 58 | 59 | 60 | False 61 | ..\packages\FluentNHibernate.2.0.1.0\lib\net40\FluentNHibernate.dll 62 | 63 | 64 | False 65 | ..\packages\Iesi.Collections.4.0.1.4000\lib\net40\Iesi.Collections.dll 66 | 67 | 68 | ..\packages\CommonServiceLocator.1.3\lib\portable-net4+sl5+netcore45+wpa81+wp8\Microsoft.Practices.ServiceLocation.dll 69 | True 70 | 71 | 72 | False 73 | ..\packages\NHibernate.4.0.3.4000\lib\net40\NHibernate.dll 74 | True 75 | 76 | 77 | ..\packages\NUnit.2.6.4\lib\nunit.framework.dll 78 | 79 | 80 | ..\packages\RhinoMocks.3.6.1\lib\net\Rhino.Mocks.dll 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | {e444ff50-c834-44a0-b97e-657beb5affc8} 107 | __NAME__.Domain.Persistence 108 | 109 | 110 | {386b7c40-6861-4e03-b94b-81d624bb4ca6} 111 | __NAME__.Domain 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. 122 | 123 | 124 | 125 | 132 | -------------------------------------------------------------------------------- /src/__NAME__.IntegrationTests/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/__NAME__.MessageBus.Client/Diagnostics/DiagnosticsSender.cs: -------------------------------------------------------------------------------- 1 | using NServiceBus; 2 | using __NAME__.Messages.Diagnostics; 3 | 4 | namespace __NAME__.MessageBus.Client.Diagnostics 5 | { 6 | public class DiagnosticsSender 7 | { 8 | private readonly ISendOnlyBus _bus; 9 | 10 | public DiagnosticsSender(ISendOnlyBus bus) 11 | { 12 | _bus = bus; 13 | } 14 | 15 | public void Ping(string sender) 16 | { 17 | _bus.Send(new PingCommand { Sender = sender }); 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /src/__NAME__.MessageBus.Client/Examples/ExampleSender.cs: -------------------------------------------------------------------------------- 1 | using NServiceBus; 2 | using __NAME__.Messages.Examples; 3 | 4 | namespace __NAME__.MessageBus.Client.Examples 5 | { 6 | public class ExampleSender 7 | { 8 | private readonly ISendOnlyBus _bus; 9 | 10 | public ExampleSender(ISendOnlyBus bus) 11 | { 12 | _bus = bus; 13 | } 14 | 15 | public void CloseExample(int id) 16 | { 17 | _bus.Send(new CloseExampleCommand {Id = id}); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/__NAME__.MessageBus.Client/MessageBusClientBootstrapper.cs: -------------------------------------------------------------------------------- 1 | using NServiceBus; 2 | using NServiceBus.Features; 3 | using StructureMap; 4 | using __NAME__.Messages; 5 | 6 | namespace __NAME__.MessageBus.Client 7 | { 8 | /// 9 | /// This class configures a ISendOnlyBus 10 | /// 11 | public static class MessageBusClientBootstrapper 12 | { 13 | public static void Bootstrap(IContainer container) 14 | { 15 | // Initialize container 16 | var configuration = new BusConfiguration(); 17 | configuration.UseContainer(c => c.ExistingContainer(container)); 18 | 19 | // Define message conventions 20 | ConventionsBuilder conventions = configuration.Conventions(); 21 | conventions.DefiningCommandsAs(MessageTypeConventions.EndsWith("Command")); 22 | conventions.DefiningEventsAs(MessageTypeConventions.EndsWith("Event")); 23 | conventions.DefiningMessagesAs(MessageTypeConventions.EndsWith("Message")); 24 | 25 | // Define features 26 | configuration.UseSerialization(); 27 | configuration.UsePersistence(); 28 | configuration.DisableFeature(); 29 | configuration.DisableFeature(); 30 | configuration.DisableFeature(); 31 | 32 | // Add the bus to the container 33 | var bus = Bus.CreateSendOnly(configuration); 34 | container.Configure(c => c.ForSingletonOf().Use(x => bus).Named("__NAME__")); 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/__NAME__.MessageBus.Client/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("__NAME__.Api.Client.Async")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("__NAME__.Api.Client.Async")] 12 | [assembly: AssemblyCopyright("Copyright © 2015")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("82730acd-bfc9-4cb2-bae6-72d062cae3f2")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /src/__NAME__.MessageBus.Client/__NAME__.MessageBus.Client.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {BF52672C-CD40-41D7-A4A8-58C978F4CC72} 8 | Library 9 | Properties 10 | __NAME__.MessageBus.Client 11 | __NAME__.MessageBus.Client 12 | v4.5.1 13 | 512 14 | ..\ 15 | true 16 | 17 | 18 | true 19 | full 20 | false 21 | bin\Debug\ 22 | DEBUG;TRACE 23 | prompt 24 | 4 25 | 26 | 27 | pdbonly 28 | true 29 | bin\Release\ 30 | TRACE 31 | prompt 32 | 4 33 | 34 | 35 | 36 | False 37 | ..\packages\Crux.StructureMap.0.2.1\lib\net40\Crux.StructureMap.dll 38 | 39 | 40 | ..\packages\CommonServiceLocator.1.3\lib\portable-net4+sl5+netcore45+wpa81+wp8\Microsoft.Practices.ServiceLocation.dll 41 | 42 | 43 | False 44 | ..\packages\NServiceBus.5.2.0\lib\net45\NServiceBus.Core.dll 45 | 46 | 47 | ..\packages\NServiceBus.StructureMap.5.0.1\lib\net45\NServiceBus.ObjectBuilder.StructureMap.dll 48 | 49 | 50 | ..\packages\structuremap.3.1.5.154\lib\net40\StructureMap.dll 51 | 52 | 53 | ..\packages\structuremap.3.1.5.154\lib\net40\StructureMap.Net4.dll 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | {d1d380b5-f384-4dba-86bf-9ecaea8b6fed} 76 | __NAME__.Messages 77 | 78 | 79 | {71A42623-F570-45FC-B7CF-B8CF4EBCA747} 80 | __NAME__.Models 81 | 82 | 83 | 84 | 85 | 86 | 87 | This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. 88 | 89 | 90 | 91 | 98 | -------------------------------------------------------------------------------- /src/__NAME__.MessageBus.Client/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/__NAME__.MessageBus.Client/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/__NAME__.MessageBus/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
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 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /src/__NAME__.MessageBus/App/Examples/CloseExampleHandler.cs: -------------------------------------------------------------------------------- 1 | using NServiceBus; 2 | using __NAME__.Domain; 3 | using __NAME__.Domain.Examples; 4 | using __NAME__.Messages.Examples; 5 | 6 | namespace __NAME__.MessageBus.App.Examples 7 | { 8 | public class CloseExampleHandler : IHandleMessages 9 | { 10 | private readonly IRepository _repository; 11 | 12 | public CloseExampleHandler(IRepository repository) 13 | { 14 | _repository = repository; 15 | } 16 | 17 | public void Handle(CloseExampleCommand message) 18 | { 19 | var entity = _repository.Load(message.Id); 20 | entity.Close(); 21 | _repository.Save(entity); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/__NAME__.MessageBus/Config/ConnectionStrings.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /src/__NAME__.MessageBus/Config/Log4Net.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 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 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /src/__NAME__.MessageBus/Config/Production/Log4Net.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 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 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /src/__NAME__.MessageBus/Config/QA/Log4Net.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 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 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /src/__NAME__.MessageBus/Config/UnicastBus.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/__NAME__.MessageBus/Infrastructure/Bootstrapping/EndpointConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using Crux.StructureMap; 4 | using Microsoft.Practices.ServiceLocation; 5 | using NServiceBus; 6 | using NServiceBus.Features; 7 | using NServiceBus.Log4Net; 8 | using StructureMap; 9 | using StructureMap.Graph; 10 | using __NAME__.Messages; 11 | 12 | namespace __NAME__.MessageBus.Infrastructure.Bootstrapping 13 | { 14 | [EndpointName("__NAME__.input")] 15 | public class EndpointConfig : IConfigureThisEndpoint, AsA_Server, INeedInitialization 16 | { 17 | public void Customize(BusConfiguration config) 18 | { 19 | // When running as a service the current directory will be %System% 20 | Directory.SetCurrentDirectory(AppDomain.CurrentDomain.BaseDirectory); 21 | 22 | InitLogging(); 23 | 24 | var container = new Container(); 25 | 26 | InitServiceBus(config, container); 27 | 28 | InitStructureMap(container); 29 | 30 | InitServiceLocator(container); 31 | } 32 | 33 | private void InitLogging() 34 | { 35 | // Configure Log4net using configuration section 36 | log4net.Config.XmlConfigurator.Configure(); 37 | } 38 | 39 | private void InitServiceBus(BusConfiguration config, IContainer container) 40 | { 41 | // Configure Logging 42 | NServiceBus.Logging.LogManager.Use(); 43 | 44 | // Configure container 45 | config.UseContainer(c => c.ExistingContainer(container)); 46 | 47 | // Xml serialization makes for easy to read messages. 48 | config.UseSerialization(); 49 | 50 | //Define conventions 51 | ConventionsBuilder conventions = config.Conventions(); 52 | conventions.DefiningCommandsAs(MessageTypeConventions.EndsWith("Command")); 53 | conventions.DefiningEventsAs(MessageTypeConventions.EndsWith("Event")); 54 | conventions.DefiningMessagesAs(MessageTypeConventions.EndsWith("Message")); 55 | 56 | // Keep it simple by default 57 | config.DisableFeature(); 58 | config.DisableFeature(); 59 | config.DisableFeature(); 60 | config.DisableFeature(); 61 | 62 | // Configure for MSMQ 63 | config.UseTransport(); 64 | config.Transactions().Enable(); 65 | config.PurgeOnStartup(false); 66 | 67 | // Configure Saga Persistence 68 | config.UsePersistence(); 69 | } 70 | 71 | private void InitServiceLocator(IContainer container) 72 | { 73 | ServiceLocator.SetLocatorProvider(() => new StructureMapServiceLocator(container)); 74 | } 75 | 76 | private void InitStructureMap(IContainer container) 77 | { 78 | container.Configure(c => c.Scan(s => { 79 | s.TheCallingAssembly(); 80 | s.LookForRegistries(); 81 | })); 82 | } 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /src/__NAME__.MessageBus/Infrastructure/Bootstrapping/NHibernateRegistry.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Crux.Domain.Entities; 3 | using Crux.Domain.Persistence; 4 | using Crux.Domain.Persistence.NHibernate; 5 | using NHibernate; 6 | using StructureMap.Configuration.DSL; 7 | using __NAME__.Domain; 8 | using __NAME__.Domain.Persistence; 9 | 10 | namespace __NAME__.MessageBus.Infrastructure.Bootstrapping 11 | { 12 | public class NHibernateRegistry : Registry 13 | { 14 | public NHibernateRegistry() 15 | { 16 | // Configure session factory 17 | ForSingletonOf() 18 | .Use(c => new SessionFactoryConfig().CreateSessionFactory()); 19 | 20 | // Configure connection provider 21 | ForSingletonOf() 22 | .Use(c => SqlConnectionProvider.FromConnectionStringKey("__NAME__")); 23 | 24 | For().Use(); 25 | 26 | // Persistence Infrastructure 27 | For>().Use>(); 28 | For>().Use>(); 29 | For().Use(); 30 | 31 | For() 32 | .Use(c => c.GetInstance().OpenStatelessSession()); 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /src/__NAME__.MessageBus/Infrastructure/Bootstrapping/ServiceRegistry.cs: -------------------------------------------------------------------------------- 1 | using Crux.Core.Bootstrapping; 2 | using Crux.StructureMap; 3 | using Microsoft.Practices.ServiceLocation; 4 | using NServiceBus.UnitOfWork; 5 | using StructureMap.Configuration.DSL; 6 | using StructureMap.Graph; 7 | 8 | namespace __NAME__.MessageBus.Infrastructure.Bootstrapping 9 | { 10 | public class ServiceRegistry : Registry 11 | { 12 | public ServiceRegistry() 13 | { 14 | Scan(s => { 15 | s.TheCallingAssembly(); 16 | s.WithDefaultConventions(); 17 | 18 | s.AddAllTypesOf(); 19 | }); 20 | 21 | For().Use(); 22 | 23 | For().Use(); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/__NAME__.MessageBus/Infrastructure/Diagnostics/PingHandler.cs: -------------------------------------------------------------------------------- 1 | using log4net; 2 | using NServiceBus; 3 | using __NAME__.Messages.Diagnostics; 4 | 5 | namespace __NAME__.MessageBus.Infrastructure.Diagnostics 6 | { 7 | public class PingHandler : IHandleMessages 8 | { 9 | private static readonly ILog Log = LogManager.GetLogger(typeof(PingHandler)); 10 | 11 | public void Handle(PingCommand message) 12 | { 13 | Log.InfoFormat("Ping received from {0} with Id {1} created on {2}", 14 | message.Sender, 15 | message.Id, 16 | message.DateCreated); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/__NAME__.MessageBus/Infrastructure/UnitOfWorkManager.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Crux.Domain.Persistence.NHibernate; 3 | using Crux.Domain.UoW; 4 | using NServiceBus.UnitOfWork; 5 | 6 | namespace __NAME__.MessageBus.Infrastructure 7 | { 8 | public class UnitOfWorkManager : IManageUnitsOfWork 9 | { 10 | private readonly INHibernateUnitOfWork _unitOfWork; 11 | private IUnitOfWorkScope _scope; 12 | 13 | public UnitOfWorkManager(INHibernateUnitOfWork unitOfWork) 14 | { 15 | _unitOfWork = unitOfWork; 16 | } 17 | 18 | public void Begin() 19 | { 20 | _scope = _unitOfWork.CreateTransactionalScope(UnitOfWorkTransactionOptions.Default()); 21 | } 22 | 23 | public void End(Exception ex = null) 24 | { 25 | using (_scope) { 26 | if (ex == null) { 27 | _scope.Complete(); 28 | } 29 | } 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/__NAME__.MessageBus/PostDeploy.ps1: -------------------------------------------------------------------------------- 1 | # Deploy and install Windows Service for NServiceBus host 2 | 3 | # Get parameters from Octopus 4 | $serviceName = $OctopusParameters['service.name'] 5 | $serviceDisplayName = $OctopusParameters['service.display_name'] 6 | $serviceBusProfile = $OctopusParameters['service.profile'] 7 | $serviceUser = $OctopusParameters['service.user'] 8 | $servicePassword = $OctopusParameters['service.password'] 9 | $installDirectory = $OctopusActionPackageCustomInstallationDirectory 10 | 11 | # Check to see if the service exists. 12 | $fullPath = Resolve-Path "$installDirectory\NServiceBus.Host.exe" 13 | 14 | #if ($InstallInfrastructure) { 15 | # Write-Host "Installing NServiceBus infrastructure (RavenDB, MSMQ etc.)" 16 | # & "$fullPath" /installInfrastructure $serviceBusProfile | Write-Host 17 | #} 18 | 19 | Write-Host "Installing service => $($serviceName)" 20 | & "$fullPath" /install /serviceName:"$serviceName" /displayName:$serviceDisplayName /username:$serviceUser /password:$servicePassword $serviceBusProfile | Write-Host 21 | 22 | # Try and start the service by name 23 | try { 24 | Write-Host "Starting service => $($serviceName)" 25 | Start-Service $serviceName 26 | } catch { 27 | Write-Host "$($_.Exception.Message)" -ForegroundColor Red 28 | Write-Host "$($_.InvocationInfo.PositionMessage)" -ForegroundColor Red 29 | exit 1 30 | } -------------------------------------------------------------------------------- /src/__NAME__.MessageBus/PreDeploy.ps1: -------------------------------------------------------------------------------- 1 | # Copy environment specific files to the config folder 2 | $path = "Config\" + $OctopusParameters['Octopus.Environment.Name'] 3 | cd $path 4 | cp *.* ..\ 5 | 6 | # Prepare for NServiceBus Deployment 7 | 8 | # Get parameters from Octopus 9 | $serviceName = $OctopusParameters['service.name'] 10 | $installDirectory = $OctopusActionPackageCustomInstallationDirectory 11 | 12 | # Check to see if the service exists. 13 | $service = Get-Service $serviceName -ErrorAction SilentlyContinue 14 | 15 | if ($service) { 16 | Write-Host "An existing service => $($serviceName) was detected." 17 | 18 | Write-Host "Stopping and uninstalling the service => $($serviceName)" 19 | $fullPath = Resolve-Path "$installDirectory\NServiceBus.Host.exe" 20 | Stop-Service $serviceName -Force 21 | & "$fullPath" /uninstall /serviceName:"$serviceName" | Write-Host 22 | } 23 | -------------------------------------------------------------------------------- /src/__NAME__.MessageBus/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("__NAME__.MessageBus")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("__NAME__.MessageBus")] 12 | [assembly: AssemblyCopyright("Copyright © 2014")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("a2aee7cc-f56f-4e66-b577-6726a37d97d5")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /src/__NAME__.MessageBus/__NAME__.MessageBus.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {AE64A886-361E-4078-BAA1-747231A78348} 8 | Library 9 | Properties 10 | __NAME__.MessageBus 11 | __NAME__.MessageBus 12 | v4.5.1 13 | 512 14 | ..\ 15 | true 16 | 17 | 18 | 19 | true 20 | full 21 | false 22 | bin\Debug\ 23 | DEBUG;TRACE 24 | prompt 25 | 4 26 | 27 | 28 | pdbonly 29 | true 30 | bin\Release\ 31 | TRACE 32 | prompt 33 | 4 34 | 35 | 36 | 37 | False 38 | ..\packages\Crux.Core.0.2.1\lib\net40\Crux.Core.dll 39 | 40 | 41 | False 42 | ..\packages\Crux.Domain.0.2.1\lib\net40\Crux.Domain.dll 43 | 44 | 45 | False 46 | ..\packages\Crux.Domain.Persistence.0.2.1\lib\net40\Crux.Domain.Persistence.dll 47 | 48 | 49 | False 50 | ..\packages\Crux.NServiceBus.0.2.1\lib\net40\Crux.NServiceBus.dll 51 | 52 | 53 | False 54 | ..\packages\Crux.StructureMap.0.2.1\lib\net40\Crux.StructureMap.dll 55 | 56 | 57 | ..\packages\FluentNHibernate.2.0.1.0\lib\net40\FluentNHibernate.dll 58 | True 59 | 60 | 61 | ..\packages\Iesi.Collections.4.0.1.4000\lib\net40\Iesi.Collections.dll 62 | True 63 | 64 | 65 | False 66 | ..\packages\log4net.2.0.3\lib\net40-full\log4net.dll 67 | 68 | 69 | ..\packages\CommonServiceLocator.1.3\lib\portable-net4+sl5+netcore45+wpa81+wp8\Microsoft.Practices.ServiceLocation.dll 70 | True 71 | 72 | 73 | ..\packages\NHibernate.4.0.3.4000\lib\net40\NHibernate.dll 74 | True 75 | 76 | 77 | False 78 | ..\packages\NServiceBus.5.2.0\lib\net45\NServiceBus.Core.dll 79 | 80 | 81 | False 82 | ..\packages\NServiceBus.Host.6.0.0\lib\net45\NServiceBus.Host.exe 83 | 84 | 85 | ..\packages\NServiceBus.Log4Net.1.0.0\lib\net45\NServiceBus.Log4Net.dll 86 | 87 | 88 | ..\packages\NServiceBus.StructureMap.5.0.1\lib\net45\NServiceBus.ObjectBuilder.StructureMap.dll 89 | 90 | 91 | False 92 | ..\packages\structuremap.3.1.5.154\lib\net40\StructureMap.dll 93 | 94 | 95 | False 96 | ..\packages\structuremap.3.1.5.154\lib\net40\StructureMap.Net4.dll 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | PreserveNewest 119 | 120 | 121 | PreserveNewest 122 | 123 | 124 | PreserveNewest 125 | 126 | 127 | PreserveNewest 128 | 129 | 130 | PreserveNewest 131 | 132 | 133 | Designer 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | {e444ff50-c834-44a0-b97e-657beb5affc8} 142 | __NAME__.Domain.Persistence 143 | 144 | 145 | {386b7c40-6861-4e03-b94b-81d624bb4ca6} 146 | __NAME__.Domain 147 | 148 | 149 | {d1d380b5-f384-4dba-86bf-9ecaea8b6fed} 150 | __NAME__.Messages 151 | 152 | 153 | {71A42623-F570-45FC-B7CF-B8CF4EBCA747} 154 | __NAME__.Models 155 | 156 | 157 | 158 | 159 | 160 | 161 | This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. 162 | 163 | 164 | 165 | 172 | 173 | Program 174 | $(ProjectDir)$(OutputPath)NServiceBus.Host.exe 175 | 176 | -------------------------------------------------------------------------------- /src/__NAME__.MessageBus/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/__NAME__.Messages/ConventionExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace __NAME__.Messages 4 | { 5 | public static class MessageTypeConventions 6 | { 7 | public static Func EndsWith(string name) 8 | { 9 | return t => t.Namespace != null && t.Namespace.StartsWith("__NAME__") && t.Name.EndsWith(name); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/__NAME__.Messages/Diagnostics/PingCommand.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace __NAME__.Messages.Diagnostics 4 | { 5 | public class PingCommand 6 | { 7 | public Guid Id { get; set; } 8 | public DateTime DateCreated { get; set; } 9 | public string Sender { get; set; } 10 | 11 | public PingCommand() 12 | { 13 | Id = Guid.NewGuid(); 14 | DateCreated = DateTime.UtcNow; 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/__NAME__.Messages/Examples/CloseExampleCommand.cs: -------------------------------------------------------------------------------- 1 | namespace __NAME__.Messages.Examples 2 | { 3 | public class CloseExampleCommand 4 | { 5 | public int Id { get; set; } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/__NAME__.Messages/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("__NAME__.Messages")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("__NAME__.Messages")] 12 | [assembly: AssemblyCopyright("Copyright © 2014")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("244e32b0-f2e9-4374-8e41-3fd54790361d")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /src/__NAME__.Messages/__NAME__.Messages.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {D1D380B5-F384-4DBA-86BF-9ECAEA8B6FED} 8 | Library 9 | Properties 10 | __NAME__.Messages 11 | __NAME__.Messages 12 | v4.5.1 13 | 512 14 | 15 | 16 | 17 | true 18 | full 19 | false 20 | bin\Debug\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | 25 | 26 | pdbonly 27 | true 28 | bin\Release\ 29 | TRACE 30 | prompt 31 | 4 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | {71A42623-F570-45FC-B7CF-B8CF4EBCA747} 52 | __NAME__.Models 53 | 54 | 55 | 56 | 63 | -------------------------------------------------------------------------------- /src/__NAME__.Models/Diagnostics/StatusItem.cs: -------------------------------------------------------------------------------- 1 | namespace __NAME__.Models.Diagnostics 2 | { 3 | public class StatusItem 4 | { 5 | public static string OK = "OK"; 6 | public static string Error = "ERROR"; 7 | 8 | public StatusItem(string id) 9 | { 10 | Id = id; 11 | } 12 | 13 | public string Id { get; set; } 14 | public string Status { get; set; } 15 | public string Comment { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/__NAME__.Models/Examples/CloseExampleModel.cs: -------------------------------------------------------------------------------- 1 | namespace __NAME__.Models.Examples 2 | { 3 | public class CloseExampleModel 4 | { 5 | public int Id { get; set; } 6 | } 7 | } -------------------------------------------------------------------------------- /src/__NAME__.Models/Examples/ExampleModel.cs: -------------------------------------------------------------------------------- 1 | namespace __NAME__.Models.Examples 2 | { 3 | public class ExampleModel 4 | { 5 | public int Id { get; set; } 6 | public string Name { get; set; } 7 | public int Status { get; set; } 8 | public string DateCreated { get; set; } 9 | public string DateUpdated { get; set; } 10 | } 11 | } -------------------------------------------------------------------------------- /src/__NAME__.Models/Examples/NewExampleModel.cs: -------------------------------------------------------------------------------- 1 | namespace __NAME__.Models.Examples 2 | { 3 | public class NewExampleModel 4 | { 5 | public string Name { get; set; } 6 | } 7 | 8 | public class NewExampleCreatedModel 9 | { 10 | public int Id { get; set; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/__NAME__.Models/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("__NAME__.Models")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("Microsoft")] 11 | [assembly: AssemblyProduct("__NAME__.Models")] 12 | [assembly: AssemblyCopyright("Copyright © Microsoft 2015")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("b706dc7b-d30a-429d-beec-eb48c405e443")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /src/__NAME__.Models/__NAME__.Models.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {71A42623-F570-45FC-B7CF-B8CF4EBCA747} 8 | Library 9 | Properties 10 | __NAME__.Models 11 | __NAME__.Models 12 | v4.5 13 | 512 14 | 15 | 16 | true 17 | full 18 | false 19 | bin\Debug\ 20 | DEBUG;TRACE 21 | prompt 22 | 4 23 | 24 | 25 | pdbonly 26 | true 27 | bin\Release\ 28 | TRACE 29 | prompt 30 | 4 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 56 | -------------------------------------------------------------------------------- /src/__NAME__.UnitTests/Domain/Examples/ExampleEntityTester.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using FluentAssertions; 3 | using NUnit.Framework; 4 | using __NAME__.Domain.Examples; 5 | 6 | namespace __NAME__.UnitTests.Domain.Examples 7 | { 8 | [TestFixture] 9 | public class ExampleEntityTester 10 | { 11 | private const string NAME = "test"; 12 | 13 | [Test] 14 | public void should_create_example_entity() 15 | { 16 | var now = DateTime.Now; 17 | var entity = new ExampleEntity(NAME); 18 | 19 | entity.Name.Should().Be(NAME); 20 | entity.Status.Should().Be(ExampleStatus.Open); 21 | entity.Timestamp.DateCreated.Should().BeWithin(1.Seconds()).After(now); 22 | entity.Timestamp.DateUpdated.Should().BeWithin(1.Seconds()).After(now); 23 | } 24 | 25 | [Test] 26 | public void should_update_status_to_closed() 27 | { 28 | var created = DateTime.Now; 29 | var entity = new ExampleEntity(NAME); 30 | 31 | var updated = DateTime.Now; 32 | entity.Close(); 33 | 34 | entity.Status.Should().Be(ExampleStatus.Closed); 35 | entity.Timestamp.DateCreated.Should().BeWithin(1.Seconds()).After(created); 36 | entity.Timestamp.DateUpdated.Should().BeWithin(1.Seconds()).After(updated); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/__NAME__.UnitTests/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("__NAME__.UnitTests")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("__NAME__.UnitTests")] 12 | [assembly: AssemblyCopyright("Copyright © 2015")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("a521a65a-4c33-4739-b47b-e75b31ce92b0")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /src/__NAME__.UnitTests/__NAME__.UnitTests.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {9F6DB1B2-BE6B-4C28-9CD7-6B9252084300} 8 | Library 9 | Properties 10 | __NAME__.UnitTests 11 | __NAME__.UnitTests 12 | v4.5.1 13 | 512 14 | ..\ 15 | true 16 | 17 | 18 | 19 | true 20 | full 21 | false 22 | bin\Debug\ 23 | DEBUG;TRACE 24 | prompt 25 | 4 26 | 27 | 28 | pdbonly 29 | true 30 | bin\Release\ 31 | TRACE 32 | prompt 33 | 4 34 | 35 | 36 | 37 | False 38 | ..\packages\Crux.Core.0.2.1\lib\net40\Crux.Core.dll 39 | 40 | 41 | False 42 | ..\packages\Crux.Domain.0.2.1\lib\net40\Crux.Domain.dll 43 | 44 | 45 | ..\packages\FluentAssertions.3.3.0\lib\net45\FluentAssertions.dll 46 | 47 | 48 | ..\packages\FluentAssertions.3.3.0\lib\net45\FluentAssertions.Core.dll 49 | 50 | 51 | ..\packages\CommonServiceLocator.1.3\lib\portable-net4+sl5+netcore45+wpa81+wp8\Microsoft.Practices.ServiceLocation.dll 52 | 53 | 54 | ..\packages\NUnit.2.6.4\lib\nunit.framework.dll 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | {362c291f-0977-4329-882c-0562ea5fc5cd} 75 | __NAME__.Api.Client 76 | 77 | 78 | {386b7c40-6861-4e03-b94b-81d624bb4ca6} 79 | __NAME__.Domain 80 | 81 | 82 | 83 | 84 | 85 | 86 | This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. 87 | 88 | 89 | 90 | 97 | -------------------------------------------------------------------------------- /src/__NAME__.UnitTests/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/__NAME__.UnitTests/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/__NAME__.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.30110.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "App", "App", "{7C79CCED-5B1B-4DEE-96D4-45030A14DB12}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "__NAME__.MessageBus", "__NAME__.MessageBus\__NAME__.MessageBus.csproj", "{AE64A886-361E-4078-BAA1-747231A78348}" 9 | EndProject 10 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Database", "Database", "{4946BBF6-4EC6-4531-AD6B-50D3DA33E6B5}" 11 | EndProject 12 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".build", ".build", "{3422E8CA-0C21-4EC6-8522-79621E17F756}" 13 | ProjectSection(SolutionItems) = preProject 14 | ..\.semver = ..\.semver 15 | ..\Gemfile = ..\Gemfile 16 | ..\init_app_pool_login.sql = ..\init_app_pool_login.sql 17 | ..\Rakefile = ..\Rakefile 18 | ..\README.md = ..\README.md 19 | EndProjectSection 20 | EndProject 21 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "__NAME__.Database", "__NAME__.Database\__NAME__.Database.csproj", "{03F78D69-A903-4A5D-89BD-2D0BAAC21D1D}" 22 | EndProject 23 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{6071D6A5-C3E5-4942-8B17-C7BDAC90F8B2}" 24 | EndProject 25 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Logic", "Logic", "{76277D87-4086-4B93-8AE2-0F7BC4DD82D3}" 26 | EndProject 27 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "__NAME__.Domain", "__NAME__.Domain\__NAME__.Domain.csproj", "{386B7C40-6861-4E03-B94B-81D624BB4CA6}" 28 | EndProject 29 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Messages", "Messages", "{06509F04-F11B-428B-84D4-44D5808AE5E3}" 30 | EndProject 31 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "__NAME__.Domain.Persistence", "__NAME__.Domain.Persistence\__NAME__.Domain.Persistence.csproj", "{E444FF50-C834-44A0-B97E-657BEB5AFFC8}" 32 | EndProject 33 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{436FEA75-7E60-457F-8F82-904018A1BED5}" 34 | ProjectSection(SolutionItems) = preProject 35 | ..\nuget.config = ..\nuget.config 36 | .nuget\packages.config = .nuget\packages.config 37 | EndProjectSection 38 | EndProject 39 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "__NAME__.Api", "__NAME__.Api\__NAME__.Api.csproj", "{042305AF-78BB-465B-A56B-BAAB48055EEC}" 40 | EndProject 41 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Client", "Client", "{087211A4-5E68-4EB4-A779-7ECAF4A8777F}" 42 | EndProject 43 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "__NAME__.Messages", "__NAME__.Messages\__NAME__.Messages.csproj", "{D1D380B5-F384-4DBA-86BF-9ECAEA8B6FED}" 44 | EndProject 45 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "__NAME__.Api.Client", "__NAME__.Api.Client\__NAME__.Api.Client.csproj", "{362C291F-0977-4329-882C-0562EA5FC5CD}" 46 | EndProject 47 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "__NAME__.UnitTests", "__NAME__.UnitTests\__NAME__.UnitTests.csproj", "{9F6DB1B2-BE6B-4C28-9CD7-6B9252084300}" 48 | EndProject 49 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "__NAME__.IntegrationTests", "__NAME__.IntegrationTests\__NAME__.IntegrationTests.csproj", "{11A056E7-6BA8-45A3-AF3F-7E369A8FC5C2}" 50 | EndProject 51 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "__NAME__.AcceptanceTests", "__NAME__.AcceptanceTests\__NAME__.AcceptanceTests.csproj", "{3FE003CC-4F00-463E-BDC7-AD55DA676E30}" 52 | EndProject 53 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "__NAME__.Models", "__NAME__.Models\__NAME__.Models.csproj", "{71A42623-F570-45FC-B7CF-B8CF4EBCA747}" 54 | EndProject 55 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "__NAME__.MessageBus.Client", "__NAME__.MessageBus.Client\__NAME__.MessageBus.Client.csproj", "{BF52672C-CD40-41D7-A4A8-58C978F4CC72}" 56 | EndProject 57 | Global 58 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 59 | Debug|Any CPU = Debug|Any CPU 60 | Release|Any CPU = Release|Any CPU 61 | EndGlobalSection 62 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 63 | {AE64A886-361E-4078-BAA1-747231A78348}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 64 | {AE64A886-361E-4078-BAA1-747231A78348}.Debug|Any CPU.Build.0 = Debug|Any CPU 65 | {AE64A886-361E-4078-BAA1-747231A78348}.Release|Any CPU.ActiveCfg = Release|Any CPU 66 | {AE64A886-361E-4078-BAA1-747231A78348}.Release|Any CPU.Build.0 = Release|Any CPU 67 | {03F78D69-A903-4A5D-89BD-2D0BAAC21D1D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 68 | {03F78D69-A903-4A5D-89BD-2D0BAAC21D1D}.Debug|Any CPU.Build.0 = Debug|Any CPU 69 | {03F78D69-A903-4A5D-89BD-2D0BAAC21D1D}.Release|Any CPU.ActiveCfg = Release|Any CPU 70 | {03F78D69-A903-4A5D-89BD-2D0BAAC21D1D}.Release|Any CPU.Build.0 = Release|Any CPU 71 | {386B7C40-6861-4E03-B94B-81D624BB4CA6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 72 | {386B7C40-6861-4E03-B94B-81D624BB4CA6}.Debug|Any CPU.Build.0 = Debug|Any CPU 73 | {386B7C40-6861-4E03-B94B-81D624BB4CA6}.Release|Any CPU.ActiveCfg = Release|Any CPU 74 | {386B7C40-6861-4E03-B94B-81D624BB4CA6}.Release|Any CPU.Build.0 = Release|Any CPU 75 | {E444FF50-C834-44A0-B97E-657BEB5AFFC8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 76 | {E444FF50-C834-44A0-B97E-657BEB5AFFC8}.Debug|Any CPU.Build.0 = Debug|Any CPU 77 | {E444FF50-C834-44A0-B97E-657BEB5AFFC8}.Release|Any CPU.ActiveCfg = Release|Any CPU 78 | {E444FF50-C834-44A0-B97E-657BEB5AFFC8}.Release|Any CPU.Build.0 = Release|Any CPU 79 | {042305AF-78BB-465B-A56B-BAAB48055EEC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 80 | {042305AF-78BB-465B-A56B-BAAB48055EEC}.Debug|Any CPU.Build.0 = Debug|Any CPU 81 | {042305AF-78BB-465B-A56B-BAAB48055EEC}.Release|Any CPU.ActiveCfg = Release|Any CPU 82 | {042305AF-78BB-465B-A56B-BAAB48055EEC}.Release|Any CPU.Build.0 = Release|Any CPU 83 | {D1D380B5-F384-4DBA-86BF-9ECAEA8B6FED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 84 | {D1D380B5-F384-4DBA-86BF-9ECAEA8B6FED}.Debug|Any CPU.Build.0 = Debug|Any CPU 85 | {D1D380B5-F384-4DBA-86BF-9ECAEA8B6FED}.Release|Any CPU.ActiveCfg = Release|Any CPU 86 | {D1D380B5-F384-4DBA-86BF-9ECAEA8B6FED}.Release|Any CPU.Build.0 = Release|Any CPU 87 | {362C291F-0977-4329-882C-0562EA5FC5CD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 88 | {362C291F-0977-4329-882C-0562EA5FC5CD}.Debug|Any CPU.Build.0 = Debug|Any CPU 89 | {362C291F-0977-4329-882C-0562EA5FC5CD}.Release|Any CPU.ActiveCfg = Release|Any CPU 90 | {362C291F-0977-4329-882C-0562EA5FC5CD}.Release|Any CPU.Build.0 = Release|Any CPU 91 | {9F6DB1B2-BE6B-4C28-9CD7-6B9252084300}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 92 | {9F6DB1B2-BE6B-4C28-9CD7-6B9252084300}.Debug|Any CPU.Build.0 = Debug|Any CPU 93 | {9F6DB1B2-BE6B-4C28-9CD7-6B9252084300}.Release|Any CPU.ActiveCfg = Release|Any CPU 94 | {9F6DB1B2-BE6B-4C28-9CD7-6B9252084300}.Release|Any CPU.Build.0 = Release|Any CPU 95 | {11A056E7-6BA8-45A3-AF3F-7E369A8FC5C2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 96 | {11A056E7-6BA8-45A3-AF3F-7E369A8FC5C2}.Debug|Any CPU.Build.0 = Debug|Any CPU 97 | {11A056E7-6BA8-45A3-AF3F-7E369A8FC5C2}.Release|Any CPU.ActiveCfg = Release|Any CPU 98 | {11A056E7-6BA8-45A3-AF3F-7E369A8FC5C2}.Release|Any CPU.Build.0 = Release|Any CPU 99 | {3FE003CC-4F00-463E-BDC7-AD55DA676E30}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 100 | {3FE003CC-4F00-463E-BDC7-AD55DA676E30}.Debug|Any CPU.Build.0 = Debug|Any CPU 101 | {3FE003CC-4F00-463E-BDC7-AD55DA676E30}.Release|Any CPU.ActiveCfg = Release|Any CPU 102 | {3FE003CC-4F00-463E-BDC7-AD55DA676E30}.Release|Any CPU.Build.0 = Release|Any CPU 103 | {71A42623-F570-45FC-B7CF-B8CF4EBCA747}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 104 | {71A42623-F570-45FC-B7CF-B8CF4EBCA747}.Debug|Any CPU.Build.0 = Debug|Any CPU 105 | {71A42623-F570-45FC-B7CF-B8CF4EBCA747}.Release|Any CPU.ActiveCfg = Release|Any CPU 106 | {71A42623-F570-45FC-B7CF-B8CF4EBCA747}.Release|Any CPU.Build.0 = Release|Any CPU 107 | {BF52672C-CD40-41D7-A4A8-58C978F4CC72}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 108 | {BF52672C-CD40-41D7-A4A8-58C978F4CC72}.Debug|Any CPU.Build.0 = Debug|Any CPU 109 | {BF52672C-CD40-41D7-A4A8-58C978F4CC72}.Release|Any CPU.ActiveCfg = Release|Any CPU 110 | {BF52672C-CD40-41D7-A4A8-58C978F4CC72}.Release|Any CPU.Build.0 = Release|Any CPU 111 | EndGlobalSection 112 | GlobalSection(SolutionProperties) = preSolution 113 | HideSolutionNode = FALSE 114 | EndGlobalSection 115 | GlobalSection(NestedProjects) = preSolution 116 | {AE64A886-361E-4078-BAA1-747231A78348} = {7C79CCED-5B1B-4DEE-96D4-45030A14DB12} 117 | {042305AF-78BB-465B-A56B-BAAB48055EEC} = {7C79CCED-5B1B-4DEE-96D4-45030A14DB12} 118 | {03F78D69-A903-4A5D-89BD-2D0BAAC21D1D} = {4946BBF6-4EC6-4531-AD6B-50D3DA33E6B5} 119 | {9F6DB1B2-BE6B-4C28-9CD7-6B9252084300} = {6071D6A5-C3E5-4942-8B17-C7BDAC90F8B2} 120 | {11A056E7-6BA8-45A3-AF3F-7E369A8FC5C2} = {6071D6A5-C3E5-4942-8B17-C7BDAC90F8B2} 121 | {3FE003CC-4F00-463E-BDC7-AD55DA676E30} = {6071D6A5-C3E5-4942-8B17-C7BDAC90F8B2} 122 | {386B7C40-6861-4E03-B94B-81D624BB4CA6} = {76277D87-4086-4B93-8AE2-0F7BC4DD82D3} 123 | {E444FF50-C834-44A0-B97E-657BEB5AFFC8} = {76277D87-4086-4B93-8AE2-0F7BC4DD82D3} 124 | {D1D380B5-F384-4DBA-86BF-9ECAEA8B6FED} = {06509F04-F11B-428B-84D4-44D5808AE5E3} 125 | {71A42623-F570-45FC-B7CF-B8CF4EBCA747} = {06509F04-F11B-428B-84D4-44D5808AE5E3} 126 | {362C291F-0977-4329-882C-0562EA5FC5CD} = {087211A4-5E68-4EB4-A779-7ECAF4A8777F} 127 | {BF52672C-CD40-41D7-A4A8-58C978F4CC72} = {087211A4-5E68-4EB4-A779-7ECAF4A8777F} 128 | EndGlobalSection 129 | EndGlobal 130 | --------------------------------------------------------------------------------