Closed saigkill closed 2 years ago
Since the generated classes are partial: Simply put your code in a seperate file for the same class.
@meihler is spot on. You can set the property as not being an AutoProperty; the generated code gives you a partial method to use as a hook to create/modify the value that is set or returned.
Is there any way, to store code (methods) to the EF model? So each regeneration that code will be applied by generation?
As example:
`[MaxLength(100)] [StringLength(100)] [NotMapped] public string DecryptedPassword { get { return Decrypt(Password); } set { Password = Encrypt(value); } }
private string Decrypt(string cipherText) { return EntityHelper.Decrypt(cipherText); }
private string Encrypt(string clearText) { return EntityHelper.Encrypt(clearText); }`