<?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: Stephany Henrique A</title>
    <description>The latest articles on DEV Community by Stephany Henrique A (@rickab10).</description>
    <link>https://dev.to/rickab10</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%2F32684%2F9fe44010-96fc-42a0-8d93-7660b0e525c5.jpg</url>
      <title>DEV Community: Stephany Henrique A</title>
      <link>https://dev.to/rickab10</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rickab10"/>
    <language>en</language>
    <item>
      <title>Exagerando na cobertura de código? Aprenda agora e veja que menos, é mais!</title>
      <dc:creator>Stephany Henrique A</dc:creator>
      <pubDate>Wed, 24 May 2023 19:55:36 +0000</pubDate>
      <link>https://dev.to/rickab10/exagerando-na-cobertura-de-codigo-aprenda-agora-e-veja-que-menos-e-mais-36me</link>
      <guid>https://dev.to/rickab10/exagerando-na-cobertura-de-codigo-aprenda-agora-e-veja-que-menos-e-mais-36me</guid>
      <description>&lt;p&gt;Fala Dev! Você ou seu time tem uma preocupação excessiva sobre a cobertura de código? Se sim, essa mensagem é especial para você e no vídeo de hoje vou tentar explicar os maleficios que isso pode trazer para o seu código.&lt;/p&gt;

&lt;p&gt;Só clicar no link abaixo e aproveitar!&lt;/p&gt;

&lt;p&gt;(&lt;a href="https://www.youtube.com/watch?v=-Z9uM4HLzMk"&gt;https://www.youtube.com/watch?v=-Z9uM4HLzMk&lt;/a&gt;)&lt;/p&gt;

</description>
      <category>testing</category>
      <category>development</category>
      <category>test</category>
    </item>
    <item>
      <title>Setting a timeout in distributed services is a good practice to avoid side effects</title>
      <dc:creator>Stephany Henrique A</dc:creator>
      <pubDate>Mon, 15 Jun 2020 11:45:11 +0000</pubDate>
      <link>https://dev.to/rickab10/setting-a-timeout-in-distributed-services-is-a-good-practice-to-avoid-side-effects-4i9c</link>
      <guid>https://dev.to/rickab10/setting-a-timeout-in-distributed-services-is-a-good-practice-to-avoid-side-effects-4i9c</guid>
      <description>&lt;p&gt;You can be working with monolithic systems and even so you may have a service distributed that helps your system in some tasks. My tip is: take care of this integration because your system will be harmed at some point, and in this article, I will explain why.&lt;/p&gt;

&lt;p&gt;In the last week, my team and I had a problem with an integration that our system makes with another system. That's why I will explain what the system does before how I discovered the problem. &lt;/p&gt;

&lt;p&gt;The system that I work with has the function of manage documents of the client. The client inserts documents, and any time it can be searched or signed with a flow that there are in the application. Basically this is the system core with more features 😃.&lt;/p&gt;

&lt;p&gt;When I insert a document, it needs to be stored somewhere, and for this, we use the &lt;a href="http://min.io/"&gt;min.io&lt;/a&gt; tool. With min.io the application can store in any place like Google, Azure, AWS, Local, and others. I do not need to create a code instruction for each vendor. We are using &lt;a href="http://min.io/"&gt;min.io&lt;/a&gt; for about 1 year and I appreciate it because I do not need to waste time creating something that &lt;a href="http://min.io/"&gt;min.io&lt;/a&gt; already implements, I can focus on the application core.&lt;/p&gt;

&lt;p&gt;But this week the client reported a problem to view documents, it was very slow. My first thought was to see the &lt;a href="http://min.io/"&gt;min.io&lt;/a&gt; server and to my surprise, it was working. So, what was the problem? In order to analyze better, I opened the Application Insights Monitor from Microsoft, and there I saw that the connection with &lt;a href="http://min.io/"&gt;min.io&lt;/a&gt; was slow.&lt;/p&gt;

&lt;p&gt;Usually, the &lt;a href="http://min.io/"&gt;min.io&lt;/a&gt; connection responds in 50ms. I know this because I see this information at Application Insights. But on that day, it was responding in 10min. What the fuck? In short, the problem was between my system and &lt;a href="http://min.io/"&gt;min.io&lt;/a&gt;, would it be network? I think so.&lt;/p&gt;

&lt;p&gt;If you do not have a monitoring system, you can not discover this problem. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--D4-HAmio--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/sgjpzvcoehvxsxlm03u2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--D4-HAmio--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/sgjpzvcoehvxsxlm03u2.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I started the see all connections with &lt;a href="http://min.io"&gt;min.io&lt;/a&gt; and I saw many long connections, you can note in the image above one example, I saw many equals this in that day. In my conclusion the min.io was not the problem, the problem was the network since at the min.io server everything was working.&lt;/p&gt;

&lt;p&gt;What problem did that bring? My system was waiting for a response from min.io, therefore it was waiting for many minutes. You must know that each web server has a finite number of threads to process requests from users and with this problem, many threads were stuck with the connections from &lt;a href="http://min.io/"&gt;min.io&lt;/a&gt;. The side effect was that my system could not serve other users. Did you understand the problem?&lt;/p&gt;

&lt;p&gt;If you read the &lt;strong&gt;&lt;em&gt;Fallacies of Distributed Computing&lt;/em&gt;&lt;/strong&gt;, you will see that network is not reliable, so we must prevent any problems that may happen, but how? Let's thought together, I am not the owner of min.io neither of the network, but I am the owner of my system, therefore, we can work to our system get "smarter".&lt;/p&gt;

&lt;h3&gt;
  
  
  Set a timeout
&lt;/h3&gt;

&lt;p&gt;You already know that any system will fail or gets slow at some point, so we must prevent this, for that not happen, we can use the Timeout pattern to cut the connection and helps the system to fail&lt;br&gt;
"gracefully".&lt;/p&gt;

&lt;p&gt;There are many timeout tools to many languages, I work with .Net and I can use the Polly, &lt;a href="http://www.thepollyproject.org/"&gt;http://www.thepollyproject.org/&lt;/a&gt;. My tip is, do not invent the wheel, never try to create your own tool when it already exists. Repeat with me, "I will not create my own tool".&lt;/p&gt;
&lt;h3&gt;
  
  
  How I can use the polly?
&lt;/h3&gt;

&lt;p&gt;First, you must install the Polly in your project, then we create a "policy", according to the code below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="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;timeOutPolicy&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Policy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;TimeoutAsync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;TimeoutStrategy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Pessimistic&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Now we execute our code wrapped by a timeout police.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;timeOutPolicy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ExecuteAsync&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;_clienteMinIo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;GetObjectAsync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;_nomeDoBucketNoMinIo&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="s"&gt;$"&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;_nomeDaPastaNoMinIo&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s"&gt;/&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;nomeDoArquivoComCaminho&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;arquivoRetornado&lt;/span&gt; &lt;span class="p"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;ObterDadosDo&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;arquivoRetornado&lt;/span&gt;&lt;span class="p"&gt;)));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Note that I created a policy that has a timeout with 10s, if in 10s our code, "GetObjectAsync", it is not executed, the policy starts and ends the task.&lt;/p&gt;

&lt;p&gt;Did I finish my job? No, there is a problem still. The &lt;a href="http://min.io/"&gt;min.io&lt;/a&gt; is executing in an async way, so even when I finish the thread, the connection with &lt;a href="http://min.io/"&gt;min.io&lt;/a&gt; server still occurs. So I created the code below to cancel the connection using a CancelationToken. With Polly timeout, we can use the func "OnTimeoutAsync" and execute some code when the timeout occurs.&lt;br&gt;
&lt;/p&gt;

&lt;div class="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;cancellationTokenSource&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;CancellationTokenSource&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;cancellationToken&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;cancellationTokenSource&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Token&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;timeOutPolicy&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Policy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;TimeoutAsync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;TimeoutStrategy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Pessimistic&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; 
        &lt;span class="k"&gt;async&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;time&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;task&lt;/span&gt;&lt;span class="p"&gt;)&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;await&lt;/span&gt; &lt;span class="n"&gt;Task&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;span class="p"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;cancellationTokenSource&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Cancel&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;
            &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;Exception&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Min.io não responde"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;timeOutPolicy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ExecuteAsync&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;_clienteMinIo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;GetObjectAsync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;_nomeDoBucketNoMinIo&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s"&gt;$"&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;_nomeDaPastaNoMinIo&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s"&gt;/&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;nomeDoArquivoComCaminho&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;arquivoRetornado&lt;/span&gt; &lt;span class="p"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;ObterDadosDo&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;arquivoRetornado&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;cancellationToken&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;The CancelationToken class is something from C# and is normal to using this when we work with async methods. With the code above, the connection is canceled when I call the instruction "cancellationTokenSource.Cancel()".&lt;/p&gt;

