-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add EFMVC 1.01 source code and delete old 0.5 version
- Loading branch information
1 parent
5c73bf0
commit 6c25422
Showing
452 changed files
with
82,285 additions
and
7,628 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -330,4 +330,4 @@ ASALocalRun/ | |
.mfractor/ | ||
|
||
# Error and log files | ||
**/App_Data/* | ||
#**/App_Data/* |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> | ||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
<ProductVersion>2.0</ProductVersion> | ||
<ProjectGuid>3ece0219-c411-432f-8013-0b7b69f9f8fc</ProjectGuid> | ||
<OutputType>Library</OutputType> | ||
<AppDesignerFolder>Properties</AppDesignerFolder> | ||
<RootNamespace>EFMVC.Azure</RootNamespace> | ||
<AssemblyName>EFMVC.Azure</AssemblyName> | ||
<StartDevelopmentStorage>True</StartDevelopmentStorage> | ||
<Name>EFMVC.Azure</Name> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
<DebugSymbols>true</DebugSymbols> | ||
<DebugType>full</DebugType> | ||
<Optimize>false</Optimize> | ||
<OutputPath>bin\Debug\</OutputPath> | ||
<DefineConstants>DEBUG;TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
<DebugType>pdbonly</DebugType> | ||
<Optimize>true</Optimize> | ||
<OutputPath>bin\Release\</OutputPath> | ||
<DefineConstants>TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<!-- Items for the project --> | ||
<ItemGroup> | ||
<ServiceDefinition Include="ServiceDefinition.csdef" /> | ||
<ServiceConfiguration Include="ServiceConfiguration.Local.cscfg" /> | ||
<ServiceConfiguration Include="ServiceConfiguration.Cloud.cscfg" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\EFMVC.Web\EFMVC.Web.csproj"> | ||
<Name>EFMVC.Web</Name> | ||
<Project>{169afe38-1ca2-4624-bdc4-78c6653b04bd}</Project> | ||
<Private>True</Private> | ||
<RoleType>Web</RoleType> | ||
<RoleName>EFMVC.Web</RoleName> | ||
<UpdateDiagnosticsConnectionStringOnPublish>True</UpdateDiagnosticsConnectionStringOnPublish> | ||
</ProjectReference> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Folder Include="EFMVC.WebContent\" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Content Include="EFMVC.WebContent\diagnostics.wadcfg"> | ||
<SubType>Content</SubType> | ||
</Content> | ||
</ItemGroup> | ||
<!-- Import the target files for this project template --> | ||
<PropertyGroup> | ||
<VisualStudioVersion Condition=" '$(VisualStudioVersion)' == '' ">10.0</VisualStudioVersion> | ||
<CloudExtensionsDir Condition=" '$(CloudExtensionsDir)' == '' ">$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Windows Azure Tools\2.0\</CloudExtensionsDir> | ||
</PropertyGroup> | ||
<Import Project="$(CloudExtensionsDir)Microsoft.WindowsAzure.targets" /> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<DiagnosticMonitorConfiguration configurationChangePollInterval="PT1M" overallQuotaInMB="4096" xmlns="http://schemas.microsoft.com/ServiceHosting/2010/10/DiagnosticsConfiguration"> | ||
<DiagnosticInfrastructureLogs /> | ||
<Directories> | ||
<IISLogs container="wad-iis-logfiles" /> | ||
<CrashDumps container="wad-crash-dumps" /> | ||
</Directories> | ||
<Logs bufferQuotaInMB="1024" scheduledTransferPeriod="PT1M" scheduledTransferLogLevelFilter="Error" /> | ||
<WindowsEventLog bufferQuotaInMB="1024" scheduledTransferPeriod="PT1M" scheduledTransferLogLevelFilter="Error"> | ||
<DataSource name="Application!*" /> | ||
</WindowsEventLog> | ||
</DiagnosticMonitorConfiguration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<ServiceConfiguration serviceName="EFMVC.Azure" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration" osFamily="3" osVersion="*" schemaVersion="2013-03.2.0"> | ||
<Role name="EFMVC.Web"> | ||
<Instances count="1" /> | ||
<ConfigurationSettings> | ||
<Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" value="UseDevelopmentStorage=true" /> | ||
</ConfigurationSettings> | ||
</Role> | ||
</ServiceConfiguration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<ServiceConfiguration serviceName="EFMVC.Azure" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration" osFamily="3" osVersion="*" schemaVersion="2013-03.2.0"> | ||
<Role name="EFMVC.Web"> | ||
<Instances count="1" /> | ||
<ConfigurationSettings> | ||
<Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" value="UseDevelopmentStorage=true" /> | ||
</ConfigurationSettings> | ||
</Role> | ||
</ServiceConfiguration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<ServiceDefinition name="EFMVC.Azure" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition" schemaVersion="2013-03.2.0"> | ||
<WebRole name="EFMVC.Web" vmsize="Small"> | ||
<Sites> | ||
<Site name="Web"> | ||
<Bindings> | ||
<Binding name="Endpoint1" endpointName="Endpoint1" /> | ||
</Bindings> | ||
</Site> | ||
</Sites> | ||
<Endpoints> | ||
<InputEndpoint name="Endpoint1" protocol="http" port="80" /> | ||
</Endpoints> | ||
<Imports> | ||
<Import moduleName="Diagnostics" /> | ||
</Imports> | ||
</WebRole> | ||
</ServiceDefinition> |
11 changes: 11 additions & 0 deletions
11
EFMVC.CommandProcessor/Command/CommandHandlerNotFoundException.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using System; | ||
namespace EFMVC.CommandProcessor.Command | ||
{ | ||
public class CommandHandlerNotFoundException : Exception | ||
{ | ||
public CommandHandlerNotFoundException(Type type) : base(string.Format("Command handler not found for command type: {0}", type)) | ||
{ | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
namespace EFMVC.CommandProcessor.Command | ||
{ | ||
public class CommandResult : ICommandResult | ||
{ | ||
public CommandResult(bool success) | ||
{ | ||
this.Success = success; | ||
} | ||
|
||
public bool Success { get; protected set; } | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
namespace EFMVC.CommandProcessor.Command | ||
{ | ||
public class CommandResults : ICommandResults | ||
{ | ||
private readonly List<ICommandResult> results = new List<ICommandResult>(); | ||
|
||
public void AddResult(ICommandResult result) | ||
{ | ||
this.results.Add(result); | ||
} | ||
|
||
public ICommandResult[] Results | ||
{ | ||
get | ||
{ | ||
return this.results.ToArray(); | ||
} | ||
} | ||
|
||
public bool Success | ||
{ | ||
get | ||
{ | ||
return this.results.All<ICommandResult>(result => result.Success); | ||
} | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
namespace EFMVC.CommandProcessor.Command | ||
{ | ||
public interface ICommand { } | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
namespace EFMVC.CommandProcessor.Command | ||
{ | ||
public interface ICommandHandler<in TCommand> where TCommand: ICommand | ||
{ | ||
ICommandResult Execute(TCommand command); | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
namespace EFMVC.CommandProcessor.Command | ||
{ | ||
public interface ICommandResult | ||
{ | ||
bool Success { get; } | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
namespace EFMVC.CommandProcessor.Command | ||
{ | ||
public interface ICommandResults | ||
{ | ||
ICommandResult[] Results { get; } | ||
|
||
bool Success { get; } | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using EFMVC.CommandProcessor; | ||
using EFMVC.Core.Common; | ||
|
||
namespace EFMVC.CommandProcessor.Command | ||
{ | ||
public interface IValidationHandler<in TCommand> where TCommand : ICommand | ||
{ | ||
IEnumerable<ValidationResult> Validate(TCommand command); | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
EFMVC.CommandProcessor/Command/ValidationHandlerNotFoundException.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using System; | ||
namespace EFMVC.CommandProcessor.Command | ||
{ | ||
public class ValidationHandlerNotFoundException : Exception | ||
{ | ||
public ValidationHandlerNotFoundException(Type type) | ||
: base(string.Format("Validation handler not found for command type: {0}", type)) | ||
{ | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
| ||
using System.Collections.Generic; | ||
using System.Web.Mvc; | ||
using EFMVC.CommandProcessor.Command; | ||
using EFMVC.Core.Common; | ||
namespace EFMVC.CommandProcessor.Dispatcher | ||
{ | ||
public class DefaultCommandBus : ICommandBus | ||
{ | ||
public ICommandResult Submit<TCommand>(TCommand command) where TCommand: ICommand | ||
{ | ||
var handler = DependencyResolver.Current.GetService<ICommandHandler<TCommand>>(); | ||
if (!((handler != null) && handler is ICommandHandler<TCommand>)) | ||
{ | ||
throw new CommandHandlerNotFoundException(typeof(TCommand)); | ||
} | ||
return handler.Execute(command); | ||
|
||
} | ||
public IEnumerable<ValidationResult> Validate<TCommand>(TCommand command) where TCommand : ICommand | ||
{ | ||
var handler = DependencyResolver.Current.GetService<IValidationHandler<TCommand>>(); | ||
if (!((handler != null) && handler is IValidationHandler<TCommand>)) | ||
{ | ||
throw new ValidationHandlerNotFoundException(typeof(TCommand)); | ||
} | ||
return handler.Validate(command); | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using EFMVC.CommandProcessor.Command; | ||
using EFMVC.Core.Common; | ||
using System.Collections.Generic; | ||
namespace EFMVC.CommandProcessor.Dispatcher | ||
{ | ||
public interface ICommandBus | ||
{ | ||
ICommandResult Submit<TCommand>(TCommand command) where TCommand: ICommand; | ||
IEnumerable<ValidationResult> Validate<TCommand>(TCommand command) where TCommand : ICommand; | ||
} | ||
} | ||
|
Oops, something went wrong.