<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ssewannonda Keith Edwin</title>
    <description>The latest articles on DEV Community by Ssewannonda Keith Edwin (@edcsu).</description>
    <link>https://dev.to/edcsu</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F845696%2F89b135a1-85a9-4af6-b336-79f93ac67557.jpeg</url>
      <title>DEV Community: Ssewannonda Keith Edwin</title>
      <link>https://dev.to/edcsu</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/edcsu"/>
    <language>en</language>
    <item>
      <title>The Delta Difference: Unleashing .NET, EF Core, and PostgreSQL Performance with Delta</title>
      <dc:creator>Ssewannonda Keith Edwin</dc:creator>
      <pubDate>Thu, 12 Jun 2025 16:27:45 +0000</pubDate>
      <link>https://dev.to/edcsu/the-delta-difference-unleashing-net-ef-core-and-postgresql-performance-with-delta-4l91</link>
      <guid>https://dev.to/edcsu/the-delta-difference-unleashing-net-ef-core-and-postgresql-performance-with-delta-4l91</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;In the world of web development, performance is king. Fast-loading applications keep users happy, reduce server load, and improve overall user experience. One of the most effective ways to achieve this is through intelligent caching. When a client requests data that hasn't changed since their last request, wouldn't it be great if we could just tell them "you already have this"? That's exactly what the &lt;code&gt;HTTP 304 Not Modified&lt;/code&gt; status code is for.&lt;/p&gt;

&lt;p&gt;However, implementing &lt;code&gt;304 Not Modified&lt;/code&gt; effectively can be tricky, especially when in the real world data lives in a database. How do you efficiently determine if the data has truly changed without re-fetching and re-processing everything? This is where &lt;strong&gt;&lt;a href="https://github.com/SimonCropp/Delta" rel="noopener noreferrer"&gt;Delta&lt;/a&gt;&lt;/strong&gt; comes in. As &lt;a href="https://github.com/SimonCropp" rel="noopener noreferrer"&gt;SimonCropp&lt;/a&gt; says &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Delta is an approach to implementing a &lt;code&gt;304 Not Modified&lt;/code&gt; leveraging DB change tracking.&lt;br&gt;
The approach uses a last updated timestamp from the database to generate an &lt;code&gt;ETag&lt;/code&gt;. All dynamic requests then have that &lt;code&gt;ETag&lt;/code&gt; checked/applied.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Tech Stack choice
&lt;/h2&gt;

&lt;p&gt;I chose this combination because:&lt;/p&gt;

&lt;p&gt;1.&lt;a href="https://dotnet.microsoft.com/en-us" rel="noopener noreferrer"&gt;Dot net&lt;/a&gt; is &lt;a href="https://devblogs.microsoft.com/dotnet/performance-improvements-in-net-9" rel="noopener noreferrer"&gt;the most performant framework&lt;/a&gt;&lt;br&gt;
2.&lt;a href="https://learn.microsoft.com/en-us/ef/core" rel="noopener noreferrer"&gt;EF Core&lt;/a&gt; has &lt;a href="https://learn.microsoft.com/en-us/ef/core/what-is-new/ef-core-9.0/whatsnew" rel="noopener noreferrer"&gt;gotten better&lt;/a&gt; and &lt;a href="https://learn.microsoft.com/en-us/ef/core/performance" rel="noopener noreferrer"&gt;provides a slew of performance steps&lt;/a&gt;&lt;br&gt;
3.&lt;a href="https://www.postgresql.org/about/" rel="noopener noreferrer"&gt;PostgreSQL&lt;/a&gt; is a powerful, open source object-relational database that safely stores and scales the most complicated data workloads. &lt;br&gt;
4.&lt;a href="https://github.com/SimonCropp/Delta" rel="noopener noreferrer"&gt;Delta&lt;/a&gt; An efficient approach to implementing a &lt;code&gt;304 Not Modified&lt;/code&gt; leveraging DB change tracking&lt;/p&gt;

&lt;h2&gt;
  
  
  Steps to use Delta
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Postgres requires &lt;code&gt;track_commit_timestamp&lt;/code&gt; flag to be enabled. 
Log into  the &lt;code&gt;psql&lt;/code&gt; with a user that has admin privileges.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;psql &lt;span class="nt"&gt;-U&lt;/span&gt; &amp;lt;insert_your_user_name&amp;gt; 
ALTER SYSTEM SET track_commit_timestamp &lt;span class="o"&gt;=&lt;/span&gt; on&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Restart the Postgres service.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Add &lt;a href="https://nuget.org/packages/Delta.EF/" rel="noopener noreferrer"&gt;Delta.EF&lt;/a&gt; to your .NET solution. &lt;code&gt;dotnet add package Delta.EF --version 6.4.2&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Enable row versioning in your AppDbContext.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;ApplicationDbContext&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;DbContext&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="nf"&gt;ApplicationDbContext&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;DbContextOptions&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;ApplicationDbContext&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;options&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; 
        &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;base&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;options&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="n"&gt;DbSet&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;Product&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;Products&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="k"&gt;protected&lt;/span&gt; &lt;span class="k"&gt;override&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;OnModelCreating&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ModelBuilder&lt;/span&gt; &lt;span class="n"&gt;builder&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;product&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;builder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Entity&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;Product&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;();&lt;/span&gt;
        &lt;span class="n"&gt;product&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;HasKey&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="p"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Id&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Update your &lt;code&gt;Program.cs&lt;/code&gt; file.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;builder&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;WebApplication&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;CreateBuilder&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="n"&gt;AppContext&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;SetSwitch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Npgsql.EnableLegacyTimestampBehavior"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="n"&gt;builder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Services&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;AddDbContextPool&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;ApplicationDbContext&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;(&lt;/span&gt;&lt;span class="n"&gt;options&lt;/span&gt; &lt;span class="p"&gt;=&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
 &lt;span class="n"&gt;options&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;UseNpgsql&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;builder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Configuration&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;GetConnectionString&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"DefaultConnection"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;opts&lt;/span&gt; &lt;span class="p"&gt;=&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;opts&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;EnableRetryOnFailure&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;maxRetryCount&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="n"&gt;maxRetryDelay&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;TimeSpan&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;FromSeconds&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;30&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
            &lt;span class="n"&gt;errorCodesToAdd&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;null&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="n"&gt;opts&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;CommandTimeout&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;60&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;

    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Environment&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;GetEnvironmentVariable&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"ASPNETCORE_ENVIRONMENT"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;!=&lt;/span&gt; &lt;span class="s"&gt;"Development"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;options&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;EnableDetailedErrors&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="n"&gt;options&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;EnableSensitiveDataLogging&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;


&lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;app&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;builder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Build&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="c1"&gt;// activate Delta&lt;/span&gt;
&lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;UseDelta&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;ApplicationDbContext&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Results
&lt;/h2&gt;

&lt;p&gt;Ran two endpoints&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Get a resource item.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Before enabling Delta
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu2zwwks0ewdx4831j4xf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu2zwwks0ewdx4831j4xf.png" alt="Before enabling Delta" width="800" height="445"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  After enabling Delta
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwd35xqf83l1vdz334cye.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwd35xqf83l1vdz334cye.png" alt="After enabling Delta" width="800" height="492"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The response time reduced from 7ms to 6ms&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Stress tested using a &lt;code&gt;getAll&lt;/code&gt; resource endpoint returning &lt;strong&gt;1000 items&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Before enabling Delta
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff3tntfgtsy3koe757cjp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff3tntfgtsy3koe757cjp.png" alt="Image description" width="800" height="455"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  After enabling Delta
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffy2ag2g4wqsnd7mohiyb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffy2ag2g4wqsnd7mohiyb.png" alt="Image description" width="800" height="482"&gt;&lt;/a&gt;&lt;br&gt;
The response time reduced from 13ms to 7ms&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;The &lt;strong&gt;Delta&lt;/strong&gt; approach, by cleverly leveraging database change tracking, offers a powerful and efficient way to implement &lt;code&gt;304 Not Modified&lt;/code&gt;. It moves the responsibility of determining "what has changed" to the database, where it's the most efficient, freeing up your application server to focus on serving dynamic content. By embracing this strategy, you can significantly improve the performance, scalability, and user experience of your web applications. Consider integrating Delta into your caching strategy and unlock the full potential of &lt;code&gt;304 Not Modified&lt;/code&gt;!&lt;br&gt;
Feel free to leave question or a comment about this.&lt;br&gt;
&lt;a href="https://github.com/SimonCropp/Delta" rel="noopener noreferrer"&gt;Star Delta&lt;/a&gt; or &lt;a href="https://github.com/sponsors/SimonCropp" rel="noopener noreferrer"&gt;sponsor Simon Cropp&lt;/a&gt; to give the package the platform it deserves.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>dotnet</category>
      <category>database</category>
      <category>programming</category>
    </item>
    <item>
      <title>OpenTelemetry in ASP .NET with Aspire</title>
      <dc:creator>Ssewannonda Keith Edwin</dc:creator>
      <pubDate>Fri, 21 Feb 2025 14:02:02 +0000</pubDate>
      <link>https://dev.to/edcsu/opentelemetry-in-asp-net-with-aspire-4206</link>
      <guid>https://dev.to/edcsu/opentelemetry-in-asp-net-with-aspire-4206</guid>
      <description>&lt;h2&gt;
  
  
  OpenTelemetry
&lt;/h2&gt;

&lt;p&gt;Its an &lt;strong&gt;Observability&lt;/strong&gt; framework and toolkit designed to manage &lt;strong&gt;telemetry&lt;/strong&gt; data that is &lt;strong&gt;traces&lt;/strong&gt;, &lt;strong&gt;metrics&lt;/strong&gt;, and &lt;strong&gt;logs&lt;/strong&gt;.&lt;br&gt;
It can be paired either #open source# tools like &lt;a href="https://learn.microsoft.com/en-us/dotnet/aspire/fundamentals/dashboard/overview?tabs=bash" rel="noopener noreferrer"&gt;Aspire dashboard&lt;/a&gt;, &lt;a href="https://prometheus.io" rel="noopener noreferrer"&gt;Prometheus&lt;/a&gt;, and commercial ones like &lt;a href="https://docs.datadoghq.com/opentelemetry" rel="noopener noreferrer"&gt;datadog&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Observability
&lt;/h2&gt;

&lt;p&gt;Observability in software, is the potential to understand the internal state of a system by examining its telemetry data.&lt;br&gt;
To make a system observable, it must be instrumented. &lt;/p&gt;

&lt;h2&gt;
  
  
  Why OpenTelemetry?
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;You own the data that you generate which is essential today in AI.&lt;/li&gt;
&lt;li&gt;You need a single set of APIs and standards for all.
These create the flexibility needed to create a modern application.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  OpenTelemetry in ASP .NET
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Search for &lt;code&gt;OpenTelemetry.*&lt;/code&gt; in your project.
There are many nuget packages for open telemetry as seen below.
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx0opyhoewuvzcdlxcj65.png" alt="OpenTelemetry packages" width="800" height="620"&gt;
&lt;/li&gt;
&lt;li&gt;Add them to your project:&lt;/li&gt;
&lt;li&gt;Update your &lt;code&gt;Program.cs&lt;/code&gt; file.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;OpenTelemetry.Resources&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;OpenTelemetry.Metrics&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;OpenTelemetry.Trace&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;OpenTelemetry.Logs&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;OpenTelemetry.Exporter&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;builder&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;WebApplication&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;CreateBuilder&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="c1"&gt;// code ommitted for brevity&lt;/span&gt;

