You can use Data Annotation attributes and Fluent API at the same time. Entity Framework gives precedence to Fluent API over Data Annotations attributes.
More Related Contents:
- How do I specify that a property should generate a TEXT column rather than an nvarchar(4000)
- EF codefirst : Should I initialize navigation properties?
- Decimal precision and scale in EF Code First
- Entity Framework Stored Procedure Table Value Parameter
- Entity Framework (EF) Code First Cascade Delete for One-to-Zero-or-One relationship
- Ignoring a class property in Entity Framework 4.1 Code First
- What difference does .AsNoTracking() make?
- The entity type is not part of the model for the current context
- How can I automatically filter out soft deleted entities with Entity Framework?
- composite key as foreign key
- Implementing Zero Or One to Zero Or One relationship in EF Code first by Fluent API
- EF Code-First One-to-one relationship: Multiplicity is not valid in Role * in relationship
- Many-to-many mapping table
- One to one optional relationship using Entity Framework Fluent API
- EF Code First: How to get random rows
- Does Entity Framework 4 Code First have support for identity generators like NHibernate?
- Entity Framework Code First Lazy Loading
- How to disable cascade delete for link tables in EF code-first?
- Mapping Database Views to EF 5.0 Code First w/Migrations
- Entity framework, problems updating related objects
- Navigation Property without Declaring Foreign Key
- Optimistic concurrency: IsConcurrencyToken and RowVersion
- How can I disable model compatibility checking in Entity Framework 4.3?
- An error occurred while saving entities that do not expose foreign key properties for their relationships
- How to Specify Primary Key Name in EF-Code-First
- Entity Framework Code First naming conventions – back to plural table names?
- The relationship could not be changed because one or more of the foreign-key properties is non nullable
- How should I set up my integration tests to use a test database with Entity Framework?
- How should I access a computed column in Entity Framework Code First?
- How can set a default value constraint with Entity Framework 6 Code First?