CHAR(1) mapping in DbLinq sqlmetal

  • Thread starter Thread starter Andrus
  • Start date Start date
A

Andrus

I noticed that CHARACTER(1) type column in database is mapped to string
data type in generated entity class.

Why it is not mapped to char data type. char type matches more closely to
sql CHAR(1) ?

Andrus.
 
Andrus,

I would assume that it is for the sake of maintenance. If the size of
the field changes in the future, then you would end up having to change the
declaration from char to string, whereas if it was string to begin with, no
change is needed in the client code (it would be just as maintainable if it
was exposed as char[]).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top