&lt;span class="n"&gt;builder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Services&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;AddOpenTelemetry&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ConfigureResource&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;resource&lt;/span&gt; &lt;span class="p"&gt;=&amp;gt;&lt;/span&gt; 
    &lt;span class="n"&gt;resource&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;AddService&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ApiConstants&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ApiName&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WithMetrics&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;metric&lt;/span&gt; &lt;span class="p"&gt;=&amp;gt;&lt;/span&gt;
     &lt;span class="p"&gt;{&lt;/span&gt;
       &lt;span class="n"&gt;metric&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;AddAspNetCoreInstrumentation&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
       &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;AddHttpClientInstrumentation&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
       &lt;span class="n"&gt;metric&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;AddOtlpExporter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;options&lt;/span&gt; &lt;span class="p"&gt;=&amp;gt;&lt;/span&gt; 
       &lt;span class="p"&gt;{&lt;/span&gt;
          &lt;span class="n"&gt;options&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Endpoint&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;Uri&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"&amp;lt;url_to_export _to&amp;gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
       &lt;span class="p"&gt;});&lt;/span&gt;
 &lt;span class="p"&gt;})&lt;/span&gt;
 &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WithTracing&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;trace&lt;/span&gt; &lt;span class="p"&gt;=&amp;gt;&lt;/span&gt;
 &lt;span class="p"&gt;{&lt;/span&gt;
     &lt;span class="n"&gt;trace&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;AddAspNetCoreInstrumentation&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
     &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;AddHttpClientInstrumentation&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
     &lt;span class="n"&gt;trace&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;AddOtlpExporter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;options&lt;/span&gt; &lt;span class="p"&gt;=&amp;gt;&lt;/span&gt;
     &lt;span class="p"&gt;{&lt;/span&gt;
          &lt;span class="n"&gt;options&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Endpoint&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;Uri&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"&amp;lt;url_to_export _to&amp;gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="p"&gt;});&lt;/span&gt;
 &lt;span class="p"&gt;});&lt;/span&gt;

 &lt;span class="n"&gt;builder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Logging&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;AddOpenTelemetry&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;options&lt;/span&gt; &lt;span class="p"&gt;=&amp;gt;&lt;/span&gt; 
 &lt;span class="p"&gt;{&lt;/span&gt;    
      &lt;span class="n"&gt;options&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;AddConsoleExporter&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;SetResourceBuilder&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ResourceBuilder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;CreateDefault&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;AddService&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ApiConstants&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ApiName&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;

      &lt;span class="n"&gt;options&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;AddOtlpExporter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;options&lt;/span&gt; &lt;span class="p"&gt;=&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;{&lt;/span&gt;
           &lt;span class="n"&gt;options&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Endpoint&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;Uri&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"&amp;lt;url_to_export _to&amp;gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;                   
      &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Your application should be able to emit logs, traces and metrics.&lt;/p&gt;

&lt;h2&gt;
  
  
  Aspire dashboard
&lt;/h2&gt;

&lt;p&gt;The &lt;strong&gt;open source&lt;/strong&gt; standalone dashboard provides a great UI for viewing telemetry and can be used by any application.&lt;br&gt;
To spin it up locally without auth, use this command&lt;br&gt;
&lt;code&gt;docker run --rm -it -d -p 18888:18888 -p 4317:18889 --name aspire-dashboard mcr.microsoft.com/dotnet/aspire-dashboard:9.0 -e DOTNET_DASHBOARD_UNSECURED_ALLOW_ANONYMOUS=true&lt;/code&gt;&lt;br&gt;
&lt;a href="https://learn.microsoft.com/en-us/dotnet/aspire/fundamentals/dashboard/configuration?tabs=bash" rel="noopener noreferrer"&gt;For more .NET Aspire dashboard configuration&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe3ofko7u2ovx4tivy6u9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe3ofko7u2ovx4tivy6u9.png" alt="Aspire dashboard" width="800" height="260"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Feel free to leave question or a comment about this. &lt;br&gt;
&lt;strong&gt;Star&lt;/strong&gt; these wonderful projects to give them the platform they deserve:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/open-telemetry" rel="noopener noreferrer"&gt;OpenTelemetry&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/dotnet/aspire" rel="noopener noreferrer"&gt;Aspire&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>opensource</category>
      <category>api</category>
      <category>webdev</category>
      <category>csharp</category>
    </item>
    <item>
      <title>TDD helper in c#</title>
      <dc:creator>Ssewannonda Keith Edwin</dc:creator>
      <pubDate>Thu, 23 Jan 2025 16:16:33 +0000</pubDate>
      <link>https://dev.to/edcsu/tdd-helper-in-c-5g6m</link>
      <guid>https://dev.to/edcsu/tdd-helper-in-c-5g6m</guid>
      <description>&lt;p&gt;Visibility is crucial in all aspects of life. This cuts through in programming as well. This is further given light when one is using &lt;a href="https://developer.ibm.com/articles/5-steps-of-test-driven-development" rel="noopener noreferrer"&gt;#tdd(Test Driven Developemnt)&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Logging significantly enhances TDD by providing insights into the behavior and execution of code.&lt;/p&gt;

&lt;h2&gt;
  
  
  How it helps
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Debugging failing tests.
In TDD, tests are first and then code to make them pass. If a test fails, logging can help you understand why by providing detailed runtime information.
Logs capture intermediate states, variable values and execution flow making it easier to pinpoint issues at any step.&lt;/li&gt;
&lt;li&gt;Tracking execution flow.
Logs verify whether the control flow matches your expectations, especially in complex logic, without needing to use a debugger.
One is able to confirm if specific code paths like conditionals or loops are being executed as intended. For example a coffee shop when one orders a latte not a macchiato.&lt;/li&gt;
&lt;li&gt;Capturing edge cases.
Logs provide a clear record of how the system behaves in edge cases.
This feedback is invaluable when refining tests to ensure comprehensive coverage and also enforcing defensive coding techniques.&lt;/li&gt;
&lt;li&gt;Understanding system behavior
Whether initiating new functionality or refactoring code, logs help ensure that intended behavior remains consistent and aligns with the expected outputs defined by tests made.&lt;/li&gt;
&lt;li&gt;Supporting collaboration.
Dev teams need a common reference point for understanding and diagnosing issues discovered during test runs and logging provides that out of the box. This minimizes the need for extensive verbal explanations by showing exact system behavior in an instant.&lt;/li&gt;
&lt;li&gt;Improving test quality.
Logs help identify gaps in test cases by highlighting untested paths or unexpected behavior that may not yet be covered in tests.&lt;/li&gt;
&lt;li&gt;Reproducing sporadic failures
For flaky or irregular test failures, logs capture valuable information like timestamps, system state, exceptions that can help diagnose and resolve the issue.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Logging in &lt;code&gt;c#&lt;/code&gt; tests
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/roryprimrose/Neovolve.Logging.Xunit" rel="noopener noreferrer"&gt;Neovolve.Logging.Xunit&lt;/a&gt; written by &lt;a href="https://github.com/roryprimrose" rel="noopener noreferrer"&gt;Rory Primrose&lt;br&gt;
&lt;/a&gt; is a NuGet package that provides an &lt;code&gt;ILogger&lt;/code&gt; or &lt;code&gt;ILogger&amp;lt;T&amp;gt;&lt;/code&gt;, which integrates with the &lt;code&gt;ITestOutputHelper&lt;/code&gt; used by &lt;a href="https://github.com/xunit/xunit" rel="noopener noreferrer"&gt;xUnit&lt;/a&gt;. This helper enables log messages to be written directly to the test output during each test execution. As a result, any log messages from the tested classes are included in the &lt;code&gt;xUnit&lt;/code&gt; test result output.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;OrderServiceTests&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="k"&gt;readonly&lt;/span&gt; &lt;span class="n"&gt;ITestOutputHelper&lt;/span&gt; &lt;span class="n"&gt;_output&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="nf"&gt;OrderServiceTests&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ITestOutputHelper&lt;/span&gt; &lt;span class="n"&gt;output&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;_output&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;output&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Fact&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;PrepareOrderReturnsValue&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;var&lt;/span&gt; &lt;span class="n"&gt;logger&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;output&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;BuildLoggerFor&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;OrderService&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;();&lt;/span&gt;

        &lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;act&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;OrderService&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

        &lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;act&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;PrepareOrder&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

        &lt;span class="c1"&gt;// The xUnit test output should now include the log message from OrderService.PrepareOrder()&lt;/span&gt;

        &lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Should&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;NotBeNull&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;By integrating logging into your TDD workflow, one gains a clearer understanding of system behavior, resulting in faster debugging and more reliable tests and visibility in business logic.&lt;/p&gt;

&lt;p&gt;Feel free to leave question or a comment about this and to star this wonderful &lt;code&gt;nuget&lt;/code&gt;. &lt;/p&gt;

</description>
      <category>csharp</category>
      <category>unittest</category>
      <category>tdd</category>
      <category>api</category>
    </item>
    <item>
      <title>🚀 Create a CRUD web API with DATA API builder and EFCORE Power Tools 🚀</title>
      <dc:creator>Ssewannonda Keith Edwin</dc:creator>
      <pubDate>Thu, 15 Aug 2024 20:18:00 +0000</pubDate>
      <link>https://dev.to/edcsu/create-a-crud-web-api-with-data-api-builder-and-efcore-power-tools-4oge</link>
      <guid>https://dev.to/edcsu/create-a-crud-web-api-with-data-api-builder-and-efcore-power-tools-4oge</guid>
      <description>&lt;p&gt;In today's agile software development world, efficiency is paramount. I'm excited to share a quick way to create a fully functional CRUD Web API in just minutes using Data API Builder and EF Core Power Tools.&lt;/p&gt;

&lt;h2&gt;
  
  
  🔧 Why This Stack?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Data API Builder: Build and configure data-driven APIs with minimal effort. It abstracts much of the complexity, allowing you to focus on business concerns.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;EF Core Power Tools: Generates clean, maintainable code for the database access layer, simplifying using EF Core.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  📈 The Benefits:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Speed: Generates API endpoints rapidly without compromising on quality.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Scalability: With the solid foundation that EF Core provides, your applications can scale effortlessly.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Productivity: Focus on your business logic rather than boilerplate code, boosting your productivity and project timelines.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you're on a project that needs rapid prototyping for a backend or want to streamline the development process, this combination is definitely worth exploring.&lt;/p&gt;

&lt;p&gt;🔗 &lt;a href="https://erikej.github.io/dotnet/sqlserver/powertools/2024/08/13/powertools-dab.html" rel="noopener noreferrer"&gt;Ready to try it? Dive in and see how much time you can save!&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Feel free to leave questions below&lt;/p&gt;

</description>
      <category>dotnet</category>
      <category>api</category>
      <category>database</category>
    </item>
    <item>
      <title>The ultimate Nuxt3 Vuetify3 setup</title>
      <dc:creator>Ssewannonda Keith Edwin</dc:creator>
      <pubDate>Tue, 11 Apr 2023 14:07:01 +0000</pubDate>
      <link>https://dev.to/edcsu/the-ultimate-nuxt3-vuetify3-setup-5dg6</link>
      <guid>https://dev.to/edcsu/the-ultimate-nuxt3-vuetify3-setup-5dg6</guid>
      <description>&lt;p&gt;&lt;a href="https://nuxt.com/docs/getting-started/introduction#introduction" rel="noopener noreferrer"&gt;Nuxt 3&lt;/a&gt; has many advantages and is the best way to harness &lt;a href="https://vuejs.org/guide/introduction.html" rel="noopener noreferrer"&gt;Vue 3&lt;/a&gt; awesomeness.&lt;/p&gt;

&lt;h2&gt;
  
  
  Create a new Nuxt 3 project
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://nuxt.com/docs/getting-started/installation#new-project" rel="noopener noreferrer"&gt;use the following guide to create a new Nuxt 3 project&lt;/a&gt;&lt;br&gt;
Upon successfully ✨ creating the Nuxt project with v3 template,Next steps:&lt;br&gt;
Enter the project folder that you have just created &lt;br&gt;
&lt;code&gt;cd &amp;lt;project_folder&amp;gt;&lt;/code&gt;&lt;br&gt;
Install dependencies using your favourite node package manager&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// using npm
npm install 

// using yarn
yarn install 

// using pnpm
pnpm install 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Start development server.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// using npm
npm run dev 

// using yarn
yarn dev

// using pnpm
pnpm run dev 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Falq6o9i9ydu8d2a6g6ro.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Falq6o9i9ydu8d2a6g6ro.png" alt="Initial view" width="800" height="429"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Add Vuetify 3
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://vuetifyjs.com/en/introduction/why-vuetify/" rel="noopener noreferrer"&gt;Vuetify 3&lt;/a&gt; is powerful Vue Component Framework based on Google’s &lt;a href="https://material.io" rel="noopener noreferrer"&gt;Material Design specification&lt;/a&gt; and comes with hundreds of customisation options that fit any style or design; even if it’s not Material.&lt;br&gt;
Add Vuetify to your project and support packages for sass and icons&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// using npm
npm install vuetify@^3.1.13 sass @mdi/font

// using yarn
yarn add vuetify@^3.1.13 sass @mdi/font

// using pnpm
pnpm install vuetify@^3.1.13 sass @mdi/font
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Create Vuetify plugin
&lt;/h2&gt;

&lt;p&gt;There is need to add Vuetify as a &lt;a href="https://nuxt.com/docs/guide/directory-structure/plugins" rel="noopener noreferrer"&gt;Nuxt plugin&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Create a &lt;em&gt;plugins&lt;/em&gt; folder and create a file named &lt;em&gt;vuetify.js&lt;/em&gt; in it.&lt;/p&gt;

&lt;p&gt;Add this code snippet in the &lt;em&gt;vuetify.js&lt;/em&gt; file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;createVuetify&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;vuetify&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nx"&gt;components&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;vuetify/components&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nx"&gt;directives&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;vuetify/directives&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nf"&gt;defineNuxtPlugin&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;nuxtApp&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;vuetify&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;createVuetify&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="nx"&gt;components&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nx"&gt;directives&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;ssr&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="nx"&gt;nuxtApp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;vueApp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;use&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;vuetify&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Vue 3 has no way to automatically detect if SSR is used — so nuxt, gridsome, and other SSR frameworks must manually set the ssr option to true in order to properly render the application.&lt;/p&gt;

&lt;h2&gt;
  
  
  Add nuxt config
&lt;/h2&gt;

&lt;p&gt;Create nuxt config file with name &lt;em&gt;nuxt.config.ts&lt;/em&gt; if it does not exist and add the following config:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// https://nuxt.com/docs/api/configuration/nuxt-config&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nf"&gt;defineNuxtConfig&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;css&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
     &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;vuetify/lib/styles/main.sass&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; 
     &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@mdi/font/css/materialdesignicons.css&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
  &lt;span class="p"&gt;],&lt;/span&gt;
  &lt;span class="na"&gt;build&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;transpile&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
      &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;vuetify&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
    &lt;span class="p"&gt;],&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With this, you should be able to use Vuetify 3 components as you like.&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://nuxt3-vuetify3-gold.vercel.app" rel="noopener noreferrer"&gt;demo of the finished setup is here&lt;/a&gt; and the &lt;a href="https://github.com/edcsu/nuxt3-vuetify3" rel="noopener noreferrer"&gt;final code can be found here&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>nuxt</category>
      <category>vuetify3</category>
      <category>vue3</category>
      <category>codenewbie</category>
    </item>
    <item>
      <title>Mudblazor for Blazor</title>
      <dc:creator>Ssewannonda Keith Edwin</dc:creator>
      <pubDate>Fri, 30 Sep 2022 20:53:51 +0000</pubDate>
      <link>https://dev.to/edcsu/mudblazor-for-blazor-490g</link>
      <guid>https://dev.to/edcsu/mudblazor-for-blazor-490g</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;There are two methods in software design. One is to make the program so simple, there are obviously no errors. The other is to make it so complicated, there are no obvious errors. - Tony Hoare&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;A software framework is a concrete or conceptual platform where common code with generic functionality can be selectively specialized or overridden by developers simplifying programming. Frameworks are libraries with a well-defined Application Program Interface (API) reusable anywhere within the software under development.&lt;/p&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://dotnet.microsoft.com/en-us/apps/aspnet" rel="noopener noreferrer"&gt;.NET&lt;/a&gt; has had various templating frameworks since its inception in the early 2000's. From the likes of &lt;a href="https://learn.microsoft.com/en-us/dotnet/desktop/wpf/overview/?view=netdesktop-6.0" rel="noopener noreferrer"&gt;Windows Presentation Foundation (WPF)&lt;/a&gt;, &lt;a href="https://learn.microsoft.com/en-us/dotnet/desktop/winforms/?view=netdesktop-6.0" rel="noopener noreferrer"&gt;Windows Forms(WF)&lt;/a&gt;, &lt;a href="https://learn.microsoft.com/en-us/aspnet/core/mvc/overview?view=aspnetcore-6.0" rel="noopener noreferrer"&gt;ASP.NET Core MVC&lt;/a&gt;, &lt;a href="https://learn.microsoft.com/en-us/aspnet/core/razor-pages/?view=aspnetcore-6.0&amp;amp;tabs=visual-studio" rel="noopener noreferrer"&gt;Razor Pages&lt;/a&gt; to &lt;a href="https://learn.microsoft.com/en-us/aspnet/core/blazor/tutorials/?view=aspnetcore-6.0" rel="noopener noreferrer"&gt;Blazor&lt;/a&gt; and now &lt;a href="https://learn.microsoft.com/en-us/dotnet/maui/what-is-maui" rel="noopener noreferrer"&gt;.NET MAUI&lt;/a&gt;.&lt;br&gt;
