Exemplo n.º 1
0
 public ITypeSpecImmutable GetSpecification(Type type, bool allowNull = false)
 {
     try {
         var spec = GetSpecificationFromCache(classStrategy.FilterNullableAndProxies(type));
         if (spec == null && !allowNull)
         {
             throw new NakedObjectSystemException(Log.LogAndReturn($"Failed to Load Specification for: {type?.FullName} error: unexpected null"));
         }
         return(spec);
     }
     catch (NakedObjectSystemException e) {
         Log.Error($"Failed to Load Specification for: {(type == null ? "null" : type.FullName)} error: {e}");
         throw;
     }
     catch (Exception e) {
         throw new NakedObjectSystemException(Log.LogAndReturn($"Failed to Load Specification for: {type?.FullName} error: {e}"));
     }
 }
Exemplo n.º 2
0
 public ITypeSpecImmutable GetSpecification(Type type, bool allowNull = false)
 {
     try {
         var spec = GetSpecificationFromCache(classStrategy.FilterNullableAndProxies(type));
         if (spec == null && !allowNull)
         {
             Log.ErrorFormat("Failed to Load Specification for: {0} error: {1}", type == null ? "null" : type.FullName, "unexpected null");
             throw new NakedObjectSystemException(string.Format("failed to find spec for {0}", type == null ? "null" : type.FullName));
         }
         return(spec);
     }
     catch (NakedObjectSystemException) {
         throw;
     }
     catch (Exception e) {
         Log.ErrorFormat("Failed to Load Specification for: {0} error: {1}", type == null ? "null" : type.FullName, e);
         throw new NakedObjectSystemException(string.Format("failed to find spec for {0}", type == null ? "null" : type.FullName));
     }
 }
Exemplo n.º 3
0
 public IObjectSpecImmutable GetSpecification(Type type)
 {
     return(GetSpecificationFromCache(classStrategy.FilterNullableAndProxies(type)));
 }