&lt;h3&gt;
  
  
  How I tested my code in my machine?
&lt;/h3&gt;

&lt;p&gt;In my machine, the &lt;a href="http://min.io"&gt;min.io&lt;/a&gt; works perfectly, but I want to test when I have a long connection or a bandwidth problem. For this, I used &lt;a href="https://github.com/Shopify/toxiproxy"&gt;https://github.com/Shopify/toxiproxy&lt;/a&gt;, a nice tool that helped me to simulate a connection problem with min.io. With Toxi Proxy you can test your application in many chaos scenarios.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ru775rfr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/iuovkyvltjeh437coquw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ru775rfr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/iuovkyvltjeh437coquw.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this image, you can see, in my machine, my document upload that had a duration of 15min. This test I did before I insert Polly in my project.&lt;/p&gt;

&lt;h3&gt;
  
  
  Does &lt;a href="http://min.io/"&gt;Min.io&lt;/a&gt; still have a network problem?
&lt;/h3&gt;

&lt;p&gt;As I said before, I am not the network owner, therefore I opened a ticket with those who take care of the network to see the problem. But now, my application does not have slow connections and the threads are free.&lt;/p&gt;

&lt;p&gt;I hope I helped you with a problem that happened to me this week. See you later!&lt;/p&gt;

</description>
      <category>microservices</category>
      <category>polly</category>
      <category>csharp</category>
      <category>timeout</category>
    </item>
    <item>
      <title>Making it simple in software development is a principle, did you know?</title>
      <dc:creator>Stephany Henrique A</dc:creator>
      <pubDate>Thu, 23 Apr 2020 00:55:16 +0000</pubDate>
      <link>https://dev.to/rickab10/making-it-simple-in-software-development-is-a-principle-did-you-know-5fm4</link>
      <guid>https://dev.to/rickab10/making-it-simple-in-software-development-is-a-principle-did-you-know-5fm4</guid>
      <description>&lt;p&gt;From time to time, we see someone making a feature more complex than necessary, but do you know that make simple is a principle in software development? Knowing the KISS and YAGNI principles.&lt;/p&gt;

&lt;p&gt;When I started to develop software, I used to see many people talking about subjects like Design Patter. So, I read many books about It. As a consequence, I used to think that if I knew Architecture, Design Patterns, and other things, I would be a great developer, but how I used to thought was my error. Below I explain why.&lt;/p&gt;

&lt;p&gt;When I started my first job, everything I used to do was complicated. A class obligatorily had a patter, A project must have the architecture "XPTO" and I loved that. I was happy when someone asked for an explanation because he/she didn't understand. I was the guy that used to complicate everything because the "Author" said this or that.&lt;/p&gt;