Microsoft offers a way &lt;a href="https://learn.microsoft.com/en-us/aspnet/core/tutorials/choose-web-ui?view=aspnetcore-6.0" rel="noopener noreferrer"&gt;to choose an ASP.NET Core web UI&lt;/a&gt; for developers to find the right user interface(UI) to use for their solution. The focus however is on Blazor and in particular for &lt;a href="https://learn.microsoft.com/en-us/aspnet/core/blazor/?view=aspnetcore-6.0#blazor-webassembly" rel="noopener noreferrer"&gt;webAssembly&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  WebAssembly
&lt;/h2&gt;

&lt;p&gt;Shortened to &lt;a href="https://webassembly.org/" rel="noopener noreferrer"&gt;Wasm&lt;/a&gt;, it is a binary instruction format for a stack-based virtual machine. Enables interoperability of programming languages, leading to deployment on the web for client and server applications.&lt;/p&gt;

&lt;h3&gt;
  
  
  Advantages
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Efficient and fast using common hardware capabilities on a wide range of platforms&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Open and debuggable designed to be pretty-printed in a textual format(on the web) for debugging, testing, experimenting, optimizing, educating and writing programs by hand.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Memory-safe in sandboxed execution environment usually inside existing JavaScript virtual machines. When embedded in the web, WebAssembly enforces the same-origin and permissions security policies of the browser.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;WebAssembly is designed to maintain the versionless, feature-tested, and backwards-compatible nature of the web. WebAssembly modules call into and out of the JavaScript context and access browser functionality through the same Web APIs accessible from JavaScript. It also supports non-web embeddings.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Blazor
&lt;/h2&gt;

