//===============================================================================
// Microsoft patterns & practices
// Web Service Software Factory
//===============================================================================
// Copyright  Microsoft Corporation.  All rights reserved.
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY
// OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT
// LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
// FITNESS FOR A PARTICULAR PURPOSE.
//===============================================================================
// The example companies, organizations, products, domain names,
// e-mail addresses, logos, people, places, and events depicted
// herein are fictitious.  No association with any real company,
// organization, product, domain name, email address, logo, person,
// places, or events is intended or should be inferred.
//===============================================================================

using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Globalization;
using Howest.SchemaDiscovery.DbObjects;

namespace Howest.Guidance.DataAccess.CodeGeneration.ObjectModel.Mappings
{
    /// <summary/>
    public class PropertyParameterMapping
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="T:PropertyParameterMapping"/> class.
        /// </summary>
        /// <param name="property">The property.</param>
        /// <param name="parameter">The parameter.</param>
        public PropertyParameterMapping(string propertyName, Parameter parameter)
        {
            if (propertyName == null)
                throw new ArgumentNullException("propertyName");

            if (parameter == null)
                throw new ArgumentNullException("parameter");
            
            this.property = propertyName;
            this.parameterInstance = parameter;
            this.parameter = parameter.Name;
        }

        private string parameter;

        /// <summary>
        /// Gets or sets the parameter.
        /// </summary>
        /// <value>The parameter.</value>
        public string Parameter
        {
            get { return parameter; }
            set { parameter = value; }
        }

        private string property;

        /// <summary>
        /// Gets or sets the property.
        /// </summary>
        /// <value>The property.</value>
        public string Property
        {
            get { return property; }
            set { property = value; }
        }

        private Parameter parameterInstance;

        /// <summary>
        /// Gets or sets the parameter instance.
        /// </summary>
        /// <value>The parameter instance.</value>
        public Parameter ParameterInstance
        {
            get { return parameterInstance; }
            set { parameterInstance = value; }
        }

        /// <summary>
        /// Returns a <see cref="T:System.String"></see> that represents the current <see cref="T:System.Object"></see>.
        /// </summary>
        /// <returns>
        /// A <see cref="T:System.String"></see> that represents the current <see cref="T:System.Object"></see>.
        /// </returns>
        public override string ToString()
        {
            return String.Format(CultureInfo.CurrentCulture,
				"{0}-->{1}", this.property, this.parameter);
        }
    }
}