Click here to Skip to main content
15,892,927 members
Articles / Web Development / ASP.NET

Very Powerful, Generic, Irony Based, Database Searcher

Rate me:
Please Sign up or sign in to vote.
4.00/5 (6 votes)
26 Aug 2010Ms-PL8 min read 30.4K   546   29  
Usage of Irony to produce a Google-like search tool on any column in a database
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace searchComponent.structure
{
    /// <summary>
    /// This class represents a join statement. The join can be left, inner or right and
    /// operates on two columns referenced by the names of tables and columns in the
    /// fields.
    /// </summary>
    public class JoinStatement
    {
        #region Enums
        /// <summary>
        /// The type of join to use qhen binding to a SQL query expression
        /// </summary>
        public enum JoinType
        {
            Inner, Left, Right, Outer
        };
        #endregion

        #region Fields
        /// <summary>
        /// This string contains the base table column in the format &lt;table&gt;.&lt;column&gt;
        /// </summary>
        private string _baseTableColumn;
        /// <summary>
        /// This string contains the join table column in the format &lt;table&gt;.&lt;column&gt;
        /// </summary>
        private string _joinTableColumn;
        /// <summary>
        /// The type of join to use
        /// </summary>
        private JoinType _type;
        
        #endregion

        #region Attributes
        /// <summary>
        /// Obtains the value of the base table column field
        /// </summary>
        public string BaseTableColumn
        {
            get { return this._baseTableColumn; }
        }
        /// <summary>
        /// Obtains the value of the join table column field
        /// </summary>
        public string JoinTableColumn
        {
            get { return this._joinTableColumn; }
        }
        /// <summary>
        /// The type of join to use
        /// </summary>
        public JoinType Type
        {
            get { return this._type; }
        }
        #endregion

        #region Constructor
        /// <summary>
        /// Constructor only assigns the parameters to the object fields.
        /// </summary>
        /// <param name="baseTable"></param>
        /// <param name="joinTable"></param>
        /// <param name="typeOfJoin"></param>
        public JoinStatement(string baseTable, string joinTable, JoinType typeOfJoin)
        {
            this._baseTableColumn = baseTable;
            this._joinTableColumn = joinTable;
            this._type = typeOfJoin;
        }
        #endregion
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Microsoft Public License (Ms-PL)


Written By
Chief Technology Officer Artexacta
Bolivia Bolivia
just a coder. Love Java, but working on asp.net

Comments and Discussions