<?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: Zohar Peled</title>
    <description>The latest articles on DEV Community by Zohar Peled (@peledzohar).</description>
    <link>https://dev.to/peledzohar</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%2F226237%2F15c9fcea-0929-4346-b584-9ff84902de8d.jpeg</url>
      <title>DEV Community: Zohar Peled</title>
      <link>https://dev.to/peledzohar</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/peledzohar"/>
    <language>en</language>
    <item>
      <title>Result.Simplified now live on nuget</title>
      <dc:creator>Zohar Peled</dc:creator>
      <pubDate>Tue, 29 Apr 2025 09:23:29 +0000</pubDate>
      <link>https://dev.to/peledzohar/resultsimplified-now-live-on-nuget-4of</link>
      <guid>https://dev.to/peledzohar/resultsimplified-now-live-on-nuget-4of</guid>
      <description>&lt;p&gt;TL;DR; - &lt;a href="https://www.nuget.org/packages/Result.Simplified/" rel="noopener noreferrer"&gt;Here's the Nuget link&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A few years back I've decided to create a &lt;code&gt;Result&lt;/code&gt; and &lt;code&gt;Result&amp;lt;T&amp;gt;&lt;/code&gt; classes to handle a situation in my code - I've had a couple of classes that contained methods with expected points of failures, but couldn't inject a logger into these classes (well, technically I could, but it was prohibited by the architect in charge). &lt;/p&gt;

&lt;p&gt;The solution I came up with was to use a couple of classes to enhance the return value of these methods - the &lt;code&gt;Result&lt;/code&gt; and &lt;code&gt;Result&amp;lt;T&amp;gt;&lt;/code&gt; classes which &lt;a href="https://dev.to/peledzohar/handling-non-exceptional-errors-using-result-and-result-t-45ml"&gt;I've blogged about in 2021&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So this project was collecting dust as a GitHub repository for a while, before I found out that this is an actual known pattern adopted into C# from functional programming - and that pattern actually has quite a few implementations - like Amichai Mantinband's &lt;a href="https://www.nuget.org/packages/ErrorOr" rel="noopener noreferrer"&gt;ErrorOr&lt;/a&gt; which is a great implementation that offers a very rich API.&lt;/p&gt;

&lt;p&gt;Lately I've needed to use the result pattern again, and as I was searching for an implementation that was accurate for my needs, I came to realize that my old &lt;code&gt;ResultOf&lt;/code&gt; project was just what I needed - nothing less, nothing more. I mean, I could go with &lt;code&gt;ErrorOr&lt;/code&gt; or any other implementation, but they all seemed to be a bit of an overkill for my specific need. &lt;/p&gt;

&lt;p&gt;So I did what any other reasonable developer did and tried to upload my existing project to Nuget - however, it turned out the package id &lt;a href="https://www.nuget.org/packages/ResultOf" rel="noopener noreferrer"&gt;ResultOf&lt;/a&gt; was already in use (with another implementation that wasn't exactly what I wanted) so I named it Result.Simplified.&lt;/p&gt;

&lt;p&gt;One thing led to another and 16 days later I'm at version 2.1.0, with a 100% test coverage, a newly created repository, and almost 700 downloads.&lt;/p&gt;

&lt;p&gt;If you've made it so far I would love to get some feedback on it, if that's not too much to ask :-)&lt;/p&gt;

</description>
      <category>c</category>
      <category>dotnet</category>
      <category>functionalpatterns</category>
    </item>
    <item>
      <title>AI based technical interview questions generator</title>
      <dc:creator>Zohar Peled</dc:creator>
      <pubDate>Tue, 18 Mar 2025 09:09:42 +0000</pubDate>
      <link>https://dev.to/peledzohar/ai-based-technical-interview-questions-generator-9j4</link>
      <guid>https://dev.to/peledzohar/ai-based-technical-interview-questions-generator-9j4</guid>
      <description>&lt;p&gt;First published on &lt;a href="https://zoharpeled.wordpress.com/2025/03/17/ai-based-technical-interview-questions-generator/" rel="noopener noreferrer"&gt;What The # Do I Know?&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;TL;DR&lt;br&gt;
If you don't want to read the background story, skip to the end.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why do we need it?
&lt;/h2&gt;

&lt;p&gt;It's no secret that good technical interviews are hard to create. &lt;br&gt;
IMHO, this is one of the main reasons why so many technical interviews and coding challenges nowadays suck. I've been looking for a new job lately after a little over seven years of continuous employment and out of around 30 technical interviews, only three were the kind of interviews where the interviewer could actually learn how I would perform on the job. &lt;br&gt;
Now, this issue isn't new - in fact, &lt;a href="https://dev.to/peledzohar/what-if-your-interview-coding-challenge-would-look-like-this-194d"&gt;I've blogged about it back in 2019&lt;/a&gt;, but unfortunately, not only did things not get better, they actually got worse.&lt;br&gt;
This is frustrating not only for me as a candidate but also for the interviewer - because, let's face it, these kinds of questions are rarely relevant to your day-to-day work.&lt;/p&gt;

