public static bool IsRepository(System.Type type) { return type != null && type.IsGenericType && typeof(Storage.IRepository<>).MakeGenericType(type.GenericTypeArguments[0]).IsAssignableFrom(type); }