<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Emmanuel D. on Medium]]></title>
        <description><![CDATA[Stories by Emmanuel D. on Medium]]></description>
        <link>https://medium.com/@manu06d?source=rss-16279deaec9a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*u165ASAnagpEPYliCiwPOA.jpeg</url>
            <title>Stories by Emmanuel D. on Medium</title>
            <link>https://medium.com/@manu06d?source=rss-16279deaec9a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 19:22:08 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@manu06d/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[What would look dotnet in a war organization]]></title>
            <link>https://medium.com/@manu06d/what-would-look-dotnet-in-a-war-organization-cc504c100e74?source=rss-16279deaec9a------2</link>
            <guid isPermaLink="false">https://medium.com/p/cc504c100e74</guid>
            <category><![CDATA[dotnet]]></category>
            <dc:creator><![CDATA[Emmanuel D.]]></dc:creator>
            <pubDate>Sun, 14 Jan 2024 07:10:32 GMT</pubDate>
            <atom:updated>2024-01-14T07:10:32.002Z</atom:updated>
            <content:encoded><![CDATA[<p>Just a fun thought about dotnet development ecosystem and how we can translate to the (unfortunately) well known war organization</p><h3>1. The industries</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/233/0*OZOlxzeD-IcoYNtu" /></figure><p>At the top of this organisation, we have the <strong>industries</strong>. Their goal is to sell products and technologies. Year after year, products are getting better and better, more powerful, performant and accurate. Those industries are the driving force of the domain. They rely on massive usage of their products and you can expect from them great shows highlighting their offers.</p><h3>2. The generals</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/254/1*Hw7SDSOdrQrLzGBfP86Cpw.png" /></figure><p>The organization has few generals, getting at this rank is a privilege that results of a huge amount of work. Generals has to be charismatic because their role is to embed in the organisation more and more people. They’re real natural leader, great communicant and highly skilled. Scott Hanselman may one of the most active General and joined Scott Guthrie, Dino Esposito (and so many others) to wall of fame</p><h3>3. The suppliers</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/254/1*asevnKq3f7_S3abdBte6tw.png" /></figure><p>Suppliers have a crucial role in this organization. Their challenge is to provide products that industry can not deliver (or doesn’t want). They fill the gaps and add high value assets to the ecosystem. They have no ulterior motivation except the love of the domain they’re working for. Improving the existing is for them a real reason for being. One famous supplier, James Newton King, that decide to build JSON support for dotnet and got more than 500 millions of download ! Jimmy Bogard decided to shake the world with his automapper and his vertical architecture. Impossible to list of all them … logging, DI … , all domains have seen suppliers making this ecosystem so rich.</p><h3>4. The supporters</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/248/1*fWLaqNxEds_nTecZ-fDhmg.png" /></figure><p>Supporters are a step beyond suppliers and industry. Their main force is not to create but to assemble all manufactured products. They have the will to share to others their true passion for their domain. They trust their cause and are will give their best for it. They know the best way to target and reach an objectives. Have you ever read some blogs without thinking of the motivation of those people .. Just sharing and make this world better ! <a href="https://andrewlock.net/">Andrew Lock</a>, <a href="https://gunnarpeipman.com/">Gungar Peipman</a>, <a href="https://www.alvinashcraft.com/">Alvin Ashcraft</a>, <a href="https://weblog.west-wind.com/">Rick Strahl</a> are some current supporters but tons of them exists on medium, twitter or blogs.</p><h3>5. The captains</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/212/1*eiIS8ITS1AbkVbruMySjLw.png" /></figure><p>Here we are, at war ! Captains are models for the troops, they lead them to a common objective and most important, they take care of them. The captain is aware and is in touch indirectly with previous roles. One day, captain may had the chance to be closed to one of them but its main strength is to be on the front with his troop, getting the job done. They are also called senior, team lead, architect whatever .. The most important is to win the fight and get good results.</p><h3>6. The front line</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/214/1*TGiBxam-4vAa33QW7UMuZQ.png" /></figure><p>Working directly with captains, they’re on the first line of fight. They’re experimented, know the art of war and got medals from previous wars. They’re reliable, may take responsibilities. They can hit a target at a far range. They know theirs enemies and have a plan to defeat them. They’re proud of their achievements, delight of the blood on their knife. Real men of battlefield.</p><h3>7. the back line</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/225/0*O2MFyQaCXvAZt3lB" /></figure><p>People in the back line are essentials to win the war. They are not afraid of fight but have a highest value on support tasks. Who will heal the front line, who will build commodities ? They’re doing the work that people on the front line can’t or doesn’t want to do. Their role is important but they won’t get highest medals for that. Being in the back line should not be seen as negative, getting strong in the back line could be as more important as getting in the front line.</p><p>This fun story is a love message to all people committed in a project. Whatever your role is, take it as seriously as possible and always give the best. Roles are not closed, closed mind think they are.</p><p>Thanks for all people who contribute to the dotnet ecosystem, giving their precious time to others by sharing and spreading knowledge. I may have omit lot of them, my apologize.</p><p>Code and war are completely different but I often use this analogy to better explain things. Make code, not war ! Sorry if some people could get offended, it was not the goal ! I have too many respect to contributors !</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cc504c100e74" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using  Razor Class Library (RCL) to generate a common UI for all your dotnet web projects]]></title>
            <link>https://medium.com/swlh/using-razor-class-library-rcl-to-generate-a-common-ui-for-all-your-dotnet-web-projects-be970d4a82a0?source=rss-16279deaec9a------2</link>
            <guid isPermaLink="false">https://medium.com/p/be970d4a82a0</guid>
            <category><![CDATA[nuget]]></category>
            <category><![CDATA[ui]]></category>
            <category><![CDATA[razor]]></category>
            <category><![CDATA[dotnet-core]]></category>
            <dc:creator><![CDATA[Emmanuel D.]]></dc:creator>
            <pubDate>Sat, 02 May 2020 12:31:42 GMT</pubDate>
            <atom:updated>2020-05-04T17:12:23.041Z</atom:updated>
            <content:encoded><![CDATA[<h3>Using Razor Class Library (RCL) to generate a common UI for all your dotnet web projects</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cCmEfSX4lQg696pu-V5idQ.jpeg" /></figure><p>Getting a pack ready-to-go to build a website is a common need for web developers. Buying a 50$ template with a complete dotnet integration is a dream as soon as you’re attentive to code quality. This article will focus on building a dotnet web library containing your website UI that you can share across all your projects with a nuget package.</p><p>In this article, we will create a Visual Studio solution containing two projects. One will contain the main UI layout template and the second one a web application in order to test our template project.</p><p>Source code of the project is available here : <a href="https://github.com/Manu06D/makeITeasy.LayoutLibrary">https://github.com/Manu06D/makeITeasy.LayoutLibrary</a></p><h3>Step by step creation of our VS solution</h3><p>Let’s first <strong>create a blank solution </strong>and then <strong>add a new project </strong>of type<strong> “Razor Class Library”</strong> (RCL). This project will contain all our front-end elements like views, javascript, style sheet. Check this <a href="https://docs.microsoft.com/en-us/aspnet/core/razor-pages/ui-class?view=aspnetcore-3.1&amp;tabs=visual-studio">documentation</a> for more info about RCL.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/519/1*eK6rEQNQ-jBNe3_SXUkJWg.png" /></figure><p>During the project creation wizard, don’t forget to <strong>check “Support pages and view”</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/973/1*j11c8oup5PhNsSFr3Hxv2w.png" /></figure><p>Now,<strong> create a new web project</strong> that will be helpful during our template development process. Consider this project like a unit test solution with the only goal to test our template rendering. <strong>Add a reference</strong> on our web project to our template project.</p><p>In the template root folder, create a two folders named Views and wwwroot. Inside the Views folder, create a sub-folder named Shared. In the wwwroot folder, create 3 folders named images, css, js.<br>This will help us to keep the same directory structure than a web site.</p><p>On the freshly created folder (Views\Shared), create a new View that will host our base layout (for example _BaseTemplateLayout.cshtml).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/325/1*xNG6EtAU3NVsnyKocZKzJw.png" /><figcaption>Your solution should look like this</figcaption></figure><p>Now, let’s start with the fun part ! We can customize our base template to integrate our design. Proceed like any other layout. Let’s put this code for the sample :</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/02d1fa48868b4ebd6c7d95b04846958d/href">https://medium.com/media/02d1fa48868b4ebd6c7d95b04846958d/href</a></iframe><p>The <strong>@RenderBody is essential</strong> because it will allow the child views to render their content in this layout.</p><p>The VS solution should compile without any error. Set our WebApp as startup project and launch it. Ensure that the web site is working properly.</p><p>Now, let’s go to the webApp projet and open “<em>Views\_ViewStart.cshtml”</em> file. <strong>Replace the name of the default layout</strong> (usually _Layout) by the name of the layout created in the template project (in my example _BaseTemplateLayout). <br>Compile, start our project and check that the page displays our new design.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/518/1*ESVRFznn9_0wtDZlohKcRQ.png" /></figure><p>In order to live debug the template (and get a recompilation of Layout/Views), you need to add watchers to specific folders as explained in <strong>this article</strong>. In the following example, the line 6 to 19 will configure razor live compilation to monitor the folder of the webApp and the folder of the template project.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/cc1d6dd9b6b429d538efae5c5bd29592/href">https://medium.com/media/cc1d6dd9b6b429d538efae5c5bd29592/href</a></iframe><p>Now let’s see some tips around RCL.</p><h4>1. Nuget Package</h4><p>We can <strong>build a nuget package</strong> of our template in order to use it in other web projects like we do with NewtonsoftJson or others famous nuget packages. Right click on the template solution, go to properties and check “Generate nuget Package on build” on the Package tab.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ur7H6Lz6QdVK_8yHZbR41A.png" /></figure><p>After the next build, in the bin folder of our template project, we will have a nuget package that we might upload to our favorite nuget repository during our CI/CD process. That is awesome !</p><h4>2. Front end tooling</h4><p>I’m a great fan of <a href="https://docs.microsoft.com/en-us/aspnet/core/client-side/libman/libman-vs?view=aspnetcore-3.1">library manager</a> for its simplicity and its smart integration into a VS solution. Unfortunately, RCL projects are not supported. As a workaround, on our webApp project, simply add a front package (right click on webApp project, Add, Client-Side library and choose jquery for example). Copy paste the file libman.json from webApp project into our template project and tadam , we get libman enabled in our template project. By default, libman will download front librairies in folder wwwroot/dist</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/376/1*BpWWnKg-kX-_nLE8HpN7uA.png" /></figure><p>As well, if you have <a href="https://marketplace.visualstudio.com/items?itemName=MadsKristensen.BundlerMinifier">Bundle &amp; Minifier extension</a>, you can enable bundle and minifcation in our template project.</p><p>Bundle and libman can be processed on build, no need to embed external front libraries in our source control. To enable bundle &amp; libman on build, right click on respective config files and enable them for build.</p><p>Now, we have some cool front libraries in our template project, we can use them in our base layout view. In order to reference an asset, we must prefix it by <strong><em>/_content/[AssemblyName]/pathToAsset</em></strong><em> </em><br>wwwroot folder is not part of asset path. So if I have a logo.png on my wwwroot/images folder, my path will be : /_content/makeITeasy.LayoutLibrary.Template/images/logo.png</p><h4>3. Partials &amp; Razor development</h4><p>Partial views are supported. This helps to get a better organisation in our template files. We might have a layout file for header, footer, menu navigation …</p><p>Just create a partial view and reference it with :</p><pre>@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers<br>&lt;partial name=&quot;_BaseTemplateFooter.cshtml&quot;&gt;&lt;/partial&gt;<br>or<br>@await Html.PartialAsync(&quot;_BaseTemplateFooter&quot;)</pre><p>The template project supports all razor features so imagination is just your limit :)</p><h4>4. Sections</h4><p>To improve file organisation and keep a clear separation of assets between template and implementations, we may use Sections. By doing this, our webApp can integrate part of its logic into the template without changing the integrity of the template.</p><p>Usually, template project contains only scripts that are related to the template (captain obvious). Our webApp will also have assets related to its scope and we need to inject them on the base template. We will proceed by using sections giving some free rein to the webApp on a limited placeholder.</p><p>Add the RenderSection directive in the base layout template</p><pre>@RenderSection(&quot;Scripts&quot;, required: false)</pre><p>Fill the Section in our view (or layout)</p><pre>@section Scripts{<br>  &lt;script&gt;<br>  console.log(&quot;hello from the view&quot;);<br>  &lt;/script&gt;<br>}</pre><p><strong>5. Passing content from View to Layout</strong></p><p>Let’s see now how we can pass content from our view to our template layout. It can be done with ViewBag, ViewData but I prefer to use dependency injection.</p><p>Imagine that our controller/view need to pass the title of the page to the template layout. In our template project, let’s create a basic class PageDefinition that will contain a property Title.</p><pre>public class PageDefinition<br>{<br>  public string Title { get; set; }<br>}</pre><p>Register this class in our webApp startup, services configuration</p><pre>services.AddScoped&lt;PageDefinition&gt;();</pre><p>In our controller, let’s set the title of the page :</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/cd0dbeb75004191065eaf0b7a2963a84/href">https://medium.com/media/cd0dbeb75004191065eaf0b7a2963a84/href</a></iframe><p>Final step is to use the value injected by DI in our template layout.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/acb61f1c7e6a3cafd95cf19ea2b9d7b1/href">https://medium.com/media/acb61f1c7e6a3cafd95cf19ea2b9d7b1/href</a></iframe><h4>Conclusion</h4><p>As you can see, packaging a website UI is as simple as developing a dotnet library. This process will ensure a high consistency between all your web projects and will help you to better organize/track your UI update. Razor Class Library rely on aspnet core development foundations so quite easy to onboard.</p><p>If things are not clear enough, you’d better check the project or code :p</p><p>Hope you like this article, don’t hesitate to drop me a message for any concerns :p</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=be970d4a82a0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/using-razor-class-library-rcl-to-generate-a-common-ui-for-all-your-dotnet-web-projects-be970d4a82a0">Using  Razor Class Library (RCL) to generate a common UI for all your dotnet web projects</a> was originally published in <a href="https://medium.com/swlh">The Startup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>