&lt;p&gt;Many technical interviews are simply a collection of &lt;a href="https://leetcode.com/" rel="noopener noreferrer"&gt;LeetCode&lt;/a&gt; questions, which poses several problems for the interviewer: If the candidate provides the correct answer, how do you know it's not because they've searched for solutions to popular interview questions a day before the interview? or because they saw you were asking that question on Glassdoor, or some other candidate told them what questions to expect? And don't even get me started on the relevance of at least some of these questions to your day-to-day work in the position you're interviewing for!&lt;/p&gt;

&lt;p&gt;So, one way to fix this is to actually take the time and invest the energy to build a good technical interview, one that will fit the position you're looking to fill so much better, that people who pass it are more likely to succeed in this position - but as I've said in the first sentence - this is hard. Really hard. And who's got the time for this anyway? I mean, if you're searching for someone to join your team, it's not because your team suffers from too much free time and not enough work, right?&lt;/p&gt;

&lt;h2&gt;
  
  
  Building the application
&lt;/h2&gt;

&lt;p&gt;For this, I've used &lt;a href="https://base44.app/" rel="noopener noreferrer"&gt;Base44&lt;/a&gt; and got an MVP up and running in literally no time. I mean, if I had to build it all manually it probably would have taken me about a week - not counting the time I’d need to learn React (which is still on my to-do list; I plan to get there someday).&lt;br&gt;
With Base44 it was ready in a matter of minutes, with just a couple of prompts. &lt;br&gt;
Since it was so easy, I decided to add more options. I went back to ChatGPT, created a few more prompts, then used Base44 to generate additional question types.&lt;/p&gt;

&lt;p&gt;As of now, the application contains 4 different options to generate technical interview questions:&lt;br&gt;
debugging questions, refactoring questions, code review questions and questions that are based on feature requirements. And the icing on the cake - You can actually view and edit the prompt before sending it to AI, or even copy it to use with your own favorite AI provider.&lt;/p&gt;

&lt;h2&gt;
  
  
  So why should you use it?
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;You'll never have to worry again if the candidate copied the answer from somewhere.&lt;/li&gt;
&lt;li&gt;You'll never have to worry again that the questions aren't reflecting the day-to-day work.&lt;/li&gt;
&lt;li&gt;You can generate new questions anytime, based on either your own code or generated one - in a matter of minutes.&lt;/li&gt;
&lt;li&gt;You can tailor your own technical interview with minimal effort, ensuring that it matches the exact needs you have for any developer position at any level.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Please, &lt;a href="https://app.base44.com/apps-show/tech-interview-generator-9e10f9b5" rel="noopener noreferrer"&gt;take it for a spin&lt;/a&gt; and let me know what you think. Did you like it? Do you think it's something you can actually use for your own interviews? Is there anything you would like to change or add to it?&lt;br&gt;
I would be very grateful if you could leave a comment on this page or contact me for any suggestions.&lt;/p&gt;

