add method updateByName in repo