Example #1
0
 /// <summary>
 ///
 /// </summary>
 /// <typeparam name="TScalar"></typeparam>
 /// <param name="command"></param>
 /// <returns></returns>
 public virtual TScalar ExecuteScalar <TScalar>(DbCommand command)
 {
     using (var subsitute = GetConnection(command))
     {
         command.Connection = subsitute.Connection;
         return(new CommandQueryResult <TScalar>(command
                                                 , ResultMapper <TScalar> .Create(), Log).FirstOrDefault());
     }
 }
Example #2
0
 /// <summary>
 ///
 /// </summary>
 /// <typeparam name="EntityType"></typeparam>
 /// <param name="command"></param>
 /// <returns></returns>
 public virtual EntityType[] ExecuteEntities <EntityType>(DbCommand command) where EntityType : class
 {
     using (var subsitute = GetConnection(command))
     {
         command.Connection = subsitute.Connection;
         return(new CommandQueryResult <EntityType>(
                    command
                    , ResultMapper <EntityType> .Create()
                    , Log).ToArray());
     }
 }