title: Return instance of Service(Class) using Unity
body: <p>Currently i have class <code>Factory</code> which have implemented methods to return instance of Management Service (Some class)</p>
  
  <pre><code>public static class Factory
  {
      //#region UserNewEditDelete
      public static IUserBM UserCreation()
      {
          return new UserBM();
      }
      //#endregion
  }
  </code></pre>
  
  <p>What would be the proper way to rewrite this class <code>Factory</code> using Unity Framework?</p>
  
  <hr>
  
  <p>My vision ::</p>
  
  <p>My Factory : </p>
  
  <pre><code>public static class Factory
      {
          public static void Register(IUnityContainer container)
          {
              container.RegisterType&lt;IUserBM, UserBM&gt;();
          }
      }
  </code></pre>
  
  <p>Register in Global.asax : </p>
  
  <pre><code>Factory.Register(UnityConfig.GetConfiguredContainer());
  </code></pre>
  
  <p>when i need to use Management Service : </p>
  
  <pre><code>UnityConfig.Container.Resolve&lt;IUserBM&gt;()
  </code></pre>
  
  <p>Is it good implementation? Thanks.</p>