</description>
      <category>interview</category>
      <category>career</category>
      <category>discuss</category>
    </item>
    <item>
      <title>AutoEntityGenerator – my first visual studio extension.</title>
      <dc:creator>Zohar Peled</dc:creator>
      <pubDate>Tue, 16 Jul 2024 10:56:00 +0000</pubDate>
      <link>https://dev.to/peledzohar/autoentitygenerator-my-first-visual-studio-extension-p9j</link>
      <guid>https://dev.to/peledzohar/autoentitygenerator-my-first-visual-studio-extension-p9j</guid>
      <description>&lt;p&gt;(First published on &lt;a href="https://zoharpeled.wordpress.com/2024/07/16/autoentitygenerator-my-first-visual-studio-extension/" rel="noopener noreferrer"&gt;What The # Do I Know?&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;TL;DR – There are links to the Visual Studio Marketplace and the GitHub repository at the end.&lt;/p&gt;

&lt;p&gt;It all started when I watched a YouTube video by Amichai Mantinband called &lt;a href="https://www.youtube.com/watch?v=RfFTVwQ9oT4" rel="noopener noreferrer"&gt;Controllers From Scratch Using .NET 8&lt;/a&gt;,&lt;br&gt;
where he shows how to properly design and build an ASP.NET Controller as a part of his ASP.NET 8 REST API Tutorial. (As a side point, I highly recommend subscribing to his YouTube channel).&lt;/p&gt;

&lt;p&gt;One of the things he talked about in this video, was the structure of end points he follows and recommend – and this structure has three parts:&lt;/p&gt;

&lt;p&gt;Mapping from request object to domain model&lt;br&gt;
Acting on the domain model&lt;br&gt;
Mapping the result of that action to a response object&lt;br&gt;
The example he shows is creating a product, so let me quickly show you the code for this example:&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="n"&gt;IActionResult&lt;/span&gt; &lt;span class="nf"&gt;Create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;CreateProductRequest&lt;/span&gt; &lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// mapping request to domain&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;request&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ToDomain&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

    &lt;span class="c1"&gt;// acting on domain object&lt;/span&gt;
    &lt;span class="n"&gt;_productService&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;product&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="c1"&gt;// mapping domain to response and return to client&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;CreatedAtAction&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="n"&gt;actionName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;nameof&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Get&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
        &lt;span class="n"&gt;routeValues&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="n"&gt;ProductId&lt;/span&gt;&lt;span class="p"&gt;:&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;Id&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="k"&gt;value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;ProductResponse&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;FromDomain&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;product&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;Of course, in this video he creates the domain model, the different request and response DTOs, and the mapping methods between them – and this is what gave me the idea for my extension – which is a very simple idea: What if, instead of having to manually write all these DTOs and mappings, we would have a light bulb action that will generate all this code for us with just a few mouse clicks, using a simple form like the “Extract interface” form?&lt;/p&gt;

&lt;p&gt;Armed with this idea and zero knowledge about visual studio extensions, I’ve called ChatGPT for help (and then also involved Claude.AI). The beginning was somewhat difficult since both of them sent me off to somewhat misleading directions, but after a few trials and errors, I’ve managed to get started with a simple POC that shows a light bulb menu item.&lt;br&gt;
After that POC up and running it was time to start focusing on what I wanted the extension to do.&lt;/p&gt;

&lt;p&gt;The first step was to get the menu item to only show when using the light bulb on a class or record definition – which was quite simple. Then I’ve used a lot of ChatGPT’s help with getting the information I needed from the code – the namespace, the class (or record) name, its constructors,&lt;br&gt;
public properties, type parameters and other relevant information,&lt;br&gt;
all collected into a class I’ve called Entity (and a bunch of other classes to go along with it such as Property, Namespace and so on):&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;Entity&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;Project&lt;/span&gt; &lt;span class="n"&gt;Project&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="n"&gt;Namespace&lt;/span&gt; &lt;span class="n"&gt;Namespace&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="n"&gt;Name&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="n"&gt;List&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;Constructor&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;Constructors&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="n"&gt;SourceFilePath&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="n"&gt;List&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;Property&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;Properties&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="n"&gt;List&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;TypeParameters&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="n"&gt;List&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;GenericConstraints&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;p&gt;Getting the entity information was basically a simple mapping between Microsoft.CodeAnalysis.CSharp.Syntax definitions to my own definitions, but it is a crucial step of the process.&lt;br&gt;
The next step was to build the UI, which contains a form where the user can select which properties they want to include in the DTO, how to name it, what would be its file name, what directory to save it to, and which direction to generate the mapping.&lt;/p&gt;

&lt;p&gt;The next step was to use the information from the UI to generate a new Entity object that represents the DTO, use then use that entity and the original one to generate the code for both the DTO and the mappings, and finally, save that code in new files in the user-selected directory.&lt;/p&gt;

&lt;p&gt;It took me about 3-4 weeks of part-time work (about 25-30 work hours a week) to get the first version to a point I feel good enough about it to release it to the public – and there’s still quite a bit of work left to do on it, but IMHO it is good enough to work with and therefore good enough to be published.&lt;/p&gt;

&lt;p&gt;As of now, it can only be installed on Visual Studio Community 2019 or 2022, but I plan to make it available for Professional and Enterprise editions as well in the (hopefully not too distant) future.&lt;/p&gt;

&lt;p&gt;It’s completely open source and free to use, you can check it out on &lt;a href="https://github.com/Peled-Zohar/AutoEntityGenerator" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt; or in the &lt;a href="https://marketplace.visualstudio.com/items?itemName=ZoharPeled.AutoEntityGenerator" rel="noopener noreferrer"&gt;Visual Studio Marketplace&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If you’ve tried it, I would very much appreciate any feedback, good or bad.&lt;/p&gt;

</description>
      <category>dotnet</category>
      <category>visualstudio</category>
    </item>
    <item>
      <title>I'm a c# developer, want to start working as a fullstack web. What frontend framework(s) should I learn?</title>
      <dc:creator>Zohar Peled</dc:creator>
      <pubDate>Sun, 04 Feb 2024 13:25:42 +0000</pubDate>
      <link>https://dev.to/peledzohar/im-a-c-developer-want-to-start-working-as-a-fullstack-web-what-frontend-frameworks-should-i-learn-28c8</link>
      <guid>https://dev.to/peledzohar/im-a-c-developer-want-to-start-working-as-a-fullstack-web-what-frontend-frameworks-should-i-learn-28c8</guid>
      <description>&lt;p&gt;Some background: I've started my professional career as a full stack developer back in late 1999, before the term was popular (perhaps even before it was coined?). &lt;br&gt;
I've worked a lot with HTML4, CSS3 and Javascript, but some time around 2009-2010 (I think) I got pulled away from Web dev and got into desktop applications - so while I do have the basic knowledge of how things work, I have no experience whatsoever with current frontend frameworks and technologies (Didn't even had the chance to learn JQuery, when it was the shiny new thing).&lt;/p&gt;

