internal Account Edit(Account editData, string userEmail) { Account original = GetProfileByEmail(userEmail); original.Name = editData.Name.Length > 0 ? editData.Name : original.Name; original.Picture = editData.Picture.Length > 0 ? editData.Picture : original.Picture; return(_repo.Edit(original)); }
internal Account Edit(Account accountToUpdate) { Account foundAccount = _repo.GetById(accountToUpdate.Id, accountToUpdate.UserId); if (_repo.Edit(accountToUpdate)) { return(accountToUpdate); } throw new Exception("You cannot edit this Account"); }