Search code examples
entity-framework-4.1edmx-designer

Entity Framework EDMX designer extensions default values


Have added designer extensions to EDMX designer which allow me to specify additional information I am using with some T4 templates. All working well but I want to assign defaults to some of my properties when the model is first created or udpated. For example, I want to set one of my property values to a certain value for primary keys. Any idea how I can hook into this?

Thanks

Ray


Solution

  • Hooking into creation means specifying the default value simply for property backing field or setting it in constructor. Hooking into updating requires logic in property setters - that is usually handled by implementing INotifyPropertyChanged interface.