&lt;p&gt;So, if I want to land a job as a fullstack developer, what should I learn? &lt;/p&gt;

</description>
      <category>webdev</category>
      <category>fullstack</category>
      <category>help</category>
      <category>discuss</category>
    </item>
    <item>
      <title>Quick question about code review comments</title>
      <dc:creator>Zohar Peled</dc:creator>
      <pubDate>Thu, 28 Apr 2022 15:15:48 +0000</pubDate>
      <link>https://dev.to/peledzohar/quick-question-about-code-review-comments-1nf4</link>
      <guid>https://dev.to/peledzohar/quick-question-about-code-review-comments-1nf4</guid>
      <description>&lt;p&gt;Recently I've started working with an environment that is new to me - the Git repository is stored on Azure dev ops and I'm working on Visual studio 2019.&lt;/p&gt;

&lt;p&gt;For every pull request we're having a code review, in which my team leader reviews the code and writes comments (optionally, of course) of what he thinks should be changed.&lt;/p&gt;

&lt;p&gt;My question is - Is there a way (and if so how) for me to see these comments directly in Visual studio? &lt;/p&gt;

&lt;p&gt;Currently I'm forced to Juggle my attention between VS and the browser showing the PR, and I think it would help a lot if I could just do it all in visual studio.&lt;/p&gt;

&lt;p&gt;Thanks and advance, &lt;br&gt;
Zohar.&lt;/p&gt;

&lt;p&gt;BTW, sorry for not writing here for so long&lt;/p&gt;

</description>
      <category>visualstudio</category>
      <category>git</category>
      <category>azure</category>
      <category>help</category>
    </item>
    <item>
      <title>Just popped in to let you know</title>
      <dc:creator>Zohar Peled</dc:creator>
      <pubDate>Sun, 17 Oct 2021 18:35:41 +0000</pubDate>
      <link>https://dev.to/peledzohar/just-popped-in-to-let-you-know-44pd</link>
      <guid>https://dev.to/peledzohar/just-popped-in-to-let-you-know-44pd</guid>
      <description>&lt;p&gt;Hi, &lt;br&gt;
It's been quite a while since my last post here (and in &lt;a href="https://zoharpeled.wordpress.com/"&gt;my own blog&lt;/a&gt;, but that's besides the point).&lt;/p&gt;

&lt;p&gt;I just popped in to let you know that if you're writing console apps in dot net, you might want to check out my nuget packege &lt;a href="https://www.nuget.org/packages/ExtendedConsole"&gt;ExtendedConsoe&lt;/a&gt;.&lt;br&gt;
It has a new version (2.0.0) that helps you write things like menus (single or multiple select), use colors, and read user inputs.&lt;/p&gt;

&lt;p&gt;Cheers.&lt;/p&gt;

</description>
      <category>csharp</category>
      <category>dotnet</category>
      <category>console</category>
    </item>
    <item>
      <title>Which do you prefer, and why?</title>
      <dc:creator>Zohar Peled</dc:creator>
      <pubDate>Mon, 29 Mar 2021 07:09:02 +0000</pubDate>
      <link>https://dev.to/peledzohar/which-do-you-prefer-and-why-3o96</link>
      <guid>https://dev.to/peledzohar/which-do-you-prefer-and-why-3o96</guid>
      <description>&lt;p&gt;Yes, I'm here again with a c# coding style question - and today - between the following different coding styles - which do you prefer and why?&lt;/p&gt;

