Inside SQL I have table that have primary key as binary(8). When I add that table to my model using Update Model from Database
I can see that this column has type=Binary
and in C# I get that column as byte[]
.
Can I map that column to int?
I know I can create a view with CAST
in SQL:
SELECT
Client_Id,
CAST(Client_Id AS INT) AS NewClient_Id,
* /*other columns*/
FROM
dbo.Clients
but this isn't a solution, because I must be able to write, not just read from that table. I know I can create stored procedure for inserts but I'd like to avoid that.
I'm usinf EntityFramewor 6.1.3.