0

Using the database first approach and the app config that stores the entire connection string, what is the best practices approach to handling an encrypted password or an entire encrypted connection string? I've read in other places about creating another constructor for the context that passes in a connection string but wanted to see if there was a better way. I want to avoid having to micro manage model classes in this way and looking for something more streamline

  • See http://stackoverflow.com/questions/8760048/encrypt-connectionstring-in-entity-framework-first-code – Steve Greene Dec 12 '16 at 18:31
  • Steve, that solution proposes to make changes to the model class. as soon as the model is updated from the database, it overwrites changes made to those classes. As my question stated, i'm looking to avoid having to micro manage model classes, especially ones that warn you that manually modifying them will be overwritten on code regeneration. –  Dec 12 '16 at 19:05
  • Send the password un-encryted as POST data usiong a HTTPS connection. – zaph Dec 12 '16 at 19:34
  • It's a windows application –  Dec 12 '16 at 20:04
  • 1
    What models are you referring to? Lots of ways to handle securing a connection string and passing it into the EF context. Why not just store an encrypted password in your app.config and replace it in code (ConnectionStringBuilder) before passing it to the context? https://msdn.microsoft.com/en-us/library/cc716760(v=vs.110).aspx – Steve Greene Dec 12 '16 at 20:23
  • im referring to the edmx (and supporting files .tt.diagram,etc), that all have a warning stating if you write into them, they will be ovewritten if you regenerate. passing in a connectionstringbuilder is fine so long as you remember to either create a new partial class for the context or re-paste it into the newly regenerated Context.cs file and include the constructor that supports a connection string. i hate the fact that i have to maintain that. Thats why im wondering if someone else has some up with a better way of streamlining this. –  Dec 12 '16 at 21:24

0 Answers0