&lt;p&gt;1:&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;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;condition&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;single&lt;/span&gt;&lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="n"&gt;line&lt;/span&gt;&lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="n"&gt;of&lt;/span&gt;&lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="n"&gt;code&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;2:&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;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;condition&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; 
    &lt;span class="n"&gt;single&lt;/span&gt;&lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="n"&gt;line&lt;/span&gt;&lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="n"&gt;of&lt;/span&gt;&lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="n"&gt;code&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;3:&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;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;condition&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; 
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;single&lt;/span&gt;&lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="n"&gt;line&lt;/span&gt;&lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="n"&gt;of&lt;/span&gt;&lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="n"&gt;code&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;4:&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;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;condition&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; 
    &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;single&lt;/span&gt;&lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="n"&gt;line&lt;/span&gt;&lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="n"&gt;of&lt;/span&gt;&lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="n"&gt;code&lt;/span&gt;&lt;span class="p"&gt;;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;5:&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;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;condition&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;single&lt;/span&gt;&lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="n"&gt;line&lt;/span&gt;&lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="n"&gt;of&lt;/span&gt;&lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="n"&gt;code&lt;/span&gt;&lt;span class="p"&gt;;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>csharp</category>
      <category>dotnet</category>
      <category>discuss</category>
    </item>
    <item>
      <title>Celebrating 1k downloads of ExtendedConsole</title>
      <dc:creator>Zohar Peled</dc:creator>
      <pubDate>Wed, 10 Mar 2021 20:46:23 +0000</pubDate>
      <link>https://dev.to/peledzohar/celebrating-1k-downloads-of-extendedconsole-4lcl</link>
      <guid>https://dev.to/peledzohar/celebrating-1k-downloads-of-extendedconsole-4lcl</guid>
      <description>&lt;p&gt;&lt;a href="https://github.com/Peled-Zohar/ExtendedConsole"&gt;ExtendedConsole&lt;/a&gt; was the second open source project I've uploaded to GitHub and it's &lt;a href="https://www.nuget.org/packages/ExtendedConsole"&gt;my first public Nuget package.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It was also the subject of &lt;a href="https://zoharpeled.wordpress.com/2019/09/07/easy-way-to-customize-your-console-apps/"&gt;my first ever blog post.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I initially uploaded it to nuget in May 2019, since than I've fixed a few bugs and added a few features. Current version is 1.0.5 and was uploaded in December 2019.&lt;/p&gt;

&lt;p&gt;This is also the first project I've published a &lt;a href="https://peled-zohar.github.io/ExtendedConsole/"&gt;complete documentation&lt;/a&gt; to, using DocFx recommended by &lt;a href="https://dev.to@bijington"&gt;Shaun Lawrence&lt;/a&gt; here on dev.&lt;/p&gt;

&lt;p&gt;I know 1k downloads is a much less than what successful packages have in an hour, but I never expected this package to have a lot of downloads to begin with so I'm happy with this number.&lt;/p&gt;

</description>
      <category>csharp</category>
      <category>dotnet</category>
    </item>
    <item>
      <title>Handling non exceptional errors using Result and Result&lt;T&gt;</title>
      <dc:creator>Zohar Peled</dc:creator>
      <pubDate>Fri, 05 Mar 2021 22:04:40 +0000</pubDate>
      <link>https://dev.to/peledzohar/handling-non-exceptional-errors-using-result-and-result-t-45ml</link>
      <guid>https://dev.to/peledzohar/handling-non-exceptional-errors-using-result-and-result-t-45ml</guid>
      <description>&lt;p&gt;(First published on &lt;a href="https://zoharpeled.wordpress.com/2021/03/05/handling-non-exceptional-errors-using-result-and-resultt/"&gt;What the # do I know?&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;tl;dr; – Check out the &lt;a href="https://github.com/Peled-Zohar/ResultOf"&gt;code on GitHub&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Microsoft’s recommendations for handling errors in dot net are published in a page entitled &lt;a href="https://docs.microsoft.com/en-us/dotnet/standard/exceptions/best-practices-for-exceptions"&gt;Best practices for exceptions.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this page there’s a paragraph entitled "Design classes so that exceptions can be avoided", which is a very good advice – If you can design your code to avoid exceptions, you really should.&lt;br&gt;
For instance, if your code contains the mathematical operation of division, you should check the values before hand to avoid having to deal with a&lt;br&gt;
DivideByZeroException thrown at the you by at run time.&lt;/p&gt;

&lt;p&gt;However, this page also contains the following recommendation:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Another way to avoid exceptions is to return null (or default) for extremely common error cases instead of throwing an exception. An extremely common error case can be considered normal flow of control. By returning null (or default) in these cases, you minimize the performance impact to an app.&lt;/p&gt;

&lt;p&gt;For value types, whether to use Nullable or default as your error indicator is something to consider for your particular app. By using Nullable, default becomes null instead of Guid.Empty. Some times, adding Nullable can make it clearer when a value is present or absent. Other times, adding Nullable can create extra cases to check that aren’t necessary, and only serve to create potential sources of errors.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This is not a bad advice, but what if your writing a void method? What if your method might fail in more than one non exceptional way? returning null doesn’t help you in these situations.&lt;br&gt;
They also suggest, in that page to&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Throw exceptions instead of returning an error code.&lt;br&gt;
Exceptions ensure that failures do not go unnoticed because calling code didn’t check a return code.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This is also a good advice, but then again, shouldn’t exceptions be used only in exceptional circumstances? you know, things that you can’t control in your code?&lt;/p&gt;

&lt;p&gt;So I’ve decided to solve this problem by using the &lt;code&gt;Result&lt;/code&gt; class for void methods, and &lt;code&gt;Result&amp;lt;T&amp;gt;&lt;/code&gt; for non-void methods.&lt;/p&gt;

&lt;p&gt;Here’s a scenario in which I found it useful to return an instance of Result instead of using a void method:&lt;br&gt;
I needed to take a parameter, get some data based on that parameter from another method, and then send that data to another service – Seems like a fairly simple and common task, right? something like this should do it:&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;void&lt;/span&gt; &lt;span class="nf"&gt;SendReport&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&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="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;report&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;GetReport&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="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;ValidateReport&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;report&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nf"&gt;SendReport&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;report&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;Except that… The &lt;code&gt;SendReport&lt;/code&gt; method had several points in which it could fail – for instance, if there was no data corresponding to the parameter, if there was data but it was invalid, if the communication between services was down and so on.&lt;br&gt;
I didn’t need this method to return anything, except I needed to know if it succeeded or failed and if it failed, why.&lt;br&gt;
In this particular case, I couldn’t introduce a logger as a dependency to this method, so I’ve decided to write a class that would help me get that information back from the method, so that I can use it in the code calling this method.&lt;/p&gt;

&lt;p&gt;Enter the &lt;code&gt;Result&lt;/code&gt; class. This is a very simple class that contains only two properties – A bool indicating success, and a string specifying the error message. The simplified code looks like this:&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;Result&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="n"&gt;Result&lt;/span&gt; &lt;span class="nf"&gt;Success&lt;/span&gt;&lt;span class="p"&gt;()&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="nf"&gt;Result&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="n"&gt;Result&lt;/span&gt; &lt;span class="nf"&gt;Fail&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;errorDescription&lt;/span&gt;&lt;span class="p"&gt;)&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="nf"&gt;Result&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;errorDescription&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;protected&lt;/span&gt; &lt;span class="nf"&gt;Result&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;Succeeded&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="k"&gt;protected&lt;/span&gt; &lt;span class="nf"&gt;Result&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;errorDescription&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;Succeeded&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="n"&gt;ErrorDescription&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;errorDescription&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;bool&lt;/span&gt; &lt;span class="n"&gt;Succeeded&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="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="n"&gt;ErrorDescription&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="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;Note the result class have no public constructors, only protected ones – you can only initialize it using the static Success or Fail methods. This serves two purposes: One, when you initialize an instance of the Result class, you have a very small chance of initializing it wrong, and two, when you read the code, it’s very clear and unambiguous.&lt;/p&gt;

