Does my function violate SRP or other best practices?

Viewed 151

I have this following piece of code, a function that will get a list of objects ( I call it Y Objects) and call another method to transform it into X Objects.

public List<X> GetXObjects()
{
    var yObjects= GetYObjects();
    var transformer = new Transformer();
    var xObjects = transformer.Transform(yObjects);
    return xObjects;
}

The current implementation works, however, I feel that my function may violate SRP or other best practices. Is it possible to refactor the code to be better?

3 Answers
Related