&lt;p&gt;It is framework for building interactive client-side web UI.&lt;br&gt;
Blazor apps are component based. Just like many &lt;a href="https://developer.mozilla.org/en-US/docs/Learn/Tools_and_testing/Client-side_JavaScript_frameworks" rel="noopener noreferrer"&gt;JavaScript frameworks&lt;/a&gt; making the transition from them to Blazor easy. Blazor was initiated in 2018.&lt;/p&gt;

&lt;h3&gt;
  
  
  Advantages
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Write code in C# instead of JavaScript.&lt;/li&gt;
&lt;li&gt;Leverage the existing .NET ecosystem of .NET libraries.&lt;/li&gt;
&lt;li&gt;Share app logic across server and client.&lt;/li&gt;
&lt;li&gt;Benefit from .NET's performance, reliability, and security.&lt;/li&gt;
&lt;li&gt;Stay productive cross platform Windows, Linux, or macOS.&lt;/li&gt;
&lt;li&gt;Build on a common set of languages, frameworks, and tools that are stable, feature-rich, and easy to use.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Mudblazor
&lt;/h2&gt;

&lt;p&gt;Just like any framework in JavaScript, it is never enough as a developer wants more advanced features which the different communities create. This makes software development easier as common tasks like authentication, state management to mention a few become a standard for the given framework. &lt;a href="https://reactjs.org/" rel="noopener noreferrer"&gt;React JS&lt;/a&gt; has &lt;a href="https://nextjs.org/" rel="noopener noreferrer"&gt;NextJS&lt;/a&gt;, &lt;a href="https://remix.run/" rel="noopener noreferrer"&gt;Remix&lt;/a&gt;, &lt;a href="https://www.gatsbyjs.com/" rel="noopener noreferrer"&gt;Gatsby&lt;/a&gt; to mention a few, &lt;a href="https://vuejs.org/" rel="noopener noreferrer"&gt;Vue&lt;/a&gt; has &lt;a href="https://nuxtjs.org/" rel="noopener noreferrer"&gt;NuxtJS&lt;/a&gt; et al. So Blazor has &lt;a href="https://mudblazor.com" rel="noopener noreferrer"&gt;MudBlazor&lt;/a&gt; which that extends its capabilities by adding functionalities that go beyond the display layer, which React is limited to. &lt;/p&gt;