&lt;p&gt;So now, the code from before looks like this:&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="n"&gt;Result&lt;/span&gt; &lt;span class="nf"&gt;SendReport&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&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="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;report&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;GetReport&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="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;isValid&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;ValidateReport&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;report&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;isValid&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Succeeded&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;SendReport&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;report&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;isValid&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;Now the calling code can handle whatever went wrong in this method, but there’s just too much code here for such a simple method, right?&lt;/p&gt;

&lt;p&gt;I know I can do better – so let me introduce the &lt;code&gt;Result&amp;lt;T&amp;gt;&lt;/code&gt; class as well.&lt;br&gt;
This class inherits the &lt;code&gt;Result&lt;/code&gt; class and adds a property of type T which is called Value. Like it’s base class, its constructors are also protected and not public, and can only be initialized from static methods.&lt;/p&gt;

&lt;p&gt;This class enables me to enhance the value I would return from a non-void method to also include the succeeded indicator and textual error description – so now my code can be simplified to this:&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;private&lt;/span&gt; &lt;span class="n"&gt;Result&lt;/span&gt; &lt;span class="nf"&gt;SendReport&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&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="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;report&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;GetReport&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="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;validationResult&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;ValidateReport&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;report&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;validationResult&lt;/span&gt;
        &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="nf"&gt;SendReport&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;validationResult&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Value&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;validationResult&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;The minimalists can see we don’t even need the report variable any more – so the first couple of code lines can be combined into one line (though I wouldn’t recommend that for the sake of readability).&lt;/p&gt;

&lt;p&gt;Now let’s take a look on how the &lt;code&gt;ValidateReport&lt;/code&gt; method might look like: We know it returns a &lt;code&gt;Result&amp;lt;T&amp;gt;&lt;/code&gt;, takes in an instance of T as a parameter, and runs some tests on it. Assume the following code, for example:&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;private&lt;/span&gt; &lt;span class="n"&gt;Result&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;Report&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;ValidateReport&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Report&lt;/span&gt; &lt;span class="n"&gt;report&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;report&lt;/span&gt; &lt;span class="k"&gt;is&lt;/span&gt; &lt;span class="k"&gt;null&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;Result&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;Report&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;.&lt;/span&gt;&lt;span class="nf"&gt;Fail&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"report is null."&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;report&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;SubReports&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Count&lt;/span&gt; &lt;span class="p"&gt;==&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;Result&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;Report&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;.&lt;/span&gt;&lt;span class="nf"&gt;Fail&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"report has no sub reports."&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="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;IsNullOrEmpty&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;report&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Author&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;Result&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;Report&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;.&lt;/span&gt;&lt;span class="nf"&gt;Fail&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"report has no author."&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;report&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;PublishDate&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;=&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;AddYears&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="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;Result&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;Report&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;.&lt;/span&gt;&lt;span class="nf"&gt;Fail&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"report is too old."&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;Result&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;Report&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;.&lt;/span&gt;&lt;span class="nf"&gt;Success&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;report&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;Pretty self explanatory, right? I like that in a code, it’s readable, simple and maintainable.&lt;br&gt;
On the other hand, however, this code is also kind of repetitive, and I’m a big fan of DRY.&lt;br&gt;
So to reduce the amount of repeating in my code, I’ve also overloaded the | and &amp;amp; operators, and to enable short-circuit conditions, I’ve also overloaded the true and false operators.&lt;/p&gt;

