写在model里,实体类里。
public string FirstName
{
get
{
return string.IsNullOrEmpty(this.Name) ? "" : Net.Sourceforge.Pinyin4j.PinyinHelper.ToHanyuPinyinString(this.Name, new Net.Sourceforge.Pinyin4j.Format.HanyuPinyinOutputFormat(), " ").ToCharArray()[0].ToString().ToUpper();
}
}