&lt;h3&gt;
  
  
  Prerequisites
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;System that compiles and runs the .NET Framework&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://dotnet.microsoft.com/en-us/" rel="noopener noreferrer"&gt;.NET SDK&lt;/a&gt;. The main version MudBlazor is using (LTS version).&lt;/li&gt;
&lt;li&gt;A code editor, &lt;a href="https://www.jetbrains.com/rider" rel="noopener noreferrer"&gt;Jet Brains Rider&lt;/a&gt;, &lt;a href="https://visualstudio.microsoft.com" rel="noopener noreferrer"&gt;Visual Studio&lt;/a&gt; or &lt;a href="https://code.visualstudio.com" rel="noopener noreferrer"&gt;VS Code&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://mudblazor.com/getting-started/installation#prerequisites" rel="noopener noreferrer"&gt;This set up of Mudblazor&lt;/a&gt; either from scratch or in an existing Blazor project should get you started.&lt;/p&gt;

&lt;h2&gt;
  
  
  Demo Project
&lt;/h2&gt;

&lt;p&gt;For a Demo project, I created a UI showing SpaceX launches upto date. At the time of writing it was in .NET 6. &lt;/p&gt;

&lt;h3&gt;
  
  
  SpaceX API
&lt;/h3&gt;

&lt;p&gt;Space Exploration Technologies Corp. (doing business as &lt;a href="https://www.spacex.com/" rel="noopener noreferrer"&gt;SpaceX&lt;/a&gt;) is an American spacecraft manufacturer, space launch provider, and a satellite communications corporation headquartered in Hawthorne, California. Founded in 2002 by Elon Musk, to reduce space transportation costs to enable the colonization of Mars. It manufactures the Falcon 9 and Falcon Heavy launch vehicles, several rocket engines, Cargo Dragon, crew spacecraft, and Starlink communications satellites. &lt;/p&gt;

&lt;h3&gt;
  
  
  Demo
&lt;/h3&gt;

&lt;p&gt;The &lt;a href="https://edcsu.github.io/SpaceXLaunches" rel="noopener noreferrer"&gt;live demo can be found here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr617ytbhro4grnhikvhf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr617ytbhro4grnhikvhf.png" alt="Image description" width="800" height="346"&gt;&lt;/a&gt; The information gotten from &lt;a href="https://api.spacex.land/rest" rel="noopener noreferrer"&gt;a SpaceX REST API&lt;/a&gt;&lt;br&gt;
One is able to see a list of MudBlazor cards showing the name and image for a mission with card actions showing a &lt;em&gt;learn more&lt;/em&gt; button and another to show the video launch on YouTube if it exists. So many components were used which are common in various JavaScript frameworks showing the ease to use.  &lt;/p&gt;

&lt;h3&gt;
  
  
  Github repo
&lt;/h3&gt;

&lt;p&gt;The source code can be found &lt;a href="https://github.com/edcsu/SpaceXLaunches" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Future
&lt;/h2&gt;

&lt;p&gt;The future is certainly bright in terms of &lt;a href="https://devblogs.microsoft.com/dotnet/performance_improvements_in_net_7/" rel="noopener noreferrer"&gt;improvements of the performance of Blazor&lt;/a&gt;  as seen in the blog post.&lt;/p&gt;

</description>
      <category>csharp</category>
      <category>blazor</category>
      <category>webassembly</category>
      <category>spacex</category>
    </item>
    <item>
      <title>Seq on Azure Web Apps is no more</title>
      <dc:creator>Ssewannonda Keith Edwin</dc:creator>
      <pubDate>Fri, 02 Sep 2022 15:09:50 +0000</pubDate>
      <link>https://dev.to/edcsu/seq-on-azure-web-apps-is-no-more-210j</link>
      <guid>https://dev.to/edcsu/seq-on-azure-web-apps-is-no-more-210j</guid>
      <description>&lt;h2&gt;
  
  
  What is Seq?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://docs.datalust.co/docs/an-overview-of-seq" rel="noopener noreferrer"&gt;Seq&lt;/a&gt; is is a real-time centralized, search and analysis server for structured application log data. Its richly featured user interface, JSON event store, and familiar query language syntax makes it efficient to detect and diagnose issues in complex applications and microservices.&lt;/p&gt;