&lt;p&gt;With this cool new feature I’ve added I can write the code in a more concise manner:&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;private&lt;/span&gt; &lt;span class="n"&gt;Result&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;Report&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;ValidateReport&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Report&lt;/span&gt; &lt;span class="n"&gt;report&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;IsValid&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"report is null."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="p"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="k"&gt;is&lt;/span&gt; &lt;span class="k"&gt;null&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nf"&gt;IsValid&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"report  has no sub reports."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="p"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;SubReports&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Count&lt;/span&gt; &lt;span class="p"&gt;==&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nf"&gt;IsValid&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"report has no author."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="p"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;IsNullOrEmpty&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Author&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
        &lt;span class="p"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nf"&gt;IsValid&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"report is too old."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="p"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;PublishDate&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;=&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;AddYears&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="n"&gt;Result&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;Report&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;IsValid&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;errorMessage&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Predicate&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;Report&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;failPredicate&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;failPredicate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;report&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="n"&gt;Result&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;Report&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;.&lt;/span&gt;&lt;span class="nf"&gt;Fail&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;errorMessage&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Result&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;Report&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;.&lt;/span&gt;&lt;span class="nf"&gt;Success&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;report&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;I’ve uploaded the &lt;code&gt;Result&lt;/code&gt; and &lt;code&gt;Result&amp;lt;T&amp;gt;&lt;/code&gt; classes as a GitHub repository called &lt;a href="https://github.com/Peled-Zohar/ResultOf"&gt;ResultOf&lt;/a&gt;, under &lt;a href="https://github.com/Peled-Zohar/ResultOf/blob/master/LICENSE"&gt;MIT licence&lt;/a&gt; which basically means everyone can use it for is free.&lt;br&gt;
Both classes are completely documented and the &lt;a href="https://github.com/Peled-Zohar/ResultOf/blob/master/README.md"&gt;README.md&lt;/a&gt; file contains usage examples.&lt;/p&gt;

</description>
      <category>csharp</category>
      <category>dotnet</category>
    </item>
    <item>
      <title>c#9 is finally here (this is not about init-only or records)</title>
      <dc:creator>Zohar Peled</dc:creator>
      <pubDate>Sun, 15 Nov 2020 08:13:15 +0000</pubDate>
      <link>https://dev.to/peledzohar/c-9-is-finally-here-this-is-not-about-init-only-or-records-c57</link>
      <guid>https://dev.to/peledzohar/c-9-is-finally-here-this-is-not-about-init-only-or-records-c57</guid>
      <description>&lt;p&gt;c# 9 and .Net 5 are finally officially released, and everybody blogs about init-only properties and records - which are very exciting and long-awaited features that I'm sure will be used a lot and contribute a lot to code quality.&lt;/p&gt;

&lt;p&gt;However, I would like to address another great thing about c# 9 that I didn't see a lot of bloggers excited about - and that is the &lt;a href="https://docs.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-9#pattern-matching-enhancements"&gt;improvements of pattern matching.&lt;/a&gt; Specifically, the adding of the &lt;code&gt;not&lt;/code&gt; keyword - as it relates to an older post I've published almost exactly a year ago: &lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag__link"&gt;
  &lt;a href="/peledzohar" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--xyrtqX8O--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/practicaldev/image/fetch/s--9GfB5G11--/c_fill%2Cf_auto%2Cfl_progressive%2Ch_150%2Cq_auto%2Cw_150/https://dev-to-uploads.s3.amazonaws.com/uploads/user/profile_image/226237/15c9fcea-0929-4346-b584-9ff84902de8d.jpeg" alt="peledzohar image"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="/peledzohar/the-perfect-non-null-test-4ohm" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;The perfect non-null test&lt;/h2&gt;
      &lt;h3&gt;Zohar Peled ・ Nov 13 '19 ・ 3 min read&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#csharp&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;
&lt;br&gt;
In c# 9, We finally actually do have the perfect non-null test, and it's way better than &lt;code&gt;x is object&lt;/code&gt; because it's much, much more readable:&lt;br&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="k"&gt;is&lt;/span&gt; &lt;span class="n"&gt;not&lt;/span&gt; &lt;span class="k"&gt;null&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="cm"&gt;/* No explanation needed... */&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;See when I first started using x is object in my code, My team leader have complained that it's less readable than the  x != null we had all over our code base. I actually had to convince him that this is a better option. With the c#9 new syntax, anyone reading the code that has even minimal knowledge of c# and the English language can instantly understand it - which finally, makes it truly the perfect non-null test.&lt;/p&gt;

