-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Remove RestSharp * Adding Example MVC Project * Remove NewtonSoft * Remove monitor task
- Loading branch information
1 parent
3054162
commit 32035d4
Showing
46 changed files
with
23,922 additions
and
173 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using System.Web.Mvc; | ||
using System.Web.Routing; | ||
|
||
namespace Appconfi.Web.Example | ||
{ | ||
public class RouteConfig | ||
{ | ||
public static void RegisterRoutes(RouteCollection routes) | ||
{ | ||
routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); | ||
|
||
routes.MapRoute( | ||
name: "Default", | ||
url: "{controller}/{action}/{id}", | ||
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } | ||
); | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using System; | ||
|
||
using Unity; | ||
using Unity.Lifetime; | ||
|
||
namespace Appconfi.Web.Example | ||
{ | ||
/// <summary> | ||
/// Specifies the Unity configuration for the main container. | ||
/// </summary> | ||
public static class UnityConfig | ||
{ | ||
#region Unity Container | ||
private static Lazy<IUnityContainer> container = | ||
new Lazy<IUnityContainer>(() => | ||
{ | ||
var container = new UnityContainer(); | ||
RegisterTypes(container); | ||
return container; | ||
}); | ||
|
||
/// <summary> | ||
/// Configured Unity Container. | ||
/// </summary> | ||
public static IUnityContainer Container => container.Value; | ||
#endregion | ||
|
||
public static void RegisterTypes(IUnityContainer container) | ||
{ | ||
container.RegisterType<IFeatureManager, FeatureManager>(new ContainerControlledLifetimeManager()); | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
using System.Linq; | ||
using System.Web.Mvc; | ||
|
||
using Unity.AspNet.Mvc; | ||
|
||
[assembly: WebActivatorEx.PreApplicationStartMethod(typeof(Appconfi.Web.Example.UnityMvcActivator), nameof(Appconfi.Web.Example.UnityMvcActivator.Start))] | ||
[assembly: WebActivatorEx.ApplicationShutdownMethod(typeof(Appconfi.Web.Example.UnityMvcActivator), nameof(Appconfi.Web.Example.UnityMvcActivator.Shutdown))] | ||
|
||
namespace Appconfi.Web.Example | ||
{ | ||
/// <summary> | ||
/// Provides the bootstrapping for integrating Unity with ASP.NET MVC. | ||
/// </summary> | ||
public static class UnityMvcActivator | ||
{ | ||
/// <summary> | ||
/// Integrates Unity when the application starts. | ||
/// </summary> | ||
public static void Start() | ||
{ | ||
FilterProviders.Providers.Remove(FilterProviders.Providers.OfType<FilterAttributeFilterProvider>().First()); | ||
FilterProviders.Providers.Add(new UnityFilterAttributeFilterProvider(UnityConfig.Container)); | ||
|
||
DependencyResolver.SetResolver(new UnityDependencyResolver(UnityConfig.Container)); | ||
|
||
// TODO: Uncomment if you want to use PerRequestLifetimeManager | ||
// Microsoft.Web.Infrastructure.DynamicModuleHelper.DynamicModuleUtility.RegisterModule(typeof(UnityPerRequestHttpModule)); | ||
} | ||
|
||
/// <summary> | ||
/// Disposes the Unity container when the application is shut down. | ||
/// </summary> | ||
public static void Shutdown() | ||
{ | ||
UnityConfig.Container.Dispose(); | ||
} | ||
} | ||
} |
Oops, something went wrong.