I always create another class like ProductImage
with a one-to-one association in order to manage lazy loading and also to normalize the table:
public class ProductImage
{
public int ProductId { get; private set; }
public byte[] Image { get; set; }
}
More Related Contents:
- Introducing FOREIGN KEY constraint may cause cycles or multiple cascade paths – why?
- Using Entity Framework (code first) migrations in production
- How to set default value for POCO’s in EF CF?
- How to map table splitting in EF Code First?
- Model First with DbContext, Fails to initialize new DataBase
- Getting exact error type in from DbValidationException
- LINQ to Entities does not recognize the method
- How can I query for null values in entity framework?
- Ignoring a class property in Entity Framework 4.1 Code First
- Get Database Table Name from Entity Framework MetaData
- Undo changes in entity framework entities
- Update primary key value using entity framework
- ASP.NET MVC: Is Controller created for every request?
- EF LINQ include multiple and nested entities
- Cannot attach the file *.mdf as database
- Generate POCO classes in different project to the project with Entity Framework model
- How to work with Enums in Entity Framework?
- Changing the type of an (Entity Framework) entity that is part of an inheritance hierarchy
- Organizationally, where should I put common queries when using Entity Framework Code First?
- Entity Framework 4 Single() vs First() vs FirstOrDefault()
- Using entity framework on multiple databases
- entity framework Unable to load the specified metadata resource [duplicate]
- How to Specify Primary Key Name in EF-Code-First
- Entity Framework: Duplicate Records in Many-to-Many relationship
- The model backing the ‘ApplicationDbContext’ context has changed since the database was created
- Entity Framework Find vs. Where
- SQL Connection Error: System.Data.SqlClient.SqlException (0x80131904)
- ‘ObjectContext’ vs ‘DbContext’ in Entity Framework
- How can set a default value constraint with Entity Framework 6 Code First?
- Forcing code-first to always initialize a non-existent database?