Char interpretation via ORM

Thread is closed for posting
2 posts, 0 answers
  1. Charlie
    Charlie avatar
    6 posts
    Member since:
    Aug 2010

    Posted 25 Oct 2010 Link to this post

    Could someone please explain why when generating the ORM DAL -   ORM would interpret field with the same domain differently.
    DMS being used is FireBird 2.0   - simple customer table -
    Fax Char(10) ,
    County Char(1)  

    here's the generated code  - why the System.Null<System.Char> type???? 

            private string fAX;
            [Column("FAX", OpenAccessType = OpenAccessType.Character, IsNullable = true, Length = 10, SqlType = "CHAR")]
            public virtual string FAX
                    return this.fAX;
                    this.fAX = value;
            private System.Nullable<System.Char> cOUNTRYID;
            [Column("COUNTRYID", OpenAccessType = OpenAccessType.Character, IsNullable = true, Length = 1, SqlType = "CHAR")]
            public virtual System.Nullable<System.Char> COUNTRYID
                    return this.cOUNTRYID;
                    this.cOUNTRYID = value;

    Thanks -
  2. Damyan Bogoev
    Damyan Bogoev avatar
    581 posts

    Posted 28 Oct 2010 Link to this post

    Hi Charlie,

    Telerik OpenAccess ORM maps a property mapped to a column of type char(1) as char property. The column allows null that’s why the generated property is Sysem.Nullable<Char>. Column of type char(n) where n less than 1 is being mapped to a string property.
    Hope that helps.

    All the best,
    Damyan Bogoev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top