&lt;p&gt;As it is self-hosted and cross platform it can be deployed either on-premise or in the cloud.&lt;br&gt;
The cloud option makes it an attractive proposition to use as it is as easy to setup as &lt;a href="https://azure.microsoft.com/en-us/services/app-service/containers/#overview" rel="noopener noreferrer"&gt;azure&lt;/a&gt; make this a seamless process.&lt;/p&gt;

&lt;h2&gt;
  
  
  Azure web app support ends
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feorg4phugx8f1ipf0wue.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feorg4phugx8f1ipf0wue.png" alt="Documentation screenshot warning" width="765" height="320"&gt;&lt;/a&gt;&lt;br&gt;
However, in August 2022, the maintainers of this popular open source application log ingesting service, announced that they had stopped support for both Azure websites and Azure web apps.&lt;br&gt;
The main reason as per the &lt;a href="https://docs.datalust.co/docs/using-azure-websites-or-app-service" rel="noopener noreferrer"&gt;documentation&lt;/a&gt; &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;These services permit container instances to run concurrently, which will cause storage corruption when hosting Seq.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The issues related to this have been reported since 2018 as seen per the GitHub issues below.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/datalust/seq-tickets/issues/724" rel="noopener noreferrer"&gt;Issue #1&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a&gt;Issue #2&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/datalust/seq-tickets/issues/1354" rel="noopener noreferrer"&gt;Issue #3&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In one of the responses, as seen in the screenshot below, they had advised against using this approach.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5o3n07dp2uuza0cu1vc7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5o3n07dp2uuza0cu1vc7.png" alt="Early response to Azure web apps issues" width="800" height="421"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Alternative options
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Serverless
&lt;/h3&gt;

&lt;p&gt;Those who still want to use serverless Docker container hosting in Azure, Azure Container Instances (ACI) is an option.&lt;br&gt;
However, for persistent storage an Azure Premium Files share must be used. Seq further recommends using &lt;a href="https://docs.datalust.co/docs/using-aks" rel="noopener noreferrer"&gt;Azure Kubernetes Services (AKS)&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Virtual machine
&lt;/h3&gt;

&lt;p&gt;This serves as a better &lt;a href="https://docs.datalust.co/docs/azure-installation" rel="noopener noreferrer"&gt;alternative&lt;/a&gt; in my experience as there is no interference in Seq data and then the complete control over it's management.  &lt;/p&gt;

</description>
      <category>azure</category>
      <category>logging</category>
      <category>cloud</category>
      <category>docker</category>
    </item>
    <item>
      <title>A swiss knife for a developer</title>
      <dc:creator>Ssewannonda Keith Edwin</dc:creator>
      <pubDate>Sat, 16 Jul 2022 10:48:47 +0000</pubDate>
      <link>https://dev.to/edcsu/a-swiss-knife-for-a-developer-293</link>
      <guid>https://dev.to/edcsu/a-swiss-knife-for-a-developer-293</guid>
      <description>&lt;p&gt;According to &lt;a href="https://www.macmillandictionary.com/dictionary/british/swiss-army-knife" rel="noopener noreferrer"&gt;Macmillan dictionary&lt;/a&gt;, A swiss knife means &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;a method or system that deals with situations of all types.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;For a typical developer during times of prototyping where a demo is required and you want to get placeholders whether in either a front-end or back-end setting, you need a few types on the go to so that you concentrate on the business need than extras that will articulate your designs. However, most online tools offer one solution like formatting a json object, getting a GUID (UUID v4) and so on. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://it-tools.tech/" rel="noopener noreferrer"&gt;IT tools tech&lt;/a&gt; is that swiss knife for a developer. It is a responsive application made with &lt;a href="https://vuejs.org/" rel="noopener noreferrer"&gt;VueJS&lt;/a&gt; that enables a developer reduce time either scraping the web or installing a flurry of CLI tools to get quick sample types needed for a prototype showcase.&lt;/p&gt;

&lt;h2&gt;
  
  
  Sidebar
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhjkkjkahqx098u8ms54z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhjkkjkahqx098u8ms54z.png" alt="Sidebar for handy tools" width="800" height="394"&gt;&lt;/a&gt;&lt;br&gt;
It has well categorized sidebar making finding what you find easily. As of version 2.5.1, these are the categories;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Crypto&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Converter&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Web&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Development&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Math&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Text&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Search bar
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fchyf5pbc1fo6hammwgdk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fchyf5pbc1fo6hammwgdk.png" alt="Search bar" width="" height=""&gt;&lt;/a&gt;&lt;br&gt;
This auto complete which offers simple and flexible type-ahead functionality leading to dynamic search of the tools in the IT Tools.&lt;/p&gt;

&lt;h2&gt;
  
  
  Main
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhnsgrc3e7pbess9qz7sn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhnsgrc3e7pbess9qz7sn.png" alt="Main grid" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This features a responsive card grid of the available tools on the site with brief descriptions of what they do. This makes it easier in accessing the tools. They have both light and dark themes to make it comfortable for the eyes at the the different time of the day.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Dealing with tokens, Date-time &lt;strong&gt;IT Tools&lt;/strong&gt; a &lt;a href="https://en.wikipedia.org/wiki/Super-app" rel="noopener noreferrer"&gt;super App&lt;/a&gt; for developers.&lt;br&gt;
Do not forget to try it out leave a &lt;a href="https://github.com/CorentinTh/it-tools" rel="noopener noreferrer"&gt;GitHub star&lt;/a&gt; or &lt;a href="https://github.com/sponsors/CorentinTh" rel="noopener noreferrer"&gt;sponsor&lt;/a&gt; the creators for the awesome and handy tool they envisioned.   &lt;/p&gt;

</description>
      <category>webdev</category>
      <category>productivity</category>
      <category>programming</category>
    </item>
    <item>
      <title>Elegant seeding of data in ASP .NET 6</title>
      <dc:creator>Ssewannonda Keith Edwin</dc:creator>
      <pubDate>Wed, 04 May 2022 14:48:11 +0000</pubDate>
      <link>https://dev.to/edcsu/elegant-seeding-of-data-in-asp-net-6-gb0</link>
      <guid>https://dev.to/edcsu/elegant-seeding-of-data-in-asp-net-6-gb0</guid>
      <description>&lt;p&gt;Seeding data to a database is one of those to-dos a backend developer encounters when they have to initialize an &lt;strong&gt;API&lt;/strong&gt; that they are building while in the development phase. This gives the both the backend and front end teams data to work with and to a certain extent the end to end integration required. This eases the work  front end teams to integrate with a given API without them referring tom mock ups.&lt;/p&gt;

