Пример #1
0
 virtual protected bool validateResult(object result)
 {
     if (result != null && DriverLoader.IsDriver(result.GetType()))
     {
         logger?.LogInformation($"Service type request successful");
         return(true);
     }
     logger?.LogInformation($"Service type request failed");
     return(false);
 }
Пример #2
0
        virtual protected bool valdateRequestType(Type serviceType)
        {
            bool   result     = false;
            string driverName = serviceType?.FullName ?? "{null}";

            logger?.LogInformation($"Type requested: {driverName}");
            if (!DriverLoader.IsDriver(serviceType))
            {
                logger?.LogInformation($"Invalid type request: '{driverName ?? "null"}', not a driver type");
            }
            else if (serviceType.IsInterface)
            {
                logger?.LogInformation($"Invalid type request: '{driverName}', request typemust be a concrete implmentation class");
            }
            else if (DriverLoader.IsApiType(serviceType))
            {
                logger?.LogInformation($"Invalid type request: '{driverName}', request type cannot be a drvier API type ");
            }
            else
            {
                result = true;
            }
            return(result);
        }