Пример #1
0
        public virtual List <TReturn> QueryWithStoredProcedure <TReturn>(string storedProcedureName, Dictionary <string, object> parameters) where TReturn : Entity
        {
            DbCommand command = dbCommandFactory.CreateCommand(storedProcedureName);

            if (parameters != null)
            {
                foreach (var item in parameters)
                {
                    command.Parameters.Add(dbCommandFactory.CreateParameter(item.Key, item.Value));
                }
            }

            return(dbCommandExecutionService.ExecuteQuery <TReturn>(command).ToList <TReturn>());
        }
Пример #2
0
        public virtual IUserAccount Get(string emailAddress)
        {
            DbCommand command = _dbCommandFactory.CreateCommand("AdminAccount_Get",
                                                                _dbCommandFactory.CreateParameter("EmailAddress", emailAddress));

            return(_dbCommandExecutionService.ExecuteQuery <Admin>(command).FirstOrDefault <IUserAccount>());
        }