Skip to content

Commit

Permalink
Usage of asp.net core app framework instead of sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
dbeuchler committed Sep 30, 2021
1 parent 009c12f commit 44b4fbd
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 25 deletions.
2 changes: 1 addition & 1 deletion src/DependentTestModule/Moryx.DependentTestModule.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<PropertyGroup>
<TargetFrameworks>net45</TargetFrameworks>
<Description>Moryx Runtime Plugin: DependentTestModule</Description>
<Description>Moryx Runtime Module: DependentTestModule</Description>
</PropertyGroup>

<ItemGroup>
Expand Down
7 changes: 4 additions & 3 deletions src/Moryx.Runtime.Kestrel/ControllerProxySubResolver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
using Castle.Core;
using Castle.MicroKernel;
using Castle.MicroKernel.Context;
using Microsoft.AspNetCore.Mvc;
using Moryx.Container;

namespace Moryx.Runtime.Kestrel
Expand All @@ -16,13 +15,15 @@ namespace Moryx.Runtime.Kestrel
/// </summary>
internal class ControllerProxySubResolver : ISubDependencyResolver
{
public Type Controller { get; }

public IContainer Container { get; }

public ControllerProxySubResolver(Type controller, IContainer container)
{
Controller = controller;
Container = container;
}
public Type Controller { get; }
public IContainer Container { get; }

public bool CanResolve(CreationContext context, ISubDependencyResolver contextHandlerResolver, ComponentModel model, DependencyModel dependency)
{
Expand Down
7 changes: 5 additions & 2 deletions src/Moryx.TestModule.Kestrel/Controllers/TestController.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
using Microsoft.AspNetCore.Mvc;
// Copyright (c) 2021, Phoenix Contact GmbH & Co. KG
// Licensed under the Apache License, Version 2.0

using Microsoft.AspNetCore.Mvc;
using Moryx.Container;

namespace Moryx.TestModule.Kestrel.Controllers
namespace Moryx.TestModule.Kestrel
{
[ApiController]
[Component(LifeCycle.Transient)]
Expand Down
4 changes: 2 additions & 2 deletions src/Moryx.TestModule.Kestrel/ModuleController/ModuleConfig.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// Copyright (c) 2020, Phoenix Contact GmbH & Co. KG
// Copyright (c) 2021, Phoenix Contact GmbH & Co. KG
// Licensed under the Apache License, Version 2.0

using System.Runtime.Serialization;
using Moryx.Configuration;

namespace Moryx.TestModule
namespace Moryx.TestModule.Kestrel
{
[DataContract]
public class ModuleConfig : ConfigBase
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
// Copyright (c) 2020, Phoenix Contact GmbH & Co. KG
// Copyright (c) 2021, Phoenix Contact GmbH & Co. KG
// Licensed under the Apache License, Version 2.0

using System;
using System.ComponentModel;
using Moryx.Runtime.Modules;
using Moryx.Serialization;
using IContainer = Moryx.Container.IContainer;

namespace Moryx.TestModule
namespace Moryx.TestModule.Kestrel
{
[ServerModuleConsole]
internal class ModuleConsole : IServerModuleConsole
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
// Copyright (c) 2020, Phoenix Contact GmbH & Co. KG
// Copyright (c) 2021, Phoenix Contact GmbH & Co. KG
// Licensed under the Apache License, Version 2.0

using System.ComponentModel;
using System.Threading;
using Moryx.Communication.Endpoints;
using Moryx.Runtime.Container;
using Moryx.Runtime.Modules;
using Moryx.TestModule.Kestrel.Controllers;

namespace Moryx.TestModule.Kestrel.ModuleController
namespace Moryx.TestModule.Kestrel
{
[ServerModule(ModuleName)]
[Description("Test module for System tests")]
[Description("Test module for testing ")]
public class ModuleController : ServerModuleFacadeControllerBase<ModuleConfig>
{
private IEndpointHost _host;
public const string ModuleName = "KestrelTester";

#region Dependencies

/// <summary>
/// Host factory to create wcf services
/// </summary>
Expand All @@ -31,8 +29,6 @@ public class ModuleController : ServerModuleFacadeControllerBase<ModuleConfig>
/// </summary>
public override string Name => ModuleName;

#region State transition

/// <inheritdoc />
protected override void OnInitialize()
{
Expand All @@ -53,6 +49,5 @@ protected override void OnStop()
{
_host.Stop();
}
#endregion
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFrameworks>net5.0</TargetFrameworks>
<Description>Moryx Runtime Plugin: KestrelTestModule.</Description>
<Description>Moryx Runtime Module: KestrelTestModule.</Description>
<OutputType>Library</OutputType>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=controllers/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=modulecontroller/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
6 changes: 5 additions & 1 deletion src/StartProject.Core/StartProject.Core.csproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<OutputType>Exe</OutputType>
</PropertyGroup>

<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Moryx.Runtime.DbUpdate\Moryx.Runtime.DbUpdate.csproj" />
<ProjectReference Include="..\Moryx.Runtime.Kernel\Moryx.Runtime.Kernel.csproj" />
Expand Down
2 changes: 1 addition & 1 deletion src/TestModule/Moryx.TestModule.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFrameworks>net45</TargetFrameworks>
<Description>Moryx Runtime Plugin: TestModule.</Description>
<Description>Moryx Runtime Module: TestModule.</Description>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit 44b4fbd

Please sign in to comment.