1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2025-12-13 05:48:35 +00:00
Artemis/src/Artemis.Core/Services/WebServer/WebApiControllerRegistration.cs
Robert 28e1532064 Web server - Added web server service
UI - Added remote management for bringing to foreground, restarting and shutting down
UI - Simplified services namespaces
2021-01-27 20:52:51 +01:00

28 lines
766 B
C#

using System;
using EmbedIO.WebApi;
using Ninject;
namespace Artemis.Core.Services
{
internal class WebApiControllerRegistration<T> : WebApiControllerRegistration where T : WebApiController
{
public WebApiControllerRegistration(IKernel kernel) : base(typeof(T))
{
Factory = () => kernel.Get<T>();
}
public Func<T> Factory { get; set; }
public override object UntypedFactory => Factory;
}
internal abstract class WebApiControllerRegistration
{
protected WebApiControllerRegistration(Type controllerType)
{
ControllerType = controllerType;
}
public abstract object UntypedFactory { get; }
public Type ControllerType { get; set; }
}
}