Kategorie: C#

  • EF Core Migrate Database First to Code First

    EF Core Migrate Database First to Code First

    This blog post is not aimed at writing yet another article about a change in the conceptual approach of database definition. And I won’t discuss the advantages of each technique. This blog post is a link collection to IMHO valuable posts and other references. The following article discusses the different approaches to creating the database…

  • Create C# SMTP Server

    It took a while to find a library which provides a SMTP server. There are a lot of SMTP clients out there, but the number of SMTP servers seems very limited. Finally, I found a library SmtpServer with an SMTP server and several hooks to extend the functionality. Open port 25 The documentation is straightforward…

  • Pre-Compiler Directives That Make Sense

    The [last blog article](/posts/sonar_code_duplicates/) was dealing with the same linked file in different projects. A reason could be, that some code needs to be compiled with different frameworks. In my case, I had to compile business logic with Microsoft CSOM for SharePoint 2016 and Microsoft CSOM for SharePoint Online. The API is more or less…

  • Dictionary ohne KeyNotFound-Exception

    Derzeit arbeite ich mit dem DevExpress DataGrid für WPF und erstelle die Spalten dynamisch, auf der Basis des Datenbankmappings. Dabei greifen die Daten auf normale Properties, aber auch Felder in einem Dictionary zu. Problem: Nicht jedes Feld aus dem Mapping z.B. „title“ hat auch in dem Dictionary einen entsprechenden Schlüssel. Das DataGrid, bzw. das Binding…

  • Refactoring I – Die Endlosschleife

    Refactoring I – Die Endlosschleife

    Das Refactoring von Code ist laut Wikipedia eine Umstrukturierung von Codes ohne eine funktionale Veränderungen der Software aus Anwendersicht. Es werden nicht-funktionale Anforderungen wie Wartbarkeit, Lesbarkeit, Erweiterbarkeit und weitere *-keiten verbessert. Refactoring kann beispielsweise durch Implementierung eines Plugin Mechanismus stattfinden. Das System wird aber im Rahmen des Refactorings nicht erweitert, sondern allenfalls bestehende Komponenten auf…