&lt;p&gt;So, one day I saw someone like me. That person used to love to do just complicated things and our project were late. You may be asking yourself, how complicated? Well, here we go&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;He created DTOs in the infrastructure layer and the same in the application layer. Why? Because an author said that each layer must have its own DTO. (I did not find this author, but...)&lt;/li&gt;
&lt;li&gt;All the devs knew very well about SQL Server or Oracle, but he wanted to use MongoDB. Why? For no reason, just because it was fashionable.&lt;/li&gt;
&lt;li&gt;Our coverage tests should be at 100%. He used to test until filter class from &lt;a href="http://asp.net/"&gt;ASP.NET&lt;/a&gt; (Microsoft had tested this before :)).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;As you can see, everything could be done in half the time, but we always used to do what he wanted because he was the project architect. Only to remember, our project was still late. So one day when our PO asked a feature to log all events from the user and our architect asks one month to do this because of "complexity" and we should do the patter "X", I exploded! :(.&lt;/p&gt;

&lt;p&gt;Our system was very little, our company did not make money with this software, only wanted to make the customer happy to get others "problems" and make money. &lt;/p&gt;

&lt;p&gt;Do you see this guy in your company? I see and sometimes I and you are this guy :(. Usually, when we want to make something more complex than it really is, it is because we want to challenge ourselves, prove that we are capable. Or sometimes we put many exceptions to the feature, that this feature gets more complex than necessary. For these reasons, we make things complex and not simple.&lt;/p&gt;

&lt;p&gt;Make the simple is difficult, Steve Jobs said once a time:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Simple can be harder than complex: You have to work hard to get your thinking clean to make it simple. But it’s worth it in the end because once you get there, you can move mountains.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;For this, there are two principles, KISS and YAGNI.&lt;/p&gt;

&lt;p&gt;You can see the kiss definition at &lt;a href="https://en.wikipedia.org/wiki/KISS_principle"&gt;https://en.wikipedia.org/wiki/KISS_principle&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;KISS, an acronym for "keep it simple, stupid" or "keep it stupid simple", is a design principle noted by the U.S. Navy in 1960.[1][2] The KISS principle states that most systems work best if they are kept simple rather than made complicated; therefore, simplicity should be a key goal in design, and unnecessary complexity should be avoided.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;And the YAGNI you can see at &lt;a href="https://deviq.com/yagni/"&gt;https://deviq.com/yagni/&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;YAGNI, or “You Ain’t Gonna Need It” (or “You Aren’t Gonna Need It”), emerged as one of the key principles of Extreme Programming. Put another way, the principle states:&lt;br&gt;
“Always implement things when you actually need them, never when you just foresee that you may need them.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I love these principles because these help me to focus on a feature and doing just the necessary, but how can I think simple?&lt;/p&gt;

&lt;p&gt;The first mistake, when we do not know about business value. You must know the business value, not only how to do. What does value this feature brings to the client? Will I make good money? I know that sometimes we do not know all about the feature, but you must not overload with many exceptions or things from your head (second mistake).&lt;/p&gt;

&lt;p&gt;But in my code, how can I use this principles?&lt;/p&gt;

&lt;p&gt;Martin Fowler in his article said a great example at &lt;a href="https://martinfowler.com/bliki/Yagni.html"&gt;https://martinfowler.com/bliki/Yagni.html&lt;/a&gt;. The example was two features similar but not the same, a feature was to do now and the second to six months later. But the team wanted to do the first feature already thinking in the second feature. How many times you and your team did not do that? "Let's get the code ready".&lt;/p&gt;

&lt;p&gt;Where is the mistake?&lt;/p&gt;

&lt;p&gt;First, you know about the first feature, you discussed this feature. The second feature you do not know everything still. Second, can you imagine the code that you will wast because you do not know everything? If did the P.O. passe a false information? If the second feature is not necessarily more? So you ain't gonna need it. &lt;/p&gt;

&lt;p&gt;Someone can talk to me, "But in the future, I can change all the code because I did not prepare correctly". Yes, you will change the code, but now you need this code and now you know about the business.&lt;/p&gt;

&lt;p&gt;My conclusion, if you do not need this still, not make it and if you will make, make it simple.&lt;/p&gt;

&lt;p&gt;So I hope to help you to open your head, se you next time.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>languages</category>
      <category>developer</category>
      <category>career</category>
    </item>
    <item>
      <title>Scrutor, automatic dependency injection for ASP.NET Core</title>
      <dc:creator>Stephany Henrique A</dc:creator>
      <pubDate>Sat, 11 Apr 2020 22:53:26 +0000</pubDate>
      <link>https://dev.to/rickab10/scrutor-automatic-dependency-injection-for-asp-net-core-4pjm</link>
      <guid>https://dev.to/rickab10/scrutor-automatic-dependency-injection-for-asp-net-core-4pjm</guid>
      <description>&lt;p&gt;If you set up the dependency injection container by hand, you need to know this library for .Net Core. With this lib, you get free to take care of what is important. &lt;/p&gt;

&lt;p&gt;Do not you know about dependency injection? Here you will find an explanation about this technique &lt;a href="https://en.wikipedia.org/wiki/Dependency_injection"&gt;https://en.wikipedia.org/wiki/Dependency_injection&lt;/a&gt;. Please, stop a moment and try to learn about this important concept.&lt;/p&gt;

&lt;p&gt;Hi guys! Today I write a fast article about .Net Core, I will explain about Scrutor. This is a nice lib that configures our classes to the dependency injection container. When I work with .Net Core and I need to inject a service (class) at a controller or another class I must configure each service that I need. This instruction is done at ConfigureServices method. So here is going an example.&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;services.AddScoped&amp;lt;SolicitadorDeManutencao, SolicitadorDeManutencao&amp;gt;();
services.AddScoped&amp;lt;FabricaDeSolicitacaoDeManutencao, FabricaDeSolicitacaoDeManutencao&amp;gt;();
services.AddScoped&amp;lt;AnaliseDeAprovacaoDaSolicitacaoDeManutencao, AnaliseDeAprovacaoDaSolicitacaoDeManutencao&amp;gt;();
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The ConfigureServices method is responsible for configuring all services of my project, there I configure EF Core, Identity, MVC Controller. The .Net Core uses this configuration to know all services that are necessary and to instance this services when requested. If I do not configure, the services will not work.&lt;/p&gt;

&lt;p&gt;As you see above, each class was configured to be injected when needed. Therefore if a controller will use one of the above classes, the .Net Core knows how to inject because it was configured as a service.&lt;/p&gt;

&lt;p&gt;This method tends to be very large, imagine a project that has 30 services, you will configure the 30 services. I do not like this, because other frameworks like Spring Boot I do not need to make this configuration, I just decorate the class as [Service]. The good thing, with Scrutor this is over.&lt;/p&gt;

&lt;p&gt;If you desire to learn more about Scrutor, please, access h&lt;a href="https://github.com/khellang/Scrutor"&gt;ttps://github.com/khellang/Scrutor&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;To configure Scrutor in my project, I need two steps&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Add package&lt;/li&gt;
&lt;li&gt;Configure lib in method Configure Service&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Let's start.&lt;/p&gt;

&lt;p&gt;I like to use .Net CLI, so I write in a terminal&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dotnet add package Scrutor
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Ok, now in ConfigureServices method in the Startup class, let's write some code&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;services.Scan(sc =&amp;gt;
{
    sc.FromCallingAssembly()
        .FromAssemblies(typeof(Program).Assembly)
        .AddClasses()
        .AsSelf();
});
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;A fast explanation, when I use o service Scan, I'm configuring all classes to be working as a service. See that I'm using the "Program" class as a reference to my library, where are my other classes. I can input any class of this library.&lt;/p&gt;

&lt;p&gt;I'm configuring all classes from this library (where the Program class is). Normally I do not like to add all classes to be configured, for example, I do not need to configure Entities or Values Object, because these classes do not need. Then I have a trick.&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
public class ServiceAttribute : Attribute
{

}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;I can create a class attribute to decorate all classes that are services. For example.&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[Service]
public class ConfirmacaoDeUsuario
{
    private readonly UserManager&amp;lt;IdentityUser&amp;gt; _userManager;
    private readonly ApplicationDbContext _context;
        ...
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Now, I can change my code where I use Scrutor to configure only classes with the attribute of type Service.&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;services.Scan(scan =&amp;gt; scan
    .FromAssemblyOf&amp;lt;Program&amp;gt;()
        .AddClasses(@class =&amp;gt; @class.WithAttribute&amp;lt;ServiceAttribute&amp;gt;())
        .UsingRegistrationStrategy(RegistrationStrategy.Skip)
        .AsSelf()
);
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Now, I am using also the option called "UsingRegistrationStrategy", this means to not configure a class more than once.&lt;/p&gt;

&lt;p&gt;Guys, I hope that you have liked and I see you next time.&lt;/p&gt;

</description>
      <category>dotnetcore</category>
      <category>scrutor</category>
      <category>dependencyinjection</category>
    </item>
    <item>
      <title>Everybody says to know, but just some people know when using #microservice. Do you know?</title>
      <dc:creator>Stephany Henrique A</dc:creator>
      <pubDate>Fri, 31 Jan 2020 22:34:39 +0000</pubDate>
      <link>https://dev.to/rickab10/everybody-says-to-know-but-just-some-people-know-when-using-micro-service-do-you-know-22g7</link>
      <guid>https://dev.to/rickab10/everybody-says-to-know-but-just-some-people-know-when-using-micro-service-do-you-know-22g7</guid>
      <description>&lt;p&gt;Today in all teams when one new solution must be created, the micro-services term is thought before the business. But, do we have knowledge about this subject? Is it better for our context? Does it work for any context?&lt;/p&gt;

&lt;p&gt;The micro-service definition is simple following the site microservices.io:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Micro-services - also known as the micro-service architecture - is an architectural style that structures an application as a collection of services that are&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Highly maintainable and testable&lt;/li&gt;
&lt;li&gt;Loosely coupled&lt;/li&gt;
&lt;li&gt;Independently deployable&lt;/li&gt;
&lt;li&gt;Organized around business capabilities&lt;/li&gt;
&lt;li&gt;Owned by a small team&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;p&gt;For me the biggest problem is understanding what is "Organized around business capabilities", but this I will explain after. In theory, anybody DEV with little expertise can do a micro-service and update his/her curriculum and says: I did one and understand what is micro-service. &lt;/p&gt;

&lt;p&gt;The problem comes after and together with the headache. Once a time I saw someone tell: The problem of micro-services is the word "micro", what this means? When we see the word micro, we think that all services must be micro-micro. It starts a problem with other services because of the coupling. So you start doing the opposite of "Loosely coupled". This happens because we study the subject of a literary way and we do not have a deep study of other things.&lt;/p&gt;

&lt;p&gt;Recently in a project that I participated in, I saw that we went affected by the wave called micro-services. Why? Because we created two services that in the end could be one. How do I know? Because there were many coupling between services. Note, I said there were because we corrected that error. The same information that there were in service A, almost all, there were in service B or service B was needed.&lt;/p&gt;

&lt;p&gt;I know information copy there is when we work with micro-services. But when all domain is copied to another service or it is much used by another service, we must think whether the service is not wrong.&lt;/p&gt;

&lt;p&gt;With micro-services, we must think before in problems that start to have but before there were not. For example: having loosely coupling services forces us to work with two things: a database for each service and a broker service to message exchange. When your services call directly other services, in case of failure of one service, all others also fail. Do you want to create services with direct communication between them? You must think better about it.&lt;/p&gt;

&lt;p&gt;What about Kafka ou RabitMQ? You can be thinking about these tools, it's OK. These tools are very simple to insert in your solution, but the problem comes up when you have more a tool to take care. Ops! Take care? Yes, We must not only insert tools but take care of them also, ok? This concern is not necessary when we have a monolith system.&lt;/p&gt;

&lt;p&gt;I wrote the word "monolith" and whether you are horrified, it is because you already went affected by the wave and at this moment you can be creating high costs to your company without need. Note I said you can...&lt;/p&gt;

&lt;p&gt;Have a monolith system is not a problem, the problem is to divide a system in half because you guess that could be many services to attend yourself or because you are studying and liked. You are not being honest.&lt;/p&gt;

&lt;p&gt;Once a time, I participated in a project that on the first day the "DEVs" showed the services in which we should create. All drawing was created by the IT team and not the business. Six months after, all services created went deleted and created a unique service and a database. Why did they do rollback? Because the division became bad, the services were so micro that got bad to keep. In that case, micro-service was a good option, but they started by technology and not by business.&lt;/p&gt;

&lt;p&gt;More a time, they did not study the item "Organized around business capabilities", they first prioritize the technologies.&lt;/p&gt;

&lt;p&gt;But after all, when must I create a micro-service? A thing that I learned time ago is that the services must not be created by IT person but the business must speak the service. How?&lt;/p&gt;

&lt;p&gt;A good exercise to know to divide your business in services is first listening to your business. E-Commerce is a good example. A product has many meanings in a company. A product to the marketing has a name, description, images and a price. That product will be shown on the site. The same product to the stock needs only the amount of product, they are concerned with keeping the product on stock. Stock and Marketing have different people, they speak different languages ​​because the product has meanings different for them. Now you know what means "Organized around business capabilities". For me, while we talk the same language we do not need to create another service, but when you cross the border and have other meanings, you need to create another service. &lt;/p&gt;

&lt;p&gt;In the cases above, the services were divided wrong, this is the same that using the CQRS for a system that has 4 screens, CRUD. Nowhere you will learn how to divide in services, you have to learn by yourself and gain experience. Whether you desire to learn about micro-services, I orient you learning about DDD, Domain-Driven Design, before. DDD has many patterns like obliques language, domain experts and bounded context that help you to learn about micro-services. After you can learn about Cache, Messaging, API Gateway, and others.&lt;/p&gt;

&lt;p&gt;You do not need to be stuck in a monolith system, you can apply a distributed system to a monolith system. For example, in my company, we have a system that manages docs for our clients. These docs when the user does the upload it is processed to extract text through OCR to improve the search after. But this process was slow because the extract was done together with the upload. Using a docker and a mini-program (Worker), we change to process the OCR after. The process now is done by another solution, a micro solution, and with that, the user does not complain because now the upload is much fast.&lt;/p&gt;

&lt;p&gt;To conclude, my tip is: Before starting a project thinking in services, study the business, gain knowledge about the subject. Remember yourself, the business talks, listen to it. You can not apply architecture because you like ou because of your ego. You must apply architecture because the business needs. I am not against services ou monolith, I am against using something that I do not need. When I create something that I do not need, my company is that pay the costs and not I.&lt;/p&gt;

&lt;p&gt;I hope you liked it, bye :)&lt;/p&gt;

</description>
      <category>microservices</category>
    </item>
    <item>
      <title>Authenticate, Authorization and Claim. All you need to know in ASP.NET Core</title>
      <dc:creator>Stephany Henrique A</dc:creator>
      <pubDate>Sun, 05 Nov 2017 17:33:57 +0000</pubDate>
      <link>https://dev.to/rickab10/authenticate-authorization-and-claim-all-you-need-to-know-in-aspnet-core-ahn</link>
      <guid>https://dev.to/rickab10/authenticate-authorization-and-claim-all-you-need-to-know-in-aspnet-core-ahn</guid>
      <description>&lt;p&gt;When we are talking about authentication and authorization a mix of mess arrive in your head.&lt;/p&gt;

&lt;p&gt;The first thing that we have to know is: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Authentication is a process to know who you are.&lt;/li&gt; 
&lt;li&gt;Authorization is the process to know if you can do what you want.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Is easier now? I will show an example. &lt;/p&gt;

&lt;p&gt;When you go to access a site and for this is needed inform a login and password, this mean that you need to be authenticated to know who you are. &lt;/p&gt;

&lt;p&gt;You access the site and when you try to access some part, as report or admin module, and the site alert you that lack privilege, this process is called authorization. That is, you have authentication but not authorization.  &lt;/p&gt;

&lt;p&gt;Build an application that take care both authentication and authorization is very hard. But for those who work with ASP.NET Core is recommended to use something called Identity. &lt;/p&gt;

&lt;p&gt;Identity is a feature of ASP.NET Core that facilitate the process to create user account, authentication and user privileges (authorization).  &lt;/p&gt;

&lt;p&gt;Using Identity with Entity Framework get more beautiful, because the Identity will use the Entity Framework's wisdom to access the data base. &lt;/p&gt;

&lt;p&gt;But, where the claim starts? &lt;/p&gt;

&lt;p&gt;Keep calm, I'm going to explain. &lt;/p&gt;

&lt;p&gt;In summary, the claim is an attribute. A person has many claims, below I explain better. &lt;/p&gt;

&lt;p&gt;All person has not an attribute but many. A person has a name, weight, height, birth date and many others. This is claim set.&lt;/p&gt;

&lt;p&gt;Each claim has an issuer, that is, who issued the claim. When I talk that a person has a weight and height, himself is the issuer. But when I talk about social number of a person, the issuer is the federal government. &lt;/p&gt;

&lt;p&gt;Another example. When you make an integration with Facebook and get person data the issuer is Facebook. Do you understand now what is claim and issuer?  &lt;/p&gt;

&lt;p&gt;What if I use Identity, how use claims? &lt;/p&gt;

&lt;p&gt;When the application is using Identity and authenticate a user, as code below, this authentication creates an object of type "ClaimsPrincipal".  &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--0CdEbV1I--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/http://www.stephanybatista.com/wp-content/uploads/2017/10/claim-img1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--0CdEbV1I--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/http://www.stephanybatista.com/wp-content/uploads/2017/10/claim-img1.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For those who do not know Identity, the "SigninManager" class is used to authenticate a user with a name and password. But note, I do not need to access the database to see if the user exists, the Identity with Entity Framework makes this for me. &lt;/p&gt;

&lt;p&gt;Ok, from now any controller has a property called "User" of type "ClaimsPrincipal". For example, when using in debug mode, I get all claims of a user authenticated. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_mi6X-wS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/http://www.stephanybatista.com/wp-content/uploads/2017/10/claim-img2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_mi6X-wS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/http://www.stephanybatista.com/wp-content/uploads/2017/10/claim-img2.png"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;If you desire, you can add others claims. Above I add a claim called "Employeer" through of object "UserManager". &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--oQJiUg9v--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/http://www.stephanybatista.com/wp-content/uploads/2017/10/claim-img3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--oQJiUg9v--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/http://www.stephanybatista.com/wp-content/uploads/2017/10/claim-img3.png"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Note that after create a user, through of method "CreateAsync", I am using the same object to add a claim for user.  &lt;/p&gt;

&lt;p&gt;In this sample, I am giving this attribute for user that is inserted and thus the application can validate that only the users with this attribute can access a part of system. Do you remember when I talked about authorization? Let's do now.&lt;/p&gt;

&lt;p&gt;In order to create this authorization, we must before create our policies in C#. In Startup class, method "ConfigureServices", I insert a policy. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--NBELK12n--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/http://www.stephanybatista.com/wp-content/uploads/2017/10/claim-img4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--NBELK12n--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/http://www.stephanybatista.com/wp-content/uploads/2017/10/claim-img4.png"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Note that I created a policy called "OnlyEmployees" and to meet this the user must have this attribute. &lt;/p&gt;

&lt;p&gt;Created the policy, now the application can deal with authorization in the controllers. In the code below, I am using a controller called "ManageController", where only those who meet the policy can access, otherwise, the user will be redirect to other page with access denied. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Yay67c0v--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/http://www.stephanybatista.com/wp-content/uploads/2017/10/claim-img5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Yay67c0v--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/http://www.stephanybatista.com/wp-content/uploads/2017/10/claim-img5.png"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Like you can see, the logic of attributes and issuers facilitate to manage users in our application. &lt;/p&gt;

&lt;p&gt;&lt;b&gt;Conclusion&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;The Identity facilitates to develop an application that need of user account and authorization. But before, we must know basic concepts as authentication and authorization and claims. &lt;/p&gt;

&lt;p&gt;&lt;b&gt;Did you like this article?&lt;/b&gt; Would you know more about .Net Core? I created a course at Udemy with a cheap price. Access &lt;a href="https://www.udemy.com/aspnet-core-20-learn-concepts-and-creating-an-web-app"&gt;https://www.udemy.com/aspnet-core-20-learn-concepts-and-creating-an-web-app&lt;/a&gt;&lt;/p&gt;

</description>
      <category>authentication</category>
      <category>authorization</category>
      <category>claim</category>
      <category>identity</category>
    </item>
    <item>
      <title>Middlewares In ASP.NET Core. What is it for? Where to use? </title>
      <dc:creator>Stephany Henrique A</dc:creator>
      <pubDate>Mon, 02 Oct 2017 21:06:39 +0000</pubDate>
      <link>https://dev.to/rickab10/middlewares-in-aspnet-core-what-is-it-for-where-to-use-bd6</link>
      <guid>https://dev.to/rickab10/middlewares-in-aspnet-core-what-is-it-for-where-to-use-bd6</guid>
      <description>

</description>
      <category>middleware</category>
      <category>aspnetcore</category>
      <category>netcore</category>
    </item>
    <item>
      <title>.Net Standard and what you need to know about it</title>
      <dc:creator>Stephany Henrique A</dc:creator>
      <pubDate>Wed, 27 Sep 2017 17:40:45 +0000</pubDate>
      <link>https://dev.to/rickab10/net-standard-what-do-you-need-to-know-about-it-3g2</link>
      <guid>https://dev.to/rickab10/net-standard-what-do-you-need-to-know-about-it-3g2</guid>
      <description>&lt;p&gt;.Net Standard is not a new framework. It is something simpler, but very worth to any Microsoft framework where it’s necessary share the code.&lt;/p&gt;

&lt;p&gt;For those that already worked some time with some Microsoft frameworks, knows that developing a code that is reusable to other framework is something complicated. For example, Windows Phone 8.1 and .Net Full Framework.&lt;/p&gt;

&lt;p&gt;That happen because each platform, or flavors, of Microsoft have its class base set. Many times one class is replicated to another platform as shown below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/http%3A%2F%2Fstephanybatista.com%2Fwp-content%2Fuploads%2F2017%2F08%2Fnet-without-standard-768x414.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/http%3A%2F%2Fstephanybatista.com%2Fwp-content%2Fuploads%2F2017%2F08%2Fnet-without-standard-768x414.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Someone can say me that there is something as PCLs, Portable Class Libraries. By creating a project “Core” of type portable, it is possible selecting which frameworks will run. For example, I create a portable library that run on .Net Full Framework, Windows Phone and Xamarin. That works, but that has problem. The PCL will implement a version to each framework selected. I guess this very weird.&lt;/p&gt;

&lt;p&gt;Do you understand the problem? The Microsoft does not have a universal library. there is something that convert to each framework. If pops up a new framework today, you will not to use this framework.&lt;/p&gt;

&lt;p&gt;Correcting, the Microsoft did not have a universal library. Now it has the .Net Standard. &lt;/p&gt;

&lt;p&gt;When .Net Core arrived, the Microsoft thought better and created the .Net Standard. It is not a new Framework, but an interfaces set that the frameworks must implement. That is, if the framework X and Y implement that interface, means that that code is accepted in the framework X and Y. Moreover, if a new platform pops up, as Xamarin, it just must implement this interface.&lt;/p&gt;

&lt;p&gt;But the benefit come now, with .Net Standard, we can have Class Library that has as target to supply implementations for many platforms, .Net Core, Xamarin, .Net Framework and others. I am not using PCL. I am using interfaces.&lt;/p&gt;

&lt;p&gt;The problem of the PCL is that it implement that code to each platform. The same code is built for all platforms that you selected. Other problem, it does not have many classes and with this could cause problem to your project. I has went through this problem when created one windows phone app.&lt;/p&gt;

&lt;p&gt;With this image bellow, you can see that there are not a classes set for a framework, but there are frameworks above of .Net Standard.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/http%3A%2F%2Fstephanybatista.com%2Fwp-content%2Fuploads%2F2017%2F08%2Fnet-with-standard-768x414.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/http%3A%2F%2Fstephanybatista.com%2Fwp-content%2Fuploads%2F2017%2F08%2Fnet-with-standard-768x414.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Currently the .Net Standard is in the version 2.0 and the &lt;a href="https://blogs.msdn.microsoft.com/dotnet/2016/09/26/introducing-net-standard/" rel="noopener noreferrer"&gt;link&lt;/a&gt;&lt;a&gt;&lt;/a&gt; show the framework versions and its implementation to .Net Standard. Each .Net Standard version specifies more interfaces. This mean that we are going to use more frameworks classes that there are not in the last version.&lt;/p&gt;

&lt;p&gt;One analogy that the Microsoft Team uses and I like to explain about this: “The .Net Standard version is compared with HTML version and frameworks are the browsers as Chrome, IE and Firefox”. As the higher the HTML version, more features you can use. But the browser has to accept this version&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Conclusion&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;The Microsoft took a long time but now created a universal interface to be used with many frameworks. Now we do not choose which frameworks we are going to use, we create a code that will be used in many frameworks.&lt;br&gt;
See you later.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Did you like this article?&lt;/b&gt; Would you know more about .Net Core? I created a course at Udemy with a cheap price. Access &lt;a href="https://www.udemy.com/aspnet-core-20-learn-concepts-and-creating-an-web-app" rel="noopener noreferrer"&gt;https://www.udemy.com/aspnet-core-20-learn-concepts-and-creating-an-web-app&lt;/a&gt;&lt;/p&gt;

</description>
      <category>netstandard</category>
      <category>netcore</category>
      <category>dotnet</category>
    </item>
    <item>
      <title>.Net Comand Line Interface (CLI), create a project by terminal</title>
      <dc:creator>Stephany Henrique A</dc:creator>
      <pubDate>Wed, 13 Sep 2017 21:41:50 +0000</pubDate>
      <link>https://dev.to/rickab10/net-comand-line-interface-cli-create-a-project-by-terminal</link>
      <guid>https://dev.to/rickab10/net-comand-line-interface-cli-create-a-project-by-terminal</guid>
      <description>&lt;p&gt;.Net Command Line Interface (CLI) is a new tool essential for development in ASP.NET Core. What do I mean by “essential?” Simple, any person or tool that wants to develop in the new platform of Microsoft must use this tool. It is the first layer of development. The Visual Studio (VS) uses the .Net CLI to build, publish, run and other things. .Net CLI also is cross-platform, that is, it can run in Windows, Apple and Linux and to start with it you must download your distribuition to your SO.&lt;/p&gt;

&lt;p&gt;You may wonder, “Do I need to learn this tool?” Those who work with VS do not need, because internally the VS use the .Net CLI. But when you do not use the VS, it will need to be used. Remember, now I can develop in other tools as Visual Studio Code, Sublime, Vim and others. Therefore, learning about it is good!&lt;/p&gt;

&lt;p&gt;Which can make the person confused it is that some time ago the DNX tool was used, when .Net Core was beta. With the arrival of the ASP.NET Core in production, the DNX was replaced by DOTNET.&lt;/p&gt;

&lt;p&gt;To use the .Net Command Line Interface (CLI) there is a pattern, driver (dotnet) + verb + argument (if there is). Below I explain the other commands:&lt;/p&gt;

&lt;ul&gt;
    &lt;li&gt;“dotnet restore” restores all dependecies needed to project.&lt;/li&gt;
    &lt;li&gt;“dotnet build” compiles the application to validate if there are errors.&lt;/li&gt;
    &lt;li&gt;“dotnet run” runs the application.&lt;/li&gt;
    &lt;li&gt;“dotnet test” runs the tests of application.&lt;/li&gt;
    &lt;li&gt;“dotnet publish” publishes the application.&lt;/li&gt;
    &lt;li&gt;“dotnet pack” creates a Nuget Packages.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To execute a project created, we must execute the command “dotnet run”.&lt;/p&gt;

&lt;p&gt;Let’s see a little working, I’m using Ubuntu 16.04. So, in the images below you can see I creating a web application and run it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/http%3A%2F%2Fwww.stephanybatista.com%2Fwp-content%2Fuploads%2F2016%2F06%2FSelection_004-1024x608.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/http%3A%2F%2Fwww.stephanybatista.com%2Fwp-content%2Fuploads%2F2016%2F06%2FSelection_004-1024x608.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To create a web project, I used:&lt;/p&gt;

&lt;ul&gt;
    &lt;li&gt;“new” to create a new project.&lt;/li&gt;
    &lt;li&gt;“mvc” to create a MVC tempate.&lt;/li&gt;
    &lt;li&gt;“-o” to give a project name.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/http%3A%2F%2Fwww.stephanybatista.com%2Fwp-content%2Fuploads%2F2016%2F06%2FSelection_006-1024x604.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/http%3A%2F%2Fwww.stephanybatista.com%2Fwp-content%2Fuploads%2F2016%2F06%2FSelection_006-1024x604.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After the project created, I access the project folder and can run the project because I created a project template.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/http%3A%2F%2Fwww.stephanybatista.com%2Fwp-content%2Fuploads%2F2016%2F06%2FHome-Page-UsingDotNetCLI-Google-Chrome_009-1024x580.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/http%3A%2F%2Fwww.stephanybatista.com%2Fwp-content%2Fuploads%2F2016%2F06%2FHome-Page-UsingDotNetCLI-Google-Chrome_009-1024x580.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And by last, this is the result.&lt;/p&gt;

&lt;p&gt;By default these are all the commands included, but you can create your own commands, for this, access &lt;a href="https://dotnet.github.io/docs/core-concepts/core-sdk/cli/extensibility.html" rel="noopener noreferrer"&gt;.NET Core CLI extensibility model.&lt;/a&gt;&lt;a&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Conclusion&lt;/p&gt;

&lt;p&gt;.Net Command Line Interface (CLI) is a tool of the interface to develop in the .Net platform. Through it, we can create a new project, restore packages, running and others. With the .Net CLI, code editors can use it for development, because it is cross-platform. Developing in Windows, Linux or Apple already does not make difference in the new platform of Microsoft.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://dotnet.github.io/docs/core-concepts/core-sdk/cli/overview.html" rel="noopener noreferrer"&gt;.NET Core Command Line Tools (CLI)&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Did you like this article?&lt;/b&gt; Would you know more about .Net Core? I created a course at Udemy with a cheap price. Access &lt;a href="https://www.udemy.com/aspnet-core-20-learn-concepts-and-creating-an-web-app" rel="noopener noreferrer"&gt;https://www.udemy.com/aspnet-core-20-learn-concepts-and-creating-an-web-app&lt;/a&gt;&lt;/p&gt;

</description>
      <category>netcore</category>
      <category>dotnetcli</category>
    </item>
    <item>
      <title>Is Entity Framework Core 2.0 Faster?</title>
      <dc:creator>Stephany Henrique A</dc:creator>
      <pubDate>Fri, 08 Sep 2017 14:31:24 +0000</pubDate>
      <link>https://dev.to/rickab10/is-entity-framework-core-20-faster</link>
      <guid>https://dev.to/rickab10/is-entity-framework-core-20-faster</guid>
      <description>&lt;p&gt;.NET Core 2.0 is in production now with many things improved in relation to the .NET Core 1.X. One such improved thing is Entity Framework Core. Thinking about that, I resolve to make a benchmark to see its performance.&lt;/p&gt;

&lt;p&gt;Those who do not know the Dapper, I recommend seeing this project. It is a little ORM, It does not do all that the Entity Framework and NHibernate do, but its query is very fast. In the last years is common to see a project with an ORM and the Dapper to optimize the query.&lt;/p&gt;

&lt;p&gt;Coming back to benchmark, I did something silly, I created the product and category entities, being that a product has a category.&lt;/p&gt;

&lt;p&gt;An observation, I am not a specialist in benchmark or measure code performance, but I liked this package to see the performance. And that is why I am using a package called benchmarkdotnet &lt;/p&gt;

&lt;p&gt;The idea is simple, comparing the insertion, query and query with filter. Of course, that that I make comparing Entity Framework Core 2.0 with Dapper.&lt;/p&gt;

&lt;p&gt;Below you see the finish result.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/http%3A%2F%2Fstephanybatista.com%2Fwp-content%2Fuploads%2F2017%2F08%2Fbenchmark.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/http%3A%2F%2Fstephanybatista.com%2Fwp-content%2Fuploads%2F2017%2F08%2Fbenchmark.jpg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The explication of each method,&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;EfInsert e DapperInsert: EfInsert is used by EF and DapperInsert is used by Dapper. The methods insert the data.&lt;/li&gt;
&lt;li&gt;EfSelect e DapperSelect: EfSelect is used by EF and DapperSelect is used by Dapper. The methods query in the database all entities.&lt;/li&gt;
&lt;li&gt;EfSeletWithFilter and DapperSelectWithFilter: EfSelectWithFilter is uded by EF and DapperSelectWithFilter is used by Dapper. The methods query in the database all products where the category name is “Games”.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Note that in all demonstration the Entity Framework Core 2.0 won. This is good, show that the Microsoft team is really fulfilling with what said about bringing a .Net Core with high performance.&lt;/p&gt;

&lt;p&gt;Whose that still has doubt in relation to use or not the Entity Framework Core 2.0, I believe that now it is a strong option, starting by performance. I created a course that approaching the Entity Framework Core 2.0, following the  &lt;a href="https://www.udemy.com/aspnet-core-20-learn-concepts-and-creating-an-web-app" rel="noopener noreferrer"&gt;link&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If you would like to analyze my benchmark and give me feedback, following the &lt;a href="https://github.com/StephanyBatista/benchmarkef" rel="noopener noreferrer"&gt;link&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Ok Guys, I hope to help you and good week.&lt;/p&gt;

</description>
      <category>netcore</category>
      <category>aspnetcore</category>
      <category>efcore20</category>
    </item>
  </channel>
</rss>
