Click here to Skip to main content
15,895,084 members
Articles / Web Development / HTML

Signum Framework Tutorials Part 3 - Southwind Load

Rate me:
Please Sign up or sign in to vote.
4.62/5 (7 votes)
21 Nov 2012CPOL23 min read 24.5K   319   10  
In this part we'll write the loading application to move data from Northwind to Southwind.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Signum.Utilities;
using Signum.Utilities.ExpressionTrees;

namespace Signum.Entities.DynamicQuery
{
    [Serializable]
    public class Column : IEquatable<Column>
    {
        public string DisplayName { get; set; }
        public QueryToken Token { get; internal set; }

        public Column(QueryToken token, string displayName)
        {
            Token = token;
            DisplayName = displayName;
        }

        public Column(ColumnDescription cd)
            : this(QueryToken.NewColumn(cd), cd.DisplayName)
        {
        }

        public string Name { get { return Token.FullKey(); } }
        public Type Type { get { return Token.Type; } }
        public Implementations Implementations { get { return Token.Implementations(); } }
        public string Format { get { return Token.Format; } }
        public string Unit { get { return Token.Unit; } }

        public override string ToString()
        {
            return "{0} '{1}'".Formato(Token.FullKey(), DisplayName);
        }

        public bool Equals(Column other)
        {
            return Token.Equals(other.Token) &&
                DisplayName == other.DisplayName;
        }

        public override bool Equals(object obj)
        {
            return obj is Column && base.Equals((Column)obj);
        }

        public override int GetHashCode()
        {
            return ToString().GetHashCode();
        }
    }

    //Temporaly used by the engine
    public class _EntityColumn : Column
    {
        public _EntityColumn(ColumnDescription entityColumn)
            : base(QueryToken.NewColumn(entityColumn), null)
        {
            if (!entityColumn.IsEntity)
                throw new ArgumentException("entityColumn");
        }
    }

    public enum ColumnOptionsMode
    {
        Add,
        Remove,
        Replace,
    }
}

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 Code Project Open License (CPOL)


Written By
Software Developer (Senior) Signum Software
Spain Spain
I'm Computer Scientist, one of the founders of Signum Software, and the lead developer behind Signum Framework.

www.signumframework.com

I love programming in C#, Linq, Compilers, Algorithms, Functional Programming, Computer Graphics, Maths...

Comments and Discussions