KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
In Entity Framework Code First approach, how do you set a default value for a property in the POCO's EntityConfiguration class? public class Person { public int Id { get; set; } public string Name { get; set; } public DateTime CreatedOn { get; set; } } public class PersonConfiguration : EntityConfiguration<Person> { public PersonConfiguration() { Property(p => p.Id).IsIdentity(); Property(p => p.Name).HasMaxLength(100); //set default value for CreatedOn ? } }
Tags (comma-separated)
Save Edits
Cancel