Exemplo n.º 1
0
        /// <summary>
        /// Definition for the Unity Resolve Property with name property.
        /// </summary>
        /// <typeparam name="T">Generic object type</typeparam>
        /// <param name="instanceName">instance enum name</param>
        /// <param name="application">application name</param>
        /// <returns>returns instance</returns>
        public static T Resolve <T>(AspectEnums.AspectInstanceNames instanceName, AspectEnums.ApplicationName application)
        {
            string name = instanceName.ToString();

            name = String.Format("{0}_{1}", application.ToString(), instanceName.ToString());
            if (_container.IsRegistered(typeof(T), name))
            {
                return(_container.Resolve <T>(name, new ResolverOverride[] { }));
            }
            else
            {
                return(default(T));
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// Method to get container instance name on basis of aspect name and application name
 /// </summary>
 /// <param name="aspectName">aspect name</param>
 /// <param name="application">application name</param>
 /// <returns>returns registration instance name</returns>
 private static string GetBusinessRegisterInstanceName(AspectEnums.AspectInstanceNames aspectName, AspectEnums.ApplicationName application)
 {
     return(String.Format("{0}_{1}", application.ToString(), aspectName.ToString()));
 }
Exemplo n.º 3
0
 private static string GetPersistenceRegisterInstanceName(AspectEnums.PeristenceInstanceNames aspectName,
                                                          AspectEnums.ApplicationName application)
 {
     return(string.Format("{0}_{1}", application.ToString(), aspectName.ToString()));
 }