You should be much more defensive than that. Check for null
first.. otherwise you're asking for it to blow up:
var entity = platypi.Find(p => p.Id == id);
return entity == null ? string.Empty : entity.Name;
You're also currently doing more than a single lookup.. which you don't need (Find
to check name.. then Find
to return name..).