/// <summary> /// 获取,只适用于主键为Id的获取 /// </summary> /// <param name="id"></param> /// <param name="viewName">试图名</param> /// <returns></returns> public T GetItem(long id, string viewName = "") { string condition = "AND Id = @Id"; return(_provider.GetItem <T>(condition, new { Id = id }, viewName)); }