示例#1
0
 public E GetEntity <E>(string condition) where E : class, new()
 {
     using (SqlConnection connection = new SqlConnection(connectionString_)) {
         using (SqlCommand sqlCommand = new SqlCommand()) {
             sqlCommand.CommandText = condition;
             using (SqlDataReader reader = ExecuteDataReader(sqlCommand, connection)) {
                 return(EntityMapping.SqlDataReaderToEntity <E>(reader));
             }
         }
     }
 }