Skip to content

Commit

Permalink
Add EFMVC 1.01 source code and delete old 0.5 version
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasLamb committed May 24, 2018
1 parent 5c73bf0 commit 6c25422
Show file tree
Hide file tree
Showing 452 changed files with 82,285 additions and 7,628 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -330,4 +330,4 @@ ASALocalRun/
.mfractor/

# Error and log files
**/App_Data/*
#**/App_Data/*
543 changes: 0 additions & 543 deletions BuildProcessTemplates/DefaultTemplate.11.1.xaml

This file was deleted.

208 changes: 0 additions & 208 deletions BuildProcessTemplates/LabDefaultTemplate.11.xaml

This file was deleted.

76 changes: 0 additions & 76 deletions BuildProcessTemplates/UpgradeTemplate.xaml

This file was deleted.

63 changes: 63 additions & 0 deletions EFMVC.Azure/EFMVC.Azure.ccproj
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>
12 changes: 12 additions & 0 deletions EFMVC.Azure/EFMVC.WebContent/diagnostics.wadcfg
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>
9 changes: 9 additions & 0 deletions EFMVC.Azure/ServiceConfiguration.Cloud.cscfg
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>
9 changes: 9 additions & 0 deletions EFMVC.Azure/ServiceConfiguration.Local.cscfg
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>
18 changes: 18 additions & 0 deletions EFMVC.Azure/ServiceDefinition.csdef
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 EFMVC.CommandProcessor/Command/CommandHandlerNotFoundException.cs
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))
{
}
}
}

13 changes: 13 additions & 0 deletions EFMVC.CommandProcessor/Command/CommandResult.cs
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; }
}
}

31 changes: 31 additions & 0 deletions EFMVC.CommandProcessor/Command/CommandResults.cs
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);
}
}
}
}

5 changes: 5 additions & 0 deletions EFMVC.CommandProcessor/Command/ICommand.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
namespace EFMVC.CommandProcessor.Command
{
public interface ICommand { }
}

8 changes: 8 additions & 0 deletions EFMVC.CommandProcessor/Command/ICommandHandler.cs
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);
}
}

8 changes: 8 additions & 0 deletions EFMVC.CommandProcessor/Command/ICommandResult.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace EFMVC.CommandProcessor.Command
{
public interface ICommandResult
{
bool Success { get; }
}
}

10 changes: 10 additions & 0 deletions EFMVC.CommandProcessor/Command/ICommandResults.cs
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; }
}
}

14 changes: 14 additions & 0 deletions EFMVC.CommandProcessor/Command/IValidationHandler.cs
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);
}
}
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))
{
}
}
}
31 changes: 31 additions & 0 deletions EFMVC.CommandProcessor/Dispatcher/DefaultCommandBus.cs
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);
}
}
}

12 changes: 12 additions & 0 deletions EFMVC.CommandProcessor/Dispatcher/ICommandBus.cs
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;
}
}

Loading

0 comments on commit 6c25422

Please sign in to comment.