Is a byte[]
the best way to represent a BLOB in an Entity Framework class? Or is there something newer/better now?
This is in an underlying SQL Server database. It is not in distinct BLOB storage (it's rare this is populated so not worth the complexity of storing it distinct).
Basic best practice is to use a byte[]
along with Table Splitting so the blob doesn't have to be loaded with the main entity.
If the byte[]
is so large you don't want to ever load it in memory, you can omit it from the EF model, and use ADO.NET streaming if your provider and database supports it, like for SQL Server SqlClient Streaming Support.