Skip to content

Commit

Permalink
Now filters are registered by the framex itself. `Framex.Core.Service…
Browse files Browse the repository at this point in the history
…CollectionExtension.RegisterFramexServices(..)` routine will take care of the filter registration as well.
  • Loading branch information
kakathian committed Aug 9, 2018
1 parent de6725d commit 10aff74
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
6 changes: 5 additions & 1 deletion Framex.Core/Framex.Core.csproj
Expand Up @@ -21,10 +21,14 @@ Usage: https://github.com/kakathian/framex/blob/master/Framex.Platform/Controlle
<PackageProjectUrl>https://github.com/kakathian/framex/</PackageProjectUrl>
<RepositoryUrl>https://github.com/kakathian/framex/</RepositoryUrl>
<RepositoryType>Git</RepositoryType>
<PackageReleaseNotes>Initial version</PackageReleaseNotes>
<PackageReleaseNotes>Fixed library versioning issues</PackageReleaseNotes>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
<FileVersion>1.0.0.0</FileVersion>
<Version>1.0.2</Version>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.1.1" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="2.1.1" />
</ItemGroup>

Expand Down
4 changes: 4 additions & 0 deletions Framex.Core/ServiceCollectionExtension.cs
Expand Up @@ -6,6 +6,10 @@ public static class ServiceCollectionExtension
{
public static void RegisterFramexServices(this IServiceCollection serviceCollection)
{
serviceCollection.AddMvc(mvcOptions =>
{
mvcOptions.Filters.Add<FramexRequestParseFilter>();
});
serviceCollection.AddScoped<IProcessorExecutionContext, ProcessorExecutionContext>();
serviceCollection.AddTransient<IValidationEngine, ValidationEngine>();
}
Expand Down
8 changes: 4 additions & 4 deletions Framex.Platform/Startup.cs
Expand Up @@ -25,10 +25,10 @@ public Startup(IConfiguration configuration)
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
services.AddMvc(mvcOptions =>
{
mvcOptions.Filters.Add<FramexRequestParseFilter>();
});
//services.AddMvc(mvcOptions =>
//{
//});

services.RegisterFramexServices();
// Register your framex derived processors here
Expand Down

0 comments on commit 10aff74

Please sign in to comment.