Get repository through a method instead of an attribute