</description>
      <category>csharp</category>
      <category>dotnet</category>
    </item>
    <item>
      <title>Fashionably late but I've finally joined Twitter</title>
      <dc:creator>Zohar Peled</dc:creator>
      <pubDate>Mon, 09 Nov 2020 12:52:33 +0000</pubDate>
      <link>https://dev.to/peledzohar/fashionably-late-but-i-ve-finally-joined-twitter-1gfi</link>
      <guid>https://dev.to/peledzohar/fashionably-late-but-i-ve-finally-joined-twitter-1gfi</guid>
      <description>&lt;p&gt;I'm not really sure why I did that - I'm not really a social media kind of guy (Don't even have a facebook account). I think it's mainly an effort to stay updated with tech by following .Net groups and professionals, and perhaps another channel to publish &lt;a href="https://zoharpeled.wordpress.com/"&gt;What the # do I know&lt;/a&gt;.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Role based security database design</title>
      <dc:creator>Zohar Peled</dc:creator>
      <pubDate>Sat, 07 Nov 2020 19:51:21 +0000</pubDate>
      <link>https://dev.to/peledzohar/role-based-security-database-design-m2h</link>
      <guid>https://dev.to/peledzohar/role-based-security-database-design-m2h</guid>
      <description>&lt;p&gt;(First published on &lt;a href="https://zoharpeled.wordpress.com/2020/11/07/role-based-security-database-design/"&gt;What The # Do I Know?&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I’ve recently got one more upvote to my second most upvoted answer on StackOverflow, bringing the score of that answer to a nice round figure of 60. This motivated me to write this blog post, in an attempt to improve that answer by adding some background.&lt;/p&gt;

&lt;p&gt;I’m not going to explain all there is to know about role-based security – first, because that will require an awful lot of time for me to study this subject extensively and second, well, it’s because I like to keep things as simple as possible.&lt;br&gt;
If you want to learn this in depth you can always start with &lt;a href="https://en.wikipedia.org/wiki/Role-based_access_control"&gt;Wikipedia&lt;/a&gt; and see where that takes you.&lt;/p&gt;

&lt;p&gt;That being said, we do need a minimal background – so: Role-based security (A.K.A. role-based access control or RBAC) is a security approach that allows access to certain resources (A.K.A securable) based on different roles the authorized users might have.&lt;br&gt;
There are four main entities involved in role based security:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Subject – (A.K.A User) which is the user that use the system. It can be either a human or an automated process – doesn’t matter.&lt;/li&gt;
&lt;li&gt;Resource (A.K.A Securable), which is a part of the application which you want to secure.&lt;/li&gt;
&lt;li&gt;Permission, which is granted on a resource. Permissions defines the actions that a subject might perform on (or with) a resource.&lt;/li&gt;
&lt;li&gt;Role, which is a collection of permissions on a specific collection of resources.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Different permissions might be relevant to different resources – for instance – Suppose your application contains information pages and different forms for the user to fill out – So Read permission is relevant to both information pages and forms, however Write permission is only relevant to forms.&lt;/p&gt;

&lt;p&gt;In this post, I’m going to show the design of a very simple permissions approach, which is all or nothing – so I won’t be dealing with permissions at all – the roles are going to be linked to the resources directly – so this design only have three entities: The subject, the role and the resource – and the connections between them would simply be subject to role (many to many), role to resource (many to many) – this means we will need only five tables on our database.&lt;/p&gt;

&lt;p&gt;Please note that I’m not going to touch authentication issues in this post, but only describe the authorization system. If you’re not sure what’s what – authentication is the process of identifying a user (usually using a a combination of username / password) and authorization is the process of allowing / denying access to resources.&lt;/p&gt;

&lt;p&gt;So – assuming the authentication process is already handled and you have your users table, let’s describe the tables needed for role based authorization.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;User (user id (PK), user name (unique), password (salted and hashed!), first name, last name, phone etc’)&lt;/li&gt;
&lt;li&gt;Role (role id (PK), role name (unique), role description)&lt;/li&gt;
&lt;li&gt;Resources (resource id (PK), resource name (unique))&lt;/li&gt;
&lt;li&gt;User To Role (user id, role id) – PK is both columns combined&lt;/li&gt;
&lt;li&gt;Role to Resource (role id, resource id) – PK is both columns combined&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This database design provides a basic yet flexible role base security, making it super simple to create and maintain different roles – making the entire authorization of your software that much easier.&lt;/p&gt;

</description>
      <category>database</category>
      <category>sql</category>
    </item>
  </channel>
</rss>
