Click here to Skip to main content
15,395,652 members
Home / Discussions / C#
   

C#

 
QuestionWPF C# Selected Row from a Listbox in the Database Pin
Diane Dolinski27-Apr-22 3:31
MemberDiane Dolinski27-Apr-22 3:31 
AnswerRe: WPF C# Selected Row from a Listbox in the Database Pin
Gerry Schmitz27-Apr-22 6:17
mveGerry Schmitz27-Apr-22 6:17 
GeneralRe: WPF C# Selected Row from a Listbox in the Database Pin
Diane Dolinski27-Apr-22 8:42
MemberDiane Dolinski27-Apr-22 8:42 
AnswerRe: WPF C# Selected Row from a Listbox in the Database Pin
Mycroft Holmes27-Apr-22 12:43
professionalMycroft Holmes27-Apr-22 12:43 
GeneralRe: WPF C# Selected Row from a Listbox in the Database Pin
Diane Dolinski27-Apr-22 19:47
MemberDiane Dolinski27-Apr-22 19:47 
GeneralRe: WPF C# Selected Row from a Listbox in the Database Pin
Diane Dolinski28-Apr-22 1:24
MemberDiane Dolinski28-Apr-22 1:24 
QuestionHow do I avoid ORM tools 'polluting' the model? Pin
Patrick Skelton26-Apr-22 21:47
MemberPatrick Skelton26-Apr-22 21:47 
AnswerRe: How do I avoid ORM tools 'polluting' the model? Pin
Richard Deeming26-Apr-22 22:16
mveRichard Deeming26-Apr-22 22:16 
In Entity Framework, you can use "fluent configuration" to configure the store, so that you don't need to add library-specific attributes to the classes.
Creating and configuring a model - EF Core | Microsoft Docs[^]

You can even mix-and-match; I tend to add the non-library-specific attributes like StringLength to the classes, and put the EF-specific stuff in an IEntityTypeConfiguration<T> class.

Patrick Skelton wrote:
once the first iteration of all this is in a production environment, how on earth do you then instigate any changes without obliterating the live database?
For Entity Framework, you can use migrations to update the database schema to match the model:
Migrations Overview - EF Core | Microsoft Docs[^]

Other ORMs will probably have something similar.

There are also third-party tools to manage your schema migrations (eg: Flyway) but they tend to cost money.



"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer

GeneralRe: How do I avoid ORM tools 'polluting' the model? Pin
Patrick Skelton27-Apr-22 21:18
MemberPatrick Skelton27-Apr-22 21:18 
AnswerRe: How do I avoid ORM tools 'polluting' the model? Pin
Gerry Schmitz27-Apr-22 6:11
mveGerry Schmitz27-Apr-22 6:11 
GeneralRe: How do I avoid ORM tools 'polluting' the model? Pin
Patrick Skelton27-Apr-22 21:20
MemberPatrick Skelton27-Apr-22 21:20 
AnswerRe: How do I avoid ORM tools 'polluting' the model? Pin
jschell8-May-22 7:54
Memberjschell8-May-22 7:54 
QuestionTLS 1.3 on Windows Vista Pin
moxol26-Apr-22 4:27
Membermoxol26-Apr-22 4:27 
AnswerRe: TLS 1.3 on Windows Vista Pin
RedDk26-Apr-22 9:38
MemberRedDk26-Apr-22 9:38 
AnswerRe: TLS 1.3 on Windows Vista Pin
Randor 26-Apr-22 17:22
professional Randor 26-Apr-22 17:22 
AnswerRe: TLS 1.3 on Windows Vista Pin
Richard Deeming26-Apr-22 21:22
mveRichard Deeming26-Apr-22 21:22 
PraiseRe: TLS 1.3 on Windows Vista Pin
Randor 26-Apr-22 21:54
professional Randor 26-Apr-22 21:54 
AnswerRe: TLS 1.3 on Windows Vista Pin
moxol27-Apr-22 1:01
Membermoxol27-Apr-22 1:01 
GeneralRe: TLS 1.3 on Windows Vista Pin
dan!sh 2-May-22 21:17
professional dan!sh 2-May-22 21:17 
QuestionClickOne Installation folder in the user pc Pin
Luis M. Rojas20-Apr-22 6:26
MemberLuis M. Rojas20-Apr-22 6:26 
AnswerRe: ClickOne Installation folder in the user pc Pin
Dave Kreskowiak20-Apr-22 6:33
mveDave Kreskowiak20-Apr-22 6:33 
GeneralRe: ClickOne Installation folder in the user pc Pin
Luis M. Rojas20-Apr-22 9:55
MemberLuis M. Rojas20-Apr-22 9:55 
GeneralRe: ClickOne Installation folder in the user pc Pin
Dave Kreskowiak20-Apr-22 9:56
mveDave Kreskowiak20-Apr-22 9:56 
QuestionNEED HELP- ERROR (71,10): error CS1513: } expected) Pin
Joana Gonçalves 202220-Apr-22 3:22
MemberJoana Gonçalves 202220-Apr-22 3:22 
AnswerRe: NEED HELP- ERROR (71,10): error CS1513: } expected) Pin
Dave Kreskowiak20-Apr-22 3:51
mveDave Kreskowiak20-Apr-22 3:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.