C# EF6 Code First binary(16) column

c# ef-code-first entity-framework-6

Question

When building a class and I want an nvarchar(255) I can decorate the property with:

[StringLength(255)]
public string Name { get; set; }

What can I do for a byte[] to make sure the column that gets created is a binary(16) in the database?

Thanks.

1
0
11/5/2015 10:55:54 PM

Popular Answer

You would use the following:

[MaxLength(16)]
public byte[] SomeByteArray { get; set; }
0
11/6/2015 1:10:07 AM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow