<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Mohamed Abdeen on Medium]]></title>
        <description><![CDATA[Stories by Mohamed Abdeen on Medium]]></description>
        <link>https://medium.com/@mohamedabdeen?source=rss-28e957fe7e01------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*5GmFZhbSqgNN_Atu.</url>
            <title>Stories by Mohamed Abdeen on Medium</title>
            <link>https://medium.com/@mohamedabdeen?source=rss-28e957fe7e01------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 01:49:02 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mohamedabdeen/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[10 Awesome Microsoft Visual Studio Extensions You Should Install]]></title>
            <link>https://medium.com/@mohamedabdeen/10-awesome-microsoft-visual-studio-extensions-you-should-install-b4f4c6c890a7?source=rss-28e957fe7e01------2</link>
            <guid isPermaLink="false">https://medium.com/p/b4f4c6c890a7</guid>
            <category><![CDATA[visual-studio-code]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Mohamed Abdeen]]></dc:creator>
            <pubDate>Wed, 20 Feb 2019 15:22:14 GMT</pubDate>
            <atom:updated>2019-02-20T15:22:14.793Z</atom:updated>
            <content:encoded><![CDATA[<h3>Visual Studio Code is Everywhere</h3><p>Visual Studio Code editor is the most popular editor nowadays, let’s find some numbers from Visual Studio Code at Connect() 2017 <a href="https://code.visualstudio.com/blogs/2017/11/16/connect">https://code.visualstudio.com/blogs/2017/11/16/connect</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*utQo9nVomtP3po19" /></figure><p>Visual Studio Code is a lightweight but powerful source code editor which runs on your desktop and is available for Windows, macOS, and Linux. It comes with built-in support for JavaScript, TypeScript, and Node.js and has a rich ecosystem of extensions. You can check the <a href="https://code.visualstudio.com/">VS Code</a> for more details. <a href="https://github.com/Microsoft/vscode">VS Code Github</a></p><p>If it is the first time for you with VS code you can find a set of <a href="https://code.visualstudio.com/docs/getstarted/introvideos">introductory videos</a> discussing how you can install VS code, customize, use it for source control and VS extensions which is the main idea behind that post.</p><p>To understand more about VS code extensions, Watch <a href="https://code.visualstudio.com/docs/introvideos/extend">VS Code Extension Video</a></p><p>Let’s jump &amp; see 10 useful VS code extensions I am using in my daily development activities.</p><h3>Extension # 1 — Better Align</h3><p>You can align multiple variable declarations, trailing comments, sections of code, etc. There’s no better way to get a feel for how amazing this extension is than installing it and giving it a try!</p><p><a href="https://marketplace.visualstudio.com/items?itemName=wwm.better-align">https://marketplace.visualstudio.com/items?itemName=wwm.better-align</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*drbVGKrNEVhqZaPW" /></figure><h3>Extension # 2</h3><p>The Material Icon Theme provides lots of icons based on Material Design for Visual Studio Code.</p><p><a href="https://marketplace.visualstudio.com/items?itemName=PKief.material-icon-theme">https://marketplace.visualstudio.com/items?itemName=PKief.material-icon-theme</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*a6-sJfqexWE_A_-R" /></figure><p>Extension # 3 Polacode</p><p>Copy a piece of code to your clipboard, open up the extension, paste the code, and click to save your image!. The tool you can use for your blog or website</p><p><a href="https://marketplace.visualstudio.com/items?itemName=pnp.polacode">https://marketplace.visualstudio.com/items?itemName=pnp.polacode</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*apfYTEsAagxnaFgn" /></figure><p>Extension # 4 — Browser Preview</p><p>It gives you a live-reloading preview right inside of VS Code. No more having to tab over to your browser to see a small change!</p><p><a href="https://marketplace.visualstudio.com/items?itemName=auchenberg.vscode-browser-preview">https://marketplace.visualstudio.com/items?itemName=auchenberg.vscode-browser-preview</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*awn4_HqrgL-Lpb9y" /></figure><p>Extension # 5 Sublime Text Keymap</p><p>This extension will make you feel right at home, by changing all of the shortcuts to match those of Sublime.</p><p><a href="https://marketplace.visualstudio.com/items?itemName=ms-vscode.sublime-keybindings">https://marketplace.visualstudio.com/items?itemName=ms-vscode.sublime-keybindings</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*UGAIH_sSv-c6rLGS" /></figure><p>Extension # 6 — Auto Rename Tag</p><p>Need to rename an element in HTML? Well, with Auto Rename Tag, you just need to rename either the opening or closing tag, and the other will be renamed automatically. Simple, but effective!</p><p><a href="https://marketplace.visualstudio.com/items?itemName=formulahendry.auto-rename-tag">https://marketplace.visualstudio.com/items?itemName=formulahendry.auto-rename-tag</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*e1sHzomVTDOi_oPx" /></figure><p>Extension # 7 Live server</p><p>Make changes in a code editor, switch to the browser, and refresh to see changes. That’s the endless cycle of a developer, but what if your browser would automatically refresh anytime you make changes? That’s where Live Server comes in!</p><p><a href="https://marketplace.visualstudio.com/items?itemName=ritwickdey.LiveServer">https://marketplace.visualstudio.com/items?itemName=ritwickdey.LiveServer</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*CIuBSnjJQ2z7ZZyV" /></figure><p>Extension # 8 — View Node Package</p><p>Click on your require or import lines in your code and click straight to the GitHub repo.</p><p><a href="https://marketplace.visualstudio.com/items?itemName=dkundel.vscode-npm-source">https://marketplace.visualstudio.com/items?itemName=dkundel.vscode-npm-source</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vJHLaSh2jrDJqVa4" /></figure><p>Extension # 9 — Import Cost</p><p>If you’re worried about the size of the packages and modules that you import into your app, check out this extension! Next, to your import statements, you will see the size of the package you are importing. This is a great way to ensure the size of your app bundles is as small as possible!</p><p><a href="https://marketplace.visualstudio.com/items?itemName=wix.vscode-import-cost">https://marketplace.visualstudio.com/items?itemName=wix.vscode-import-cost</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*q0q0TBd92T7XuHfM" /></figure><p>Extension # 10 Quokka</p><p>is a rapid prototyping playground for javascript and typescript. it runs your code immediately as you type &amp; display the results</p><p><a href="https://marketplace.visualstudio.com/items?itemName=WallabyJs.quokka-vscode">https://marketplace.visualstudio.com/items?itemName=WallabyJs.quokka-vscode</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*i5KYGB3w3F4PAmYD" /></figure><p>Also, I have two other stories discovering more visual studio code extensions you will like</p><h3><a href="https://medium.com/@mohamedabdeen/visual-studio-code-extensions-you-should-have-part-1-db1e181538cc?source=your_stories_page---------------------------">Visual Studio Code Extensions You Should Have … Part (1)</a></h3><h3><a href="https://medium.com/@mohamedabdeen/visual-studio-code-extensions-you-should-have-part-2-20c31383e487?source=your_stories_page---------------------------">Visual Studio Code Extensions You Should Have … Part (2)</a></h3><p>Let me know in the comments if you have any feedback or feel free to reach out to me through my <a href="https://www.linkedin.com/in/mohamedabdeen">LinkedIn</a>. Follow me on <a href="https://medium.com/@mohamed.s.abdeen">Medium</a>. Don’t forget to hit the 💙 if you enjoyed this article.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b4f4c6c890a7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[IQueryable vs. IEnumerable in .NET]]></title>
            <link>https://medium.com/@mohamedabdeen/iqueryable-vs-ienumerable-in-net-92a15a803da3?source=rss-28e957fe7e01------2</link>
            <guid isPermaLink="false">https://medium.com/p/92a15a803da3</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[c]]></category>
            <category><![CDATA[entity-framework]]></category>
            <dc:creator><![CDATA[Mohamed Abdeen]]></dc:creator>
            <pubDate>Sat, 13 Oct 2018 13:53:03 GMT</pubDate>
            <atom:updated>2018-10-13T13:53:03.470Z</atom:updated>
            <content:encoded><![CDATA[<h3>IQueryable vs. IEnumerable in .NET</h3><p>First of all, <a href="http://msdn.microsoft.com/en-us/library/bb351562.aspx">IQueryable&lt;T&gt;</a> <em>extends</em> the IEnumerable&lt;T&gt; interface, so anything you can do with a “plain” IEnumerable&lt;T&gt;, you can also do with an IQueryable&lt;T&gt;.</p><p>What IQueryable&lt;T&gt; has that IEnumerable&lt;T&gt; <em>doesn’t</em> are two properties in particular — one that points to a <strong>query provider</strong> (e.g., a LINQ to SQL provider) and another one pointing to a <strong>query expression</strong> representing the IQueryable&lt;T&gt; object as a runtime-traversable abstract syntax tree that can be understood by the given query provider (for the most part, you can’t give a LINQ to SQL expression to a LINQ to Entities provider without an exception being thrown).</p><ul><li>IEnumerable&lt;T&gt; is great for working with sequences that are iterated in-memory, but</li><li>IQueryable&lt;T&gt; allows for out-of-memory things like a remote data source, such as a database or web service.</li></ul><p>The first important point to remember is IQueryable interface inherits from IEnumerable, so whatever IEnumerable can do, IQueryable can also do.</p><p>There are many differences but let us discuss the one big difference which makes the biggest difference. <strong>IEnumerable</strong> interface is useful when your collection is loaded using LINQ or Entity framework and you want to apply a filter on the collection.</p><p>Consider the below simple code which uses IEnumerable with entity framework. It’s using a Where filter to get records whose EmpId is 2.</p><p>EmpEntities ent = new EmpEntities();<br> IEnumerable&lt;Employee&gt; emp = ent.Employees; <br> IEnumerable&lt;Employee&gt; temp = emp.Where(x =&gt; x.Empid == 2).ToList&lt;Employee&gt;();</p><p>This where filter is executed on the client side where the IEnumerable code is. In other words all the data is fetched from the database and then at the client its scans and gets the record with EmpId is 2.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/790/1*L3PsV2NrTccDRNhsqfZW-w.png" /></figure><p>But now see the below code we have changed <strong>IEnumerable</strong> to <strong>IQueryable</strong>. It creates a SQL Query at the server side and only necessary data is sent to the client side.</p><p>EmpEntities ent = new EmpEntities();<br> IQueryable&lt;Employee&gt; emp = ent.Employees;<br> IQueryable&lt;Employee&gt; temp = emp.Where(x =&gt; x.Empid == 2).ToList&lt;Employee&gt;();</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/818/1*GH8Fn6eZh7KPzQzPP5k_fQ.png" /></figure><p>So the difference between IQueryable and IEnumerable is about where the filter logic is executed. One executes on the client side and the other executes on the database. So if you working with only in-memory data collection IEnumerable is a good choice but if you want to query data collection which is connected with database `IQueryable is a better choice as it reduces network traffic and uses the power of SQL language.</p><blockquote><strong>IEnumerable:</strong> IEnumerable is best suitable for working with in-memory collection (or local queries). IEnumerable doesn’t move between items, it is forward only collection.</blockquote><blockquote><strong>IQueryable:</strong> IQueryable best suits for remote data source, like a database or web service (or remote queries). IQueryable is a very powerful feature that enables a variety of interesting deferred execution scenarios (like paging and composition based queries).</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=92a15a803da3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mobile Development … The options you have before The project KICK OFF (Part 1)]]></title>
            <link>https://medium.com/@mohamedabdeen/mobile-development-the-options-you-have-before-the-project-kick-off-part-1-252a8307c14f?source=rss-28e957fe7e01------2</link>
            <guid isPermaLink="false">https://medium.com/p/252a8307c14f</guid>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[ionic]]></category>
            <category><![CDATA[xamarin]]></category>
            <category><![CDATA[react-native]]></category>
            <dc:creator><![CDATA[Mohamed Abdeen]]></dc:creator>
            <pubDate>Fri, 20 Jul 2018 15:54:19 GMT</pubDate>
            <atom:updated>2018-07-20T15:54:19.136Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fOC6v5M8fA_RQzRqHHXJ5Q.png" /><figcaption>Photo Source: <a href="https://pixabay.com/en/ux-prototyping-design-webdesign-788002/">https://pixabay.com/en/ux-prototyping-design-webdesign-788002/</a></figcaption></figure><p>As we are in mobile era and with exploding popularity of smartphones and tablets, mobile application development is becoming a more and more popular medium of software creation with thousands of mobile development opportunities. The creation of mobile applications shares much of its roots from traditional software development because at the end result, we are creating software intended to utilize the unique features and hardware of mobile devices.</p><p>Apps are much like desktop software in that they’re designed using a wide range of programming languages and frameworks. While the most popular operating systems, iOS and Android, have done an excellent job in standardizing the types of mobile app development available for programmers to make, apps can take on a wide range of shapes in some of the following ways</p><ol><li>Native</li><li>Hybrid</li><li>Compiled</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vU1ghEe_SHX59oilwg5VGw.png" /><figcaption>Build Mobile Application Alternatives.</figcaption></figure><h4>Cordova</h4><p>Cordova wraps your HTML/JavaScript app into a native container which can access the device functions of several platforms. These functions are exposed via a unified JavaScript API, allowing you to easily write one set of code to target nearly every phone or tablet on the market today and publish to their app stores. <em>Apache Cordova is a mobile application development framework originally created by Nitobi. Adobe Systems purchased Nitobi in 2011, rebranded it as PhoneGap, and later released an open source version of the software called Apache Cordova.</em></p><p><a href="https://cordova.apache.org/">Apache Cordova</a></p><h4>Ionic</h4><p>Ionic is a complete open-source SDK for hybrid mobile app development. The original version was released in 2013 and built on top of AngularJS and Apache Cordova.</p><p><a href="https://ionicframework.com/">Ionic Framework - The Cross-Platform App Development Leader</a></p><blockquote><strong>Cordova vs. Ionic vs. PhoneGap</strong></blockquote><blockquote>are hybrid apps. Cordova is a framework which runs a JavaScript app in a WebView that has additional native extensions, which is the definition of a hybrid app. Ionic is based on Cordova and comes with Angular. It has set of standard controls that mimic native controls. PhoneGap is a distribution of Cordova with a few custom packages and tweaks.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c9yHay4uykI91PVufjfEYQ.png" /><figcaption><a href="https://stackshare.io/stackups/apache-cordova-vs-ionic-vs-phonegap">https://stackshare.io/stackups/apache-cordova-vs-ionic-vs-phonegap</a></figcaption></figure><p>To know more about the differences you can go through the next Quora question.</p><p><a href="https://www.quora.com/What-are-the-basic-differences-between-PhoneGap-Ionic-Titanium-and-Cordova">What are the basic differences between PhoneGap, Ionic, Titanium and Cordova?</a></p><h4>Flutter</h4><p>Flutter is an open-source mobile application framework created by Google. It is used to develop applications for Android and iOS.</p><p><a href="https://flutter.io/">Flutter - Beautiful native apps in record time</a></p><h4>React Native</h4><p>React Native lets you build mobile apps using only JavaScript. It uses the same design as React, letting you compose a rich mobile UI from declarative components. With React Native, you don’t build a “mobile web app”, an “HTML5 app”, or a “hybrid app”. You build a real mobile app that’s indistinguishable from an app built using Objective-C or Java. React Native uses the same fundamental UI building blocks as regular iOS and Android apps. You just put those building blocks together using JavaScript and React.</p><p>For example, on iOS, a React Native ScrollView uses a native UIScrollView. On Android, it uses a native ScrollView. On iOS, a React Native Image uses a native UIImageView. On Android, it uses a native ImageView. React Native wraps the fundamental native components, giving you the performance of a native app, plus the clean design of React.</p><p>React Native combines smoothly with components written in Objective-C, Java, or Swift. It’s simple to drop down to native code if you need to optimize a few aspects of your application. It’s also easy to build part of your app in React Native, and part of your app using native code directly — that’s how the Facebook app works.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/954/1*3oexn_ZQp_Wj_npsJ71mvQ.png" /></figure><p><a href="https://facebook.github.io/react-native/">React Native · Learn once, write anywhere</a></p><h4>NativeScript</h4><p>NativeScript is an open-source framework to develop apps on the Apple iOS and Android platforms Open source framework for building truly native mobile apps with Angular, Vue.js, TypeScript, or JavaScript. Beautiful, accessible, platform-native UI — without WebViews. Define once and let NativeScript adapt to run everywhere, or tailor the UI to specific devices and screens . Write and deploy native mobile apps for iOS and Android from a single codebase. Use Angular or Vue to share existing web-based code.</p><p><a href="https://www.nativescript.org/">Native mobile apps with Angular, Vue.js, TypeScript, JavaScript - NativeScript</a></p><h4>Xamarin</h4><p>With a C# shared codebase, developers can use Xamarin tools to write native Android, IOS and windows applications with native user interfaces and share code across multiple platforms, including Windows and MacOs. According to Xamarin, over 1.4 million developers were using Xamarin’s products in 120 countries around the world as of April 2017.</p><p><a href="https://developer.xamarin.com/getting-started/">Getting Started with Xamarin - Xamarin</a></p><p>In the next part i will go through a comparison between all the above frameworks we mentioned here so it can be more easier for you to select the suitable framework before your project kick off.</p><p>Let me know in the comments if you have any feedback or feel free to reach out to me through my <a href="https://www.linkedin.com/in/mohamedabdeen">LinkedIn</a>.</p><p>Or my about me <a href="https://about.me/mohamedabdeen">Link</a>. Follow me on <a href="https://medium.com/@mohamed.s.abdeen">Medium</a>.</p><p>Don’t forget to hit the 💙 if you enjoyed this article.</p><p>Cheers and happy learning!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=252a8307c14f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Docker … The Easy Definition … Part (2)]]></title>
            <link>https://medium.com/@mohamedabdeen/the-docker-the-easy-definition-part-2-356a2269f776?source=rss-28e957fe7e01------2</link>
            <guid isPermaLink="false">https://medium.com/p/356a2269f776</guid>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[technology-trends]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Mohamed Abdeen]]></dc:creator>
            <pubDate>Mon, 23 Apr 2018 17:51:56 GMT</pubDate>
            <atom:updated>2018-04-23T17:51:56.750Z</atom:updated>
            <content:encoded><![CDATA[<p>In this story, i will continue what i have started in my last post regarding the docker … the easy definition</p><p><a href="https://medium.com/@mohamed.s.abdeen/the-docker-the-easy-definition-part-1-4327bf83ef12">The Docker … The Easy Definition … Part (1)</a></p><h3>Docker Definitions Dictionary</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/851/1*04UPVnBfBEveJUSRB6pRKQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/852/1*BELw09GPxnbK5kuZDHFJ6Q.png" /></figure><h3>How is Docker working?</h3><p>With Docker, you create a special file called a Docker file. Docker files define a build process, which, when fed to the ‘docker build’ command, will produce an immutable docker image. You can think of this as a snapshot of your application, ready to be brought to life at any time. When you want to start it up, just use the ‘docker run’ command to run it anywhere the docker daemon is supported and running. It can be on your laptop, your production server in the cloud, or on a raspberry pi. Regardless of where your image is running, it will behave the same way.</p><h3>Why Docker?</h3><p>1. Ease of use: Docker has made it much easier for anyone — developers, systems admins, architects and others — to take advantage of containers in order to quickly build and test portable applications. It allows anyone to package an application on their laptop, which in turn can run unmodified on any public cloud, private cloud, or even bare metal. The mantra is: “build once, run anywhere.”</p><p>2. Speed: Docker containers are very lightweight and fast. Since containers are just sandboxed environments running on the kernel, they take up fewer resources. You can create and run a Docker container in seconds, compared to VMs which might take longer because they have to boot up a full virtual operating system every time.</p><p>3. Docker Hub: Docker users also benefit from the increasingly rich ecosystem of Docker Hub, which you can think of as an “app store for Docker images.” Docker Hub has tens of thousands of public images created by the community that are readily available for use. It’s incredibly easy to search for images that meet your needs, ready to pull down and use with little-to-no modification.</p><p>4. Modularity and Scalability: Docker makes it easy to break out your application’s functionality into individual containers. For example, you might have your Postgres database running in one container and your Redis server in another while your Node.js app is in another. With Docker, it’s become easier to link these containers together to create your application, making it easy to scale or update components independently in the future.</p><h3>Setting up your computer</h3><p>Install on Windows , Linux</p><h4>Check Your Setup</h4><p>Check if the Docker is installed successfully. Follow the below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/481/1*gTz0eio6hqday-1EBDmdAw.png" /></figure><p>docker version</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/465/1*3QiIc7Dc9hVJf0gw-mdS9g.png" /></figure><p>docker info</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/510/1*2D77Sq01onijfclaJL68ZQ.png" /></figure><p>Run another image, to run web server. If the image is not found locally, Docker will pulls it from Docker Hub.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/617/1*-KudZgUZk09MvppS_b68yA.png" /></figure><p>If you run the Docker Info command again, you will find that there are two images there.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/488/1*8ysUBQz0f0xjeVBQtS56Sw.png" /></figure><p>Let’s have another quick demo but here let’s first pull the Docker image by command → docker pull microsoft/dotnet</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/525/1*QBy1X0zQHMdwn_Hjci7oAg.png" /></figure><p>Run the image → docker run — rm microsoft/dotnet-samples</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/630/1*q1dbNoD8oiBkGIcFwn_pag.png" /></figure><p>Now you have a clear understanding of what is the docker and how it is working. i am planning to do more posts regarding the docker with real examples like working with angular, Rest APIs project… Stay tuned</p><p>Let me know in the comments if you have any feedback or feel free to reach out to me through my <a href="https://www.linkedin.com/in/mohamedabdeen">LinkedIn</a>.</p><p>Or my about me <a href="https://about.me/mohamedabdeen">Link</a>. Follow me on <a href="https://medium.com/@mohamed.s.abdeen">Medium</a>.</p><p>Don’t forget to hit the 💙 if you enjoyed this article.</p><p>Cheers and happy learning!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=356a2269f776" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Docker … The Easy Definition … Part (1)]]></title>
            <link>https://medium.com/@mohamedabdeen/the-docker-the-easy-definition-part-1-4327bf83ef12?source=rss-28e957fe7e01------2</link>
            <guid isPermaLink="false">https://medium.com/p/4327bf83ef12</guid>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[vmware]]></category>
            <category><![CDATA[docker-image]]></category>
            <category><![CDATA[development]]></category>
            <dc:creator><![CDATA[Mohamed Abdeen]]></dc:creator>
            <pubDate>Wed, 18 Apr 2018 16:53:09 GMT</pubDate>
            <atom:updated>2018-04-18T16:53:09.585Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GsYb27j-EZDWl4DmpHgncg.png" /></figure><p>Regardless of whether or not you have an immediate use-case in mind for Docker, For sure you have heard many new IT terminologies nowadays like DevOps, Micro Services, and Docker which is our today topic. I will not ask you to be Docker guru but at least you should know the definitions for all modern technologies, terminologies we are hearing every day. In today story, we will go through the basic understanding of The Docker.</p><p>Before going into what is the Docker? Let’s first understand what is a virtual machine and How is it different than Dockers?</p><h4>But Why do we have VMs Or Dockers? What is the goal?</h4><p>Containers and VMs are similar in their goals: to isolate an application and its dependencies into a self-contained unit that can run anywhere.</p><p>Moreover, containers and VMs remove the need for physical hardware, allowing for more efficient use of computing resources, both in terms of energy consumption and cost-effectiveness.</p><h4>What is VM ?</h4><p>It is an emulation of a real computer that executes programs like a real computer. VMs run on top of a physical machine using a “hypervisor”. A hypervisor, in turn, runs on either a host machine. A hypervisor is a piece of software, firmware, or hardware that VMs run on top of. The hypervisors themselves run on physical computers, referred to as the “host machine”. The host machine provides the VMs with resources, including RAM and CPU. These resources are divided between VMs and can be distributed as you see fit. The VM that is running on the host machine (again, using a hypervisor) is also often called a “guest machine.” This guest machine contains both the application and whatever it needs to run that application (e.g. system binaries and libraries). It also carries an entire virtualized hardware stack of its own, including virtualized network adapters, storage, and CPU — which means it also has its own full-fledged guest operating system.</p><p>First off, a hosted virtualization hypervisor runs on the operating system of the host machine. For example, a computer running OSX can have a VM (e.g. VirtualBox or VMware Workstation 8) installed on top of that OS. The VM doesn’t have direct access to hardware, so it has to go through the host operating system (in our case, the Mac’s OSX).</p><p>Well, since the VM has a virtual operating system of its own, the hypervisor plays an essential role in providing the VMs with a platform to manage and execute this guest operating system. It allows for host computers to share their resources amongst the virtual machines that are running as guests on top of them.</p><h4>What is the container ?</h4><p>containers are a way of packaging software.it is a lightweight, stand-alone, executable package of a piece of software that includes everything needed to run it: code, runtime, system tools, system libraries, settings. What makes them special is that when you run a container, you know exactly how it will run — it’s predictable, repeatable and immutable. There are no unexpected errors when you move it to a new machine, or between environments. All of your application’s code, libraries, and dependencies are packed together in the container as an immutable artifact</p><p>It is available for both Linux and Windows-based apps, the containerized software will always run the same, regardless of the environment. Containers isolate software from its surroundings, for example, differences between development and staging environments and help reduce conflicts between teams running different software on the same infrastructure.</p><p>You can think of running a container like running a virtual machine, without the overhead of an entire operating system. So, bundling your application in a container vs. a virtual machine will improve startup time significantly.</p><h4>Containers vs. VMs</h4><p>Containers and virtual machines have similar resource isolation and allocation benefits but function differently because containers virtualize the operating system instead of hardware. Containers are more portable and efficient.</p><p>The one big difference between containers and VMs is that containers *share* the host system’s kernel with other containers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/1*dQa6nvnIVvIZ6BkrnBG8Jw.png" /></figure><h4>Can I use containers &amp; VMs together ?</h4><p>You will find the answer in the below diagram.</p><p>Reference : <a href="https://www.docker.com/">https://www.docker.com/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/729/1*GNoIyooWA7N5krmm7I5wbw.png" /></figure><h4>SO, The Docker … The Easy definition</h4><p>Docker is an open-source project based on Linux containers. It uses Linux kernel features. It helps to create images , containers and manage both. Docker helps you create and deploy software within containers. It’s an open source collection of tools that help you “Build, Ship, and Run any App, Anywhere”. Yes, it really is as magic as it sounds.</p><h4>Container or Image … Same OR Different</h4><p>While you are reading more about the Docker. You will find yourself reading both terms containers, images so is it the same thing or there is a difference between both:</p><p>Using an object-oriented programming analogy, the difference between a Docker image and a Docker container is the same as that of the difference between a class and an object. An object is the runtime instance of a class. Similarly, a container is the runtime instance of an image.</p><p>An image is an ordered collection of root filesystem changes and the corresponding execution parameters for use within a container runtime. Images are read-only.</p><ul><li><a href="https://docs.docker.com/glossary/?term=image">https://docs.docker.com/glossary/?term=image</a></li></ul><p>A container is an active (or inactive if exited) stateful instantiation of an image.</p><ul><li><a href="https://docs.docker.com/glossary/?term=container">https://docs.docker.com/glossary/?term=container</a></li></ul><p>If you run the following the below Docker commands you get images &amp; containers separately. [In Part 2 , we will install the Docker on your machine, Also we will run Docker Hello World example, Plus discover more about Docker commands… ]</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/848/1*v3EWk_tQjXUTa86Zbs_nTQ.png" /></figure><h4>More Important Terminologies to be considered:</h4><p>Now we understand exactly what is the Docker and how it is different than VMs, Let’s cover the below terminologies:</p><blockquote>Docker Daemon: The background service running on the host that manages the building, running and distributing Docker containers.</blockquote><blockquote>Docker Client : The command line tool that allows the user to interact with the Docker daemon.</blockquote><blockquote>Docker Store : Store is, among other things, a registry of Docker images. You can think of the registry as a directory of all available Docker images.</blockquote><blockquote>Docker File : is what you or developer write code to do something (ex- Install)</blockquote><p>SO, The Process is</p><ul><li><strong>DockerFile</strong> — (Build) → <strong>Docker Image</strong> — (run) → <strong>Docker Container</strong></li><li><strong><em>Docker File</em></strong> is what you or developer write code to do something (ex- Install)</li><li><strong><em>Docker Image</em></strong> is you get when you build Docker file .</li><li><strong><em>Docker Container</em></strong> is you get when you run your Docker image</li></ul><p>In the next Part (2) we will cover more about the below diagram, what is it? Docker Hello World, Docker Commands</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/566/1*eDgyc7-2cqMmG7ApQFuM8A.png" /></figure><p>Based on the above diagram, Let’s summarize</p><ul><li>Pull <strong>Image</strong> form docker hub or build from Dockerfile =&gt; Gives a docker Image(not editable).</li><li>Run the Image(docker run image_name:tag_name) =&gt; Gives a running Image i.e. Container(editable)</li></ul><p>The Docker engine takes the image and adds a read-write filesystem on top, then initialises various settings. These settings include network options (IP, port, etc.), name, ID, and any resource limits (CPU, memory). If the Docker engine has been asked to run the container it will also initialise a process inside it. A container can be stopped and restarted, in which case it will retain all settings and filesystem changes (but will lose anything in memory and all processes will be restarted). For this reason a stopped or exited container is <em>not</em> the same as an image.</p><p>Let me know in the comments if you have any feedback or feel free to reach out to me through my <a href="https://www.linkedin.com/in/mohamedabdeen">LinkedIn</a>.</p><p>Or my about me <a href="https://about.me/mohamedabdeen">Link</a>. Follow me on <a href="https://medium.com/@mohamed.s.abdeen">Medium</a>.</p><p>Don’t forget to hit the 💙 if you enjoyed this article.</p><p>Cheers and happy learning!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4327bf83ef12" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Complete Guide to Manage Your .NET , .NET Core Applications Logging Using Log4net.]]></title>
            <link>https://medium.com/@mohamedabdeen/a-complete-guide-to-manage-your-net-net-core-applications-logging-using-log4net-27d98a1793e5?source=rss-28e957fe7e01------2</link>
            <guid isPermaLink="false">https://medium.com/p/27d98a1793e5</guid>
            <category><![CDATA[logging]]></category>
            <dc:creator><![CDATA[Mohamed Abdeen]]></dc:creator>
            <pubDate>Sat, 14 Apr 2018 09:42:20 GMT</pubDate>
            <atom:updated>2018-04-14T09:42:20.676Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/998/1*H9dTQ3D6DiOeGvCeVSHgbQ.png" /></figure><p>Unit testing, design documentation, logging — all of these are secondary development activities that we know we really should be doing!. However, logging doesn’t seem to receive the same level of attention; consequently, developers find it hard to know the ‘what, when, and how’ of logging. Is it important? I think anyone who has been in the position of debugging a live application armed with just a log file will tell you, “yes!” There is nothing more frustrating than finding a log file swamped with superfluous detail. Logging, like unit testing, should be considered from day one of a project. It is a valuable tool, not a tedious task. so let’s dive in our story and answer the first question:</p><h3>What is logging?</h3><p>Logging is the process of recording application actions and state to a secondary interface maybe file or DB … and here the question is coming what is information we need to log in our application which actions and what application state we should record (log). You can log for different reasons maybe you need to observe the application actions and the state, however, an application log may also be use for creating statistics relating to the application usage. for example, a log file maybe be used to determine the number of concurrent users as a measure of performance.</p><h4>Logging Messages Classifications</h4><p>The typical classification system associates a log level with each item sent to the log. These log levels are usually comprised of three types which describe events or problems that have occurred within the application, of gradually increasing severity, <strong><em>WARN, ERROR, FATAL</em></strong>, one for general information purposes, <strong><em>INFO</em></strong>, and one for the purposes of debugging, <strong><em>DEBUG</em></strong>.</p><ul><li>INFO → Just information messages. not used for a fault or error state in the application. Like version information of the software, usage information (who is using the software? what are they currently doing), what is external services is the application use.</li><li>WARN → indicates some form of application failure, however, the user experience has not been affected in any way. For example, a WARN message might be appropriate if an external service could not be used; however, a secondary service which performs the same functions was available. Also, a WARN message is appropriate if repeated attempts were required to access a given resource.</li><li>ERROR → it should indicate that something more critical has occurred. ERROR messages should be used to indicate that the application faced a significant problem and that, as a result, the user experience was affected in some way. For example, a database connection could have failed, resulting in parts of the application being rendered unusable.</li><li>FATAL → The user experience was not just affected, it has entirely ceased! For example, a component which is central to the operation of the application has failed in a way that leaves it in an unstable state, with the only possible course of action being to terminate the application altogether.</li><li>DEBUG → indicate that the logged message is to be used for debugging purposes</li></ul><h4>What should i be logging?</h4><p>“what should I be logging?” This is not an easy question to answer, and it <em>depends very much on the nature of the application which is being developed</em>.</p><p>And here is the Logging frameworks are important because they make it easy to <strong>write your logs to different places</strong> by simply changing your configuration. You can write your .NET logs to a file on disk, a database, a log management system or potentially dozens of other places, all without changing your code.</p><h4>What is the log4net ?</h4><p>log4net has been around for a long time and is very similar to log4j which is for java.so, we can say log4net is a tool to help the programmer output log statements to a variety of output targets. in case of problems with an application, it is helpful to enable logging so that the problem can be located. Trust me, you have to configure it before writing your first line of application code. With log4net it is possible to enable logging at runtime without modifying the application binary.</p><p><a href="https://www.nuget.org/packages/log4net/">log4net 2.0.8</a></p><p>Log4net has three main components: <em>loggers</em>, <em>appenders</em> and <em>layouts</em>. These three types of components work together to enable developers to log messages according to message type and level, and to control at runtime how these messages are formatted and where they are reported. These components are helped by <em>filters</em> that control the actions of the appender and <em>object renderers</em> that turn objects into strings.</p><blockquote>Loggers it is the logging space, that is the space of all possible logging statements, is categorized according to some developer-choses criteria. Loggers are named entities. Logger names are case-sensitive and they follow the following hierarchical naming rule: For example, the logger named “Foo.Bar” is a parent of the logger named “Foo.Bar.Baz”. Similarly, “System” is a parent of “System.Text” and an ancestor of”System.Text.StringBuilder”.</blockquote><blockquote>Appenders are how you direct where you want your logs sent. The most popular of the standard appenders are most likely the RollingFileAppender and ConsoleAppender.</blockquote><blockquote>Layouts, More often than not, users wish to customize not only the output destination but also the output format. This is accomplished by associating a <em>layout</em> with an appender. The layout is responsible for formatting the logging request according to the user’s wishes, whereas an appender takes care of sending the formatted output to its destination. The PatternLayout, part of the standard log4net distribution, lets the user specify the output format according to conversion patterns similar to the C language printf function.</blockquote><h4>What is the root logger ?</h4><p>The <em>root</em> logger resides at the top of the logger hierarchy. It is exceptional in three ways:</p><ol><li>It always exists</li><li>It cannot be retrieved by name</li><li>It always has an assigned level. The default value for the <em>root</em> logger is DEBUG.</li></ol><p>This rule is at the heart of log4net. It assumes that levels are ordered. For the standard levels, we have DEBUG &lt; INFO &lt; WARN &lt; ERROR &lt; FATAL.</p><h4>Log4net in ACTION</h4><ol><li>Add log4net package</li><li>Add log4net.config file to your project or you can put log4net configuration directly in web.config , app.config but i preferred a separate file for log4net configuration.</li></ol><pre>&lt;section name=&quot;log4net&quot; type=&quot;log4net.Config.Log4NetConfigurationSectionHandler, log4net&quot; /&gt;</pre><p>3. on log4net.config file Set “Copy to Output Directory” to Copy Alway</p><p>4. Tell log4net to load your config.</p><ul><li>putting this in your AssemblyInfo.cs file. You can find it under the Properties section in your project. or by using xml configurator class inside log4net namespace</li></ul><pre>[assembly: log4net.Config.XmlConfigurator(ConfigFile = &quot;log4net.config&quot;)]</pre><p>5. Log something</p><pre>private static readonly ILog log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);</pre><h4>Use log4net as Engineer</h4><p>Be sure to use Debug, Info, Warning, Error, and Fatal logging levels as appropriate within your code. Don’t lot everything as Debug. Be sure to think about how you would be viewing the logs and what you want to see it later when coding your logging statements.</p><p>You can specify in your log4net config which log4net logging levels you want to log. This is really valuable if you want to specify only certain levels to be logged to a specific log appender or to reduce logging in production. This also you to log more or less data without changing your code.</p><p><strong>log4net levels:</strong></p><ul><li>All — Log everything</li><li>Debug</li><li>Info</li><li>Warn</li><li>Error</li><li>Fatal</li><li>Off — Don’t log anything</li></ul><h4>Log4net Pattern Layout</h4><pre>&lt;layout type=&quot;log4net.Layout.PatternLayout&quot;&gt;<br>        &lt;param name=&quot;ConversionPattern&quot; value=&quot;%-5p %d{MM-dd hh:mm:ss.ffff}  [%thread]  %m%n&quot; /&gt;<br>      &lt;/layout&gt;</pre><p>let’s explain the above layout : write the level (%p), current date time (%d), thread # (%thread), the message (%m) and a new line (%n). The “-5” in the “%-5p” is to set the width of the field to 5 characters.</p><p>you can log more information but it will have performance impact to your app &amp; are not recommended for high volume of logging like the following:</p><ul><li>%method — name of the method where the log message was written</li><li>%stacktrace{level} — output a stack trace to show where the log message was written</li><li>%type — type of the caller issuing the log request. Mostly likely your class name</li><li>%line — the line number from where your logging statement was logged</li></ul><h4>log4net for .NET Core</h4><p>the log4net team published new NuGet packages that support .Net Standard 1.3, which means it should work with .NET Core. i already done with one basic Hello world example explaining how you can configure log4net inside one .Net Core console application.</p><p><a href="https://github.com/mohamedabdeen/log4net-netcore">mohamedabdeen/log4net-netcore</a></p><h3>log4net Best Practices</h3><ol><li>Define your LogManager Object as static</li><li>IF you have issues with log4net appenders, you can enable internal log4net logging via web.config file.</li></ol><pre>&lt;system.diagnostics&gt;<br>    &lt;trace autoflush=&quot;true&quot;&gt;<br>        &lt;listeners&gt;<br>            &lt;add <br>                name=&quot;textWriterTraceListener&quot; <br>                type=&quot;System.Diagnostics.TextWriterTraceListener&quot; <br>                initializeData=&quot;C:\tmp\log4net.txt&quot; /&gt;<br>        &lt;/listeners&gt;<br>    &lt;/trace&gt;<br>&lt;/system.diagnostics&gt;</pre><p>3. Do not send emails on every exception. [SmtpAppender]</p><p>4. Use log management system to views logs files across many servers.</p><p>5. You can make your own custom log4net appenders. for example, you can build custom appenders to log your message to any cloud services such as azure table or AWS.</p><p>6. Customize the layout in logs file using log4net pattern layouts.</p><p>7. You can use the diagnostic contexts to log additional fields, i am really in love with this feature. let’s explain more about this, you can also log custom fields to help give some more context about the user, customer or even the transaction related to the log statements, then you can modify log4net pattern layout to include “%property{customer}” to output it in the logs.</p><pre>log4net.ThreadContext.Properties[&quot;customer&quot;] = &quot;My Customer Name&quot;;<br><br>            log.Debug(&quot;We are going to try and do a web request&quot;);<br><br>            try<br>            {<br>                Class1.ThrowWebException();<br>            }<br>            catch (Exception ex)<br>            {<br>                log.Error(&quot;Error trying to do something&quot;, ex);<br>            }<br>            log.Debug(&quot;We are done with the web request&quot;);</pre><p>8. Using log4net, you can log an object or properties with a message</p><h4>REFERENCES</h4><p><a href="https://logging.apache.org/">Welcome - Apache Logging Services</a></p><p>Let me know in the comments if you have any feedback or feel free to reach out to me through my <a href="https://www.linkedin.com/in/mohamedabdeen">LinkedIn</a>.</p><p>Or my about me <a href="https://about.me/mohamedabdeen">Link</a>. Follow me on <a href="https://medium.com/@mohamed.s.abdeen">Medium</a>.</p><p>Don’t forget to hit the 💙 if you enjoyed this article.</p><p>Cheers and happy learning!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=27d98a1793e5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Entity Framework 6 Questions & Answers]]></title>
            <link>https://medium.com/@mohamedabdeen/entity-framework-6-questions-answers-84fd4dce7f8a?source=rss-28e957fe7e01------2</link>
            <guid isPermaLink="false">https://medium.com/p/84fd4dce7f8a</guid>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Mohamed Abdeen]]></dc:creator>
            <pubDate>Tue, 10 Apr 2018 16:32:36 GMT</pubDate>
            <atom:updated>2018-04-10T16:32:36.130Z</atom:updated>
            <content:encoded><![CDATA[<p>In this story i will list some common questions &amp; answers on Microsoft Entity Framework. you should have the basic knowledge of entity framework so you can understand what is here. Maybe the below questions are not advanced enough but for sure it will come to your mind while you are studying EF. Before we start our Q &amp; A session let’s introduce what is the entity framework first</p><blockquote>The Entity Framework enables you to query, insert, update, and delete data, using Common Language Runtime (CLR) objects which is known as entities. The Entity Framework maps the entities and relationships that are defined in your model to a database.</blockquote><h4>What is code first in entity framework?</h4><ul><li>Code First modeling workflow targets a database that doesn’t exist and Code First will create it.</li><li>It can also be used if you have an empty database and then Code First will add new tables too.</li><li>Code First allows you to define your model using C# or VB.Net classes.</li><li>Additional configuration can optionally be performed using attributes on your classes and properties or by using a fluent API.</li></ul><h4>How can I deploy entity framework model to another DB server?</h4><p>If another developer wants these changes on their machine they can just sync once we check our changes into source control. Once they have our new migrations they can just run the Update-Database command to have the changes applied locally. However if we want to push these changes out to a test server, and eventually production, we probably want a SQL script we can hand off to our DBA.</p><ul><li>Run the Update-Database command but this time specify the –Script flag so that changes are written to a script rather than applied. We’ll also specify a source and target migration to generate the script for. We want a script to go from an empty database ($InitialDatabase) to the latest version (migration AddPostAbstract). If you don’t specify a target migration, Migrations will use the latest migration as the target. If you don’t specify a source migrations, Migrations will use the current state of the database.</li><li>Run the Update-Database -Script -SourceMigration: $InitialDatabase -TargetMigration: AddPostAbstract command in Package Manager Console</li></ul><h4>How can I get the list of migrations applied to DB ?</h4><p><a href="https://coding.abel.nu/2012/03/ef-migrations-command-reference/#Get-Migrations">Get-Migrations</a>:command Displays the migrations that have been applied to the target database.</p><h4>What can I do if I don’t know what is the command name?</h4><p>The commands that you execute to manage migrations from the Package Manager Console are largely the same as those for Entity Framework 6. The full range of commands can be found by typing get-help entity framework at the PM prompt:</p><h4>What is the entity life cycle inside Entity Framework?</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9VEDreMmFqzHafudpi37Bw.png" /></figure><h4>Can I change entity state by code ?</h4><p>Sometimes state of entities are set automatically by the context, but it can also be modified manually by the developer. Even though all the combinations of switches from one state to another are possible, but some of them are meaningless. For example, <strong>Added</strong> entity to the <strong>Deleted</strong> state, or vice versa.</p><h4>What is Un-Changed state of entity in entity framework?</h4><ul><li>When an entity is Unchanged, it’s bound to the context but it hasn’t been modified.</li><li>By default, an entity retrieved from the database is in this state.</li><li>When an entity is attached to the context (with the Attach method), it similarly is in the Unchanged state.</li><li>The context can’t track changes to objects that it doesn’t reference, so when they’re attached it assumes they’re Unchanged.</li></ul><h4>How entity can reach detached state ?</h4><ul><li>Detached is the default state of a newly created entity because the context can’t track the creation of any object in your code.</li><li>This is true even if you instantiate the entity inside a using block of the context.</li><li>Detached is even the state of entities retrieved from the database when tracking is disabled.</li><li>When an entity is detached, it isn’t bound to the context, so its state isn’t tracked.</li><li>It can be disposed of, modified, used in combination with other classes, or used in any other way you might need.</li><li>Because there is no context tracking it, it has no meaning to Entity Framework.</li></ul><h4>What is the best practice to implement EF for both web &amp; desktop applications?</h4><blockquote>Web Applications</blockquote><ul><li>It is now a common and best practice that for web applications, context is used per request.</li><li>In web applications, we deal with requests that are very short but holds all the server transaction they are therefore the proper duration for the context to live in.</li></ul><blockquote>Desktop Applications</blockquote><ul><li>For desktop application, like Win Forms/WPF, etc. the context is used per form/dialog/page.</li><li>Since we don’t want to have the context as a singleton for our application we will dispose it when we move from one form to another.</li><li>In this way, we will gain a lot of the context’s abilities and won’t suffer from the implications of long running contexts.</li></ul><h4>What are the conventions used by EF to create DB tables?</h4><p>The conventions for the type discovery are:</p><ul><li>Code-First includes types defined as a DbSet property in context class.</li><li>Code-First includes reference types included in entity types even if they are defined in different assembly.</li><li>Code-First includes derived classes even if only the base class is defined as DbSet property.</li></ul><h4>What is the difference between data annotation &amp; Fluent API ?</h4><p>Code-First leverages a programming pattern referred to as convention over configuration. It means you can override these conventions by configuring your domain classes to provide EF with the information it needs. There are two ways to configure your domain classes.</p><ul><li>DataAnnotations</li><li>Fluent API</li></ul><p>DataAnnotation is a simple attribute based configuration, which you can apply to your domain classes and its properties. You can find most of the attributes in the <a href="http://msdn.microsoft.com/en-us/library/system.componentmodel.dataannotations(v=vs.110).aspx">System.ComponentModel.DataAnnotations</a> namespace. However, DataAnnotation provides only a subset of Fluent API configurations. So, if you don’t find some attributes in DataAnnotation, then you have to use Fluent API to configure it.</p><p>Fluent API configuration is applied as EF builds the model from your domain classes You can inject the configurations by overriding the DbContext class’ OnModelCreating method.</p><h4>Are data annotations &amp; fluent API offering the same capabilities ?</h4><p>DataAnnotations only give you a subset of configuration options. Fluent API provides a full set of configuration options available in Code-First.</p><h4>How can I manage Nullable primitive data types inside entity framework?</h4><p>Code-First will create Not Null column for a primitive data type property because primitive data type can not be null unless it is marked as Nullable using ? sign or Nullable&lt;T&gt;.</p><h4>How can I turn off cascading delete inside entity framework ?</h4><p>Use Fluent API to configure entities to turn off the cascading delete as shown below.</p><blockquote>protected override void OnModelCreating(DbModelBuilder modelBuilder){</blockquote><blockquote>modelBuilder.Entity&lt;Student&gt;().HasOptional&lt;Standard&gt;(s =&gt; s.Standard).WithMany().WillCascadeOnDelete(false);</blockquote><blockquote>}</blockquote><h4>What is the relationship between ADO .Net &amp; EF ?</h4><p>We know that EF is called ADO.NET EF which means that EF sits on top of the ADO.NET , which tells us that it cant be faster than ADO.NET. But remember the power of LINQ which EF provides the developers. It is really powerful when comes with EF. Since EF encapsulates ADO.NET at the background it used ADO.NET only, but the question comes why EF then?? Yes if we use EF and LINQ then the maintainability and code redundancy reduces as we do not have to write the big queries anymore like SP and all</p><p>Let me know in the comments if you have any feedback or feel free to reach out to me through my <a href="https://www.linkedin.com/in/mohamedabdeen">LinkedIn</a>.</p><p>Or my about me <a href="https://about.me/mohamedabdeen">Link</a>. Follow me on <a href="https://medium.com/@mohamed.s.abdeen">Medium</a>.</p><p>Don’t forget to hit the 💙 if you enjoyed this article.</p><p>Cheers and happy learning!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=84fd4dce7f8a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Serverless Architecture … The easy Definition]]></title>
            <link>https://medium.com/@mohamedabdeen/serverless-architecture-the-easy-definition-f296b19fb0ad?source=rss-28e957fe7e01------2</link>
            <guid isPermaLink="false">https://medium.com/p/f296b19fb0ad</guid>
            <category><![CDATA[serverless]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Mohamed Abdeen]]></dc:creator>
            <pubDate>Sun, 08 Apr 2018 05:27:52 GMT</pubDate>
            <atom:updated>2018-04-08T05:27:52.331Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/580/1*FZez47Cx47OO4eVS7XA_Sg.png" /></figure><p>In this post, i will go through quick introduction about what is the serverless, nowadays we are hearing this word everywhere. my main goal in this article is getting you comfortable with this word.</p><p>I’ll try to keep this simple: the phrase “serverless” doesn’t mean servers are no longer involved. It simply means that developers no longer have to think “that much” about them. Computing resources get used as services without having to manage around physical capacities or limits.</p><p>Initially, there were only three cloud computing models i.e. Infrastructure as a Service (IaaS), Platform as a service (PaaS) and Software as a Service (SaaS). Then in few years ‘As a Service’ (aaS) model started appearing everywhere to the point that we have lost track of the never-ending list of aaS offerings which consists of almost every single thing in the computing world. Here are some examples just for fun: security as a service, network as a service, backup as a service, customization as a service, logging as a service, APIs as a Service, data as a service, backend as a service, authentication as a Service and the list goes on and on. Although it appears that these providers just want to be part of aaS (as a Service) Club, in reality, there are legitimate business reasons why so many companies have converted their products and services into aaS model.</p><p>To summarize, the name Serverless computing is a bit of a misnomer. It doesn’t mean that there are no servers, they are involved, but it means that we don’t need to worry about them. In the Serverless world, we simply upload a function, specify the resources it requires and simply upload the function to the Cloud. The Cloud vendor (Amazon, Microsoft, Google) will take of provisioning the server and deploy the function on it. This way, we don’t think anywhere about the servers and so the name <strong>Serverless</strong>. As the demand for the function goes up, the Cloud vendor will provision more servers and decommission them when the demand goes down. All of this is transparent to the end user. Along the same lines, we should be able to create a RDBMS table and put data into it, without worrying about the server infrastructure. Have a look on the below diagram to understand more about functions architecture.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EiggeTkA9jzUpZG-n8nxnQ.png" /></figure><h3>As a Service model offers many benefits:</h3><ol><li>These services are fully managed therefore customers do not have to worry about how to architect, host, scale and operate these services.</li></ol><p>2. They offer subscription-based pricing where customers only pay for what they use and Lastly, these services are typically very easy to consume through standard web based APIs.</p><p>3. When you start using these cloud-based services in your applications, you outsource parts of your application out to the cloud service providers. As developers started using more and more of these cloud-based services in their applications, they soon realized that they do not need monolithic full stack applications anymore. All they need is some way to glue and orchestrate various cloud services together in a coherent manner with a user interface and by doing this, they can build highly scalable business applications without using any servers at all.</p><p>4. Serverless is about abstracting users away from servers, infrastructure, and having to deal with low-level configuration or the core operating system. Instead, developers make use of single purpose services (such as S3 for storage or Auth0 for identity management) and elastic compute platforms (such as AWS Lambda) to execute code.</p><p>5. Avoid the traditional way when an application gets developed, the next step is to get it deployed on the servers. For this the capacity planning, procurement, installation of server hardware and software must be done, which might take from a few weeks to a few months. Not only it is time consuming, but it also involves a lot of CAPEX (initial expenses) and OPEX (running expenses).</p><p>6. By composing and combining different services together in a loose orchestration developers can now build complex systems very quickly and spend most of their time focusing on their core business problem. These serverless systems can scale, grow and evolve without developers or solution architects having to worry about remembering to patch that web server yet again.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GcboltGUnIEhOFEE-SZ8tg.png" /></figure><p>The term <em>Serverless</em> covers two types of cloud computing architectures:</p><ul><li><strong>Backend as a Service or BaaS</strong>, where an application runs huge chunks of its backend code on a cloud server managed by a third-party provider. BaaS clouds can cater to specific functionality like login management or API maintenance. It’s not uncommon to see UI-heavy one-page web apps to run most of their server-side code on a serverless platfrom.</li><li><strong>Function-as-a-service or FaaS</strong>, where application run separate server-side functions in ephemeral containers. These functions are evoked from a cloud managed by a third party.</li></ul><p><a href="https://cloud.google.com/serverless/">https://cloud.google.com/serverless/</a></p><h3>Cost Calculations</h3><p>With the Serverless functions, the charge is based upon the number of times a function is invoked and on the amount of resources the function consumes. It’s no way related to the servers. So, the charge is directly proportional to the growth of business, which makes sense for start-ups which are not short of good, but are short of funding till the idea is proven.</p><blockquote>Billing model — When using serverless platforms, you pay only for the compute that you need. Serverless architecture introduces a true pay-per-usage model, where customers pay only when a function is executed. Serverless’ billing model makes it ideal for microservices that have small load requirements and for applications with a “spikey” traffic profile. Unlike in traditional environments, there is no need to pay for VMs or containers that often sit idle.</blockquote><pre>Google CloudFunction g, IBM OpenWhisk t, Azure Functions and AWS <br><br>Lambda are the services which enable us to upload a function and the rest is taken care for us automatically. Although Serverless functions are convenient, there are a few problems associated with it. <br><br>• There is no standardization across them. Let&#39;s say a function has been written for AWS Lambda, the same doesn&#39;t work for Azure Functions. The code must be rewritten. <br><br>• There is a problem with warming up. When a function is not invoked for a few minutes, then it is evoked and it might take a few seconds for the warm up or the load it when the function is invoked again. <br><br>• Debugging the Serverless functions is not easy as all the dependencies and the environment are not there in the local machine.</pre><h3>Lambda (Amazon AWS)</h3><p>Amazon Web Services (AWS) is usually the first name that comes to mind when you think of cloud computing for good reason — they are by the far the largest provider in this space and are host to a much broader set of supporting tools and resources than any of their competitors.</p><p><a href="https://aws.amazon.com/lambda/"><strong>AWS Lambda</strong></a> is the <em>functions-as-a-service</em> offering that enables serverless development on the Amazon cloud, and as a result of being around the longest, is also the largest service in use currently.</p><h4>Supported Languages</h4><p>Lambda currently supports functions written in Javascript (<em>and languages that compile to it</em>) with Node.js, Python, Java (<em>Java 8 is supported</em>) and the Microsoft family of .NET languages (<em>C#, Visual Basic and F#</em>) by way of support for .NET Core.</p><h3>Azure Functions (Microsoft Azure)</h3><p><a href="https://azure.microsoft.com/en-gb/services/functions/"><strong>Azure Functions</strong></a> is Microsoft’s serverless offering, and provides a similar <em>functions-as-a-service</em> model to AWS Lambda.</p><h4>Supported Languages</h4><p>The landscape here deviates a little from AWS. The languages supported here are JavaScript (<em>and languages that compile to it)</em> with Node.js, C#, F#, Python, PHP, Bash, Batch and PowerShell.</p><h3>Cloud Functions (Google Cloud Platform)</h3><p><a href="https://cloud.google.com/functions/"><strong>Cloud Functions</strong></a> is Google’s serverless proposition, and while it largely follows Azure and AWS in terms of feature parity, there are a few notable differences.</p><h4>Supported Languages</h4><p>Currently Google Cloud Functions only supports Javascript</p><h3>Websites to visit</h3><blockquote><a href="https://serverless.com/"><em>https://serverless.com/</em></a></blockquote><blockquote><a href="https://serverless-stack.com/"><em>https://serverless-stack.com/</em></a></blockquote><h3>References</h3><p><a href="https://www.linkedin.com/pulse/what-serverless-architecture-muhammad-ahmed/?trk=pulse_spock-articles">https://www.linkedin.com/pulse/what-serverless-architecture-muhammad-ahmed/?trk=pulse_spock-articles</a></p><p>Different questions &amp; answers on Quora <a href="http://www.quora/">www.quora</a>.com</p><p>Let me know in the comments if you have any feedback or feel free to reach out to me through my <a href="https://www.linkedin.com/in/mohamedabdeen">LinkedIn</a>.</p><p>Or my about me <a href="https://about.me/mohamedabdeen">Link</a>. Follow me on <a href="https://medium.com/@mohamed.s.abdeen">Medium</a>.</p><p>Don’t forget to hit the 💙 if you enjoyed this article.</p><p>Cheers and happy learning!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f296b19fb0ad" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[2017 Get Cleared … 2018 Get Started]]></title>
            <link>https://medium.com/@mohamedabdeen/2017-get-cleared-2018-get-started-38a36e8abf42?source=rss-28e957fe7e01------2</link>
            <guid isPermaLink="false">https://medium.com/p/38a36e8abf42</guid>
            <category><![CDATA[life]]></category>
            <category><![CDATA[goals]]></category>
            <category><![CDATA[2018]]></category>
            <category><![CDATA[personal-development]]></category>
            <category><![CDATA[productivity]]></category>
            <dc:creator><![CDATA[Mohamed Abdeen]]></dc:creator>
            <pubDate>Thu, 28 Dec 2017 17:37:19 GMT</pubDate>
            <atom:updated>2017-12-28T17:37:19.647Z</atom:updated>
            <content:encoded><![CDATA[<p><em>As it is the last week of 2017, all of us are busy in 2017 reviewing and 2018 planning. Here i am going to share some ideas, resolutions to get a better 2018. Before start 2018 goals planning, you have to do 2017 reflections which means evaluate yourself and how you are near from your 2017 goals. one word i wanna say</em>: making progress in your health, your work, and your life isn’t about learning how to focus and concentrate better, it’s about learning how to choose and commit to a specific task. one from impressive statements i received in my mail:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M4RKG6SspY226C3cExa5DA.png" /></figure><p><em>Let’s start with the first step.</em></p><h4><strong>2017 Reflections</strong></h4><p>If you had a 2017 goals plan, you can go through the coming questions</p><ol><li>What were my highlights of 2017?</li><li>What about 2017 am i most grateful for?</li><li>What were the 5 biggest achievements of 2017?</li><li>What were the 3 main challenges of 2017?</li><li>From 1 to 5, What were your rate of 2017 based on your achievements ?</li></ol><p>If it is the first year you think about your life goals planning, bring pend and white paper and start write all what are coming to your mind.</p><h4><strong>Get Clear</strong></h4><ol><li>Where do you want to go? [Your vision for 1 &amp; 3 years]</li><li>Why do you want that motivation? [Your Motivation]</li><li>What will help? What are the stands in the way ?</li></ol><p>After answer the previous questions, list your strength, challenges &amp; barriers in your life, your feelings, your bad behaviors</p><h4>2018 Interested Areas</h4><blockquote>the most important areas you have to think about while you are planning your 2018 goals are: <strong><em>Health (Nutrition, Sleep, Excerise)</em></strong><em> , </em><strong><em>Relationships (Family, Friends, …) </em></strong><em>, </em><strong><em>Career</em></strong><em>, </em><strong><em>Personal Growth</em></strong><em>, </em><strong><em>Finance &amp; Money, Spiritual</em></strong></blockquote><h4>Smart Goals</h4><p>The next step is listing all your big goals in different areas but take care list your smart goal not just a goal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OuvOItQCUC9s6Wv8PbCHHg.png" /></figure><h4>What is your values?</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/910/1*nynirgry16vPk3IWXD4rvw.png" /></figure><h4>Different Resolution Ideas</h4><ol><li>Explore a creative hobby and do it for 3 months</li><li>Design your ideal habits</li><li>List 5 bad habits and break them</li><li>Read 12 books per a year [12 book * 12 month Challenge]</li><li>Listen to audiobooks [<a href="https://www.audible.com/">https://www.audible.com/</a> &amp; <a href="https://www.blinkist.com/">https://www.blinkist.com/</a>]</li><li>6. Try something you’ve always wanted to try</li><li>Control your finances. Save &amp; invest. [i will list in the next section many sources to increase your income]</li><li>Gather your old things to sell for extra cash</li><li>Reconnect with an old friend</li><li>Learn hot to compliment &amp; thanks people</li><li>Try journaling one day per a week</li><li>Volunteer</li><li>Try yoga or meditation</li><li>Wake up earlier [5:30 am] than usual</li><li>Learn 5 new skill</li><li>Know more about the right eating habits</li><li>Define your fears</li><li>Learn how to speed things up with templates</li><li>Learn how to deep work in a sea of distractions</li><li>Keep track of what you have done.</li><li>Explore how to be goal oriented</li></ol><h4>Income Sources</h4><ol><li>Blogging</li><li>Social Media Manager</li><li>Youtube Channels</li><li>Write Books</li><li>Online training &amp; Workshops</li><li>Affiliate Marketing</li><li>Consulting &amp; Coaching</li><li>Virtual Assistant</li><li>Facebook Ad Manager</li><li>Editor</li><li>Copy Writer</li><li>Web Designer</li><li>Graphic Designer</li></ol><h4>My 2018 Reading List</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4Akz_-w7cdGyfVPax1Z4iQ.png" /></figure><p>At the end, you don’t even have to succeed. You just need to get started. Starting before you feel ready is one of the habits of successful people.</p><p>Most of the time, the ability to get started and commit to a task is the only thing you need to do to focus better. Most people don’t have trouble with focusing. They have trouble with deciding.</p><p>Let me know in the comments if you have any feedback or feel free to reach out to me through my <a href="https://www.linkedin.com/in/mohamedabdeen">LinkedIn</a>.</p><p>Or my about me <a href="https://about.me/mohamedabdeen">Link</a>. Follow me on <a href="https://medium.com/@mohamed.s.abdeen">Medium</a>.</p><p>Don’t forget to hit the 💙 if you enjoyed this article.</p><p>Cheers and happy learning!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=38a36e8abf42" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Angular 4 Quick Points]]></title>
            <link>https://medium.com/@mohamedabdeen/angular-4-tips-tricks-a4757462acd1?source=rss-28e957fe7e01------2</link>
            <guid isPermaLink="false">https://medium.com/p/a4757462acd1</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[web]]></category>
            <category><![CDATA[angular-4]]></category>
            <category><![CDATA[full-stack]]></category>
            <dc:creator><![CDATA[Mohamed Abdeen]]></dc:creator>
            <pubDate>Sat, 16 Sep 2017 16:28:36 GMT</pubDate>
            <atom:updated>2017-09-16T16:29:20.693Z</atom:updated>
            <content:encoded><![CDATA[<h4><strong>Scoped package</strong></h4><p>A way to group related <em>npm</em> packages. Read more at the <a href="https://docs.npmjs.com/misc/scope">npm-scope</a> page. Angular modules are delivered within <em>scoped packages</em> such as @angular/core, @angular/common, @angular/platform-browser-dynamic, @angular/http, and @angular/router. Import a scoped package the same way that you import a normal package. The only difference, from a consumer perspective, is that the scoped package name begins with the Angular <em>scope name</em>, @angular.</p><blockquote>import { Component } from ‘@angular/core’;</blockquote><h4>Barrel</h4><p>A way to <em>roll up exports</em> from several ES2015 modules into a single convenient ES2015 module. The barrel itself is an ES2015 module file that re-exports <em>selected</em> exports of other ES2015 modules.</p><blockquote>The Angular <a href="https://angular.io/docs/ts/latest/glossary.html#scoped-package">scoped packages</a> each have a barrel named index.</blockquote><h4><strong>Structural directives</strong></h4><p>A category of <a href="https://angular.io/docs/ts/latest/glossary.html#directive">directive</a> that can shape or reshape HTML layout, typically by adding and removing elements in the DOM. The ngIf “conditional element” directive and the ngFor “repeater” directive are well-known examples. Read more in the <a href="https://angular.io/docs/ts/latest/structural-directives.html">Structural Directives</a> page.</p><h4>Angular-Cli, Creating new application in angular 4</h4><p>Creating a new application has a few different options we can use. There are many options that can be seen by typing ng help. I’ll show off a few of the important ones here:</p><ul><li>— directory: Specify the directory you want to create this project in</li><li>— style: (Default: css) The style file default extension. Possible values: css, scss, less, sass, styl(stylus). You can later change the value in “.angular-cli.json” (defaults.styleExt).</li><li>— prefix (Default: app) The prefix to use for all component selectors. You can later change the value in “.angular-cli.json” (apps[0].prefix)</li><li>— routing (Default: false) Generate a routing module.</li></ul><h4>Angular-Cli, ng generate options</h4><ul><li>— flat: Don’t create the code in it’s own directory. Just add all files to the current directory.</li><li>— route=&lt;route&gt;: Specify the parent route. Only used for generating <strong>components</strong> and <strong>routes</strong>.</li><li>— skip-router-generation: Don’t create the route config. Only used for generating <strong>routes</strong>.</li><li>— default: The generated route should be a default route.</li><li>— lazy: Specify if route is lazy. default true</li></ul><h4>Angular-Cli, Generating a new module with Routing</h4><p>In addition to generating components, we can generate modules. Modules are a way we can encapsulate similar functionality into a section of our app. By separating parts out into their own section, we can treat that module as its own compartment of our app with routing. This will become child routing for our app and then we can even lazy load it! To generate a module, we can use ng generate module. To add routing to it, we can add the — routing flag.</p><h4>Angular-Cli, AOT</h4><p>We can also build with AOT to make sure our Angular app is compiled during build-time instead of in browser at run-time. <strong>This can help reduce the size of our app by more than half!</strong></p><h4>JEST, Angular 4 Testing</h4><p><a href="http://facebook.github.io/jest">Jest</a> is a <em>painless JavaScript testing platform. </em>Jest is a testing platform, widely adapted by many <a href="http://facebook.github.io/jest/users.html">large companies</a> and swiftly adopted by the React community.</p><ul><li>Sits on top of Jasmine, so the API is nearly identical.</li><li>Has all of it’s API <a href="http://facebook.github.io/jest/docs/api.html">documented</a>, along with guides, examples and helpful community on forums like <a href="https://www.reactiflux.com/">Reactiflux</a> and <a href="http://stackoverflow.com/unanswered/tagged/jestjs">Stack Overflow</a>.</li><li>Focuses on Developer Experience (speed and ease of use is the first priority.)</li><li>Provides meaningful error messages.</li><li>Runs on Continuous Integration servers without extra tooling (abstracting the DOM with <a href="https://github.com/tmpvar/jsdom"><em>jsdom</em></a> library.)</li><li>Provides code coverage out of the box.</li><li>Integrates with Babel and TypeScript seamlessly.</li></ul><p>you can know more about angular 4 &amp; JEST testing framework from the following link:</p><p><a href="https://www.xfive.co/blog/testing-angular-faster-jest/">Testing Angular Faster with Jest - Xfive</a></p><h3>Building forms in angular 4</h3><h4>Template-Driven forms</h4><p>we’ll actually be talking about the kind of forms we’re used to with AngularJS, whereby we bind directives and behaviour to our templates, and let Angular roll with it. On a high-level, this is what template-driven forms achieve for us — by specifying directives to bind our models, values, validation and so on, we are letting the template do the work under the scenes.</p><h4><strong>Reactive forms</strong></h4><p>A technique for building Angular forms through code in a component. The alternative technique is <a href="https://angular.io/docs/ts/latest/glossary.html#template-driven-forms">template-driven forms</a>.When building reactive forms:</p><ul><li>The “source of truth” is the component. The validation is defined using code in the component.</li><li>Each control is explicitly created in the component class with new FormControl() or with FormBuilder.</li><li>The template input elements do <em>not</em> use ngModel.</li><li>The associated Angular directives are all prefixed with Form, such as FormGroup, FormControl, and FormControlName.</li></ul><p>Reactive forms are powerful, flexible, and a good choice for more complex data-entry form scenarios, such as dynamic generation of form controls.</p><h4>Angular 4, ngFor</h4><p>Angular ngFor is a built-in Directive that allows us to iterate over a collection. This collection is typically an array In this story, we will go through using of ngFor in angular 2, 4.</p><h4><a href="https://toddmotto.com/angular-ngfor-template-element#ngmodule-import">NgModule import</a></h4><p>First of all, to use ngFor, you need to import the CommonModule. However, if you’re using the BrowserModule in the root module, you won’t need to import it, as the BrowserModule exposes the CommonModule for us - so you only need to import the CommonModule when creating further modules with @NgModule</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*deZSXeBgMWfcDbcffdsovQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gSidDMiZdbtHKzOXB1Ae2Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HKylgumf-4IBdriLbgkOqQ.png" /><figcaption>ngFor — index</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UVgmBgSSoTEfAo486RCMNQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lcPlvOTLtsNmeRrpKGJp4A.png" /></figure><p>Let me know in the comments if you have any feedback or feel free to reach out to me through my <a href="https://www.linkedin.com/in/mohamedabdeen">LinkedIn</a>. Or my about me <a href="https://about.me/mohamedabdeen">Link</a>. Follow me on <a href="https://medium.com/@mohamed.s.abdeen">Medium</a>.</p><p>Don’t forget to hit the 💙 if you enjoyed this article.</p><p>Cheers and happy learning!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a4757462acd1" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>