private Type[] CommandToContract(Type commandType)
{
var query = from t in commandType.GetInterfaces()
where t.IsGenericType && t.GetGenericTypeDefinition() == typeof(IQueryRepositoryCommand<,>)
select t;
var result = query.ToArray();
return result;
}