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

Case-sensitive columns

4 Answers 51 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Ashley
Top achievements
Rank 1
Ashley asked on 04 Jan 2013, 02:28 PM
Hi,

We have a scenario where we have a composite primary key with 3 columns. In certain instances the only difference between the records will be the use of a different case.

Is there a way to set a column as case-sensitive when you map it? I'm imagining something like:
configuration.HasProperty(table => table.Column).HasLength(50).IsCaseSensitive().IsIdentity();


Regards,
Ashley

4 Answers, 1 is accepted

Sort by
0
PetarP
Telerik team
answered on 09 Jan 2013, 02:31 PM
Hi Ashley,

 By default OpenAccess does no alter your provided column names. This said if you specify them as case sensitive they will stay that way during forward mapping. You can use something similar to this:

productConfiguration.MapType(x => new
            {
                ID = x.ID,
                productName = x.Price,
                ProductName = x.ProductName
            }).ToTable("Products");
And it will result in the following schema being created:
CREATE TABLE [Products] (
    [Products_id] int NOT NULL,             -- <internal-pk>
    [ID] int NOT NULL,                      -- iD
    [productName] numeric(20,10) NOT NULL-- <Price>k__BackingField
    [ProductName] varchar(255) NULL,        -- <ProductName>k__BackingField
    CONSTRAINT [pk_Products] PRIMARY KEY ([Products_id])

Regards,
Petar
the Telerik team
Q3'12 SP1 of OpenAccess ORM packs Multi-Table Entities mapping support. Check it out.
0
Ashley
Top achievements
Rank 1
answered on 09 Jan 2013, 02:44 PM
Hi Petar,

I am talking about the column data. So in a primary key column we could for example have both a and A as 2 separate keys. Is this possible?

Regards,
Ashley
0
Accepted
PetarP
Telerik team
answered on 14 Jan 2013, 01:36 PM
Hello Ashley,

 I am afraid that this is not possible at the moment. Currently all pk columns are treated as case insensitive and this cannot be switched off. I will write this down as a feature request and we will discuss the possibility of adding this in the future.
I am sorry for any inconvenience caused. Please find your Telerik points updated for bringing this issue to our attention.

Greetings,
Petar
the Telerik team
Q3'12 SP1 of OpenAccess ORM packs Multi-Table Entities mapping support. Check it out.
0
Ashley
Top achievements
Rank 1
answered on 21 Jan 2013, 06:58 AM
Hi Petar,

Thanks for the feedback.

Regards,
Ashley
Tags
General Discussions
Asked by
Ashley
Top achievements
Rank 1
Answers by
PetarP
Telerik team
Ashley
Top achievements
Rank 1
Share this question
or