Пример #1
0
 public virtual void EndWorkUnitScope()
 {
     if (WorkUnitScope != null)
     {
         WorkUnitScope.Dispose();
         WorkUnitScope = null;
     }
 }
Пример #2
0
 public override IEnumerable <object> ResolveAll(Type type)
 {
     if (WorkUnitScope != null)
     {
         var stype = typeof(IEnumerable <>).MakeGenericType(type);
         return((IEnumerable <object>)WorkUnitScope.Resolve(stype));
     }
     return(base.ResolveAll(type));
 }
Пример #3
0
 public override bool IsRegistered(Type type, string name = null)
 {
     if (WorkUnitScope != null)
     {
         if (string.IsNullOrEmpty(name))
         {
             return(WorkUnitScope.IsRegistered(type));
         }
         else
         {
             return(WorkUnitScope.IsRegisteredWithName(name, type));
         }
     }
     return(base.IsRegistered(type, name));
 }
Пример #4
0
 public override object ResolveOptional(Type type, string name = null)
 {
     if (WorkUnitScope != null)
     {
         if (string.IsNullOrEmpty(name))
         {
             if (WorkUnitScope.IsRegistered(type))
             {
                 return(WorkUnitScope.ResolveOptional(type));
             }
         }
         else
         {
             if (WorkUnitScope.IsRegisteredWithName(name, type))
             {
                 return(WorkUnitScope.ResolveNamed(name, type));
             }
         }
     }
     return(base.Resolve(type, name));
 }