/// <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()); } }
/// <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()); } }