public static T SingleOrDefault <T>(object primaryKey)
 {
     using (var db = new PetaDbContext())
     {
         return(db.SingleOrDefault <T>(primaryKey));
     }
 }
 public static T SingleOrDefault <T>(string sql, params object[] args)
 {
     using (var db = new PetaDbContext())
     {
         return(db.SingleOrDefault <T>(sql, args));
     }
 }
 /// <summary>
 /// Remark:获取对象实体系列重载方法
 /// </summary>
 #region 获取对象实体系列重载方法
 public static T SingleOrDefault <T>(Sql sql)
 {
     using (var db = new PetaDbContext())
     {
         return(db.SingleOrDefault <T>(sql));
     }
 }