TransactionalNodeService.MapParameter.ExistsInDb C# (CSharp) Метод

ExistsInDb() публичный Метод

public ExistsInDb ( IDbConnectionAbstraction connectionAbstraction ) : bool
connectionAbstraction IDbConnectionAbstraction
Результат bool
        public bool ExistsInDb(IDbConnectionAbstraction connectionAbstraction)
        {
            SqlCommand checkExistsSqlCommand = new SqlCommand(CheckParameterExists, connectionAbstraction.Connection);
            checkExistsSqlCommand.Parameters.Add(IdSqlParameter);

            connectionAbstraction.Open();
            int numberOfItems = (int)checkExistsSqlCommand.ExecuteScalar();
            connectionAbstraction.Close();

            if (numberOfItems > 0)
            {
                return true;
            }
            else
            {
                return false;
            }
        }