Column Properties

  • Column property can be set using it's type initializer, for example:
using System;
using System.Collections.Generic;
using System.Text;
using Firefly.Box;
using ENV.Data;

namespace Northwind.Models
{ 
    public class Students : Entity
    {
        [PrimaryKey]
        public readonly NumberColumn Id = new NumberColumn("Id", "5"){ AllowNull = false };
        public readonly TextColumn LastName = new TextColumn("LastName", "30");
        public readonly TextColumn FirstName = new TextColumn("FirstName", "30");
        public Students()
           : base("Students", Northwind.Shared.DataSources.Northwind1)
        {
        }
    }
} 
  • Among the properties you'll find:
    • Name - the column name in the database
    • Caption - the column's caption
    • AllowNull
    • Format - see formatting
    • Storage - the way the column will be stored in the database
    • StorageType - the way a TextColumn will be stored in the database (unicode etc...)
  • Properties can also be set in the constructor:
using System;
using System.Collections.Generic;
using System.Text;
using Firefly.Box;
using ENV.Data;

namespace Northwind.Models
{ 
    public class Students : Entity
    {
        [PrimaryKey]
        public readonly NumberColumn Id = new NumberColumn("Id", "5"){ AllowNull = false };
        public readonly TextColumn LastName = new TextColumn("LastName", "30");
        public readonly TextColumn FirstName = new TextColumn("FirstName", "30");
        public Students()
           : base("Students", Northwind.Shared.DataSources.Northwind1)
        {
            LastName.StatusTip = "Bla Bla";
        }
    }
} 

Help us improve, Edit this page on GitHub
or email us at info@fireflymigration.com