<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>ASP.Net developers &gt; Metasys Software Pvt Ltd.</title>
	<atom:link href="https://www.metasyssoftware.com/tag/asp-net-developers/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.metasyssoftware.com</link>
	<description>Unique People, Unique Solutions</description>
	<lastBuildDate>Fri, 24 May 2024 09:09:32 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://www.metasyssoftware.com/wp-content/uploads/2023/10/metasys-svg-.png</url>
	<title>ASP.Net developers &gt; Metasys Software Pvt Ltd.</title>
	<link>https://www.metasyssoftware.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>How to Keep an Application Logged in to Avoid Session Timeout and Data Loss (Asp.net)?</title>
		<link>https://www.metasyssoftware.com/microsoft-technologies/how-to-keep-an-application-logged-in-to-avoid-session-timeout-and-data-loss-asp-net/</link>
		
		<dc:creator><![CDATA[meta_prasad]]></dc:creator>
		<pubDate>Thu, 06 Jul 2023 05:56:43 +0000</pubDate>
				<category><![CDATA[Microsoft Technologies]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[ASP.Net developers]]></category>
		<category><![CDATA[ASP.Net Development Company in India]]></category>
		<guid isPermaLink="false">https://www.metasyssoftware.com/?p=6256</guid>

					<description><![CDATA[<p>Session Management is an important aspect to be taken care of while writing code. Several factors play a role in [&#8230;]</p>
The post <a href="https://www.metasyssoftware.com/microsoft-technologies/how-to-keep-an-application-logged-in-to-avoid-session-timeout-and-data-loss-asp-net/">How to Keep an Application Logged in to Avoid Session Timeout and Data Loss (Asp.net)?</a> appeared first on <a href="https://www.metasyssoftware.com">Metasys Software Pvt Ltd.</a>.]]></description>
										<content:encoded><![CDATA[<div id="pl-6256"  class="panel-layout" ><div id="pg-6256-0"  class="panel-grid panel-no-style" ><div id="pgc-6256-0-0"  class="panel-grid-cell" ><div id="panel-6256-0-0-0" class="so-panel widget widget_sow-editor panel-first-child panel-last-child" data-index="0" ><div
			
			class="so-widget-sow-editor so-widget-sow-editor-base"
			
		>
<div class="siteorigin-widget-tinymce textwidget">
	<p>Session Management is an important aspect to be taken care of while writing code. Several factors play a role in deciding your strategy and it is never one size fits all. It is important to understand the context and specific requirements of a business to determine the appropriate session duration.</p>
<p>In this context, the application was used as an internal application to gather data on all the work being completed by the construction crew. This was reviewed by the managers and supervisors and thereafter billers generated the invoices.</p>
<p>It was important here to allow for long session durations. The users wanted the ability to remain logged in even when the application might be idle for a long time, and with no data loss. This would not be recommended in the context of personal banking, where security and avoidance of session hacking are of far greater importance.</p>
<p>This article explains how you can maintain a session in ASP.Net and avoid getting logged out, even when the application is idle for a long time. This method will also help in preventing data loss.</p>
<p>We used Handler to maintain the session in ASP.Net.</p>
<p><h2><strong>Why Handler?</strong></h2>
</p>
<ul>
<li>Handler makes a simple post-back call to the server to keep the session alive.</li>
<li>In Handler, a session variable is accessed only if it is inherited by the interface IRequiresSessionState. The handler receives the request from the aspx page and, in turn, sends a response.</li>
</ul>
<p><strong>Implementation of Handler in our application using Asp.net and jQuery:</strong></p>
<p>We employ Handler in our application for user data maintenance and to prevent session time out.</p>
<p><strong>How Handler Works:</strong></p>
<ul>
<li>Create a handler by right-clicking on the website and adding an item by selecting a generic handler.  Eg:(KeepActive.ashx) - extension of handler is ASHX.</li>
<li>Make a call to the handler using jQuery function.</li>
</ul>
<p><strong>Code snippet:</strong></p>
<p><%@ WebHandler Language="C#" Class="KeepActive" %><br />
using System;<br />
using System.Web;<br />
using System.Web.SessionState;<br />
public class KeepActive : IHttpHandler, IRequiresSessionState<br />
{<br />
    public void ProcessRequest(HttpContext context)<br />
    {<br />
        try<br />
        {<br />
            context.Session["Active"] = DateTime.Now;<br />
        }<br />
        catch { }<br />
    }<br />
  }<br />
    public bool IsReusable<br />
    {<br />
        get<br />
        {<br />
            return false;<br />
        }<br />
    }<br />
}
</p>
<ul>
<li>After the handler is created, create a jQuery function named “setinterval”, which runs at an    interval to update session.</li>
<li>Please find the below jQuery code, which is called on load of the page and it has a function named “setinterval”, which get triggered after every five minutes:</li>
</ul>
<p><strong>Code snippet:</strong></p>
<p>window.onload = function () {<br />
var idleInterval = setInterval(timerIncrement, 300000); // for 5 minutes<br />
}</p>
<ul>
<li>The above function calls another function named “timerIncrement”, which triggers and calls handler named “KeepActive” after every five minutes. It is necessary to update the session and keep it alive</li>
</ul>
<p><strong>Code snippet:</strong></p>
<p>function timerIncrement() {<br />
idleTime = idleTime + 1;<br />
if (idleTime &gt; 1) { // Greater than 10 minutes<br />
if (typeof GetHiddenForemanReportID == 'function') {<br />
var foremanReportID = GetHiddenForemanReportID();<br />
jq.post("/KeepActive.ashx?foremanReportID=" + foremanReportID, null,     function () {<br />
});</p>
<p>MetaSys Software’s developers have successfully delivered applications using <a href="https://www.metasyssoftware.com/case-study-dotnet">ASP.Net Core</a> and .Net &amp; ASP.Net Framework. For more details, see <a href="https://www.metasyssoftware.com/dot-net">https://www.metasyssoftware.com/dot-net</a>. <a href="https://www.metasyssoftware.com/contact/">Contact us</a> with your project requirements now!</p>
</div>
</div></div></div></div></div>The post <a href="https://www.metasyssoftware.com/microsoft-technologies/how-to-keep-an-application-logged-in-to-avoid-session-timeout-and-data-loss-asp-net/">How to Keep an Application Logged in to Avoid Session Timeout and Data Loss (Asp.net)?</a> appeared first on <a href="https://www.metasyssoftware.com">Metasys Software Pvt Ltd.</a>.]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>What, Why, and How of Microservices?</title>
		<link>https://www.metasyssoftware.com/dot-net/microservices/</link>
		
		<dc:creator><![CDATA[meta_prasad]]></dc:creator>
		<pubDate>Fri, 09 Apr 2021 08:20:04 +0000</pubDate>
				<category><![CDATA[Dot Net]]></category>
		<category><![CDATA[DotNet application development]]></category>
		<category><![CDATA[Microservices. ASP.Net]]></category>
		<category><![CDATA[ASP.Net developers]]></category>
		<category><![CDATA[DotNet programmer]]></category>
		<category><![CDATA[Dot Net application development company]]></category>
		<category><![CDATA[Dot Net application developers]]></category>
		<category><![CDATA[DotNet run]]></category>
		<category><![CDATA[DotNet framework]]></category>
		<guid isPermaLink="false">https://www.metasyssoftware.com/?p=3533</guid>

					<description><![CDATA[<p>What are Microservices? Historically applications were Monolithic applications where the architecture was a unified and closely coupled integrated unit. Microservices, [&#8230;]</p>
The post <a href="https://www.metasyssoftware.com/dot-net/microservices/">What, Why, and How of Microservices?</a> appeared first on <a href="https://www.metasyssoftware.com">Metasys Software Pvt Ltd.</a>.]]></description>
										<content:encoded><![CDATA[<h1><strong>What are Microservices?</strong></h1>
<p>Historically applications were Monolithic applications where the architecture was a unified and closely coupled integrated unit. Microservices, on the contrary, are smaller independent unified business modules. Each module in Microservices performs its own unique business functionality, at times with dedicated databases.</p>
<p><img fetchpriority="high" decoding="async" class="aligncenter wp-image-3534 size-full" title="Monolith and Microservices" src="https://www.metasyssoftware.com/wp-content/uploads/Monolith-and-Microservices.jpg" alt="Monolith and Microservices" width="750" height="390" /></p>
<p>As shown in the above image, the architecture of Microservices consists of independent smaller units, which are interconnected and managed with the help of API Gateway.</p>
<h2><strong>Why opt for Microservices instead of Monolithic Applications?</strong></h2>
<p>A Monolithic application is a big container with a collection of different smaller independent parts combined and coupled tightly together, which creates varied inseparable disadvantages.</p>
<p>Here are a few disadvantages of Monolithic services.</p>
<p style="text-align: left;">• Inflexible – Monolithic applications cannot be built using different technologies.<br />
• Unreliable – One bug or issue in the application may result in the shutdown of the entire system.<br />
• Not Scalable – The tightly coupled nature of a Monolithic application does not scale easily, as workloads cannot be easily distributed across multiple nodes or hardware.<br />
• Hinders continuous deployment – Continuous delivery and deployment in short cycles of time is difficult due to the monolithic nature of the application<br />
• Longer development timelines – The development of Monolithic applications requires lengthy timelines since every feature demands rebuilding of the entire application.<br />
• Complex applications –Incorporating changes in complex monolithic applications become expensive and a maintenance nightmare.</p>
<p>As mentioned earlier, a microservices application is a collection of small independent services designed for different business purposes. In Microservices, each individual service is self-contained. Communication with each self-contained unit is managed by an API Gateway. There are various API Gateways available, and the client can communicate with different business functions of Microservices via the API Gateway.</p>
<h2><strong>Features of Microservices</strong></h2>
<p>• Decoupled Components – Decoupled services in Microservices architecture enables the entire application to be built, modified, and scaled up quickly with ease.<br />
• Componentization –As each service is an independent component, they can be easily individually replaced and upgraded.</p>
<p>• Undivided business capability –Each Microservice is effortless and focuses on a single business capability</p>
<p>• Autonomy – Developers and teams can work with minimal dependencies, thus increasing development speed and turnaround time.<br />
• Continuous delivery – Allows frequent releases of features by systematic automation of application creation, testing, and approval.<br />
• Responsibility – Microservices treat applications as products and not projects, ensuring the responsibility is in-built.<br />
• Decentralized governance – With no fixed or standardized tool or any technology patterns, developers have the freedom to choose tools based on the requirements to accomplish the job within stipulated timelines.<br />
• Agility – New features can be added easily and quickly developed. A Microservices architecture supports agile development.</p>
<h2><strong>Advantages of Microservices</strong></h2>
<p>• Independent development – all services are independent of their business purposes and usage.<br />
• Independent deployment –The architecture of Microservices allows services to be individually deployed.<br />
• Isolation of fault – the system continues to function even if one service or a part of the application ceases to work.<br />
• Mixed technologies stack – it is not mandatory to use only one of the platforms for development. We can use multiple platforms and built Microservices architecture as per the need of the application.<br />
• Individual scaling – scale different individual components and deploy them individually without affecting other components.</p>
<h2><strong>Best Practices to Design Microservices</strong></h2>
<p>• Separate data store for each Microservices<br />
• Maintain the level of code maturity<br />
• Separate build for each Microservice<br />
• Deploy services into containers<br />
• Treat server as stateless</p>
<h2><strong>Disadvantages of Microservices</strong></h2>
<p>• Huge number of services makes application management tough to track<br />
• The developer will require to solve issues pertaining to Network latency and load balancing</p>
<h2><strong>How to create Microservices and API Gateway interface?</strong></h2>
<p>Note: This is for those who are familiar with <a href="https://www.metasyssoftware.com/dot-net-development/">ASP.Net</a> project concepts.</p>
<p>In this demo, we&#8217;ll cover the following points,</p>
<p>1. Create two Microservices<br />
2. Create an API Gateway<br />
3. For creating the demo project VS2019 or VS Code, .Net Core 3.1 SDK needs to be installed on the machine</p>
<h2><strong>Steps to Create a Microservices Demo Project</strong></h2>
<p><strong>Step 1</strong><br />
• Create two .Net Core web API template project for different purposes<br />
• First, UserService project for user data purpose<br />
• Second, ProductService project for product data purpose<br />
• Create UserController in UserService project and ProductController in ProductService<br />
• Add simple action into the controller that returns the string for testing purpose<br />
• If required, connect API project with the database</p>
<p><img decoding="async" class="aligncenter wp-image-3535 size-full" title="Simplemicroservice" src="https://www.metasyssoftware.com/wp-content/uploads/Simplemicroservice.png" alt="Simplemicroservice" width="333" height="491" /></p>
<p><strong>Step 2 &#8211; </strong>Test the above web API project with the help of postman individually</p>
<h3><strong>1.) Product Service Output</strong></h3>
<p><img decoding="async" class="aligncenter wp-image-3536 size-full" title="Product service output" src="https://www.metasyssoftware.com/wp-content/uploads/Product-service-output.png" alt="Product service output" width="755" height="343" /></p>
<h3><strong>2.) User Service Output</strong></h3>
<p><img loading="lazy" decoding="async" class="aligncenter wp-image-3537 size-full" title="User service output" src="https://www.metasyssoftware.com/wp-content/uploads/User-service-output.png" alt="User service output" width="725" height="448" /></p>
<p>&nbsp;</p>
<p><strong>Step 3 &#8211; </strong>Create .net core web empty template project for API Gateway with the desired name. In this instance, we chose ‘APIGateway’</p>
<p><strong>Step 4 &#8211; </strong>Include the dependency of ocelot API Gateway from NuGet package manager</p>
<p><img loading="lazy" decoding="async" class="aligncenter wp-image-3538 size-full" title="Ocelot" src="https://www.metasyssoftware.com/wp-content/uploads/Ocelot.png" alt="Ocelot" width="578" height="166" /></p>
<p style="text-align: left;"><strong>Step 5 –</strong><br />
• Create a JSON file to configure API Gateway for web API and assign a name. In this instance, it is ‘ocelot.json’<br />
• Include the following code text to the JSON file for configuring the API Gateway. In this demo project, API Gateway is used for routing purpose. API Gateway serves different purposes such as:<br />
o Routing<br />
o Caching<br />
o Logging<br />
o Authentication<br />
o Authorization<br />
o Load balancing<br />
o Service Discovery</p>
<p><img loading="lazy" decoding="async" class=" wp-image-3539 aligncenter" src="https://www.metasyssoftware.com/wp-content/uploads/Ocelot.JSON.png" alt="Ocelot.JSON" width="947" height="453" /></p>
<p style="text-align: center;">Note: In the above image, detail of ocelot.JSON are in the comments</p>
<p style="text-align: left;">Some details of ocelot.JSON are considered while configuring API Gateway from the ocelot package.</p>
<p>• The request forwarded to URL set byDownstreamPathTemplate, DownstreamHostAndPorts and DownstreamScheme<br />
• Ocelot will use the UpstreamPathTemplate URL to identify where the DownstreamPathTemplate request is to be used.<br />
• Ocelot uses UpstreamHttpMethod to make a difference between multiple requests with the same URLs but with different HTTP verbs. We can set a specific list of HTTP Methods or set a blank to allow any of them.</p>
<p><strong>Step 6 &#8211;</strong> Configure the JSON file for application configuration as shown below in Program.cs file</p>
<p><img loading="lazy" decoding="async" class="aligncenter wp-image-3540 size-full" title="Program.cs file" src="https://www.metasyssoftware.com/wp-content/uploads/Program.cs-file.png" alt="Program.cs file" width="1059" height="529" /></p>
<p><strong>Step 7 –</strong> Set Ocelot middleware ASP.Net project as shown below in Startup.cs file</p>
<p><img loading="lazy" decoding="async" class="aligncenter wp-image-3541 size-full" title="Startup.cs file" src="https://www.metasyssoftware.com/wp-content/uploads/Startup.cs-file.png" alt="Startup.cs file" width="1056" height="510" /></p>
<p><strong>Step 8 –</strong> Run the application to test the working condition of API Gateway. Before running, make sure all projects are marked as startup projects. To handle request from the API Gateway application UserService and ProductService must be running.</p>
<p>Note: If you are testing project through VS2019, the following steps will help you mark all projects as the startup project.</p>
<p><strong>Step 9 &#8211;</strong> Right-click on the main solution and click on the property, alter the settings as shown below</p>
<p><img loading="lazy" decoding="async" class="aligncenter wp-image-3542 size-full" title="Simplemicroservice image 2" src="https://www.metasyssoftware.com/wp-content/uploads/Simplemicroservice-image-2.png" alt="Simplemicroservice image 2" width="1115" height="548" /><br />
<strong>Step 10 &#8211;</strong> Below screen shows the final output. When you run the project, all three startup projects will be running, at times, on different ports. We need to check if Customer and User service received a call from the API Gateway project, as shown below.</p>
<p><img loading="lazy" decoding="async" class="aligncenter wp-image-3543" title="API Gateway project" src="https://www.metasyssoftware.com/wp-content/uploads/API-Gateway-project.png" alt="API Gateway project" width="1098" height="585" /></p>
<p>&nbsp;</p>
<p>Hope this article has helped you understand the know-how of Microservices. If you have any questions, please feel free to drop them in our comments section. Happy to Help!<br />
Happy Coding!</p>The post <a href="https://www.metasyssoftware.com/dot-net/microservices/">What, Why, and How of Microservices?</a> appeared first on <a href="https://www.metasyssoftware.com">Metasys Software Pvt Ltd.</a>.]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
