This is a migrated thread and some comments may be shown as answers.

Char interpretation via ORM

1 Answer 52 Views
Getting Started
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Charlie
Top achievements
Rank 1
Charlie asked on 25 Oct 2010, 04:58 PM
Hello,
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 -
Customer(
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")]
        [Storage("fAX")]
        public virtual string FAX
        {
            get
            {
                return this.fAX;
            }
            set
            {
                this.fAX = value;
            }
        }
       
        private System.Nullable<System.Char> cOUNTRYID;
       
        [Column("COUNTRYID", OpenAccessType = OpenAccessType.Character, IsNullable = true, Length = 1, SqlType = "CHAR")]
        [Storage("cOUNTRYID")]
        public virtual System.Nullable<System.Char> COUNTRYID
        {
            get
            {
                return this.cOUNTRYID;
            }
            set
            {
                this.cOUNTRYID = value;
            }
        }
       

Thanks -

1 Answer, 1 is accepted

Sort by
0
Damyan Bogoev
Telerik team
answered on 28 Oct 2010, 05:52 PM
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
Tags
Getting Started
Asked by
Charlie
Top achievements
Rank 1
Answers by
Damyan Bogoev
Telerik team
Share this question
or