コード例 #1
0
ファイル: UnityConfig.cs プロジェクト: IcaroTorres/HateoasNet
 /// <summary>
 ///   Registers the type mappings with the Unity Container.
 /// </summary>
 /// <param name="container">The unity Container to configure.</param>
 /// <remarks>
 /// </remarks>
 public static void RegisterTypes(IUnityContainer container)
 {
     container
     .RegisterFactory <IHateoasContext>(f => HateoasConfig.ConfigureFromAssembly(typeof(GuildHateoasBuilder)))
     .RegisterFactory <IHateoas>(f => new Hateoas(f.Resolve <IHateoasContext>()))
     .RegisterType <Seeder>();
 }
コード例 #2
0
ファイル: UnityConfig.cs プロジェクト: cpoDesign/HateoasNet
 /// <summary>
 ///   Registers the type mappings with the Unity Container.
 /// </summary>
 /// <param name="container">The unity Container to configure.</param>
 /// <remarks>
 /// </remarks>
 public static void RegisterTypes(IUnityContainer container)
 {
     container
     .RegisterFactory <IHateoasContext>(f => HateoasConfig.ConfigureFromAssembly(typeof(GuildHateoasResource)))
     .RegisterFactory <IResourceLinkFactory>(f => new ResourceLinkFactory())
     .RegisterType <IHateoasSerializer, HateoasSerializer>()
     .RegisterType <IResourceFactory, ResourceFactory>()
     .RegisterType <HateoasMediaTypeFormatter>()
     .RegisterType <Seeder>();
 }