Created
January 16, 2021 07:58
-
-
Save sampetrosov/566e676cafc9eaa3a05f050b137bc8b6 to your computer and use it in GitHub Desktop.
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
using System.Reflection; | |
using System.Web.Http; | |
using Autofac; | |
using Autofac.Integration.WebApi; | |
namespace CustomController | |
{ | |
public class Startup | |
{ | |
public static void Configuration(HttpConfiguration config) | |
{ | |
config.MapHttpAttributeRoutes(); | |
} | |
} | |
public class ServiceRegistration : Autofac.Module | |
{ | |
protected override void Load(ContainerBuilder builder) | |
{ | |
GlobalConfiguration.Configure(Startup.Configuration); | |
builder.RegisterApiControllers(Assembly.GetExecutingAssembly()); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment