This question is locked. New answers and comments are not allowed.
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:
Regards,
Ashley
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
0
Hi Ashley,
And it will result in the following schema being created:
Regards,
Petar
the Telerik team
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"
);
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])
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
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
Hello Ashley,
Petar
the Telerik team
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.
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
Thanks for the feedback.
Regards,
Ashley