&lt;p&gt;In this quick post, I show you how to seed data to any database in ASP.NET 6 Web API.&lt;/p&gt;

&lt;h1&gt;
  
  
  Initial Setup
&lt;/h1&gt;

&lt;p&gt;Once you've &lt;a href="https://docs.microsoft.com/en-us/aspnet/core/tutorials/min-web-api?view=aspnetcore-6.0&amp;amp;tabs=visual-studio" rel="noopener noreferrer"&gt;created your Web API&lt;/a&gt; you need to add Entity Framework NuGet packages:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dotnet add package Microsoft.EntityFrameworkCore --version 6.0.3
dotnet add package Microsoft.EntityFrameworkCore.Abstractions --version 6.0.3 
dotnet add package Microsoft.EntityFrameworkCore.Analyzers --version 6.0.3
dotnet add package Microsoft.EntityFrameworkCore.Design --version 6.0.3 
dotnet add package Microsoft.EntityFrameworkCore.InMemory --version 6.0.3
dotnet add package Microsoft.EntityFrameworkCore.SqlServer --version 6.0.3 
dotnet add package Microsoft.EntityFrameworkCore.Tools --version 6.0.3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Add Entity
&lt;/h1&gt;

&lt;p&gt;You then create an entity that will be used by the API. Here I used the default &lt;em&gt;WeatherForecast&lt;/em&gt; model that comes with the new Web API project from the previous step.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;WeatherForecast&lt;/span&gt; 
&lt;span class="p"&gt;{&lt;/span&gt;
     &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="n"&gt;DateTime&lt;/span&gt; &lt;span class="n"&gt;Date&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
     &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;TemperatureC&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
     &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="n"&gt;Summary&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Add ApplicationDbContext
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;Microsoft.EntityFrameworkCore&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="nn"&gt;SeedWebApplication.Data.Context&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="cp"&gt;#nullable disable
&lt;/span&gt;    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;ApplicationDbContext&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;DbContext&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="nf"&gt;ApplicationDbContext&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;

        &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="nf"&gt;ApplicationDbContext&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;DbContextOptions&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;ApplicationDbContext&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;options&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;base&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;options&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;

        &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="n"&gt;DbSet&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;WeatherForecast&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;WeatherForecasts&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Create a seed class
&lt;/h1&gt;

&lt;p&gt;This is the class that adds a few records to your database.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="nn"&gt;SeedWebApplication.Data&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;SeedData&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;PopulateDb&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;IApplicationBuilder&lt;/span&gt; &lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;var&lt;/span&gt; &lt;span class="n"&gt;serviceScope&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ApplicationServices&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;CreateScope&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
            &lt;span class="nf"&gt;AddInitialData&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;serviceScope&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ServiceProvider&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;GetService&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;ApplicationDbContext&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;()!);&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;

        &lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;AddInitialData&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ApplicationDbContext&lt;/span&gt; &lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(!&lt;/span&gt;&lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;WeatherForecasts&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Any&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
            &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;summaries&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt;
                &lt;span class="p"&gt;{&lt;/span&gt;
                    &lt;span class="s"&gt;"Freezing"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"Bracing"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"Chilly"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"Cool"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"Mild"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"Warm"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"Balmy"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"Hot"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"Sweltering"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"Scorching"&lt;/span&gt;
                &lt;span class="p"&gt;};&lt;/span&gt;

                &lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;seedForecasts&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Enumerable&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;20&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;Select&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;index&lt;/span&gt; &lt;span class="p"&gt;=&amp;gt;&lt;/span&gt;
                       &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="n"&gt;WeatherForecast&lt;/span&gt;
                       &lt;span class="p"&gt;{&lt;/span&gt;
                           &lt;span class="n"&gt;Id&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Guid&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;NewGuid&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
                           &lt;span class="n"&gt;Date&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;DateTime&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Now&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;AddDays&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;index&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
                           &lt;span class="n"&gt;Created&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;DateTime&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Now&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;AddDays&lt;/span&gt;&lt;span class="p"&gt;(-&lt;/span&gt;&lt;span class="m"&gt;7&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
                           &lt;span class="n"&gt;Updated&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;DateTime&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Now&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;AddDays&lt;/span&gt;&lt;span class="p"&gt;(-&lt;/span&gt;&lt;span class="m"&gt;5&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
                           &lt;span class="n"&gt;TemperatureC&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Random&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Shared&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Next&lt;/span&gt;&lt;span class="p"&gt;(-&lt;/span&gt;&lt;span class="m"&gt;20&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;55&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
                           &lt;span class="n"&gt;Summary&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;summaries&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Random&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Shared&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Next&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;summaries&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Length&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
                      &lt;span class="p"&gt;})&lt;/span&gt;
                    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ToList&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

                &lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;WeatherForecasts&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;AddRange&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;seedForecasts&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
                &lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;SaveChanges&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
                &lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Seeded data to the Database"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Modify &lt;em&gt;program.cs&lt;/em&gt;
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;builder&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;WebApplication&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;CreateBuilder&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="n"&gt;builder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Services&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;AddDbContext&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;ApplicationDbContext&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;(&lt;/span&gt;&lt;span class="n"&gt;options&lt;/span&gt; &lt;span class="p"&gt;=&amp;gt;&lt;/span&gt;
         &lt;span class="n"&gt;options&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;UseInMemoryDatabase&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"inmemo"&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;


&lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;app&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;builder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Build&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;


&lt;span class="n"&gt;SeedData&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;PopulateDb&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Run&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And yes you have successfully seeded data to your database! &lt;/p&gt;

&lt;p&gt;Source code for complete solution can be found on my &lt;a href="https://github.com/edcsu/SeedWebApplication" rel="noopener noreferrer"&gt;Github&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Until next time, love your neighbor, love yourself!&lt;/p&gt;

</description>
      <category>csharp</category>
      <category>dotnet</category>
      <category>database</category>
    </item>
  </channel>
</rss>
