<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-2159069551745631737</id><updated>2026-10-01T02:28:56.173-07:00</updated><category term="Dotnet Solutions by Piush Shukla"/><category term="Piush Shukla"/><category term="Chetu Interview Question"/><category term="Ajax Cascading DropDownList With Database Example in GridView"/><category term="Querystring"/><category term="View state"/><category term="What Is LINQ?"/><category term=".NET FrameWork FAQ&#39;s"/><category term=".NET Framework 4.6"/><category term="2.0"/><category term="2nd highest salary of employee in sql"/><category term="3.0"/><category term="3.5 and 4.0"/><category term="38)What is appsettings?"/><category term="ASP.NET  Page Life Cycle"/><category term="AUTOCOMPLETE EXTENDER VALUE IN TEXTBOX BASED ON DROPDOWNLIST VALUE"/><category term="Access Modifiers"/><category term="Acid propert in sql server 2008"/><category term="Add loop multiple HTML5 videos using javascript"/><category term="Add two or more byte array in c#"/><category term="Aggregate Functions in SQL SERVER"/><category term="Ajax AutoCompleteExtender sample without using webservice (or) Asp.Net AJAX AutoComplete Extender From Database without using webservice"/><category term="Alphanumeric"/><category term="Android equilvalent of c#  AES decryption"/><category term="Assembly  dotnet"/><category term="Async calling between .Net and Flash"/><category term="Automatically redirect http to https in IIS"/><category term="Biggest difference between Table variables &amp; Temp tables in Sql Server"/><category term="Binding drop down from Current year in asp.net"/><category term="Blank Field"/><category term="C#: Interfaces - Implicit and Explicit implementation"/><category term="Calculate Relative Time in c#"/><category term="Can abstract class have constructors"/><category term="Can we have try block without catch"/><category term="Cannot open database requested by the login. The login failed. Login failed for user &#39;NT AUTHORITY\NETWORK SERVICE&#39;."/><category term="Change user password using changepassword control in asp.net membership provider"/><category term="Chetu .Net Interview Question"/><category term="Chetu Interview Question WCF"/><category term="Chetu Interview Question in .Net"/><category term="Chetu Intrview Question"/><category term="Class vs Object vs Instance"/><category term="Client Side Validation in asp.net"/><category term="Cloning objects in C#"/><category term="Coding standards in programming"/><category term="Common Performance Issues in .net"/><category term="Compare Session state and Viewstate in .NET?"/><category term="Concept of Heap and Stack"/><category term="Config File"/><category term="Constraints in sql server"/><category term="Constructor"/><category term="Context"/><category term="Context.handler"/><category term="Convert.tostring()?"/><category term="Cookie"/><category term="Coupling and Cohesion"/><category term="Create Html table in c# dynamically"/><category term="Create symlink inside Virtual Machine (Virtual Box) Host&#39;s shared folder"/><category term="Credit Card Transaction types"/><category term="Database Connectionstrings in .net"/><category term="Date"/><category term="Date Formatting in C#"/><category term="Decimal"/><category term="Decompress using GZipStream c#"/><category term="Decryption in AES c#"/><category term="Default Access modifiers in C#?"/><category term="Delete and Head HTTP method in WEB API"/><category term="Deployment of Silverlight App + Silverlight-Enabled WCF Service to Production"/><category term="Dictionaries in .Net"/><category term="Difference Between Implict Transaction And Explict Transaction"/><category term="Difference Between String and StringBuilder"/><category term="Difference Betwwen javascript and jquery"/><category term="Difference between ADO and ADO.net"/><category term="Difference between ADO.net Dataset and ADO Recordset"/><category term="Difference between Close() and Dispose() Method"/><category term="Difference between DataList and Repeater controls"/><category term="Difference between Dataset and DataReader"/><category term="Difference between Globalization and Localization"/><category term="Difference between Interface and Abstract Class"/><category term="Difference between Linq and Entity Framework"/><category term="Difference between Nhibernate vs Linq"/><category term="Difference between String and string in c#"/><category term="Difference between Struct and Class"/><category term="Difference between VB.NET and C#.NET"/><category term="Difference between WCF and Web services?"/><category term="Difference between Web.config and Machine.config"/><category term="Difference between a Class and Component"/><category term="Difference between a Layer and Tier?"/><category term="Difference between const and readonly?"/><category term="Difference between convert.tostring() and .tostring()"/><category term="Difference between debug build and release build"/><category term="Difference between event and delegate"/><category term="Difference between imperative and interrogative code"/><category term="Difference between linq and ado.net"/><category term="Difference between lock and Monitor.Enter()"/><category term="Difference between markup language"/><category term="Difference between varchar and char"/><category term="Differences Between Microsoft Visual Basic .NET and Microsoft Visual C# .NET"/><category term="Differences between Bankcard processing and Virtual check processing:"/><category term="Differences between Window and Web Forms"/><category term="Differnce between Application"/><category term="Diffrences in Linq and ado.net"/><category term="Disable Multiple Button Click in Asp.net"/><category term="Disadvantage of Ajax"/><category term="Dispose"/><category term="Dispose in C#"/><category term="Dll Vs Exe"/><category term="Dotnet Interview question for fresher"/><category term="Encapsulation in C#:"/><category term="Event logging in window services c#"/><category term="Execute command line in C#"/><category term="ExecuteNonQuery and ExecuteScalar."/><category term="Explain inline"/><category term="Explain the protocols a .Net Web Service uses"/><category term="Fastest Way to Update Rows in a Large Table in SQL Server"/><category term="Float and Double in C#?"/><category term="Freeing Memory in .Net + Finalize Method + Destructor + Difference between Finalize and Destructor + Garbage Collection"/><category term="Garbage Collector"/><category term="Get"/><category term="Get Ascii value in c#"/><category term="Get Printer List of System in c# Self Host WCF with Window Service"/><category term="Getting exception of Invalid length in decryption from AES Algorithm"/><category term="Global.asax File in ASP.NET"/><category term="Group By Query  in Linq"/><category term="Hashtable Concept in .Net"/><category term="How can we find the open transactions details in sql server"/><category term="How do disable back button in browser"/><category term="How does .NET remoting work?"/><category term="How many design patterns are there and what are they?"/><category term="How many types of triggers are there in update panel"/><category term="How to Send Email using Asp.Net  with C#"/><category term="How to add Auto Increment Serial No in Grid View  in C#.net"/><category term="How to assign width to label/button/textbox in vb.net ?"/><category term="How to configure State Server in ASP.Net??"/><category term="How to create Crystal report"/><category term="How to create setup file in Visual studio 2008"/><category term="How to declare a property in a class"/><category term="How to declare a property in an Interface"/><category term="How to get distinct values from an array in C#?"/><category term="How to pass QueryString Between Pages"/><category term="How to read binary data in ado.net Sqlite"/><category term="How to select Only One CheckBox In Grid View"/><category term="How to write conditional statement in CSS?"/><category term="IEnumerable  In .net"/><category term="INSERT into a table records extracted from another table"/><category term="If I write System.exit (0); at the end of the try block"/><category term="Immutable"/><category term="Import Excel To Sql in c# Dotnet"/><category term="In .Netframework how CLR(Commom language runtime) has work???"/><category term="Inserting data in linq"/><category term="Is there a way to check if a file is in use?"/><category term="IsPostBack in Asp.net"/><category term="JQuery and Advantages"/><category term="Java equivalent of C# AES Decryption"/><category term="Join In sql"/><category term="Join In sql server with example"/><category term="Joins In Sql"/><category term="Jquery calender as a dropdown in asp.net"/><category term="Jump statement in C#"/><category term="Lambda expression"/><category term="Linq Interview Question"/><category term="Linq To sql in Dotnet"/><category term="Login form in asp.net"/><category term="Master page in asp.net"/><category term="MobileNo"/><category term="Name Spaces Available in .NET Framework 4:"/><category term="Name the Basic or Default Databases of SQL SERVER and What are their functions and use.?"/><category term="Nested Trigger"/><category term="New Keyword in c#"/><category term="Nth Highest Salary Record In Sql Server"/><category term="OOPS Concepts in Dot Net"/><category term="PCI-DSS Programming Guidelines"/><category term="Pass Send GridView Row Value/Data Using Hyperlink in ASP.NET"/><category term="Password recovery with .NET  using C#"/><category term="Polymorphism"/><category term="Print a web form using asp.net with c#"/><category term="PrintAPIHeartTest"/><category term="Problems Steps Recorder in Windows 7"/><category term="Pros and cons of LINQ"/><category term="Put"/><category term="Query in Entity Framework"/><category term="Query string in asp.net"/><category term="Queue  in .Net"/><category term="Random Number Generator in c#"/><category term="React Js Interview Questions"/><category term="Read ByteData from txt file which contains binary data"/><category term="Read XML Using Linq"/><category term="Read Xml Data in asp.net"/><category term="Regular expression for validating the IP Address using Javascript?"/><category term="Repeater Control example in asp.net"/><category term="Request Entity Too Large Web API issue"/><category term="Required Field"/><category term="Response.Redirect(url"/><category term="Return anonymous type in Linq to Sql"/><category term="Role of IIS"/><category term="SQL Group By"/><category term="SQL Injection"/><category term="SQL Optimization Tips"/><category term="SQL Server Error - Saving Changes in not permitted."/><category term="SQL Server performance tips"/><category term="Sample regular expression - Numeric"/><category term="Scalabilty in .net"/><category term="Scope of public/private/friend/protected/protected friend"/><category term="Script to logout and redirect to login page if user is idle for 5minutes."/><category term="Scripting languages and Programming languages"/><category term="Select Statement"/><category term="Session"/><category term="Setting Up Your Environment In Entity Framework"/><category term="Silver lightIntroduction"/><category term="Soap"/><category term="Some Intersting Question for interview"/><category term="Sort array in ascending descending order"/><category term="SortedList  in .Net"/><category term="Sorting in data structure"/><category term="Sql Basic Interview Question"/><category term="Sql Interview Question"/><category term="Sql server date format"/><category term="SqlCommand Object"/><category term="SqlDataReader"/><category term="Stack in .net"/><category term="Static Constructor"/><category term="Static Member"/><category term="Static Method"/><category term="Swap Place in a Array C#"/><category term="Swapping Two Numbers"/><category term="T-SQL query to find all the Foreign Key Relations in a Database"/><category term="Temporay and Global Table in Sql"/><category term="The 3 ways to get an accurate count of the number of records in a table are as below"/><category term="The DataSet and SqlDataAdapter"/><category term="The IHttpHandler and IHttpHandlerFactory interfaces ?"/><category term="Two models in one view in ASP MVC 3"/><category term="Types of Errors in Dotnet"/><category term="UDDI"/><category term="Use of EnablePageMethods in Asp.Net AJAX"/><category term="Value Type and Reference Type Concept in .Net"/><category term="View In Sql Server"/><category term="Visual Studio Keyboard Shortcuts"/><category term="WCF Fundamentals"/><category term="Web API calling c# with byte data"/><category term="Web API validation on input field"/><category term="Web Service in ASP.NET"/><category term="Web Services in .Net"/><category term="Web services vs. CORBA and DCOM."/><category term="Web.Config File"/><category term="What are Generics in C#?"/><category term="What are contracts in WCF"/><category term="What are difference between GET and POST Methods?"/><category term="What are differences between function and stored procedure?"/><category term="What are different methods of session maintenance in ASP.NET?"/><category term="What are the attributes of a strong name?"/><category term="What are the four LINQ Providers that .NET Framework ships?"/><category term="What do you mean by three-tier architecture?"/><category term="What does NULL mean?"/><category term="What is .Net Framework?"/><category term="What is .Net Platform?"/><category term="What is .Net Web Service"/><category term="What is AJAX"/><category term="What is Assembly name and name space?"/><category term="What is Biml"/><category term="What is Constructor Chaining?"/><category term="What is Difference between == and .Equals() Method?"/><category term="What is FOREIGN KEY?"/><category term="What is MVC Pattern?"/><category term="What is MVC architecture?"/><category term="What is Normalization"/><category term="What is OOP?"/><category term="What is Object Relational Designer (0/R Designer)?"/><category term="What is Operator Overloading?"/><category term="What is PRIMARY KEY?"/><category term="What is Polymorphism?"/><category term="What is Prototyping?"/><category term="What is SQL Profiler?"/><category term="What is SQL Server Agent"/><category term="What is Server??"/><category term="What is Smart Navigation ?"/><category term="What is Stored procedure?"/><category term="What is Transport and Message Reliability?"/><category term="What is UNIQUE KEY constraint?"/><category term="What is WCF"/><category term="What is a LinqDataSource"/><category term="What is a Partial class?"/><category term="What is a Scheduled Jobs in sql"/><category term="What is a cookie?"/><category term="What is address in WCF and how many types of transport schemas are there in WCF"/><category term="What is binding and how many types of bindings are there in WCF?"/><category term="What is cursor in SQL Server?"/><category term="What is difference between ExecuteReader"/><category term="What is lock statement in C#"/><category term="What is the DataContext class and how is it related to LINQ?"/><category term="What is the Difference between read only and constant variables?"/><category term="What is the Pre-Compilation feature of ASP.NET 2.0?"/><category term="What is the ValidationSummary in Asp.net?"/><category term="What is the command name to shrink the data file and log file size in SQL server 2005"/><category term="What is the difference Grid View and between Data Grid (Windows)?"/><category term="What is the difference between .tostring()"/><category term="What is the difference between Copy and Clone Method."/><category term="What is the difference between First() and Single() extension methods in LINQ"/><category term="What is the difference between FirstOrDefault() and SingleOrDefault() extension method in LINQ"/><category term="What is the difference between a Local and a Global temporary table?"/><category term="What is the difference between authorization and authentication?"/><category term="What is the difference between framework and IDE?"/><category term="What is the difference between the Select clause and SelectMany() method in LINQ?"/><category term="What is the difference between view state and hidden field?"/><category term="What is the use of SN.exe?"/><category term="What is three-tier architecture"/><category term="What is two-tier architecture?"/><category term="What is “ref” keyword in C#"/><category term="What will be the best:- Web application OR Web site"/><category term="What&#39;s the difference between a primary key and a unique key?"/><category term="When to use Interface"/><category term="Which DLL translate XML"/><category term="Why are mutable structs evil?"/><category term="Why catch and rethrow Exception in C#?"/><category term="Why do we need .Net Web Services"/><category term="Windows 8 feature"/><category term="Windows Server 2012"/><category term="Wpf vs Silverlight"/><category term="Write the basic syntax of a LINQ query in Visual Basic as well as in C#"/><category term="Wsdl"/><category term="all rows of the DataTable"/><category term="application state"/><category term="asp.net dropdownlist Header  value disabled to select"/><category term="benefit of using LINQ on Dataset"/><category term="cache"/><category term="calculate someone&#39;s age in C#?"/><category term="cookies"/><category term="copy between two Stream instances - C#"/><category term="copy data from one server database table to another server database table in SQL server"/><category term="data table"/><category term="dataview"/><category term="delete procedures"/><category term="difference between .NET 1.1"/><category term="difference between ASP.NET and VB.NET"/><category term="difference between Decimal"/><category term="difference between Linq and Stored procedure"/><category term="difference between a Thread and a Process"/><category term="difference between casting and boxing"/><category term="difference between dataset"/><category term="difference between i++ and ++i"/><category term="difference between portal and website"/><category term="difference between the having clause and the group by statement"/><category term="differences between .NET Framework 3.0 and 3.5"/><category term="differences between Server-side and Client-side code"/><category term="differences between arrays and collections"/><category term="different types of directives in .NET"/><category term="dll"/><category term="embedded and external style sheets ."/><category term="error 15128 in Microsoft Sql Server"/><category term="facebook smiley and facebook chat word"/><category term="false)"/><category term="find difference between two dates in C#"/><category term="find list of all procedure and function containing Search Word"/><category term="first text as a custom in dotnet"/><category term="functions or views in Sql"/><category term="get STD OUT results"/><category term="get list with procedures"/><category term="get total number of tables in a database in SQL"/><category term="get value from RadioButtonList control in java script"/><category term="get value from a textbox in java script"/><category term="get value from dropdown (select) control in java script"/><category term="how to document web services"/><category term="how to rename a column or table in SQL SERVER"/><category term="ifferences between interface and an abstract class"/><category term="memory release on close of window application c#"/><category term="out Keyword” in C#."/><category term="post"/><category term="remove special characters from string in c#.net"/><category term="retrieve records with or without null values from database in sql server"/><category term="sealed classes in c#"/><category term="session state"/><category term="shut down an application in Asp.Net"/><category term="similarilty and difference between .dll extension and .exe extension files"/><category term="stored procedure in Sql server"/><category term="true) Vs Response.Redirect(url"/><category term="user functions or views from a database in SQL"/><category term="var keyword in dotnet"/><category term="what is .pdb file in .net?"/><category term="what is Entity Framework in .net"/><category term="when do we required ASP.NET web services"/><category term="will the finally block still execute?"/><title type='text'>.Net</title><subtitle type='html'>By Piush Shukla</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://piushshukla.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2159069551745631737/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://piushshukla.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/2159069551745631737/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Piush shukla</name><uri>http://www.blogger.com/profile/16392649283296436146</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>432</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2159069551745631737.post-3219814855351168520</id><published>2026-02-02T01:21:00.000-08:00</published><updated>2026-07-10T22:05:30.298-07:00</updated><title type='text'></title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://piushshukla.blogspot.com/feeds/3219814855351168520/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://piushshukla.blogspot.com/2026/02/blog-post.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2159069551745631737/posts/default/3219814855351168520'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2159069551745631737/posts/default/3219814855351168520'/><link rel='alternate' type='text/html' href='http://piushshukla.blogspot.com/2026/02/blog-post.html' title=''/><author><name>Piush shukla</name><uri>http://www.blogger.com/profile/16392649283296436146</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2159069551745631737.post-1378745742887648999</id><published>2025-11-11T07:00:16.812-08:00</published><updated>2025-11-29T23:23:05.465-08:00</updated><title type='text'></title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;Happy to walk through workflows, architecture, or demo components&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://piushshukla.blogspot.com/feeds/1378745742887648999/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://piushshukla.blogspot.com/2025/11/blog-post.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2159069551745631737/posts/default/1378745742887648999'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2159069551745631737/posts/default/1378745742887648999'/><link rel='alternate' type='text/html' href='http://piushshukla.blogspot.com/2025/11/blog-post.html' title=''/><author><name>Piush shukla</name><uri>http://www.blogger.com/profile/16392649283296436146</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2159069551745631737.post-7735058054307850056</id><published>2025-10-06T20:35:00.000-07:00</published><updated>2025-10-10T00:19:58.377-07:00</updated><title type='text'></title><content type='html'>&lt;h3 data-end=&quot;212&quot; data-start=&quot;145&quot;&gt;🧾 &lt;strong data-end=&quot;212&quot; data-start=&quot;152&quot;&gt;Steps to Schedule a Batch File in Windows Task Scheduler&lt;/strong&gt;&lt;/h3&gt;&lt;h4 data-end=&quot;253&quot; data-start=&quot;214&quot;&gt;&lt;strong data-end=&quot;253&quot; data-start=&quot;219&quot;&gt;Step 1: Create Your Batch File&lt;/strong&gt;&lt;/h4&gt;&lt;ol data-end=&quot;544&quot; data-start=&quot;254&quot;&gt;
&lt;li data-end=&quot;276&quot; data-start=&quot;254&quot;&gt;
&lt;p data-end=&quot;276&quot; data-start=&quot;257&quot;&gt;Open &lt;strong data-end=&quot;273&quot; data-start=&quot;262&quot;&gt;Notepad&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;425&quot; data-start=&quot;277&quot;&gt;
&lt;p data-end=&quot;318&quot; data-start=&quot;280&quot;&gt;Type your batch commands, for example:&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;425&quot; data-start=&quot;322&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-bat&quot;&gt;@echo off
echo Running monthly maintenance...
:: Add your commands here
pause
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li data-end=&quot;544&quot; data-start=&quot;426&quot;&gt;
&lt;p data-end=&quot;544&quot; data-start=&quot;429&quot;&gt;Save the file as &lt;code data-end=&quot;464&quot; data-start=&quot;446&quot;&gt;monthly_task.bat&lt;/code&gt; (example name).&lt;br data-end=&quot;483&quot; data-start=&quot;480&quot; /&gt;
📁 Save it in a folder like: &lt;code data-end=&quot;544&quot; data-start=&quot;515&quot;&gt;C:\Scripts\monthly_task.bat&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;&lt;hr data-end=&quot;549&quot; data-start=&quot;546&quot; /&gt;&lt;h4 data-end=&quot;587&quot; data-start=&quot;551&quot;&gt;&lt;strong data-end=&quot;587&quot; data-start=&quot;556&quot;&gt;Step 2: Open Task Scheduler&lt;/strong&gt;&lt;/h4&gt;&lt;ol data-end=&quot;699&quot; data-start=&quot;588&quot;&gt;
&lt;li data-end=&quot;655&quot; data-start=&quot;588&quot;&gt;
&lt;p data-end=&quot;655&quot; data-start=&quot;591&quot;&gt;Press &lt;strong data-end=&quot;612&quot; data-start=&quot;597&quot;&gt;Windows + R&lt;/strong&gt; → type &lt;code data-end=&quot;634&quot; data-start=&quot;620&quot;&gt;taskschd.msc&lt;/code&gt; → press &lt;strong data-end=&quot;652&quot; data-start=&quot;643&quot;&gt;Enter&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;699&quot; data-start=&quot;656&quot;&gt;
&lt;p data-end=&quot;699&quot; data-start=&quot;659&quot;&gt;The &lt;strong data-end=&quot;681&quot; data-start=&quot;663&quot;&gt;Task Scheduler&lt;/strong&gt; window will open.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;&lt;hr data-end=&quot;704&quot; data-start=&quot;701&quot; /&gt;&lt;h4 data-end=&quot;742&quot; data-start=&quot;706&quot;&gt;&lt;strong data-end=&quot;742&quot; data-start=&quot;711&quot;&gt;Step 3: Create a Basic Task&lt;/strong&gt;&lt;/h4&gt;&lt;ol data-end=&quot;872&quot; data-start=&quot;743&quot;&gt;
&lt;li data-end=&quot;797&quot; data-start=&quot;743&quot;&gt;
&lt;p data-end=&quot;797&quot; data-start=&quot;746&quot;&gt;Click &lt;strong data-end=&quot;776&quot; data-start=&quot;752&quot;&gt;“Create Basic Task…”&lt;/strong&gt; on the right side.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;853&quot; data-start=&quot;798&quot;&gt;
&lt;p data-end=&quot;853&quot; data-start=&quot;801&quot;&gt;Enter a &lt;strong data-end=&quot;817&quot; data-start=&quot;809&quot;&gt;name&lt;/strong&gt; (e.g., “Run Monthly Batch File”).&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;872&quot; data-start=&quot;854&quot;&gt;
&lt;p data-end=&quot;872&quot; data-start=&quot;857&quot;&gt;Click &lt;strong data-end=&quot;871&quot; data-start=&quot;863&quot;&gt;Next&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;&lt;hr data-end=&quot;877&quot; data-start=&quot;874&quot; /&gt;&lt;h4 data-end=&quot;922&quot; data-start=&quot;879&quot;&gt;&lt;strong data-end=&quot;922&quot; data-start=&quot;884&quot;&gt;Step 4: Set the Trigger (Schedule)&lt;/strong&gt;&lt;/h4&gt;&lt;ol data-end=&quot;1146&quot; data-start=&quot;923&quot;&gt;
&lt;li data-end=&quot;966&quot; data-start=&quot;923&quot;&gt;
&lt;p data-end=&quot;966&quot; data-start=&quot;926&quot;&gt;Select &lt;strong data-end=&quot;946&quot; data-start=&quot;933&quot;&gt;“Monthly”&lt;/strong&gt; → click &lt;strong data-end=&quot;963&quot; data-start=&quot;955&quot;&gt;Next&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1012&quot; data-start=&quot;967&quot;&gt;
&lt;p data-end=&quot;1012&quot; data-start=&quot;970&quot;&gt;Under &lt;strong data-end=&quot;986&quot; data-start=&quot;976&quot;&gt;Months&lt;/strong&gt;, select &lt;strong data-end=&quot;1009&quot; data-start=&quot;995&quot;&gt;All months&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1081&quot; data-start=&quot;1013&quot;&gt;
&lt;p data-end=&quot;1081&quot; data-start=&quot;1016&quot;&gt;Under &lt;strong data-end=&quot;1030&quot; data-start=&quot;1022&quot;&gt;Days&lt;/strong&gt;, enter &lt;strong data-end=&quot;1043&quot; data-start=&quot;1038&quot;&gt;1&lt;/strong&gt; (this means 1st day of each month).&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1127&quot; data-start=&quot;1082&quot;&gt;
&lt;p data-end=&quot;1127&quot; data-start=&quot;1085&quot;&gt;Set the &lt;strong data-end=&quot;1107&quot; data-start=&quot;1093&quot;&gt;Start time&lt;/strong&gt; (e.g., 10:00 AM).&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1146&quot; data-start=&quot;1128&quot;&gt;
&lt;p data-end=&quot;1146&quot; data-start=&quot;1131&quot;&gt;Click &lt;strong data-end=&quot;1145&quot; data-start=&quot;1137&quot;&gt;Next&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;&lt;hr data-end=&quot;1151&quot; data-start=&quot;1148&quot; /&gt;&lt;h4 data-end=&quot;1184&quot; data-start=&quot;1153&quot;&gt;&lt;strong data-end=&quot;1184&quot; data-start=&quot;1158&quot;&gt;Step 5: Set the Action&lt;/strong&gt;&lt;/h4&gt;&lt;ol data-end=&quot;1384&quot; data-start=&quot;1185&quot;&gt;
&lt;li data-end=&quot;1236&quot; data-start=&quot;1185&quot;&gt;
&lt;p data-end=&quot;1236&quot; data-start=&quot;1188&quot;&gt;Select &lt;strong data-end=&quot;1216&quot; data-start=&quot;1195&quot;&gt;“Start a program”&lt;/strong&gt; → click &lt;strong data-end=&quot;1233&quot; data-start=&quot;1225&quot;&gt;Next&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1292&quot; data-start=&quot;1237&quot;&gt;
&lt;p data-end=&quot;1292&quot; data-start=&quot;1240&quot;&gt;In the &lt;strong data-end=&quot;1265&quot; data-start=&quot;1247&quot;&gt;Program/script&lt;/strong&gt; field, click &lt;strong data-end=&quot;1289&quot; data-start=&quot;1279&quot;&gt;Browse&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1365&quot; data-start=&quot;1293&quot;&gt;
&lt;p data-end=&quot;1365&quot; data-start=&quot;1296&quot;&gt;Locate and select your &lt;code data-end=&quot;1325&quot; data-start=&quot;1319&quot;&gt;.bat&lt;/code&gt; file (&lt;code data-end=&quot;1361&quot; data-start=&quot;1332&quot;&gt;C:\Scripts\monthly_task.bat&lt;/code&gt;).&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1384&quot; data-start=&quot;1366&quot;&gt;
&lt;p data-end=&quot;1384&quot; data-start=&quot;1369&quot;&gt;Click &lt;strong data-end=&quot;1383&quot; data-start=&quot;1375&quot;&gt;Next&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;&lt;hr data-end=&quot;1389&quot; data-start=&quot;1386&quot; /&gt;&lt;h4 data-end=&quot;1424&quot; data-start=&quot;1391&quot;&gt;&lt;strong data-end=&quot;1424&quot; data-start=&quot;1396&quot;&gt;Step 6: Finish the Setup&lt;/strong&gt;&lt;/h4&gt;&lt;ol data-end=&quot;1477&quot; data-start=&quot;1425&quot;&gt;
&lt;li data-end=&quot;1454&quot; data-start=&quot;1425&quot;&gt;
&lt;p data-end=&quot;1454&quot; data-start=&quot;1428&quot;&gt;Review the summary page.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1477&quot; data-start=&quot;1455&quot;&gt;
&lt;p data-end=&quot;1477&quot; data-start=&quot;1458&quot;&gt;Click &lt;strong data-end=&quot;1474&quot; data-start=&quot;1464&quot;&gt;Finish&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;&lt;hr data-end=&quot;1482&quot; data-start=&quot;1479&quot; /&gt;&lt;h4 data-end=&quot;1532&quot; data-start=&quot;1484&quot;&gt;&lt;strong data-end=&quot;1532&quot; data-start=&quot;1489&quot;&gt;Step 7: (Optional) Run as Administrator&lt;/strong&gt;&lt;/h4&gt;&lt;p data-end=&quot;1576&quot; data-start=&quot;1533&quot;&gt;If your batch file needs admin permissions:&lt;/p&gt;&lt;ol data-end=&quot;1722&quot; data-start=&quot;1577&quot;&gt;
&lt;li data-end=&quot;1635&quot; data-start=&quot;1577&quot;&gt;
&lt;p data-end=&quot;1635&quot; data-start=&quot;1580&quot;&gt;Right-click the created task → choose &lt;strong data-end=&quot;1632&quot; data-start=&quot;1618&quot;&gt;Properties&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1705&quot; data-start=&quot;1636&quot;&gt;
&lt;p data-end=&quot;1705&quot; data-start=&quot;1639&quot;&gt;In the &lt;strong data-end=&quot;1657&quot; data-start=&quot;1646&quot;&gt;General&lt;/strong&gt; tab, check &lt;strong data-end=&quot;1703&quot; data-start=&quot;1669&quot;&gt;“Run with highest privileges.”&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1722&quot; data-start=&quot;1706&quot;&gt;
&lt;p data-end=&quot;1722&quot; data-start=&quot;1709&quot;&gt;Click &lt;strong data-end=&quot;1721&quot; data-start=&quot;1715&quot;&gt;OK&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;&lt;hr data-end=&quot;1727&quot; data-start=&quot;1724&quot; /&gt;&lt;h4 data-end=&quot;1759&quot; data-start=&quot;1729&quot;&gt;&lt;strong data-end=&quot;1759&quot; data-start=&quot;1734&quot;&gt;Step 8: Test the Task&lt;/strong&gt;&lt;/h4&gt;&lt;ol data-end=&quot;1849&quot; data-start=&quot;1760&quot;&gt;
&lt;li data-end=&quot;1803&quot; data-start=&quot;1760&quot;&gt;
&lt;p data-end=&quot;1803&quot; data-start=&quot;1763&quot;&gt;Right-click your task → click &lt;strong data-end=&quot;1800&quot; data-start=&quot;1793&quot;&gt;Run&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1849&quot; data-start=&quot;1804&quot;&gt;
&lt;p data-end=&quot;1849&quot; data-start=&quot;1807&quot;&gt;Confirm your batch file executes properly.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;&lt;hr data-end=&quot;1854&quot; data-start=&quot;1851&quot; /&gt;&lt;p data-end=&quot;111&quot; data-start=&quot;0&quot;&gt;

























&lt;/p&gt;&lt;p data-end=&quot;1965&quot; data-start=&quot;1856&quot;&gt;✅ &lt;strong data-end=&quot;1869&quot; data-start=&quot;1858&quot;&gt;Result:&lt;/strong&gt;&lt;br data-end=&quot;1872&quot; data-start=&quot;1869&quot; /&gt;
Your batch file will now &lt;strong data-end=&quot;1944&quot; data-start=&quot;1897&quot;&gt;automatically run on the 1st of every month&lt;/strong&gt; at the time you set.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://piushshukla.blogspot.com/feeds/7735058054307850056/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://piushshukla.blogspot.com/2025/10/despite-multiple-verbal-and-written.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2159069551745631737/posts/default/7735058054307850056'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2159069551745631737/posts/default/7735058054307850056'/><link rel='alternate' type='text/html' href='http://piushshukla.blogspot.com/2025/10/despite-multiple-verbal-and-written.html' title=''/><author><name>Piush shukla</name><uri>http://www.blogger.com/profile/16392649283296436146</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2159069551745631737.post-6592587765759169878</id><published>2025-09-24T22:14:00.000-07:00</published><updated>2025-09-24T22:14:52.675-07:00</updated><title type='text'>Trigger in Azure Functions</title><content type='html'>&lt;h2 data-end=&quot;163&quot; data-start=&quot;120&quot;&gt;🟢 What is a Trigger in Azure Functions?&lt;/h2&gt;
&lt;ul data-end=&quot;350&quot; data-start=&quot;164&quot;&gt;
&lt;li data-end=&quot;253&quot; data-start=&quot;164&quot;&gt;
&lt;p data-end=&quot;253&quot; data-start=&quot;166&quot;&gt;An &lt;strong data-end=&quot;187&quot; data-start=&quot;169&quot;&gt;Azure Function&lt;/strong&gt; is a small piece of code that runs only when something &lt;em data-end=&quot;252&quot; data-start=&quot;243&quot;&gt;happens&lt;/em&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;297&quot; data-start=&quot;254&quot;&gt;
&lt;p data-end=&quot;297&quot; data-start=&quot;256&quot;&gt;That “something” is called a &lt;strong data-end=&quot;296&quot; data-start=&quot;285&quot;&gt;trigger&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;350&quot; data-start=&quot;298&quot;&gt;
&lt;p data-end=&quot;350&quot; data-start=&quot;300&quot;&gt;&lt;strong data-end=&quot;331&quot; data-start=&quot;300&quot;&gt;Trigger = automatic starter&lt;/strong&gt; for your function.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;450&quot; data-start=&quot;352&quot;&gt;Example:&lt;br data-end=&quot;363&quot; data-start=&quot;360&quot; /&gt;
If you want a function to run every day at 9 AM, a &lt;strong data-end=&quot;431&quot; data-start=&quot;414&quot;&gt;Timer trigger&lt;/strong&gt; starts it for you.&lt;/p&gt;
&lt;hr data-end=&quot;455&quot; data-start=&quot;452&quot; /&gt;
&lt;h2 data-end=&quot;471&quot; data-start=&quot;457&quot;&gt;🧩 Key Idea&lt;/h2&gt;
&lt;ul data-end=&quot;620&quot; data-start=&quot;472&quot;&gt;
&lt;li data-end=&quot;522&quot; data-start=&quot;472&quot;&gt;
&lt;p data-end=&quot;522&quot; data-start=&quot;474&quot;&gt;Each function &lt;strong data-end=&quot;521&quot; data-start=&quot;488&quot;&gt;must have exactly one trigger&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;620&quot; data-start=&quot;523&quot;&gt;
&lt;p data-end=&quot;545&quot; data-start=&quot;525&quot;&gt;The trigger decides:&lt;/p&gt;
&lt;ol data-end=&quot;620&quot; data-start=&quot;548&quot;&gt;
&lt;li data-end=&quot;578&quot; data-start=&quot;548&quot;&gt;
&lt;p data-end=&quot;578&quot; data-start=&quot;551&quot;&gt;&lt;strong data-end=&quot;559&quot; data-start=&quot;551&quot;&gt;When&lt;/strong&gt; the function runs.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;620&quot; data-start=&quot;581&quot;&gt;
&lt;p data-end=&quot;620&quot; data-start=&quot;584&quot;&gt;&lt;strong data-end=&quot;603&quot; data-start=&quot;584&quot;&gt;What input data&lt;/strong&gt; is passed to it.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;625&quot; data-start=&quot;622&quot; /&gt;
&lt;h2 data-end=&quot;669&quot; data-start=&quot;627&quot;&gt;🔑 Common Trigger Types (with Examples)&lt;/h2&gt;
&lt;p data-end=&quot;736&quot; data-start=&quot;671&quot;&gt;Below are the most used Azure Function triggers and what they do.&lt;/p&gt;
&lt;div class=&quot;_tableContainer_1rjym_1&quot;&gt;&lt;div class=&quot;group _tableWrapper_1rjym_13 flex w-fit flex-col-reverse&quot; tabindex=&quot;-1&quot;&gt;&lt;table class=&quot;w-fit min-w-(--thread-content-width)&quot; data-end=&quot;1979&quot; data-start=&quot;738&quot;&gt;&lt;thead data-end=&quot;798&quot; data-start=&quot;738&quot;&gt;&lt;tr data-end=&quot;798&quot; data-start=&quot;738&quot;&gt;&lt;th data-col-size=&quot;sm&quot; data-end=&quot;753&quot; data-start=&quot;738&quot;&gt;Trigger Type&lt;/th&gt;&lt;th data-col-size=&quot;md&quot; data-end=&quot;780&quot; data-start=&quot;753&quot;&gt;What Starts the Function&lt;/th&gt;&lt;th data-col-size=&quot;md&quot; data-end=&quot;798&quot; data-start=&quot;780&quot;&gt;Simple Example&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody data-end=&quot;1979&quot; data-start=&quot;860&quot;&gt;&lt;tr data-end=&quot;1017&quot; data-start=&quot;860&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;879&quot; data-start=&quot;860&quot;&gt;&lt;strong data-end=&quot;878&quot; data-start=&quot;862&quot;&gt;HTTP Trigger&lt;/strong&gt;&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;919&quot; data-start=&quot;879&quot;&gt;An HTTP request (like a web API call)&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;1017&quot; data-start=&quot;919&quot;&gt;Someone sends a GET/POST request to a URL such as &lt;code data-end=&quot;1015&quot; data-start=&quot;971&quot;&gt;https://myfunc.azurewebsites.net/api/hello&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;1110&quot; data-start=&quot;1018&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;1038&quot; data-start=&quot;1018&quot;&gt;&lt;strong data-end=&quot;1037&quot; data-start=&quot;1020&quot;&gt;Timer Trigger&lt;/strong&gt;&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;1075&quot; data-start=&quot;1038&quot;&gt;A scheduled time (like a cron job)&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;1110&quot; data-start=&quot;1075&quot;&gt;Run cleanup every night at 2 AM&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;1234&quot; data-start=&quot;1111&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;1130&quot; data-start=&quot;1111&quot;&gt;&lt;strong data-end=&quot;1129&quot; data-start=&quot;1113&quot;&gt;Blob Trigger&lt;/strong&gt;&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;1181&quot; data-start=&quot;1130&quot;&gt;A file is added or updated in Azure Blob Storage&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;1234&quot; data-start=&quot;1181&quot;&gt;Automatically resize an image after it’s uploaded&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;1351&quot; data-start=&quot;1235&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;1263&quot; data-start=&quot;1235&quot;&gt;&lt;strong data-end=&quot;1262&quot; data-start=&quot;1237&quot;&gt;Queue Storage Trigger&lt;/strong&gt;&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;1312&quot; data-start=&quot;1263&quot;&gt;A new message is put in an Azure Storage Queue&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;1351&quot; data-start=&quot;1312&quot;&gt;Process new orders added to a queue&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;1478&quot; data-start=&quot;1352&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;1378&quot; data-start=&quot;1352&quot;&gt;&lt;strong data-end=&quot;1377&quot; data-start=&quot;1354&quot;&gt;Service Bus Trigger&lt;/strong&gt;&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;1437&quot; data-start=&quot;1378&quot;&gt;A message arrives in an Azure Service Bus queue or topic&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;1478&quot; data-start=&quot;1437&quot;&gt;Handle incoming payment notifications&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;1631&quot; data-start=&quot;1479&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;1504&quot; data-start=&quot;1479&quot;&gt;&lt;strong data-end=&quot;1503&quot; data-start=&quot;1481&quot;&gt;Event Grid Trigger&lt;/strong&gt;&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;1583&quot; data-start=&quot;1504&quot;&gt;An Azure event occurs (e.g., new file in a storage account, resource change)&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;1631&quot; data-start=&quot;1583&quot;&gt;Send a Slack message when a new file arrives&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;1742&quot; data-start=&quot;1632&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;1656&quot; data-start=&quot;1632&quot;&gt;&lt;strong data-end=&quot;1655&quot; data-start=&quot;1634&quot;&gt;Event Hub Trigger&lt;/strong&gt;&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;1714&quot; data-start=&quot;1656&quot;&gt;A batch of event-stream data arrives (IoT or telemetry)&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;1742&quot; data-start=&quot;1714&quot;&gt;Analyze live sensor data&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;1875&quot; data-start=&quot;1743&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;1767&quot; data-start=&quot;1743&quot;&gt;&lt;strong data-end=&quot;1766&quot; data-start=&quot;1745&quot;&gt;Cosmos DB Trigger&lt;/strong&gt;&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;1814&quot; data-start=&quot;1767&quot;&gt;A document changes in a Cosmos DB collection&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;1875&quot; data-start=&quot;1814&quot;&gt;Update a cache or run analytics whenever a record changes&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;1979&quot; data-start=&quot;1876&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;1905&quot; data-start=&quot;1876&quot;&gt;&lt;strong data-end=&quot;1904&quot; data-start=&quot;1878&quot;&gt;SignalR Trigger (rare)&lt;/strong&gt;&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;1931&quot; data-start=&quot;1905&quot;&gt;A SignalR event happens&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;1979&quot; data-start=&quot;1931&quot;&gt;Send real-time messages to connected clients&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;
&lt;hr data-end=&quot;1984&quot; data-start=&quot;1981&quot; /&gt;
&lt;h2 data-end=&quot;2018&quot; data-start=&quot;1986&quot;&gt;🛠️ How It Works Step by Step&lt;/h2&gt;
&lt;ol data-end=&quot;2730&quot; data-start=&quot;2020&quot;&gt;
&lt;li data-end=&quot;2427&quot; data-start=&quot;2020&quot;&gt;
&lt;p data-end=&quot;2123&quot; data-start=&quot;2023&quot;&gt;&lt;strong data-end=&quot;2042&quot; data-start=&quot;2023&quot;&gt;Binding in Code&lt;/strong&gt;&lt;br data-end=&quot;2045&quot; data-start=&quot;2042&quot; /&gt;
In the function’s code you specify the trigger type and connection details.&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;2427&quot; data-start=&quot;2127&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-csharp&quot;&gt;[&lt;span class=&quot;hljs-meta&quot;&gt;FunctionName(&lt;span class=&quot;hljs-string&quot;&gt;&quot;MyHttpFunction&quot;&lt;/span&gt;&lt;/span&gt;)]
&lt;span class=&quot;hljs-function&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;static&lt;/span&gt; IActionResult &lt;span class=&quot;hljs-title&quot;&gt;Run&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot;&gt;
    [HttpTrigger(AuthorizationLevel.Function, &lt;/span&gt;&lt;span class=&quot;hljs-string&quot;&gt;&quot;get&quot;&lt;/span&gt;, &lt;span class=&quot;hljs-string&quot;&gt;&quot;post&quot;&lt;/span&gt;)] HttpRequest req,
    ILogger log)
{
    log.LogInformation(&lt;span class=&quot;hljs-string&quot;&gt;&quot;HTTP trigger fired.&quot;&lt;/span&gt;);
    &lt;span class=&quot;hljs-keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;new&lt;/span&gt; OkObjectResult(&lt;span class=&quot;hljs-string&quot;&gt;&quot;Hello World!&quot;&lt;/span&gt;);
}
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2553&quot; data-start=&quot;2429&quot;&gt;
&lt;p data-end=&quot;2553&quot; data-start=&quot;2432&quot;&gt;&lt;strong data-end=&quot;2451&quot; data-start=&quot;2432&quot;&gt;Runtime Listens&lt;/strong&gt;&lt;br data-end=&quot;2454&quot; data-start=&quot;2451&quot; /&gt;
Azure Functions runtime listens for that event (HTTP call, queue message, timer schedule, etc.).&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2730&quot; data-start=&quot;2555&quot;&gt;
&lt;p data-end=&quot;2730&quot; data-start=&quot;2558&quot;&gt;&lt;strong data-end=&quot;2575&quot; data-start=&quot;2558&quot;&gt;Event Happens&lt;/strong&gt;&lt;br data-end=&quot;2578&quot; data-start=&quot;2575&quot; /&gt;
When the event occurs, the runtime &lt;strong data-end=&quot;2639&quot; data-start=&quot;2616&quot;&gt;starts the function&lt;/strong&gt; automatically and passes in the data (like the HTTP body, message text, or blob contents).&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;hr data-end=&quot;2735&quot; data-start=&quot;2732&quot; /&gt;
&lt;h2 data-end=&quot;2769&quot; data-start=&quot;2737&quot;&gt;⚙️ Details About Each Trigger&lt;/h2&gt;
&lt;h3 data-end=&quot;2790&quot; data-start=&quot;2771&quot;&gt;1. HTTP Trigger&lt;/h3&gt;
&lt;ul data-end=&quot;2974&quot; data-start=&quot;2791&quot;&gt;
&lt;li data-end=&quot;2823&quot; data-start=&quot;2791&quot;&gt;
&lt;p data-end=&quot;2823&quot; data-start=&quot;2793&quot;&gt;&lt;strong data-end=&quot;2805&quot; data-start=&quot;2793&quot;&gt;Use for:&lt;/strong&gt; APIs or webhooks.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2874&quot; data-start=&quot;2824&quot;&gt;
&lt;p data-end=&quot;2874&quot; data-start=&quot;2826&quot;&gt;&lt;strong data-end=&quot;2836&quot; data-start=&quot;2826&quot;&gt;Input:&lt;/strong&gt; Request body, query strings, headers.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2903&quot; data-start=&quot;2875&quot;&gt;
&lt;p data-end=&quot;2903&quot; data-start=&quot;2877&quot;&gt;&lt;strong data-end=&quot;2888&quot; data-start=&quot;2877&quot;&gt;Return:&lt;/strong&gt; HTTP response.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2974&quot; data-start=&quot;2904&quot;&gt;
&lt;p data-end=&quot;2974&quot; data-start=&quot;2906&quot;&gt;&lt;strong data-end=&quot;2919&quot; data-start=&quot;2906&quot;&gt;Security:&lt;/strong&gt; Set &lt;code data-end=&quot;2944&quot; data-start=&quot;2924&quot;&gt;AuthorizationLevel&lt;/code&gt; (Anonymous, Function, Admin).&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-end=&quot;2996&quot; data-start=&quot;2976&quot;&gt;2. Timer Trigger&lt;/h3&gt;
&lt;ul data-end=&quot;3164&quot; data-start=&quot;2997&quot;&gt;
&lt;li data-end=&quot;3050&quot; data-start=&quot;2997&quot;&gt;
&lt;p data-end=&quot;3050&quot; data-start=&quot;2999&quot;&gt;&lt;strong data-end=&quot;3011&quot; data-start=&quot;2999&quot;&gt;Use for:&lt;/strong&gt; Scheduled tasks like cleanup, backups.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3126&quot; data-start=&quot;3051&quot;&gt;
&lt;p data-end=&quot;3126&quot; data-start=&quot;3053&quot;&gt;&lt;strong data-end=&quot;3073&quot; data-start=&quot;3053&quot;&gt;Schedule Format:&lt;/strong&gt; CRON expression, e.g., &lt;code data-end=&quot;3112&quot; data-start=&quot;3097&quot;&gt;&quot;0 0 2 * * *&quot;&lt;/code&gt; (2 AM daily).&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3164&quot; data-start=&quot;3127&quot;&gt;
&lt;p data-end=&quot;3164&quot; data-start=&quot;3129&quot;&gt;&lt;strong data-end=&quot;3141&quot; data-start=&quot;3129&quot;&gt;Example:&lt;/strong&gt; Nightly email reports.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-end=&quot;3185&quot; data-start=&quot;3166&quot;&gt;3. Blob Trigger&lt;/h3&gt;
&lt;ul data-end=&quot;3321&quot; data-start=&quot;3186&quot;&gt;
&lt;li data-end=&quot;3218&quot; data-start=&quot;3186&quot;&gt;
&lt;p data-end=&quot;3218&quot; data-start=&quot;3188&quot;&gt;&lt;strong data-end=&quot;3200&quot; data-start=&quot;3188&quot;&gt;Use for:&lt;/strong&gt; Processing files.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3267&quot; data-start=&quot;3219&quot;&gt;
&lt;p data-end=&quot;3267&quot; data-start=&quot;3221&quot;&gt;&lt;strong data-end=&quot;3236&quot; data-start=&quot;3221&quot;&gt;Works with:&lt;/strong&gt; Azure Blob Storage containers.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3321&quot; data-start=&quot;3268&quot;&gt;
&lt;p data-end=&quot;3321&quot; data-start=&quot;3270&quot;&gt;&lt;strong data-end=&quot;3282&quot; data-start=&quot;3270&quot;&gt;Example:&lt;/strong&gt; Process a CSV when someone uploads it.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-end=&quot;3351&quot; data-start=&quot;3323&quot;&gt;4. Queue Storage Trigger&lt;/h3&gt;
&lt;ul data-end=&quot;3511&quot; data-start=&quot;3352&quot;&gt;
&lt;li data-end=&quot;3401&quot; data-start=&quot;3352&quot;&gt;
&lt;p data-end=&quot;3401&quot; data-start=&quot;3354&quot;&gt;&lt;strong data-end=&quot;3366&quot; data-start=&quot;3354&quot;&gt;Use for:&lt;/strong&gt; Simple messaging between services.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3511&quot; data-start=&quot;3402&quot;&gt;
&lt;p data-end=&quot;3511&quot; data-start=&quot;3404&quot;&gt;&lt;strong data-end=&quot;3416&quot; data-start=&quot;3404&quot;&gt;Example:&lt;/strong&gt; One system drops a message when an order is placed; the function picks it up and processes it.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-end=&quot;3539&quot; data-start=&quot;3513&quot;&gt;5. Service Bus Trigger&lt;/h3&gt;
&lt;ul data-end=&quot;3679&quot; data-start=&quot;3540&quot;&gt;
&lt;li data-end=&quot;3595&quot; data-start=&quot;3540&quot;&gt;
&lt;p data-end=&quot;3595&quot; data-start=&quot;3542&quot;&gt;&lt;strong data-end=&quot;3554&quot; data-start=&quot;3542&quot;&gt;Use for:&lt;/strong&gt; Enterprise messaging (queues or topics).&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3679&quot; data-start=&quot;3596&quot;&gt;
&lt;p data-end=&quot;3679&quot; data-start=&quot;3598&quot;&gt;&lt;strong data-end=&quot;3610&quot; data-start=&quot;3598&quot;&gt;Example:&lt;/strong&gt; Payment gateway sends a Service Bus message when a payment succeeds.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-end=&quot;3706&quot; data-start=&quot;3681&quot;&gt;6. Event Grid Trigger&lt;/h3&gt;
&lt;ul data-end=&quot;3822&quot; data-start=&quot;3707&quot;&gt;
&lt;li data-end=&quot;3765&quot; data-start=&quot;3707&quot;&gt;
&lt;p data-end=&quot;3765&quot; data-start=&quot;3709&quot;&gt;&lt;strong data-end=&quot;3721&quot; data-start=&quot;3709&quot;&gt;Use for:&lt;/strong&gt; Reacting to Azure events in near real-time.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3822&quot; data-start=&quot;3766&quot;&gt;
&lt;p data-end=&quot;3822&quot; data-start=&quot;3768&quot;&gt;&lt;strong data-end=&quot;3780&quot; data-start=&quot;3768&quot;&gt;Example:&lt;/strong&gt; Notify a team when a new blob is created.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-end=&quot;3848&quot; data-start=&quot;3824&quot;&gt;7. Event Hub Trigger&lt;/h3&gt;
&lt;ul data-end=&quot;3971&quot; data-start=&quot;3849&quot;&gt;
&lt;li data-end=&quot;3909&quot; data-start=&quot;3849&quot;&gt;
&lt;p data-end=&quot;3909&quot; data-start=&quot;3851&quot;&gt;&lt;strong data-end=&quot;3863&quot; data-start=&quot;3851&quot;&gt;Use for:&lt;/strong&gt; High-volume event streams like IoT telemetry.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3971&quot; data-start=&quot;3910&quot;&gt;
&lt;p data-end=&quot;3971&quot; data-start=&quot;3912&quot;&gt;&lt;strong data-end=&quot;3924&quot; data-start=&quot;3912&quot;&gt;Example:&lt;/strong&gt; Analyze millions of device signals per minute.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-end=&quot;3997&quot; data-start=&quot;3973&quot;&gt;8. Cosmos DB Trigger&lt;/h3&gt;
&lt;ul data-end=&quot;4124&quot; data-start=&quot;3998&quot;&gt;
&lt;li data-end=&quot;4042&quot; data-start=&quot;3998&quot;&gt;
&lt;p data-end=&quot;4042&quot; data-start=&quot;4000&quot;&gt;&lt;strong data-end=&quot;4012&quot; data-start=&quot;4000&quot;&gt;Use for:&lt;/strong&gt; Reacting to database changes.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;4124&quot; data-start=&quot;4043&quot;&gt;
&lt;p data-end=&quot;4124&quot; data-start=&quot;4045&quot;&gt;&lt;strong data-end=&quot;4057&quot; data-start=&quot;4045&quot;&gt;Example:&lt;/strong&gt; Automatically update a search index when a product record changes.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;4129&quot; data-start=&quot;4126&quot; /&gt;
&lt;h2 data-end=&quot;4151&quot; data-start=&quot;4131&quot;&gt;🧠 Best Practices&lt;/h2&gt;
&lt;ol data-end=&quot;4595&quot; data-start=&quot;4153&quot;&gt;
&lt;li data-end=&quot;4242&quot; data-start=&quot;4153&quot;&gt;
&lt;p data-end=&quot;4186&quot; data-start=&quot;4156&quot;&gt;&lt;strong data-end=&quot;4184&quot; data-start=&quot;4156&quot;&gt;One Trigger per Function&lt;/strong&gt;&lt;/p&gt;
&lt;ul data-end=&quot;4242&quot; data-start=&quot;4190&quot;&gt;
&lt;li data-end=&quot;4242&quot; data-start=&quot;4190&quot;&gt;
&lt;p data-end=&quot;4242&quot; data-start=&quot;4192&quot;&gt;Each function listens to exactly one event source.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li data-end=&quot;4319&quot; data-start=&quot;4243&quot;&gt;
&lt;p data-end=&quot;4272&quot; data-start=&quot;4246&quot;&gt;&lt;strong data-end=&quot;4270&quot; data-start=&quot;4246&quot;&gt;Keep Functions Short&lt;/strong&gt;&lt;/p&gt;
&lt;ul data-end=&quot;4319&quot; data-start=&quot;4276&quot;&gt;
&lt;li data-end=&quot;4319&quot; data-start=&quot;4276&quot;&gt;
&lt;p data-end=&quot;4319&quot; data-start=&quot;4278&quot;&gt;Do small tasks quickly to avoid timeouts.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li data-end=&quot;4456&quot; data-start=&quot;4320&quot;&gt;
&lt;p data-end=&quot;4348&quot; data-start=&quot;4323&quot;&gt;&lt;strong data-end=&quot;4346&quot; data-start=&quot;4323&quot;&gt;Scale Automatically&lt;/strong&gt;&lt;/p&gt;
&lt;ul data-end=&quot;4456&quot; data-start=&quot;4352&quot;&gt;
&lt;li data-end=&quot;4456&quot; data-start=&quot;4352&quot;&gt;
&lt;p data-end=&quot;4456&quot; data-start=&quot;4354&quot;&gt;Triggers like Queue, Event Hub, and Blob scale the number of function instances based on event volume.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li data-end=&quot;4595&quot; data-start=&quot;4457&quot;&gt;
&lt;p data-end=&quot;4495&quot; data-start=&quot;4460&quot;&gt;&lt;strong data-end=&quot;4493&quot; data-start=&quot;4460&quot;&gt;Use Bindings for Input/Output&lt;/strong&gt;&lt;/p&gt;
&lt;ul data-end=&quot;4595&quot; data-start=&quot;4499&quot;&gt;
&lt;li data-end=&quot;4595&quot; data-start=&quot;4499&quot;&gt;
&lt;p data-end=&quot;4595&quot; data-start=&quot;4501&quot;&gt;You can directly read or write to storage, queues, etc., with simple parameters—no extra code.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;hr data-end=&quot;4600&quot; data-start=&quot;4597&quot; /&gt;
&lt;h2 data-end=&quot;4616&quot; data-start=&quot;4602&quot;&gt;Quick Recap&lt;/h2&gt;
&lt;ul data-end=&quot;4903&quot; data-start=&quot;4618&quot;&gt;
&lt;li data-end=&quot;4666&quot; data-start=&quot;4618&quot;&gt;
&lt;p data-end=&quot;4666&quot; data-start=&quot;4620&quot;&gt;&lt;strong data-end=&quot;4651&quot; data-start=&quot;4620&quot;&gt;Trigger = automatic starter&lt;/strong&gt; for your code.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;4762&quot; data-start=&quot;4667&quot;&gt;
&lt;p data-end=&quot;4762&quot; data-start=&quot;4669&quot;&gt;Common triggers: &lt;strong data-end=&quot;4761&quot; data-start=&quot;4686&quot;&gt;HTTP, Timer, Blob, Queue, Service Bus, Event Grid, Event Hub, Cosmos DB&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;4813&quot; data-start=&quot;4763&quot;&gt;
&lt;p data-end=&quot;4813&quot; data-start=&quot;4765&quot;&gt;Each function &lt;strong data-end=&quot;4812&quot; data-start=&quot;4779&quot;&gt;must have exactly one trigger&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;4903&quot; data-start=&quot;4814&quot;&gt;
&lt;p data-end=&quot;4903&quot; data-start=&quot;4816&quot;&gt;Azure Functions automatically listens for the event and runs your code when it happens.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;5120&quot; data-is-last-node=&quot;&quot; data-is-only-node=&quot;&quot; data-start=&quot;4905&quot;&gt;In short:&lt;br data-end=&quot;4917&quot; data-start=&quot;4914&quot; /&gt;
&lt;strong data-end=&quot;5120&quot; data-is-last-node=&quot;&quot; data-start=&quot;4917&quot;&gt;Azure Function triggers let you run code automatically whenever a specific event (like a request, message, or file upload) occurs—no servers to manage, just write the function and choose the trigger.&lt;/strong&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://piushshukla.blogspot.com/feeds/6592587765759169878/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://piushshukla.blogspot.com/2025/09/trigger-in-azure-functions.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2159069551745631737/posts/default/6592587765759169878'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2159069551745631737/posts/default/6592587765759169878'/><link rel='alternate' type='text/html' href='http://piushshukla.blogspot.com/2025/09/trigger-in-azure-functions.html' title='Trigger in Azure Functions'/><author><name>Piush shukla</name><uri>http://www.blogger.com/profile/16392649283296436146</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2159069551745631737.post-973734467866598173</id><published>2025-09-24T22:12:00.000-07:00</published><updated>2025-11-17T09:01:59.661-08:00</updated><title type='text'>CDC</title><content type='html'>&lt;h1 style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; color: #111827; font-size: 2.25em; font-weight: 800; line-height: 1.11111; margin: 0px 0px 0.888889em;&quot;&gt;ETF Job Creation: Problem &amp;amp; Solution Document&lt;/h1&gt;&lt;h3 data-end=&quot;100&quot; data-start=&quot;81&quot;&gt;&lt;div class=&quot;prose break-words dark:prose-invert prose-p:leading-relaxed prose-pre:p-0 fix-max-with-100 prose-p:!mt-0&quot; style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-prose-body: #374151; --tw-prose-bold: #111827; --tw-prose-bullets: #d1d5db; --tw-prose-captions: #6b7280; --tw-prose-code: #111827; --tw-prose-counters: #6b7280; --tw-prose-headings: #111827; --tw-prose-hr: #e5e7eb; --tw-prose-invert-body: #d1d5db; --tw-prose-invert-bold: #fff; --tw-prose-invert-bullets: #4b5563; --tw-prose-invert-captions: #9ca3af; --tw-prose-invert-code: #fff; --tw-prose-invert-counters: #9ca3af; --tw-prose-invert-headings: #fff; --tw-prose-invert-hr: #374151; --tw-prose-invert-kbd-shadows: 255 255 255; --tw-prose-invert-kbd: #fff; --tw-prose-invert-lead: #9ca3af; --tw-prose-invert-links: #fff; --tw-prose-invert-pre-bg: rgba(0,0,0,.5); --tw-prose-invert-pre-code: #d1d5db; --tw-prose-invert-quote-borders: #374151; --tw-prose-invert-quotes: #f3f4f6; --tw-prose-invert-td-borders: #374151; --tw-prose-invert-th-borders: #4b5563; --tw-prose-kbd-shadows: 17 24 39; --tw-prose-kbd: #111827; --tw-prose-lead: #4b5563; --tw-prose-links: #111827; --tw-prose-pre-bg: #1f2937; --tw-prose-pre-code: #e5e7eb; --tw-prose-quote-borders: #e5e7eb; --tw-prose-quotes: #111827; --tw-prose-td-borders: #e5e7eb; --tw-prose-th-borders: #d1d5db; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; -webkit-text-stroke-width: 0px; background-color: white; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; color: #374151; font-family: __Inter_f367f3, __Inter_Fallback_f367f3, ui-sans-serif, system-ui, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Segoe UI Symbol&amp;quot;, &amp;quot;Noto Color Emoji&amp;quot;; font-size: medium; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; line-height: 1.75; max-width: 100%; orphans: 2; overflow-wrap: break-word; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;hr style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border-color: rgb(229, 231, 235); border-image: initial; border-style: solid; border-width: 1px 0px 0px; box-sizing: border-box; color: inherit; height: 0px; margin: 3em 0px;&quot; /&gt;&lt;/div&gt;&lt;/h3&gt;&lt;h2 style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; color: #111827; font-size: 1.5em; font-weight: 700; line-height: 1.33333; margin: 0px 0px 1em;&quot;&gt;1. Problem Statement&lt;/h2&gt;&lt;h3 style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; color: #111827; font-size: 1.25em; font-weight: 600; line-height: 1.6; margin: 0px 0px 0.6em;&quot;&gt;&lt;span style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; display: block;&quot;&gt;Current Challenges in ETF Job Creation&lt;/span&gt;&lt;/h3&gt;&lt;h3 data-end=&quot;100&quot; data-start=&quot;81&quot;&gt;&lt;div class=&quot;prose break-words dark:prose-invert prose-p:leading-relaxed prose-pre:p-0 fix-max-with-100 prose-p:!mt-0&quot; style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-prose-body: #374151; --tw-prose-bold: #111827; --tw-prose-bullets: #d1d5db; --tw-prose-captions: #6b7280; --tw-prose-code: #111827; --tw-prose-counters: #6b7280; --tw-prose-headings: #111827; --tw-prose-hr: #e5e7eb; --tw-prose-invert-body: #d1d5db; --tw-prose-invert-bold: #fff; --tw-prose-invert-bullets: #4b5563; --tw-prose-invert-captions: #9ca3af; --tw-prose-invert-code: #fff; --tw-prose-invert-counters: #9ca3af; --tw-prose-invert-headings: #fff; --tw-prose-invert-hr: #374151; --tw-prose-invert-kbd-shadows: 255 255 255; --tw-prose-invert-kbd: #fff; --tw-prose-invert-lead: #9ca3af; --tw-prose-invert-links: #fff; --tw-prose-invert-pre-bg: rgba(0,0,0,.5); --tw-prose-invert-pre-code: #d1d5db; --tw-prose-invert-quote-borders: #374151; --tw-prose-invert-quotes: #f3f4f6; --tw-prose-invert-td-borders: #374151; --tw-prose-invert-th-borders: #4b5563; --tw-prose-kbd-shadows: 17 24 39; --tw-prose-kbd: #111827; --tw-prose-lead: #4b5563; --tw-prose-links: #111827; --tw-prose-pre-bg: #1f2937; --tw-prose-pre-code: #e5e7eb; --tw-prose-quote-borders: #e5e7eb; --tw-prose-quotes: #111827; --tw-prose-td-borders: #e5e7eb; --tw-prose-th-borders: #d1d5db; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; -webkit-text-stroke-width: 0px; background-color: white; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; color: #374151; font-family: __Inter_f367f3, __Inter_Fallback_f367f3, ui-sans-serif, system-ui, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Segoe UI Symbol&amp;quot;, &amp;quot;Noto Color Emoji&amp;quot;; font-size: medium; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; line-height: 1.75; max-width: 100%; orphans: 2; overflow-wrap: break-word; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;ul style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; list-style: disc; margin: 0px 0px 1.25em; padding-inline-start: 1.625em; padding: 0px;&quot;&gt;&lt;li style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; margin-bottom: 0.5em; margin-top: 0.5em; padding-inline-start: 0.375em;&quot;&gt;&lt;span style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; display: block;&quot;&gt;&lt;p class=&quot;mb-2 last:mb-0&quot; style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; line-height: 1.625; margin-bottom: 1rem !important; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; color: #111827; font-weight: 600;&quot;&gt;High Development Effort&lt;/strong&gt;&lt;br style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box;&quot; /&gt;Creating new jobs, especially for new clients or new file formats, demands significant development time, including writing new scripts, packages, and stored procedures.&lt;/p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; margin-bottom: 0.5em; margin-top: 0.5em; padding-inline-start: 0.375em;&quot;&gt;&lt;span style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; display: block;&quot;&gt;&lt;p class=&quot;mb-2 last:mb-0&quot; style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; line-height: 1.625; margin-bottom: 1rem !important; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; color: #111827; font-weight: 600;&quot;&gt;Redundant and Repetitive Work&lt;/strong&gt;&lt;br style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box;&quot; /&gt;Many jobs that are repetitive or similar require manual recreation, leading to repetitive coding and testing efforts.&lt;/p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; margin-bottom: 0.5em; margin-top: 0.5em; padding-inline-start: 0.375em;&quot;&gt;&lt;span style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; display: block;&quot;&gt;&lt;p class=&quot;mb-2 last:mb-0&quot; style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; line-height: 1.625; margin-bottom: 1rem !important; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; color: #111827; font-weight: 600;&quot;&gt;Limited Self-Service Capability&lt;/strong&gt;&lt;br style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box;&quot; /&gt;Business or Operations (OPS) teams currently do not have the ability to configure or create jobs independently, making the process dependent on Development (Dev) and Quality Assurance (QA) teams and increasing turnaround time.&lt;/p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; margin-bottom: 0.5em; margin-top: 0.5em; padding-inline-start: 0.375em;&quot;&gt;&lt;span style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; display: block;&quot;&gt;&lt;p class=&quot;mb-2 last:mb-0&quot; style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; line-height: 1.625; margin-bottom: 1rem !important; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; color: #111827; font-weight: 600;&quot;&gt;Complex Job Modifications&lt;/strong&gt;&lt;br style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box;&quot; /&gt;Changes to existing jobs, such as adding/removing fields or modifying configurations, involve manual updates to packages and stored procedures, impacting maintenance and agility.&lt;/p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; margin-bottom: 0.5em; margin-top: 0.5em; padding-inline-start: 0.375em;&quot;&gt;&lt;span style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; display: block;&quot;&gt;&lt;p class=&quot;mb-2 last:mb-0&quot; style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; line-height: 1.625; margin-bottom: 1rem !important; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; color: #111827; font-weight: 600;&quot;&gt;Scattered Configuration Management&lt;/strong&gt;&lt;br style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box;&quot; /&gt;Job-related configurations (e.g., file paths, email distribution lists) are managed separately, increasing the risk of inconsistencies and complicating configuration updates.&lt;/p&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border-color: rgb(229, 231, 235); border-image: initial; border-style: solid; border-width: 1px 0px 0px; box-sizing: border-box; color: inherit; height: 0px; margin: 3em 0px;&quot; /&gt;&lt;/div&gt;&lt;/h3&gt;&lt;h2 style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; color: #111827; font-size: 1.5em; font-weight: 700; line-height: 1.33333; margin: 0px 0px 1em;&quot;&gt;2. Scope&lt;/h2&gt;&lt;h3 style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; color: #111827; font-size: 1.25em; font-weight: 600; line-height: 1.6; margin: 0px 0px 0.6em;&quot;&gt;&lt;span style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; display: block;&quot;&gt;In Scope&lt;/span&gt;&lt;/h3&gt;&lt;h3 data-end=&quot;100&quot; data-start=&quot;81&quot;&gt;&lt;div class=&quot;prose break-words dark:prose-invert prose-p:leading-relaxed prose-pre:p-0 fix-max-with-100 prose-p:!mt-0&quot; style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-prose-body: #374151; --tw-prose-bold: #111827; --tw-prose-bullets: #d1d5db; --tw-prose-captions: #6b7280; --tw-prose-code: #111827; --tw-prose-counters: #6b7280; --tw-prose-headings: #111827; --tw-prose-hr: #e5e7eb; --tw-prose-invert-body: #d1d5db; --tw-prose-invert-bold: #fff; --tw-prose-invert-bullets: #4b5563; --tw-prose-invert-captions: #9ca3af; --tw-prose-invert-code: #fff; --tw-prose-invert-counters: #9ca3af; --tw-prose-invert-headings: #fff; --tw-prose-invert-hr: #374151; --tw-prose-invert-kbd-shadows: 255 255 255; --tw-prose-invert-kbd: #fff; --tw-prose-invert-lead: #9ca3af; --tw-prose-invert-links: #fff; --tw-prose-invert-pre-bg: rgba(0,0,0,.5); --tw-prose-invert-pre-code: #d1d5db; --tw-prose-invert-quote-borders: #374151; --tw-prose-invert-quotes: #f3f4f6; --tw-prose-invert-td-borders: #374151; --tw-prose-invert-th-borders: #4b5563; --tw-prose-kbd-shadows: 17 24 39; --tw-prose-kbd: #111827; --tw-prose-lead: #4b5563; --tw-prose-links: #111827; --tw-prose-pre-bg: #1f2937; --tw-prose-pre-code: #e5e7eb; --tw-prose-quote-borders: #e5e7eb; --tw-prose-quotes: #111827; --tw-prose-td-borders: #e5e7eb; --tw-prose-th-borders: #d1d5db; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; -webkit-text-stroke-width: 0px; background-color: white; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; color: #374151; font-family: __Inter_f367f3, __Inter_Fallback_f367f3, ui-sans-serif, system-ui, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Segoe UI Symbol&amp;quot;, &amp;quot;Noto Color Emoji&amp;quot;; font-size: medium; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; line-height: 1.75; max-width: 100%; orphans: 2; overflow-wrap: break-word; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;ul style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; list-style: disc; margin: 0px 0px 1.25em; padding-inline-start: 1.625em; padding: 0px;&quot;&gt;&lt;li style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; margin-bottom: 0.5em; margin-top: 0.5em; padding-inline-start: 0.375em;&quot;&gt;&lt;span style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; display: block;&quot;&gt;Similar or repetitive reporting files for new Funds/Fund Families.&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; margin-bottom: 0.5em; margin-top: 0.5em; padding-inline-start: 0.375em;&quot;&gt;&lt;span style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; display: block;&quot;&gt;Requests for a new type of file that is already generated for another Fund/Fund Family.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;/h3&gt;&lt;h3 style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; color: #111827; font-size: 1.25em; font-weight: 600; line-height: 1.6; margin: 1.6em 0px 0.6em;&quot;&gt;&lt;span style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; display: block;&quot;&gt;Out of Scope&lt;/span&gt;&lt;/h3&gt;&lt;h3 data-end=&quot;100&quot; data-start=&quot;81&quot;&gt;&lt;div class=&quot;prose break-words dark:prose-invert prose-p:leading-relaxed prose-pre:p-0 fix-max-with-100 prose-p:!mt-0&quot; style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-prose-body: #374151; --tw-prose-bold: #111827; --tw-prose-bullets: #d1d5db; --tw-prose-captions: #6b7280; --tw-prose-code: #111827; --tw-prose-counters: #6b7280; --tw-prose-headings: #111827; --tw-prose-hr: #e5e7eb; --tw-prose-invert-body: #d1d5db; --tw-prose-invert-bold: #fff; --tw-prose-invert-bullets: #4b5563; --tw-prose-invert-captions: #9ca3af; --tw-prose-invert-code: #fff; --tw-prose-invert-counters: #9ca3af; --tw-prose-invert-headings: #fff; --tw-prose-invert-hr: #374151; --tw-prose-invert-kbd-shadows: 255 255 255; --tw-prose-invert-kbd: #fff; --tw-prose-invert-lead: #9ca3af; --tw-prose-invert-links: #fff; --tw-prose-invert-pre-bg: rgba(0,0,0,.5); --tw-prose-invert-pre-code: #d1d5db; --tw-prose-invert-quote-borders: #374151; --tw-prose-invert-quotes: #f3f4f6; --tw-prose-invert-td-borders: #374151; --tw-prose-invert-th-borders: #4b5563; --tw-prose-kbd-shadows: 17 24 39; --tw-prose-kbd: #111827; --tw-prose-lead: #4b5563; --tw-prose-links: #111827; --tw-prose-pre-bg: #1f2937; --tw-prose-pre-code: #e5e7eb; --tw-prose-quote-borders: #e5e7eb; --tw-prose-quotes: #111827; --tw-prose-td-borders: #e5e7eb; --tw-prose-th-borders: #d1d5db; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; -webkit-text-stroke-width: 0px; background-color: white; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; color: #374151; font-family: __Inter_f367f3, __Inter_Fallback_f367f3, ui-sans-serif, system-ui, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Segoe UI Symbol&amp;quot;, &amp;quot;Noto Color Emoji&amp;quot;; font-size: medium; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; line-height: 1.75; max-width: 100%; orphans: 2; overflow-wrap: break-word; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;ul style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; list-style: disc; margin: 0px 0px 1.25em; padding-inline-start: 1.625em; padding: 0px;&quot;&gt;&lt;li style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; margin-bottom: 0.5em; margin-top: 0.5em; padding-inline-start: 0.375em;&quot;&gt;&lt;span style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; display: block;&quot;&gt;Addition of new fields in existing files for an existing Fund/Fund Family.&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; margin-bottom: 0.5em; margin-top: 0.5em; padding-inline-start: 0.375em;&quot;&gt;&lt;span style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; display: block;&quot;&gt;Requests for reports with different field combinations, transformations, or formats than current reports.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border-color: rgb(229, 231, 235); border-image: initial; border-style: solid; border-width: 1px 0px 0px; box-sizing: border-box; color: inherit; height: 0px; margin: 3em 0px;&quot; /&gt;&lt;/div&gt;&lt;/h3&gt;&lt;h2 style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; color: #111827; font-size: 1.5em; font-weight: 700; line-height: 1.33333; margin: 0px 0px 1em;&quot;&gt;3. Benefits of Current System Limitations&lt;/h2&gt;&lt;h3 data-end=&quot;100&quot; data-start=&quot;81&quot;&gt;&lt;div class=&quot;prose break-words dark:prose-invert prose-p:leading-relaxed prose-pre:p-0 fix-max-with-100 prose-p:!mt-0&quot; style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-prose-body: #374151; --tw-prose-bold: #111827; --tw-prose-bullets: #d1d5db; --tw-prose-captions: #6b7280; --tw-prose-code: #111827; --tw-prose-counters: #6b7280; --tw-prose-headings: #111827; --tw-prose-hr: #e5e7eb; --tw-prose-invert-body: #d1d5db; --tw-prose-invert-bold: #fff; --tw-prose-invert-bullets: #4b5563; --tw-prose-invert-captions: #9ca3af; --tw-prose-invert-code: #fff; --tw-prose-invert-counters: #9ca3af; --tw-prose-invert-headings: #fff; --tw-prose-invert-hr: #374151; --tw-prose-invert-kbd-shadows: 255 255 255; --tw-prose-invert-kbd: #fff; --tw-prose-invert-lead: #9ca3af; --tw-prose-invert-links: #fff; --tw-prose-invert-pre-bg: rgba(0,0,0,.5); --tw-prose-invert-pre-code: #d1d5db; --tw-prose-invert-quote-borders: #374151; --tw-prose-invert-quotes: #f3f4f6; --tw-prose-invert-td-borders: #374151; --tw-prose-invert-th-borders: #4b5563; --tw-prose-kbd-shadows: 17 24 39; --tw-prose-kbd: #111827; --tw-prose-lead: #4b5563; --tw-prose-links: #111827; --tw-prose-pre-bg: #1f2937; --tw-prose-pre-code: #e5e7eb; --tw-prose-quote-borders: #e5e7eb; --tw-prose-quotes: #111827; --tw-prose-td-borders: #e5e7eb; --tw-prose-th-borders: #d1d5db; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; -webkit-text-stroke-width: 0px; background-color: white; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; color: #374151; font-family: __Inter_f367f3, __Inter_Fallback_f367f3, ui-sans-serif, system-ui, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Segoe UI Symbol&amp;quot;, &amp;quot;Noto Color Emoji&amp;quot;; font-size: medium; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; line-height: 1.75; max-width: 100%; orphans: 2; overflow-wrap: break-word; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;ul style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; list-style: disc; margin: 0px 0px 1.25em; padding-inline-start: 1.625em; padding: 0px;&quot;&gt;&lt;li style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; margin-bottom: 0.5em; margin-top: 0.5em; padding-inline-start: 0.375em;&quot;&gt;&lt;span style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; display: block;&quot;&gt;Minimal changes to existing jobs reduce risk but limit agility.&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; margin-bottom: 0.5em; margin-top: 0.5em; padding-inline-start: 0.375em;&quot;&gt;&lt;span style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; display: block;&quot;&gt;Business/OPS team lacks self-service capabilities for configuring jobs.&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; margin-bottom: 0.5em; margin-top: 0.5em; padding-inline-start: 0.375em;&quot;&gt;&lt;span style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; display: block;&quot;&gt;Heavy reliance on Dev/QA teams for creation or replication of jobs.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border-color: rgb(229, 231, 235); border-image: initial; border-style: solid; border-width: 1px 0px 0px; box-sizing: border-box; color: inherit; height: 0px; margin: 3em 0px;&quot; /&gt;&lt;/div&gt;&lt;/h3&gt;&lt;h2 style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; color: #111827; font-size: 1.5em; font-weight: 700; line-height: 1.33333; margin: 0px 0px 1em;&quot;&gt;4. Proposed Solution&lt;/h2&gt;&lt;h3 style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; color: #111827; font-size: 1.25em; font-weight: 600; line-height: 1.6; margin: 0px 0px 0.6em;&quot;&gt;&lt;span style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; display: block;&quot;&gt;Streamlined ETF Job Creation Process&lt;/span&gt;&lt;/h3&gt;&lt;h3 data-end=&quot;100&quot; data-start=&quot;81&quot;&gt;&lt;div class=&quot;prose break-words dark:prose-invert prose-p:leading-relaxed prose-pre:p-0 fix-max-with-100 prose-p:!mt-0&quot; style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-prose-body: #374151; --tw-prose-bold: #111827; --tw-prose-bullets: #d1d5db; --tw-prose-captions: #6b7280; --tw-prose-code: #111827; --tw-prose-counters: #6b7280; --tw-prose-headings: #111827; --tw-prose-hr: #e5e7eb; --tw-prose-invert-body: #d1d5db; --tw-prose-invert-bold: #fff; --tw-prose-invert-bullets: #4b5563; --tw-prose-invert-captions: #9ca3af; --tw-prose-invert-code: #fff; --tw-prose-invert-counters: #9ca3af; --tw-prose-invert-headings: #fff; --tw-prose-invert-hr: #374151; --tw-prose-invert-kbd-shadows: 255 255 255; --tw-prose-invert-kbd: #fff; --tw-prose-invert-lead: #9ca3af; --tw-prose-invert-links: #fff; --tw-prose-invert-pre-bg: rgba(0,0,0,.5); --tw-prose-invert-pre-code: #d1d5db; --tw-prose-invert-quote-borders: #374151; --tw-prose-invert-quotes: #f3f4f6; --tw-prose-invert-td-borders: #374151; --tw-prose-invert-th-borders: #4b5563; --tw-prose-kbd-shadows: 17 24 39; --tw-prose-kbd: #111827; --tw-prose-lead: #4b5563; --tw-prose-links: #111827; --tw-prose-pre-bg: #1f2937; --tw-prose-pre-code: #e5e7eb; --tw-prose-quote-borders: #e5e7eb; --tw-prose-quotes: #111827; --tw-prose-td-borders: #e5e7eb; --tw-prose-th-borders: #d1d5db; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; -webkit-text-stroke-width: 0px; background-color: white; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; color: #374151; font-family: __Inter_f367f3, __Inter_Fallback_f367f3, ui-sans-serif, system-ui, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Segoe UI Symbol&amp;quot;, &amp;quot;Noto Color Emoji&amp;quot;; font-size: medium; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; line-height: 1.75; max-width: 100%; orphans: 2; overflow-wrap: break-word; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; display: block; margin-top: 0px;&quot;&gt;&lt;p class=&quot;mb-2 last:mb-0&quot; style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; line-height: 1.625; margin-bottom: 1rem !important; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;To reduce development costs and repetitive work, the following improvements are proposed:&lt;/p&gt;&lt;/span&gt;&lt;hr style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border-color: rgb(229, 231, 235); border-image: initial; border-style: solid; border-width: 1px 0px 0px; box-sizing: border-box; color: inherit; height: 0px; margin: 3em 0px;&quot; /&gt;&lt;/div&gt;&lt;/h3&gt;&lt;h3 style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; color: #111827; font-size: 1.25em; font-weight: 600; line-height: 1.6; margin: 0px 0px 0.6em;&quot;&gt;&lt;span style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; display: block;&quot;&gt;4.1 UI for Job Creation&lt;/span&gt;&lt;/h3&gt;&lt;h3 data-end=&quot;100&quot; data-start=&quot;81&quot;&gt;&lt;div class=&quot;prose break-words dark:prose-invert prose-p:leading-relaxed prose-pre:p-0 fix-max-with-100 prose-p:!mt-0&quot; style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-prose-body: #374151; --tw-prose-bold: #111827; --tw-prose-bullets: #d1d5db; --tw-prose-captions: #6b7280; --tw-prose-code: #111827; --tw-prose-counters: #6b7280; --tw-prose-headings: #111827; --tw-prose-hr: #e5e7eb; --tw-prose-invert-body: #d1d5db; --tw-prose-invert-bold: #fff; --tw-prose-invert-bullets: #4b5563; --tw-prose-invert-captions: #9ca3af; --tw-prose-invert-code: #fff; --tw-prose-invert-counters: #9ca3af; --tw-prose-invert-headings: #fff; --tw-prose-invert-hr: #374151; --tw-prose-invert-kbd-shadows: 255 255 255; --tw-prose-invert-kbd: #fff; --tw-prose-invert-lead: #9ca3af; --tw-prose-invert-links: #fff; --tw-prose-invert-pre-bg: rgba(0,0,0,.5); --tw-prose-invert-pre-code: #d1d5db; --tw-prose-invert-quote-borders: #374151; --tw-prose-invert-quotes: #f3f4f6; --tw-prose-invert-td-borders: #374151; --tw-prose-invert-th-borders: #4b5563; --tw-prose-kbd-shadows: 17 24 39; --tw-prose-kbd: #111827; --tw-prose-lead: #4b5563; --tw-prose-links: #111827; --tw-prose-pre-bg: #1f2937; --tw-prose-pre-code: #e5e7eb; --tw-prose-quote-borders: #e5e7eb; --tw-prose-quotes: #111827; --tw-prose-td-borders: #e5e7eb; --tw-prose-th-borders: #d1d5db; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; -webkit-text-stroke-width: 0px; background-color: white; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; color: #374151; font-family: __Inter_f367f3, __Inter_Fallback_f367f3, ui-sans-serif, system-ui, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Segoe UI Symbol&amp;quot;, &amp;quot;Noto Color Emoji&amp;quot;; font-size: medium; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; line-height: 1.75; max-width: 100%; orphans: 2; overflow-wrap: break-word; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;ul style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; list-style: disc; margin: 0px 0px 1.25em; padding-inline-start: 1.625em; padding: 0px;&quot;&gt;&lt;li style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; margin-bottom: 0.5em; margin-top: 0.5em; padding-inline-start: 0.375em;&quot;&gt;&lt;span style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; display: block;&quot;&gt;Develop a dedicated screen where Output ID/Job ID can be created directly via a user-friendly interface.&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; margin-bottom: 0.5em; margin-top: 0.5em; padding-inline-start: 0.375em;&quot;&gt;&lt;span style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; display: block;&quot;&gt;This interface will replicate current SQL insert script functionality, eliminating manual script creation.&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; margin-bottom: 0.5em; margin-top: 0.5em; padding-inline-start: 0.375em;&quot;&gt;&lt;span style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; display: block;&quot;&gt;It empowers Business/OPS teams to create or replicate job configurations quickly without Dev/QA involvement.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border-color: rgb(229, 231, 235); border-image: initial; border-style: solid; border-width: 1px 0px 0px; box-sizing: border-box; color: inherit; height: 0px; margin: 3em 0px;&quot; /&gt;&lt;/div&gt;&lt;/h3&gt;&lt;h3 style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; color: #111827; font-size: 1.25em; font-weight: 600; line-height: 1.6; margin: 0px 0px 0.6em;&quot;&gt;&lt;span style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; display: block;&quot;&gt;4.2 UI for SSIS Configuration Management&lt;/span&gt;&lt;/h3&gt;&lt;h3 data-end=&quot;100&quot; data-start=&quot;81&quot;&gt;&lt;div class=&quot;prose break-words dark:prose-invert prose-p:leading-relaxed prose-pre:p-0 fix-max-with-100 prose-p:!mt-0&quot; style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-prose-body: #374151; --tw-prose-bold: #111827; --tw-prose-bullets: #d1d5db; --tw-prose-captions: #6b7280; --tw-prose-code: #111827; --tw-prose-counters: #6b7280; --tw-prose-headings: #111827; --tw-prose-hr: #e5e7eb; --tw-prose-invert-body: #d1d5db; --tw-prose-invert-bold: #fff; --tw-prose-invert-bullets: #4b5563; --tw-prose-invert-captions: #9ca3af; --tw-prose-invert-code: #fff; --tw-prose-invert-counters: #9ca3af; --tw-prose-invert-headings: #fff; --tw-prose-invert-hr: #374151; --tw-prose-invert-kbd-shadows: 255 255 255; --tw-prose-invert-kbd: #fff; --tw-prose-invert-lead: #9ca3af; --tw-prose-invert-links: #fff; --tw-prose-invert-pre-bg: rgba(0,0,0,.5); --tw-prose-invert-pre-code: #d1d5db; --tw-prose-invert-quote-borders: #374151; --tw-prose-invert-quotes: #f3f4f6; --tw-prose-invert-td-borders: #374151; --tw-prose-invert-th-borders: #4b5563; --tw-prose-kbd-shadows: 17 24 39; --tw-prose-kbd: #111827; --tw-prose-lead: #4b5563; --tw-prose-links: #111827; --tw-prose-pre-bg: #1f2937; --tw-prose-pre-code: #e5e7eb; --tw-prose-quote-borders: #e5e7eb; --tw-prose-quotes: #111827; --tw-prose-td-borders: #e5e7eb; --tw-prose-th-borders: #d1d5db; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; -webkit-text-stroke-width: 0px; background-color: white; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; color: #374151; font-family: __Inter_f367f3, __Inter_Fallback_f367f3, ui-sans-serif, system-ui, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Segoe UI Symbol&amp;quot;, &amp;quot;Noto Color Emoji&amp;quot;; font-size: medium; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; line-height: 1.75; max-width: 100%; orphans: 2; overflow-wrap: break-word; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;ul style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; list-style: disc; margin: 0px 0px 1.25em; padding-inline-start: 1.625em; padding: 0px;&quot;&gt;&lt;li style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; margin-bottom: 0.5em; margin-top: 0.5em; padding-inline-start: 0.375em;&quot;&gt;&lt;span style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; display: block;&quot;&gt;&lt;span style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; display: block;&quot;&gt;&lt;p class=&quot;mb-2 last:mb-0&quot; style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; line-height: 1.625; margin-bottom: 1rem !important; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;Create a screen to centrally store all SSIS package-related configurations such as:&lt;/p&gt;&lt;/span&gt;&lt;ul style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; list-style: disc; margin: 0.75em 0px; padding-inline-start: 1.625em; padding: 0px;&quot;&gt;&lt;li style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; margin-bottom: 0.5em; margin-top: 0.5em; padding-inline-start: 0.375em;&quot;&gt;&lt;span style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; display: block;&quot;&gt;Output file paths&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; margin-bottom: 0.5em; margin-top: 0.5em; padding-inline-start: 0.375em;&quot;&gt;&lt;span style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; display: block;&quot;&gt;File names&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; margin-bottom: 0.5em; margin-top: 0.5em; padding-inline-start: 0.375em;&quot;&gt;&lt;span style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; display: block;&quot;&gt;Email distribution lists (DLs)&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; margin-bottom: 0.5em; margin-top: 0.5em; padding-inline-start: 0.375em;&quot;&gt;&lt;span style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; display: block;&quot;&gt;Other configurable settings&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; margin-bottom: 0.5em; margin-top: 0.5em; padding-inline-start: 0.375em;&quot;&gt;&lt;span style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; display: block;&quot;&gt;&lt;span style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; display: block;&quot;&gt;&lt;p class=&quot;mb-2 last:mb-0&quot; style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; line-height: 1.625; margin-bottom: 1rem !important; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;&quot;&gt;SSIS packages will read configuration details directly from the database via this interface, replacing the need for multiple separate configuration files.&lt;/p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border-color: rgb(229, 231, 235); border-image: initial; border-style: solid; border-width: 1px 0px 0px; box-sizing: border-box; color: inherit; height: 0px; margin: 3em 0px;&quot; /&gt;&lt;/div&gt;&lt;/h3&gt;&lt;h3 style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; color: #111827; font-size: 1.25em; font-weight: 600; line-height: 1.6; margin: 0px 0px 0.6em;&quot;&gt;&lt;span style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; display: block;&quot;&gt;4.3 UI for Job Scheduling (Future Scope)&lt;/span&gt;&lt;/h3&gt;&lt;h3 data-end=&quot;100&quot; data-start=&quot;81&quot;&gt;&lt;div class=&quot;prose break-words dark:prose-invert prose-p:leading-relaxed prose-pre:p-0 fix-max-with-100 prose-p:!mt-0&quot; style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-prose-body: #374151; --tw-prose-bold: #111827; --tw-prose-bullets: #d1d5db; --tw-prose-captions: #6b7280; --tw-prose-code: #111827; --tw-prose-counters: #6b7280; --tw-prose-headings: #111827; --tw-prose-hr: #e5e7eb; --tw-prose-invert-body: #d1d5db; --tw-prose-invert-bold: #fff; --tw-prose-invert-bullets: #4b5563; --tw-prose-invert-captions: #9ca3af; --tw-prose-invert-code: #fff; --tw-prose-invert-counters: #9ca3af; --tw-prose-invert-headings: #fff; --tw-prose-invert-hr: #374151; --tw-prose-invert-kbd-shadows: 255 255 255; --tw-prose-invert-kbd: #fff; --tw-prose-invert-lead: #9ca3af; --tw-prose-invert-links: #fff; --tw-prose-invert-pre-bg: rgba(0,0,0,.5); --tw-prose-invert-pre-code: #d1d5db; --tw-prose-invert-quote-borders: #374151; --tw-prose-invert-quotes: #f3f4f6; --tw-prose-invert-td-borders: #374151; --tw-prose-invert-th-borders: #4b5563; --tw-prose-kbd-shadows: 17 24 39; --tw-prose-kbd: #111827; --tw-prose-lead: #4b5563; --tw-prose-links: #111827; --tw-prose-pre-bg: #1f2937; --tw-prose-pre-code: #e5e7eb; --tw-prose-quote-borders: #e5e7eb; --tw-prose-quotes: #111827; --tw-prose-td-borders: #e5e7eb; --tw-prose-th-borders: #d1d5db; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; -webkit-text-stroke-width: 0px; background-color: white; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; color: #374151; font-family: __Inter_f367f3, __Inter_Fallback_f367f3, ui-sans-serif, system-ui, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Segoe UI Symbol&amp;quot;, &amp;quot;Noto Color Emoji&amp;quot;; font-size: medium; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; line-height: 1.75; max-width: 100%; orphans: 2; overflow-wrap: break-word; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;ul style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; list-style: disc; margin: 0px 0px 1.25em; padding-inline-start: 1.625em; padding: 0px;&quot;&gt;&lt;li style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; margin-bottom: 0.5em; margin-top: 0.5em; padding-inline-start: 0.375em;&quot;&gt;&lt;span style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; display: block;&quot;&gt;Design a screen to allow job scheduling directly in SQL Server.&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; margin-bottom: 0.5em; margin-top: 0.5em; padding-inline-start: 0.375em;&quot;&gt;&lt;span style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; display: block;&quot;&gt;This will require elevated permissions on the MSDB database.&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; margin-bottom: 0.5em; margin-top: 0.5em; padding-inline-start: 0.375em;&quot;&gt;&lt;span style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; display: block;&quot;&gt;Enables Business/OPS teams to manage job schedules without manual SQL Server Agent setup.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border-color: rgb(229, 231, 235); border-image: initial; border-style: solid; border-width: 1px 0px 0px; box-sizing: border-box; color: inherit; height: 0px; margin: 3em 0px;&quot; /&gt;&lt;/div&gt;&lt;/h3&gt;&lt;h2 style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; color: #111827; font-size: 1.5em; font-weight: 700; line-height: 1.33333; margin: 0px;&quot;&gt;5. Summary of Workflow Changes&lt;/h2&gt;&lt;h3 data-end=&quot;100&quot; data-start=&quot;81&quot;&gt;&lt;div class=&quot;prose break-words dark:prose-invert prose-p:leading-relaxed prose-pre:p-0 fix-max-with-100 prose-p:!mt-0&quot; style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-prose-body: #374151; --tw-prose-bold: #111827; --tw-prose-bullets: #d1d5db; --tw-prose-captions: #6b7280; --tw-prose-code: #111827; --tw-prose-counters: #6b7280; --tw-prose-headings: #111827; --tw-prose-hr: #e5e7eb; --tw-prose-invert-body: #d1d5db; --tw-prose-invert-bold: #fff; --tw-prose-invert-bullets: #4b5563; --tw-prose-invert-captions: #9ca3af; --tw-prose-invert-code: #fff; --tw-prose-invert-counters: #9ca3af; --tw-prose-invert-headings: #fff; --tw-prose-invert-hr: #374151; --tw-prose-invert-kbd-shadows: 255 255 255; --tw-prose-invert-kbd: #fff; --tw-prose-invert-lead: #9ca3af; --tw-prose-invert-links: #fff; --tw-prose-invert-pre-bg: rgba(0,0,0,.5); --tw-prose-invert-pre-code: #d1d5db; --tw-prose-invert-quote-borders: #374151; --tw-prose-invert-quotes: #f3f4f6; --tw-prose-invert-td-borders: #374151; --tw-prose-invert-th-borders: #4b5563; --tw-prose-kbd-shadows: 17 24 39; --tw-prose-kbd: #111827; --tw-prose-lead: #4b5563; --tw-prose-links: #111827; --tw-prose-pre-bg: #1f2937; --tw-prose-pre-code: #e5e7eb; --tw-prose-quote-borders: #e5e7eb; --tw-prose-quotes: #111827; --tw-prose-td-borders: #e5e7eb; --tw-prose-th-borders: #d1d5db; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: white; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; color: #374151; font-family: __Inter_f367f3, __Inter_Fallback_f367f3, ui-sans-serif, system-ui, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Segoe UI Symbol&amp;quot;, &amp;quot;Noto Color Emoji&amp;quot;; font-size: medium; font-weight: 400; line-height: 1.75; max-width: 100%; overflow-wrap: break-word;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;overflow-x-auto my-4&quot; style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: white; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; color: #09090b; font-family: __Inter_f367f3, __Inter_Fallback_f367f3, ui-sans-serif, system-ui, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Segoe UI Symbol&amp;quot;, &amp;quot;Noto Color Emoji&amp;quot;; font-size: medium; font-weight: 400; margin-bottom: 1rem; margin-top: 1rem; max-width: 100%; overflow-x: auto;&quot;&gt;&lt;table class=&quot;markdown-table&quot; style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border-collapse: collapse; border-color: inherit; border-image: initial; border-style: solid; border-width: 0px; font-size: 0.875rem; line-height: 1.25rem; margin-bottom: 1rem; margin-top: 1rem; overflow: hidden; text-indent: 0px; width: 1112.59px;&quot;&gt;&lt;thead style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box;&quot;&gt;&lt;tr style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box;&quot;&gt;&lt;th style=&quot;--tw-bg-opacity: 1; --tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: #f3f4f6; border: 1px solid rgb(228, 228, 231); box-sizing: border-box; padding: 0.75rem 1.5rem; text-align: left; text-wrap-mode: nowrap;&quot;&gt;&lt;p style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; margin: 0px;&quot;&gt;Phase/Action&lt;/p&gt;&lt;/th&gt;&lt;th style=&quot;--tw-bg-opacity: 1; --tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: #f3f4f6; border: 1px solid rgb(228, 228, 231); box-sizing: border-box; padding: 0.75rem 1.5rem; text-align: left; text-wrap-mode: nowrap;&quot;&gt;&lt;p style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; margin: 0px;&quot;&gt;Current Process&lt;/p&gt;&lt;/th&gt;&lt;th style=&quot;--tw-bg-opacity: 1; --tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: #f3f4f6; border: 1px solid rgb(228, 228, 231); box-sizing: border-box; padding: 0.75rem 1.5rem; text-align: left; text-wrap-mode: nowrap;&quot;&gt;&lt;p style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; margin: 0px;&quot;&gt;Proposed Process&lt;/p&gt;&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box;&quot;&gt;&lt;tr style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 1px solid rgb(228, 228, 231); box-sizing: border-box; padding: 0.75rem 1.5rem; text-wrap-mode: nowrap;&quot;&gt;&lt;p style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; margin: 0px;&quot;&gt;New Client Onboarding&lt;/p&gt;&lt;/td&gt;&lt;td style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 1px solid rgb(228, 228, 231); box-sizing: border-box; padding: 0.75rem 1.5rem; text-wrap-mode: nowrap;&quot;&gt;&lt;p style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; margin: 0px;&quot;&gt;Write DB scripts and packages manually&lt;/p&gt;&lt;/td&gt;&lt;td style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 1px solid rgb(228, 228, 231); box-sizing: border-box; padding: 0.75rem 1.5rem; text-wrap-mode: nowrap;&quot;&gt;&lt;p style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; margin: 0px;&quot;&gt;Use UI to insert Output ID &amp;amp; create job configurations&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 1px solid rgb(228, 228, 231); box-sizing: border-box; padding: 0.75rem 1.5rem; text-wrap-mode: nowrap;&quot;&gt;&lt;p style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; margin: 0px;&quot;&gt;Job Creation for Existing Clients&lt;/p&gt;&lt;/td&gt;&lt;td style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 1px solid rgb(228, 228, 231); box-sizing: border-box; padding: 0.75rem 1.5rem; text-wrap-mode: nowrap;&quot;&gt;&lt;p style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; margin: 0px;&quot;&gt;Create packages, stored procedures, and configs manually&lt;/p&gt;&lt;/td&gt;&lt;td style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 1px solid rgb(228, 228, 231); box-sizing: border-box; padding: 0.75rem 1.5rem; text-wrap-mode: nowrap;&quot;&gt;&lt;p style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; margin: 0px;&quot;&gt;Use UI to select existing templates and configure jobs&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 1px solid rgb(228, 228, 231); box-sizing: border-box; padding: 0.75rem 1.5rem; text-wrap-mode: nowrap;&quot;&gt;&lt;p style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; margin: 0px;&quot;&gt;Changes to Existing Jobs&lt;/p&gt;&lt;/td&gt;&lt;td style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 1px solid rgb(228, 228, 231); box-sizing: border-box; padding: 0.75rem 1.5rem; text-wrap-mode: nowrap;&quot;&gt;&lt;p style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; margin: 0px;&quot;&gt;Modify existing packages and update config files manually&lt;/p&gt;&lt;/td&gt;&lt;td style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 1px solid rgb(228, 228, 231); box-sizing: border-box; padding: 0.75rem 1.5rem; text-wrap-mode: nowrap;&quot;&gt;&lt;p style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; margin: 0px;&quot;&gt;UI allows configuration changes without code changes&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 1px solid rgb(228, 228, 231); box-sizing: border-box; padding: 0.75rem 1.5rem; text-wrap-mode: nowrap;&quot;&gt;&lt;p style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; margin: 0px;&quot;&gt;Job Scheduling&lt;/p&gt;&lt;/td&gt;&lt;td style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 1px solid rgb(228, 228, 231); box-sizing: border-box; padding: 0.75rem 1.5rem; text-wrap-mode: nowrap;&quot;&gt;&lt;p style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; margin: 0px;&quot;&gt;Manual SQL Server Agent setup&lt;/p&gt;&lt;/td&gt;&lt;td style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 1px solid rgb(228, 228, 231); box-sizing: border-box; padding: 0.75rem 1.5rem; text-wrap-mode: nowrap;&quot;&gt;&lt;p style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; margin: 0px;&quot;&gt;UI-based scheduling for ease and automation&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;prose break-words dark:prose-invert prose-p:leading-relaxed prose-pre:p-0 fix-max-with-100 prose-p:!mt-0&quot; style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-prose-body: #374151; --tw-prose-bold: #111827; --tw-prose-bullets: #d1d5db; --tw-prose-captions: #6b7280; --tw-prose-code: #111827; --tw-prose-counters: #6b7280; --tw-prose-headings: #111827; --tw-prose-hr: #e5e7eb; --tw-prose-invert-body: #d1d5db; --tw-prose-invert-bold: #fff; --tw-prose-invert-bullets: #4b5563; --tw-prose-invert-captions: #9ca3af; --tw-prose-invert-code: #fff; --tw-prose-invert-counters: #9ca3af; --tw-prose-invert-headings: #fff; --tw-prose-invert-hr: #374151; --tw-prose-invert-kbd-shadows: 255 255 255; --tw-prose-invert-kbd: #fff; --tw-prose-invert-lead: #9ca3af; --tw-prose-invert-links: #fff; --tw-prose-invert-pre-bg: rgba(0,0,0,.5); --tw-prose-invert-pre-code: #d1d5db; --tw-prose-invert-quote-borders: #374151; --tw-prose-invert-quotes: #f3f4f6; --tw-prose-invert-td-borders: #374151; --tw-prose-invert-th-borders: #4b5563; --tw-prose-kbd-shadows: 17 24 39; --tw-prose-kbd: #111827; --tw-prose-lead: #4b5563; --tw-prose-links: #111827; --tw-prose-pre-bg: #1f2937; --tw-prose-pre-code: #e5e7eb; --tw-prose-quote-borders: #e5e7eb; --tw-prose-quotes: #111827; --tw-prose-td-borders: #e5e7eb; --tw-prose-th-borders: #d1d5db; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: white; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; color: #374151; font-family: __Inter_f367f3, __Inter_Fallback_f367f3, ui-sans-serif, system-ui, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Segoe UI Symbol&amp;quot;, &amp;quot;Noto Color Emoji&amp;quot;; font-size: medium; font-weight: 400; line-height: 1.75; max-width: 100%; overflow-wrap: break-word;&quot;&gt;&lt;hr style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border-bottom: 0px solid rgb(229, 231, 235); border-image: initial; border-left: 0px solid rgb(229, 231, 235); border-right: 0px solid rgb(229, 231, 235); border-top-color: rgb(229, 231, 235); border-top-style: solid; box-sizing: border-box; color: inherit; height: 0px; margin: 0px 0px 3em;&quot; /&gt;&lt;/div&gt;&lt;/h3&gt;&lt;h2 style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; color: #111827; line-height: 1.33333; margin: 0px 0px 1em;&quot;&gt;6. Expected Benefits of Proposed Solution&lt;/h2&gt;&lt;h3 data-end=&quot;100&quot; data-start=&quot;81&quot;&gt;&lt;div class=&quot;prose break-words dark:prose-invert prose-p:leading-relaxed prose-pre:p-0 fix-max-with-100 prose-p:!mt-0&quot; style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-prose-body: #374151; --tw-prose-bold: #111827; --tw-prose-bullets: #d1d5db; --tw-prose-captions: #6b7280; --tw-prose-code: #111827; --tw-prose-counters: #6b7280; --tw-prose-headings: #111827; --tw-prose-hr: #e5e7eb; --tw-prose-invert-body: #d1d5db; --tw-prose-invert-bold: #fff; --tw-prose-invert-bullets: #4b5563; --tw-prose-invert-captions: #9ca3af; --tw-prose-invert-code: #fff; --tw-prose-invert-counters: #9ca3af; --tw-prose-invert-headings: #fff; --tw-prose-invert-hr: #374151; --tw-prose-invert-kbd-shadows: 255 255 255; --tw-prose-invert-kbd: #fff; --tw-prose-invert-lead: #9ca3af; --tw-prose-invert-links: #fff; --tw-prose-invert-pre-bg: rgba(0,0,0,.5); --tw-prose-invert-pre-code: #d1d5db; --tw-prose-invert-quote-borders: #374151; --tw-prose-invert-quotes: #f3f4f6; --tw-prose-invert-td-borders: #374151; --tw-prose-invert-th-borders: #4b5563; --tw-prose-kbd-shadows: 17 24 39; --tw-prose-kbd: #111827; --tw-prose-lead: #4b5563; --tw-prose-links: #111827; --tw-prose-pre-bg: #1f2937; --tw-prose-pre-code: #e5e7eb; --tw-prose-quote-borders: #e5e7eb; --tw-prose-quotes: #111827; --tw-prose-td-borders: #e5e7eb; --tw-prose-th-borders: #d1d5db; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: white; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; color: #374151; font-family: __Inter_f367f3, __Inter_Fallback_f367f3, ui-sans-serif, system-ui, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Segoe UI Symbol&amp;quot;, &amp;quot;Noto Color Emoji&amp;quot;; font-size: medium; font-weight: 400; line-height: 1.75; max-width: 100%; overflow-wrap: break-word;&quot;&gt;&lt;ul style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; list-style-image: initial; list-style-position: initial; margin: 0px 0px 1.25em; padding-inline-start: 1.625em; padding: 0px;&quot;&gt;&lt;li style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; margin-bottom: 0.5em; margin-top: 0.5em; padding-inline-start: 0.375em;&quot;&gt;&lt;span style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; display: block;&quot;&gt;&lt;span style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; color: #111827; font-weight: 600;&quot;&gt;Reduced Development Time:&lt;/span&gt;&amp;nbsp;Automate repetitive steps and eliminate manual script creation.&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; margin-bottom: 0.5em; margin-top: 0.5em; padding-inline-start: 0.375em;&quot;&gt;&lt;span style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; display: block;&quot;&gt;&lt;span style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; color: #111827; font-weight: 600;&quot;&gt;Empowered Business/OPS Teams:&lt;/span&gt;&amp;nbsp;Enable non-technical users to configure and manage jobs independently.&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; margin-bottom: 0.5em; margin-top: 0.5em; padding-inline-start: 0.375em;&quot;&gt;&lt;span style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; display: block;&quot;&gt;&lt;span style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; color: #111827; font-weight: 600;&quot;&gt;Consistency and Accuracy:&lt;/span&gt;&amp;nbsp;Centralized configuration storage reduces errors and inconsistencies.&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; margin-bottom: 0.5em; margin-top: 0.5em; padding-inline-start: 0.375em;&quot;&gt;&lt;span style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; display: block;&quot;&gt;&lt;span style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; color: #111827; font-weight: 600;&quot;&gt;Improved Agility:&lt;/span&gt;&amp;nbsp;Faster onboarding for new clients and easier job modifications.&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; margin-bottom: 0.5em; margin-top: 0.5em; padding-inline-start: 0.375em;&quot;&gt;&lt;span style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; display: block;&quot;&gt;&lt;span style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(228, 228, 231); box-sizing: border-box; color: #111827; font-weight: 600;&quot;&gt;Future Proof:&lt;/span&gt;&amp;nbsp;UI-based scheduling adds flexibility and reduces dependency on DBAs.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;/h3&gt;</content><link rel='replies' type='application/atom+xml' href='http://piushshukla.blogspot.com/feeds/973734467866598173/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://piushshukla.blogspot.com/2025/09/cdc.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2159069551745631737/posts/default/973734467866598173'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2159069551745631737/posts/default/973734467866598173'/><link rel='alternate' type='text/html' href='http://piushshukla.blogspot.com/2025/09/cdc.html' title='CDC'/><author><name>Piush shukla</name><uri>http://www.blogger.com/profile/16392649283296436146</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2159069551745631737.post-366991155058892892</id><published>2025-09-23T21:22:00.000-07:00</published><updated>2025-09-23T21:22:57.205-07:00</updated><title type='text'>Web API Versioning</title><content type='html'>&lt;h2 data-end=&quot;183&quot; data-start=&quot;150&quot;&gt;1️⃣ Why API Versioning Matters&lt;/h2&gt;
&lt;p data-end=&quot;234&quot; data-start=&quot;185&quot;&gt;Imagine you published a REST API for mobile apps:&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;260&quot; data-start=&quot;235&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre!&quot;&gt;GET /api/products
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;ul data-end=&quot;382&quot; data-start=&quot;261&quot;&gt;
&lt;li data-end=&quot;312&quot; data-start=&quot;261&quot;&gt;
&lt;p data-end=&quot;312&quot; data-start=&quot;263&quot;&gt;Later you need a new field or change a parameter.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;382&quot; data-start=&quot;313&quot;&gt;
&lt;p data-end=&quot;382&quot; data-start=&quot;315&quot;&gt;You can’t break old mobile apps that still call the &lt;strong data-end=&quot;381&quot; data-start=&quot;367&quot;&gt;old format&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;412&quot; data-start=&quot;384&quot;&gt;&lt;strong data-end=&quot;402&quot; data-start=&quot;384&quot;&gt;API versioning&lt;/strong&gt; lets you:&lt;/p&gt;
&lt;ul data-end=&quot;506&quot; data-start=&quot;413&quot;&gt;
&lt;li data-end=&quot;451&quot; data-start=&quot;413&quot;&gt;
&lt;p data-end=&quot;451&quot; data-start=&quot;415&quot;&gt;Publish &lt;strong data-end=&quot;439&quot; data-start=&quot;423&quot;&gt;new versions&lt;/strong&gt; of your API&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;506&quot; data-start=&quot;452&quot;&gt;
&lt;p data-end=&quot;506&quot; data-start=&quot;454&quot;&gt;Keep &lt;strong data-end=&quot;475&quot; data-start=&quot;459&quot;&gt;old versions&lt;/strong&gt; running until clients migrate.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;511&quot; data-start=&quot;508&quot; /&gt;
&lt;h2 data-end=&quot;551&quot; data-start=&quot;513&quot;&gt;2️⃣ Common Ways to Show the Version&lt;/h2&gt;
&lt;p data-end=&quot;632&quot; data-start=&quot;553&quot;&gt;You must tell the server &lt;strong data-end=&quot;595&quot; data-start=&quot;578&quot;&gt;which version&lt;/strong&gt; the client wants.&lt;br data-end=&quot;616&quot; data-start=&quot;613&quot; /&gt;
Popular options:&lt;/p&gt;
&lt;div class=&quot;_tableContainer_1rjym_1&quot;&gt;&lt;div class=&quot;group _tableWrapper_1rjym_13 flex w-fit flex-col-reverse&quot; tabindex=&quot;-1&quot;&gt;&lt;table class=&quot;w-fit min-w-(--thread-content-width)&quot; data-end=&quot;1460&quot; data-start=&quot;634&quot;&gt;&lt;thead data-end=&quot;771&quot; data-start=&quot;634&quot;&gt;&lt;tr data-end=&quot;771&quot; data-start=&quot;634&quot;&gt;&lt;th data-col-size=&quot;sm&quot; data-end=&quot;659&quot; data-start=&quot;634&quot;&gt;Approach&lt;/th&gt;&lt;th data-col-size=&quot;sm&quot; data-end=&quot;707&quot; data-start=&quot;659&quot;&gt;Example call&lt;/th&gt;&lt;th data-col-size=&quot;sm&quot; data-end=&quot;738&quot; data-start=&quot;707&quot;&gt;Pros&lt;/th&gt;&lt;th data-col-size=&quot;sm&quot; data-end=&quot;771&quot; data-start=&quot;738&quot;&gt;Cons&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody data-end=&quot;1460&quot; data-start=&quot;910&quot;&gt;&lt;tr data-end=&quot;1048&quot; data-start=&quot;910&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;935&quot; data-start=&quot;910&quot;&gt;&lt;strong data-end=&quot;924&quot; data-start=&quot;912&quot;&gt;URL path&lt;/strong&gt;&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;983&quot; data-start=&quot;935&quot;&gt;&lt;code data-end=&quot;955&quot; data-start=&quot;937&quot;&gt;/api/v1/products&lt;/code&gt;&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;1014&quot; data-start=&quot;983&quot;&gt;Very clear, cache friendly&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;1048&quot; data-start=&quot;1014&quot;&gt;URL changes with every version&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;1186&quot; data-start=&quot;1049&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;1074&quot; data-start=&quot;1049&quot;&gt;&lt;strong data-end=&quot;1067&quot; data-start=&quot;1051&quot;&gt;Query string&lt;/strong&gt;&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;1123&quot; data-start=&quot;1074&quot;&gt;&lt;code data-end=&quot;1107&quot; data-start=&quot;1076&quot;&gt;/api/products?api-version=1.0&lt;/code&gt;&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;1153&quot; data-start=&quot;1123&quot;&gt;Easy to test&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;1186&quot; data-start=&quot;1153&quot;&gt;Less obvious in logs&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;1323&quot; data-start=&quot;1187&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;1212&quot; data-start=&quot;1187&quot;&gt;&lt;strong data-end=&quot;1204&quot; data-start=&quot;1189&quot;&gt;HTTP header&lt;/strong&gt;&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;1260&quot; data-start=&quot;1212&quot;&gt;&lt;code data-end=&quot;1233&quot; data-start=&quot;1214&quot;&gt;GET /api/products&lt;/code&gt; + &lt;code data-end=&quot;1255&quot; data-start=&quot;1236&quot;&gt;x-api-version:1.0&lt;/code&gt;&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;1290&quot; data-start=&quot;1260&quot;&gt;Clean URLs&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;1323&quot; data-start=&quot;1290&quot;&gt;Harder to debug in browser&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;1460&quot; data-start=&quot;1324&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;1357&quot; data-start=&quot;1324&quot;&gt;&lt;strong data-end=&quot;1356&quot; data-start=&quot;1326&quot;&gt;Accept header (media type)&lt;/strong&gt;&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;1397&quot; data-start=&quot;1357&quot;&gt;&lt;code data-end=&quot;1392&quot; data-start=&quot;1359&quot;&gt;Accept: application/json; v=1.0&lt;/code&gt;&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;1427&quot; data-start=&quot;1397&quot;&gt;Follows REST best practice&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;1460&quot; data-start=&quot;1427&quot;&gt;Requires custom header setup&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p data-end=&quot;1492&quot; data-start=&quot;1462&quot;&gt;You can even &lt;strong data-end=&quot;1486&quot; data-start=&quot;1475&quot;&gt;combine&lt;/strong&gt; them.&lt;/p&gt;
&lt;hr data-end=&quot;1497&quot; data-start=&quot;1494&quot; /&gt;
&lt;h2 data-end=&quot;1532&quot; data-start=&quot;1499&quot;&gt;3️⃣ Official Microsoft Library&lt;/h2&gt;
&lt;p data-end=&quot;1556&quot; data-start=&quot;1534&quot;&gt;Use the NuGet package:&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;1601&quot; data-start=&quot;1558&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre!&quot;&gt;Microsoft.AspNetCore.Mvc.Versioning
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;p data-end=&quot;1638&quot; data-start=&quot;1603&quot;&gt;This library makes versioning easy.&lt;/p&gt;
&lt;hr data-end=&quot;1643&quot; data-start=&quot;1640&quot; /&gt;
&lt;h2 data-end=&quot;1687&quot; data-start=&quot;1645&quot;&gt;4️⃣ Basic Setup (Path-based Versioning)&lt;/h2&gt;
&lt;h3 data-end=&quot;1711&quot; data-start=&quot;1689&quot;&gt;1. Install Package&lt;/h3&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;1778&quot; data-start=&quot;1712&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-bash&quot;&gt;dotnet add package Microsoft.AspNetCore.Mvc.Versioning
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;h3 data-end=&quot;1830&quot; data-start=&quot;1780&quot;&gt;2. Configure in &lt;code data-end=&quot;1812&quot; data-start=&quot;1800&quot;&gt;Program.cs&lt;/code&gt; (or &lt;code data-end=&quot;1829&quot; data-start=&quot;1817&quot;&gt;Startup.cs&lt;/code&gt;)&lt;/h3&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;2083&quot; data-start=&quot;1831&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-csharp&quot;&gt;builder.Services.AddApiVersioning(options =&amp;gt;
{
    options.AssumeDefaultVersionWhenUnspecified = &lt;span class=&quot;hljs-literal&quot;&gt;true&lt;/span&gt;;
    options.DefaultApiVersion = &lt;span class=&quot;hljs-keyword&quot;&gt;new&lt;/span&gt; ApiVersion(&lt;span class=&quot;hljs-number&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;hljs-number&quot;&gt;0&lt;/span&gt;);
    options.ReportApiVersions = &lt;span class=&quot;hljs-literal&quot;&gt;true&lt;/span&gt;; &lt;span class=&quot;hljs-comment&quot;&gt;// adds headers: api-supported-versions&lt;/span&gt;
});
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;ul data-end=&quot;2248&quot; data-start=&quot;2084&quot;&gt;
&lt;li data-end=&quot;2179&quot; data-start=&quot;2084&quot;&gt;
&lt;p data-end=&quot;2179&quot; data-start=&quot;2086&quot;&gt;&lt;strong data-end=&quot;2125&quot; data-start=&quot;2086&quot;&gt;AssumeDefaultVersionWhenUnspecified&lt;/strong&gt;: if client doesn’t pass a version, use default (1.0).&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2248&quot; data-start=&quot;2180&quot;&gt;
&lt;p data-end=&quot;2248&quot; data-start=&quot;2182&quot;&gt;&lt;strong data-end=&quot;2203&quot; data-start=&quot;2182&quot;&gt;ReportApiVersions&lt;/strong&gt;: tells clients which versions are available.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-end=&quot;2281&quot; data-start=&quot;2250&quot;&gt;3. Version Your Controllers&lt;/h3&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;2491&quot; data-start=&quot;2282&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-csharp&quot;&gt;[&lt;span class=&quot;hljs-meta&quot;&gt;ApiVersion(&lt;span class=&quot;hljs-string&quot;&gt;&quot;1.0&quot;&lt;/span&gt;&lt;/span&gt;)]
[&lt;span class=&quot;hljs-meta&quot;&gt;Route(&lt;span class=&quot;hljs-string&quot;&gt;&quot;api/v{version:apiVersion}/[controller]&quot;&lt;/span&gt;&lt;/span&gt;)]
[&lt;span class=&quot;hljs-meta&quot;&gt;ApiController&lt;/span&gt;]
&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;ProductsController&lt;/span&gt; : &lt;span class=&quot;hljs-title&quot;&gt;ControllerBase&lt;/span&gt;
{
    [&lt;span class=&quot;hljs-meta&quot;&gt;HttpGet&lt;/span&gt;]
    &lt;span class=&quot;hljs-function&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;hljs-built_in&quot;&gt;string&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;GetV1&lt;/span&gt;() =&amp;gt; &lt;span class=&quot;hljs-string&quot;&gt;&quot;This is V1&quot;&lt;/span&gt;;
}
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;p data-end=&quot;2514&quot; data-start=&quot;2493&quot;&gt;Add a second version:&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;2743&quot; data-start=&quot;2515&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-csharp&quot;&gt;[&lt;span class=&quot;hljs-meta&quot;&gt;ApiVersion(&lt;span class=&quot;hljs-string&quot;&gt;&quot;2.0&quot;&lt;/span&gt;&lt;/span&gt;)]
[&lt;span class=&quot;hljs-meta&quot;&gt;Route(&lt;span class=&quot;hljs-string&quot;&gt;&quot;api/v{version:apiVersion}/[controller]&quot;&lt;/span&gt;&lt;/span&gt;)]
[&lt;span class=&quot;hljs-meta&quot;&gt;ApiController&lt;/span&gt;]
&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;ProductsV2Controller&lt;/span&gt; : &lt;span class=&quot;hljs-title&quot;&gt;ControllerBase&lt;/span&gt;
{
    [&lt;span class=&quot;hljs-meta&quot;&gt;HttpGet&lt;/span&gt;]
    &lt;span class=&quot;hljs-function&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;hljs-built_in&quot;&gt;string&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;GetV2&lt;/span&gt;() =&amp;gt; &lt;span class=&quot;hljs-string&quot;&gt;&quot;This is V2 with more fields&quot;&lt;/span&gt;;
}
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;p data-end=&quot;2762&quot; data-start=&quot;2745&quot;&gt;Now clients call:&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;2804&quot; data-start=&quot;2763&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre!&quot;&gt;/api/v1/products
/api/v2/products
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;hr data-end=&quot;2809&quot; data-start=&quot;2806&quot; /&gt;
&lt;h2 data-end=&quot;2841&quot; data-start=&quot;2811&quot;&gt;5️⃣ Query-String Versioning&lt;/h2&gt;
&lt;p data-end=&quot;2876&quot; data-start=&quot;2843&quot;&gt;If you prefer &lt;code data-end=&quot;2875&quot; data-start=&quot;2857&quot;&gt;?api-version=1.0&lt;/code&gt;:&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;3021&quot; data-start=&quot;2878&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-csharp&quot;&gt;builder.Services.AddApiVersioning(options =&amp;gt;
{
    options.ApiVersionReader = &lt;span class=&quot;hljs-keyword&quot;&gt;new&lt;/span&gt; QueryStringApiVersionReader(&lt;span class=&quot;hljs-string&quot;&gt;&quot;api-version&quot;&lt;/span&gt;);
});
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;p data-end=&quot;3097&quot; data-start=&quot;3022&quot;&gt;Then the route can simply be &lt;code data-end=&quot;3080&quot; data-start=&quot;3051&quot;&gt;[Route(&quot;api/[controller]&quot;)]&lt;/code&gt;.&lt;br data-end=&quot;3084&quot; data-start=&quot;3081&quot; /&gt;
Clients call:&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;3135&quot; data-start=&quot;3098&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre!&quot;&gt;/api/products?api-version=1.0
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;hr data-end=&quot;3140&quot; data-start=&quot;3137&quot; /&gt;
&lt;h2 data-end=&quot;3172&quot; data-start=&quot;3142&quot;&gt;6️⃣ Header-Based Versioning&lt;/h2&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;3314&quot; data-start=&quot;3174&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-csharp&quot;&gt;builder.Services.AddApiVersioning(options =&amp;gt;
{
    options.ApiVersionReader = &lt;span class=&quot;hljs-keyword&quot;&gt;new&lt;/span&gt; HeaderApiVersionReader(&lt;span class=&quot;hljs-string&quot;&gt;&quot;x-api-version&quot;&lt;/span&gt;);
});
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;p data-end=&quot;3334&quot; data-start=&quot;3315&quot;&gt;Client adds header:&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;3361&quot; data-start=&quot;3335&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre!&quot;&gt;&lt;span class=&quot;hljs-section&quot;&gt;x-api-version: 2.0&lt;/span&gt;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;hr data-end=&quot;3366&quot; data-start=&quot;3363&quot; /&gt;
&lt;h2 data-end=&quot;3410&quot; data-start=&quot;3368&quot;&gt;7️⃣ Multiple Versions in One Controller&lt;/h2&gt;
&lt;p data-end=&quot;3455&quot; data-start=&quot;3412&quot;&gt;You can keep both actions in the same file:&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;3766&quot; data-start=&quot;3457&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-csharp&quot;&gt;[&lt;span class=&quot;hljs-meta&quot;&gt;ApiVersion(&lt;span class=&quot;hljs-string&quot;&gt;&quot;1.0&quot;&lt;/span&gt;&lt;/span&gt;)]
[&lt;span class=&quot;hljs-meta&quot;&gt;ApiVersion(&lt;span class=&quot;hljs-string&quot;&gt;&quot;2.0&quot;&lt;/span&gt;&lt;/span&gt;)]
[&lt;span class=&quot;hljs-meta&quot;&gt;Route(&lt;span class=&quot;hljs-string&quot;&gt;&quot;api/products&quot;&lt;/span&gt;&lt;/span&gt;)]
[&lt;span class=&quot;hljs-meta&quot;&gt;ApiController&lt;/span&gt;]
&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;ProductsController&lt;/span&gt; : &lt;span class=&quot;hljs-title&quot;&gt;ControllerBase&lt;/span&gt;
{
    [&lt;span class=&quot;hljs-meta&quot;&gt;HttpGet, MapToApiVersion(&lt;span class=&quot;hljs-string&quot;&gt;&quot;1.0&quot;&lt;/span&gt;&lt;/span&gt;)]
    &lt;span class=&quot;hljs-function&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;hljs-built_in&quot;&gt;string&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;GetV1&lt;/span&gt;() =&amp;gt; &lt;span class=&quot;hljs-string&quot;&gt;&quot;Old result&quot;&lt;/span&gt;;

    [&lt;span class=&quot;hljs-meta&quot;&gt;HttpGet, MapToApiVersion(&lt;span class=&quot;hljs-string&quot;&gt;&quot;2.0&quot;&lt;/span&gt;&lt;/span&gt;)]
    &lt;span class=&quot;hljs-function&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;hljs-built_in&quot;&gt;string&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;GetV2&lt;/span&gt;() =&amp;gt; &lt;span class=&quot;hljs-string&quot;&gt;&quot;New result&quot;&lt;/span&gt;;
}
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;hr data-end=&quot;3771&quot; data-start=&quot;3768&quot; /&gt;
&lt;h2 data-end=&quot;3812&quot; data-start=&quot;3773&quot;&gt;8️⃣ Deleting or Deprecating Versions&lt;/h2&gt;
&lt;p data-end=&quot;3848&quot; data-start=&quot;3814&quot;&gt;Mark an old version as deprecated:&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;3902&quot; data-start=&quot;3850&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-csharp&quot;&gt;[&lt;span class=&quot;hljs-meta&quot;&gt;ApiVersion(&lt;span class=&quot;hljs-string&quot;&gt;&quot;1.0&quot;&lt;/span&gt;&lt;/span&gt;, Deprecated = true)]
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;p data-end=&quot;3963&quot; data-start=&quot;3903&quot;&gt;The response header &lt;code data-end=&quot;3948&quot; data-start=&quot;3923&quot;&gt;api-deprecated-versions&lt;/code&gt; warns clients.&lt;/p&gt;
&lt;hr data-end=&quot;3968&quot; data-start=&quot;3965&quot; /&gt;
&lt;h2 data-end=&quot;3991&quot; data-start=&quot;3970&quot;&gt;9️⃣ Best Practices&lt;/h2&gt;
&lt;ol data-end=&quot;4326&quot; data-start=&quot;3993&quot;&gt;
&lt;li data-end=&quot;4050&quot; data-start=&quot;3993&quot;&gt;
&lt;p data-end=&quot;4050&quot; data-start=&quot;3996&quot;&gt;&lt;strong data-end=&quot;4033&quot; data-start=&quot;3996&quot;&gt;Choose one clear versioning style&lt;/strong&gt; and stick to it.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;4116&quot; data-start=&quot;4051&quot;&gt;
&lt;p data-end=&quot;4116&quot; data-start=&quot;4054&quot;&gt;&lt;strong data-end=&quot;4066&quot; data-start=&quot;4054&quot;&gt;Document&lt;/strong&gt; which versions exist and when they’ll be retired.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;4195&quot; data-start=&quot;4117&quot;&gt;
&lt;p data-end=&quot;4195&quot; data-start=&quot;4120&quot;&gt;&lt;strong data-end=&quot;4147&quot; data-start=&quot;4120&quot;&gt;Use semantic versioning&lt;/strong&gt; (1.0, 1.1, 2.0) to show backward compatibility.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;4243&quot; data-start=&quot;4196&quot;&gt;
&lt;p data-end=&quot;4243&quot; data-start=&quot;4199&quot;&gt;&lt;strong data-end=&quot;4217&quot; data-start=&quot;4199&quot;&gt;Automate tests&lt;/strong&gt; for every active version.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;4326&quot; data-start=&quot;4244&quot;&gt;
&lt;p data-end=&quot;4326&quot; data-start=&quot;4247&quot;&gt;When possible, design for &lt;strong data-end=&quot;4299&quot; data-start=&quot;4273&quot;&gt;backward compatibility&lt;/strong&gt; to avoid breaking clients.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;hr data-end=&quot;4331&quot; data-start=&quot;4328&quot; /&gt;
&lt;h2 data-end=&quot;4355&quot; data-start=&quot;4333&quot;&gt;🔟 Quick Flow Recap&lt;/h2&gt;
&lt;ol data-end=&quot;4610&quot; data-start=&quot;4357&quot;&gt;
&lt;li data-end=&quot;4416&quot; data-start=&quot;4357&quot;&gt;
&lt;p data-end=&quot;4416&quot; data-start=&quot;4360&quot;&gt;Client requests with a version (URL / query / header).&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;4482&quot; data-start=&quot;4417&quot;&gt;
&lt;p data-end=&quot;4482&quot; data-start=&quot;4420&quot;&gt;ASP.NET Core checks the version using the configured reader.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;4544&quot; data-start=&quot;4483&quot;&gt;
&lt;p data-end=&quot;4544&quot; data-start=&quot;4486&quot;&gt;The correct controller/action for that version executes.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;4610&quot; data-start=&quot;4545&quot;&gt;
&lt;p data-end=&quot;4610&quot; data-start=&quot;4548&quot;&gt;Response headers tell the client which versions are supported.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;hr data-end=&quot;4615&quot; data-start=&quot;4612&quot; /&gt;
&lt;h3 data-end=&quot;4637&quot; data-start=&quot;4617&quot;&gt;🧠 Key Takeaways&lt;/h3&gt;
&lt;ul data-end=&quot;4907&quot; data-start=&quot;4638&quot;&gt;
&lt;li data-end=&quot;4712&quot; data-start=&quot;4638&quot;&gt;
&lt;p data-end=&quot;4712&quot; data-start=&quot;4640&quot;&gt;API versioning keeps old clients working while you release improvements.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;4785&quot; data-start=&quot;4713&quot;&gt;
&lt;p data-end=&quot;4785&quot; data-start=&quot;4715&quot;&gt;&lt;strong data-end=&quot;4754&quot; data-start=&quot;4715&quot;&gt;Microsoft.AspNetCore.Mvc.Versioning&lt;/strong&gt; makes it almost plug-and-play.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;4853&quot; data-start=&quot;4786&quot;&gt;
&lt;p data-end=&quot;4853&quot; data-start=&quot;4788&quot;&gt;Pick a strategy (URL path, query, or header) and stay consistent.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;4907&quot; data-start=&quot;4854&quot;&gt;
&lt;p data-end=&quot;4907&quot; data-start=&quot;4856&quot;&gt;Mark old versions as &lt;strong data-end=&quot;4891&quot; data-start=&quot;4877&quot;&gt;deprecated&lt;/strong&gt; before removal.&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;</content><link rel='replies' type='application/atom+xml' href='http://piushshukla.blogspot.com/feeds/366991155058892892/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://piushshukla.blogspot.com/2025/09/web-api-versioning.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2159069551745631737/posts/default/366991155058892892'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2159069551745631737/posts/default/366991155058892892'/><link rel='alternate' type='text/html' href='http://piushshukla.blogspot.com/2025/09/web-api-versioning.html' title='Web API Versioning'/><author><name>Piush shukla</name><uri>http://www.blogger.com/profile/16392649283296436146</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2159069551745631737.post-5124135248559741138</id><published>2025-09-22T21:50:00.000-07:00</published><updated>2025-09-22T21:50:50.781-07:00</updated><title type='text'>Kubernetes</title><content type='html'>&lt;h2 data-end=&quot;169&quot; data-start=&quot;140&quot;&gt;🟢 1️⃣ What is Kubernetes?&lt;/h2&gt;
&lt;ul data-end=&quot;377&quot; data-start=&quot;170&quot;&gt;
&lt;li data-end=&quot;237&quot; data-start=&quot;170&quot;&gt;
&lt;p data-end=&quot;237&quot; data-start=&quot;172&quot;&gt;&lt;strong data-end=&quot;192&quot; data-start=&quot;172&quot;&gt;Kubernetes (K8s)&lt;/strong&gt; is a &lt;strong data-end=&quot;234&quot; data-start=&quot;198&quot;&gt;container orchestration platform&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;303&quot; data-start=&quot;238&quot;&gt;
&lt;p data-end=&quot;303&quot; data-start=&quot;240&quot;&gt;It &lt;strong data-end=&quot;275&quot; data-start=&quot;243&quot;&gt;manages, deploys, and scales&lt;/strong&gt; containers automatically.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;377&quot; data-start=&quot;304&quot;&gt;
&lt;p data-end=&quot;377&quot; data-start=&quot;306&quot;&gt;Think of it as a &lt;strong data-end=&quot;356&quot; data-start=&quot;323&quot;&gt;manager for Docker containers&lt;/strong&gt; in a large system.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;393&quot; data-start=&quot;379&quot;&gt;&lt;strong data-end=&quot;391&quot; data-start=&quot;379&quot;&gt;Analogy:&lt;/strong&gt;&lt;/p&gt;
&lt;ul data-end=&quot;512&quot; data-start=&quot;394&quot;&gt;
&lt;li data-end=&quot;432&quot; data-start=&quot;394&quot;&gt;
&lt;p data-end=&quot;432&quot; data-start=&quot;396&quot;&gt;Docker = single shipping container&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;512&quot; data-start=&quot;433&quot;&gt;
&lt;p data-end=&quot;512&quot; data-start=&quot;435&quot;&gt;Kubernetes = entire shipping port with cranes, storage, and delivery trucks&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;517&quot; data-start=&quot;514&quot; /&gt;
&lt;h2 data-end=&quot;558&quot; data-start=&quot;519&quot;&gt;🟢 2️⃣ Why Kubernetes for .NET Core?&lt;/h2&gt;
&lt;ol data-end=&quot;904&quot; data-start=&quot;559&quot;&gt;
&lt;li data-end=&quot;636&quot; data-start=&quot;559&quot;&gt;
&lt;p data-end=&quot;636&quot; data-start=&quot;562&quot;&gt;&lt;strong data-end=&quot;574&quot; data-start=&quot;562&quot;&gt;Scaling:&lt;/strong&gt; Automatically increase or decrease the number of instances.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;701&quot; data-start=&quot;637&quot;&gt;
&lt;p data-end=&quot;701&quot; data-start=&quot;640&quot;&gt;&lt;strong data-end=&quot;657&quot; data-start=&quot;640&quot;&gt;Self-healing:&lt;/strong&gt; Restarts failed containers automatically.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;774&quot; data-start=&quot;702&quot;&gt;
&lt;p data-end=&quot;774&quot; data-start=&quot;705&quot;&gt;&lt;strong data-end=&quot;724&quot; data-start=&quot;705&quot;&gt;Load balancing:&lt;/strong&gt; Distributes traffic between multiple instances.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;834&quot; data-start=&quot;775&quot;&gt;
&lt;p data-end=&quot;834&quot; data-start=&quot;778&quot;&gt;&lt;strong data-end=&quot;798&quot; data-start=&quot;778&quot;&gt;Rolling updates:&lt;/strong&gt; Update services without downtime.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;904&quot; data-start=&quot;835&quot;&gt;
&lt;p data-end=&quot;904&quot; data-start=&quot;838&quot;&gt;&lt;strong data-end=&quot;860&quot; data-start=&quot;838&quot;&gt;Service discovery:&lt;/strong&gt; Easy communication between microservices.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;hr data-end=&quot;909&quot; data-start=&quot;906&quot; /&gt;
&lt;h2 data-end=&quot;944&quot; data-start=&quot;911&quot;&gt;🟢 3️⃣ Key Kubernetes Concepts&lt;/h2&gt;
&lt;div class=&quot;_tableContainer_1rjym_1&quot;&gt;&lt;div class=&quot;group _tableWrapper_1rjym_13 flex w-fit flex-col-reverse&quot; tabindex=&quot;-1&quot;&gt;&lt;table class=&quot;w-fit min-w-(--thread-content-width)&quot; data-end=&quot;1597&quot; data-start=&quot;946&quot;&gt;&lt;thead data-end=&quot;975&quot; data-start=&quot;946&quot;&gt;&lt;tr data-end=&quot;975&quot; data-start=&quot;946&quot;&gt;&lt;th data-col-size=&quot;sm&quot; data-end=&quot;964&quot; data-start=&quot;946&quot;&gt;Term&lt;/th&gt;&lt;th data-col-size=&quot;md&quot; data-end=&quot;975&quot; data-start=&quot;964&quot;&gt;Meaning&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody data-end=&quot;1597&quot; data-start=&quot;1006&quot;&gt;&lt;tr data-end=&quot;1093&quot; data-start=&quot;1006&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;1024&quot; data-start=&quot;1006&quot;&gt;Pod&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;1093&quot; data-start=&quot;1024&quot;&gt;Smallest deployable unit (usually 1 container, can have multiple)&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;1168&quot; data-start=&quot;1094&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;1112&quot; data-start=&quot;1094&quot;&gt;Node&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;1168&quot; data-start=&quot;1112&quot;&gt;A server (VM or physical machine) running Kubernetes&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;1229&quot; data-start=&quot;1169&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;1187&quot; data-start=&quot;1169&quot;&gt;Cluster&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;1229&quot; data-start=&quot;1187&quot;&gt;A group of nodes managed by Kubernetes&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;1313&quot; data-start=&quot;1230&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;1248&quot; data-start=&quot;1230&quot;&gt;Deployment&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;1313&quot; data-start=&quot;1248&quot;&gt;Defines how many replicas of a pod to run and manages updates&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;1391&quot; data-start=&quot;1314&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;1332&quot; data-start=&quot;1314&quot;&gt;Service&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;1391&quot; data-start=&quot;1332&quot;&gt;Exposes pods internally or externally for communication&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;1455&quot; data-start=&quot;1392&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;1410&quot; data-start=&quot;1392&quot;&gt;ConfigMap&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;1455&quot; data-start=&quot;1410&quot;&gt;Stores configuration (key-value) for pods&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;1530&quot; data-start=&quot;1456&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;1474&quot; data-start=&quot;1456&quot;&gt;Secret&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;1530&quot; data-start=&quot;1474&quot;&gt;Stores sensitive info (passwords, API keys) securely&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;1597&quot; data-start=&quot;1531&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;1549&quot; data-start=&quot;1531&quot;&gt;Namespace&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;1597&quot; data-start=&quot;1549&quot;&gt;Logical separation of resources in a cluster&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;
&lt;hr data-end=&quot;1602&quot; data-start=&quot;1599&quot; /&gt;
&lt;h2 data-end=&quot;1659&quot; data-start=&quot;1604&quot;&gt;🟢 4️⃣ Example: Deploy a .NET Core API to Kubernetes&lt;/h2&gt;
&lt;h3 data-end=&quot;1701&quot; data-start=&quot;1661&quot;&gt;Step 1: Dockerize Your .NET Core App&lt;/h3&gt;
&lt;ul data-end=&quot;1759&quot; data-start=&quot;1702&quot;&gt;
&lt;li data-end=&quot;1759&quot; data-start=&quot;1702&quot;&gt;
&lt;p data-end=&quot;1759&quot; data-start=&quot;1704&quot;&gt;Create Dockerfile and build image as explained earlier.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-end=&quot;1802&quot; data-start=&quot;1761&quot;&gt;Step 2: Push Docker Image to Registry&lt;/h3&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;1908&quot; data-start=&quot;1803&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-bash&quot;&gt;docker tag mywebapi:1.0 mydockerhubuser/mywebapi:1.0
docker push mydockerhubuser/mywebapi:1.0
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;h3 data-end=&quot;1950&quot; data-start=&quot;1910&quot;&gt;Step 3: Create Kubernetes Deployment&lt;/h3&gt;
&lt;p data-end=&quot;1968&quot; data-start=&quot;1951&quot;&gt;&lt;code data-end=&quot;1968&quot; data-start=&quot;1951&quot;&gt;deployment.yaml&lt;/code&gt;&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;2324&quot; data-start=&quot;1969&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-yaml&quot;&gt;&lt;span class=&quot;hljs-attr&quot;&gt;apiVersion:&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;apps/v1&lt;/span&gt;
&lt;span class=&quot;hljs-attr&quot;&gt;kind:&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;Deployment&lt;/span&gt;
&lt;span class=&quot;hljs-attr&quot;&gt;metadata:&lt;/span&gt;
  &lt;span class=&quot;hljs-attr&quot;&gt;name:&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;mywebapi-deployment&lt;/span&gt;
&lt;span class=&quot;hljs-attr&quot;&gt;spec:&lt;/span&gt;
  &lt;span class=&quot;hljs-attr&quot;&gt;replicas:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot;&gt;3&lt;/span&gt;
  &lt;span class=&quot;hljs-attr&quot;&gt;selector:&lt;/span&gt;
    &lt;span class=&quot;hljs-attr&quot;&gt;matchLabels:&lt;/span&gt;
      &lt;span class=&quot;hljs-attr&quot;&gt;app:&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;mywebapi&lt;/span&gt;
  &lt;span class=&quot;hljs-attr&quot;&gt;template:&lt;/span&gt;
    &lt;span class=&quot;hljs-attr&quot;&gt;metadata:&lt;/span&gt;
      &lt;span class=&quot;hljs-attr&quot;&gt;labels:&lt;/span&gt;
        &lt;span class=&quot;hljs-attr&quot;&gt;app:&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;mywebapi&lt;/span&gt;
    &lt;span class=&quot;hljs-attr&quot;&gt;spec:&lt;/span&gt;
      &lt;span class=&quot;hljs-attr&quot;&gt;containers:&lt;/span&gt;
      &lt;span class=&quot;hljs-bullet&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;hljs-attr&quot;&gt;name:&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;mywebapi&lt;/span&gt;
        &lt;span class=&quot;hljs-attr&quot;&gt;image:&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;mydockerhubuser/mywebapi:1.0&lt;/span&gt;
        &lt;span class=&quot;hljs-attr&quot;&gt;ports:&lt;/span&gt;
        &lt;span class=&quot;hljs-bullet&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;hljs-attr&quot;&gt;containerPort:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot;&gt;80&lt;/span&gt;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;ul data-end=&quot;2378&quot; data-start=&quot;2326&quot;&gt;
&lt;li data-end=&quot;2378&quot; data-start=&quot;2326&quot;&gt;
&lt;p data-end=&quot;2378&quot; data-start=&quot;2328&quot;&gt;&lt;strong data-end=&quot;2341&quot; data-start=&quot;2328&quot;&gt;replicas:&lt;/strong&gt; number of pods (instances) to run.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-end=&quot;2426&quot; data-start=&quot;2380&quot;&gt;Step 4: Expose the Deployment as a Service&lt;/h3&gt;
&lt;p data-end=&quot;2441&quot; data-start=&quot;2427&quot;&gt;&lt;code data-end=&quot;2441&quot; data-start=&quot;2427&quot;&gt;service.yaml&lt;/code&gt;&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;2639&quot; data-start=&quot;2442&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-yaml&quot;&gt;&lt;span class=&quot;hljs-attr&quot;&gt;apiVersion:&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;v1&lt;/span&gt;
&lt;span class=&quot;hljs-attr&quot;&gt;kind:&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;Service&lt;/span&gt;
&lt;span class=&quot;hljs-attr&quot;&gt;metadata:&lt;/span&gt;
  &lt;span class=&quot;hljs-attr&quot;&gt;name:&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;mywebapi-service&lt;/span&gt;
&lt;span class=&quot;hljs-attr&quot;&gt;spec:&lt;/span&gt;
  &lt;span class=&quot;hljs-attr&quot;&gt;type:&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;LoadBalancer&lt;/span&gt;
  &lt;span class=&quot;hljs-attr&quot;&gt;selector:&lt;/span&gt;
    &lt;span class=&quot;hljs-attr&quot;&gt;app:&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;mywebapi&lt;/span&gt;
  &lt;span class=&quot;hljs-attr&quot;&gt;ports:&lt;/span&gt;
    &lt;span class=&quot;hljs-bullet&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;hljs-attr&quot;&gt;protocol:&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;TCP&lt;/span&gt;
      &lt;span class=&quot;hljs-attr&quot;&gt;port:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot;&gt;80&lt;/span&gt;
      &lt;span class=&quot;hljs-attr&quot;&gt;targetPort:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot;&gt;80&lt;/span&gt;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;ul data-end=&quot;2697&quot; data-start=&quot;2640&quot;&gt;
&lt;li data-end=&quot;2697&quot; data-start=&quot;2640&quot;&gt;
&lt;p data-end=&quot;2697&quot; data-start=&quot;2642&quot;&gt;&lt;code data-end=&quot;2656&quot; data-start=&quot;2642&quot;&gt;LoadBalancer&lt;/code&gt; exposes your API to the outside world.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;2702&quot; data-start=&quot;2699&quot; /&gt;
&lt;h3 data-end=&quot;2739&quot; data-start=&quot;2704&quot;&gt;Step 5: Apply Config to Cluster&lt;/h3&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;2814&quot; data-start=&quot;2740&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-bash&quot;&gt;kubectl apply -f deployment.yaml
kubectl apply -f service.yaml
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;ul data-end=&quot;2888&quot; data-start=&quot;2816&quot;&gt;
&lt;li data-end=&quot;2850&quot; data-start=&quot;2816&quot;&gt;
&lt;p data-end=&quot;2850&quot; data-start=&quot;2818&quot;&gt;Check pods: &lt;code data-end=&quot;2848&quot; data-start=&quot;2830&quot;&gt;kubectl get pods&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2888&quot; data-start=&quot;2851&quot;&gt;
&lt;p data-end=&quot;2888&quot; data-start=&quot;2853&quot;&gt;Check services: &lt;code data-end=&quot;2886&quot; data-start=&quot;2869&quot;&gt;kubectl get svc&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;2893&quot; data-start=&quot;2890&quot; /&gt;
&lt;h2 data-end=&quot;2941&quot; data-start=&quot;2895&quot;&gt;🟢 5️⃣ How Microservices Work on Kubernetes&lt;/h2&gt;
&lt;ul data-end=&quot;3173&quot; data-start=&quot;2942&quot;&gt;
&lt;li data-end=&quot;3002&quot; data-start=&quot;2942&quot;&gt;
&lt;p data-end=&quot;3002&quot; data-start=&quot;2944&quot;&gt;Each microservice runs in its &lt;strong data-end=&quot;2999&quot; data-start=&quot;2974&quot;&gt;own deployment + pods&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3077&quot; data-start=&quot;3003&quot;&gt;
&lt;p data-end=&quot;3077&quot; data-start=&quot;3005&quot;&gt;Services communicate internally via &lt;strong data-end=&quot;3063&quot; data-start=&quot;3041&quot;&gt;Kubernetes Service&lt;/strong&gt; (DNS name).&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3173&quot; data-start=&quot;3078&quot;&gt;
&lt;p data-end=&quot;3173&quot; data-start=&quot;3080&quot;&gt;Messages/events can be processed asynchronously using &lt;strong data-end=&quot;3152&quot; data-start=&quot;3134&quot;&gt;message queues&lt;/strong&gt; (RabbitMQ, Kafka).&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;3178&quot; data-start=&quot;3175&quot; /&gt;
&lt;h2 data-end=&quot;3217&quot; data-start=&quot;3180&quot;&gt;🟢 6️⃣ Benefits for .NET Core Apps&lt;/h2&gt;
&lt;ol data-end=&quot;3489&quot; data-start=&quot;3218&quot;&gt;
&lt;li data-end=&quot;3282&quot; data-start=&quot;3218&quot;&gt;
&lt;p data-end=&quot;3282&quot; data-start=&quot;3221&quot;&gt;Easy to &lt;strong data-end=&quot;3265&quot; data-start=&quot;3229&quot;&gt;scale APIs or background workers&lt;/strong&gt; independently.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3353&quot; data-start=&quot;3283&quot;&gt;
&lt;p data-end=&quot;3353&quot; data-start=&quot;3286&quot;&gt;Can run &lt;strong data-end=&quot;3312&quot; data-start=&quot;3294&quot;&gt;cross-platform&lt;/strong&gt; containers (.NET Core works on Linux).&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3414&quot; data-start=&quot;3354&quot;&gt;
&lt;p data-end=&quot;3414&quot; data-start=&quot;3357&quot;&gt;&lt;strong data-end=&quot;3395&quot; data-start=&quot;3357&quot;&gt;Automatic updates and self-healing&lt;/strong&gt; reduce downtime.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3489&quot; data-start=&quot;3415&quot;&gt;
&lt;p data-end=&quot;3489&quot; data-start=&quot;3418&quot;&gt;Supports &lt;strong data-end=&quot;3457&quot; data-start=&quot;3427&quot;&gt;microservices architecture&lt;/strong&gt; with multiple small services.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;hr data-end=&quot;3494&quot; data-start=&quot;3491&quot; /&gt;
&lt;h3 data-end=&quot;3520&quot; data-start=&quot;3496&quot;&gt;🟢 7️⃣ Quick Summary&lt;/h3&gt;
&lt;ul data-end=&quot;3704&quot; data-start=&quot;3521&quot;&gt;
&lt;li data-end=&quot;3564&quot; data-start=&quot;3521&quot;&gt;
&lt;p data-end=&quot;3564&quot; data-start=&quot;3523&quot;&gt;&lt;strong data-end=&quot;3533&quot; data-start=&quot;3523&quot;&gt;Docker&lt;/strong&gt;: packages app into container&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3622&quot; data-start=&quot;3565&quot;&gt;
&lt;p data-end=&quot;3622&quot; data-start=&quot;3567&quot;&gt;&lt;strong data-end=&quot;3581&quot; data-start=&quot;3567&quot;&gt;Kubernetes&lt;/strong&gt;: manages many containers automatically&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3704&quot; data-start=&quot;3623&quot;&gt;
&lt;p data-end=&quot;3704&quot; data-start=&quot;3625&quot;&gt;&lt;strong data-end=&quot;3653&quot; data-start=&quot;3625&quot;&gt;.NET Core + Docker + K8s&lt;/strong&gt; → scalable, resilient microservices architecture&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;</content><link rel='replies' type='application/atom+xml' href='http://piushshukla.blogspot.com/feeds/5124135248559741138/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://piushshukla.blogspot.com/2025/09/kubernetes.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2159069551745631737/posts/default/5124135248559741138'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2159069551745631737/posts/default/5124135248559741138'/><link rel='alternate' type='text/html' href='http://piushshukla.blogspot.com/2025/09/kubernetes.html' title='Kubernetes'/><author><name>Piush shukla</name><uri>http://www.blogger.com/profile/16392649283296436146</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2159069551745631737.post-3405189702640139020</id><published>2025-09-22T21:48:00.000-07:00</published><updated>2025-09-22T21:48:45.692-07:00</updated><title type='text'>Docker</title><content type='html'>&lt;h2 data-end=&quot;138&quot; data-start=&quot;113&quot;&gt;🟢 1️⃣ What is Docker?&lt;/h2&gt;
&lt;ul data-end=&quot;386&quot; data-start=&quot;139&quot;&gt;
&lt;li data-end=&quot;231&quot; data-start=&quot;139&quot;&gt;
&lt;p data-end=&quot;231&quot; data-start=&quot;141&quot;&gt;Docker is a &lt;strong data-end=&quot;185&quot; data-start=&quot;153&quot;&gt;tool to package applications&lt;/strong&gt; with all dependencies into a &lt;strong data-end=&quot;228&quot; data-start=&quot;215&quot;&gt;container&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;325&quot; data-start=&quot;232&quot;&gt;
&lt;p data-end=&quot;325&quot; data-start=&quot;234&quot;&gt;&lt;strong data-end=&quot;270&quot; data-start=&quot;234&quot;&gt;Container = isolated environment&lt;/strong&gt; that runs your app anywhere (Windows, Linux, cloud).&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;386&quot; data-start=&quot;326&quot;&gt;
&lt;p data-end=&quot;386&quot; data-start=&quot;328&quot;&gt;&lt;strong data-end=&quot;340&quot; data-start=&quot;328&quot;&gt;Benefit:&lt;/strong&gt; “It works on my machine” problem is solved.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;526&quot; data-start=&quot;388&quot;&gt;&lt;strong data-end=&quot;400&quot; data-start=&quot;388&quot;&gt;Analogy:&lt;/strong&gt; Docker is like a &lt;strong data-end=&quot;440&quot; data-start=&quot;418&quot;&gt;shipping container&lt;/strong&gt; for your app. It includes your app, .NET runtime, libraries, and everything needed.&lt;/p&gt;
&lt;hr data-end=&quot;531&quot; data-start=&quot;528&quot; /&gt;
&lt;h2 data-end=&quot;573&quot; data-start=&quot;533&quot;&gt;🟢 2️⃣ Why Use Docker with .NET Core?&lt;/h2&gt;
&lt;ol data-end=&quot;806&quot; data-start=&quot;574&quot;&gt;
&lt;li data-end=&quot;646&quot; data-start=&quot;574&quot;&gt;
&lt;p data-end=&quot;646&quot; data-start=&quot;577&quot;&gt;Cross-platform: Run .NET Core apps on &lt;strong data-end=&quot;643&quot; data-start=&quot;615&quot;&gt;Linux, Windows, or cloud&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;696&quot; data-start=&quot;647&quot;&gt;
&lt;p data-end=&quot;696&quot; data-start=&quot;650&quot;&gt;Easy deployment: Package app + dependencies.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;739&quot; data-start=&quot;697&quot;&gt;
&lt;p data-end=&quot;739&quot; data-start=&quot;700&quot;&gt;Isolation: No conflicts between apps.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;806&quot; data-start=&quot;740&quot;&gt;
&lt;p data-end=&quot;806&quot; data-start=&quot;743&quot;&gt;Microservices: Each service can run in its &lt;strong data-end=&quot;803&quot; data-start=&quot;786&quot;&gt;own container&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;hr data-end=&quot;811&quot; data-start=&quot;808&quot; /&gt;
&lt;h2 data-end=&quot;857&quot; data-start=&quot;813&quot;&gt;🟢 3️⃣ Steps to Dockerize a .NET Core App&lt;/h2&gt;
&lt;h3 data-end=&quot;893&quot; data-start=&quot;859&quot;&gt;Step 1: Create a .NET Core App&lt;/h3&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;971&quot; data-start=&quot;894&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-bash&quot;&gt;dotnet new webapi -n MyWebApi
&lt;span class=&quot;hljs-built_in&quot;&gt;cd&lt;/span&gt; MyWebApi
dotnet build
dotnet run
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;ul data-end=&quot;1023&quot; data-start=&quot;972&quot;&gt;
&lt;li data-end=&quot;1023&quot; data-start=&quot;972&quot;&gt;
&lt;p data-end=&quot;1023&quot; data-start=&quot;974&quot;&gt;Your API runs locally on &lt;code data-end=&quot;1022&quot; data-start=&quot;999&quot;&gt;http://localhost:5000&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;1028&quot; data-start=&quot;1025&quot; /&gt;
&lt;h3 data-end=&quot;1061&quot; data-start=&quot;1030&quot;&gt;Step 2: Create a Dockerfile&lt;/h3&gt;
&lt;ul data-end=&quot;1134&quot; data-start=&quot;1062&quot;&gt;
&lt;li data-end=&quot;1134&quot; data-start=&quot;1062&quot;&gt;
&lt;p data-end=&quot;1134&quot; data-start=&quot;1064&quot;&gt;In the root folder, create a file named &lt;strong data-end=&quot;1118&quot; data-start=&quot;1104&quot;&gt;Dockerfile&lt;/strong&gt; (no extension):&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;1610&quot; data-start=&quot;1136&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-dockerfile&quot;&gt;# 1. Base image with .NET runtime
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
WORKDIR /app
EXPOSE 80

# 2. Build image with SDK
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
WORKDIR /src
COPY [&quot;MyWebApi.csproj&quot;, &quot;./&quot;]
RUN dotnet restore &quot;./MyWebApi.csproj&quot;
COPY . .
RUN dotnet publish &quot;MyWebApi.csproj&quot; -c Release -o /app/publish

# 3. Final image
FROM base AS final
WORKDIR /app
COPY --from=build /app/publish .
ENTRYPOINT [&quot;dotnet&quot;, &quot;MyWebApi.dll&quot;]
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;p data-end=&quot;1628&quot; data-start=&quot;1612&quot;&gt;&lt;strong data-end=&quot;1628&quot; data-start=&quot;1612&quot;&gt;Explanation:&lt;/strong&gt;&lt;/p&gt;
&lt;ul data-end=&quot;1819&quot; data-start=&quot;1629&quot;&gt;
&lt;li data-end=&quot;1682&quot; data-start=&quot;1629&quot;&gt;
&lt;p data-end=&quot;1682&quot; data-start=&quot;1631&quot;&gt;&lt;strong data-end=&quot;1650&quot; data-start=&quot;1631&quot;&gt;Stage 1 (base):&lt;/strong&gt; Runtime image to run the app.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1747&quot; data-start=&quot;1683&quot;&gt;
&lt;p data-end=&quot;1747&quot; data-start=&quot;1685&quot;&gt;&lt;strong data-end=&quot;1705&quot; data-start=&quot;1685&quot;&gt;Stage 2 (build):&lt;/strong&gt; SDK image to build and publish the app.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1819&quot; data-start=&quot;1748&quot;&gt;
&lt;p data-end=&quot;1819&quot; data-start=&quot;1750&quot;&gt;&lt;strong data-end=&quot;1770&quot; data-start=&quot;1750&quot;&gt;Stage 3 (final):&lt;/strong&gt; Copy published files to runtime image and run.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;1824&quot; data-start=&quot;1821&quot; /&gt;
&lt;h3 data-end=&quot;1856&quot; data-start=&quot;1826&quot;&gt;Step 3: Build Docker Image&lt;/h3&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;1899&quot; data-start=&quot;1857&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-bash&quot;&gt;docker build -t mywebapi:1.0 .
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;ul data-end=&quot;2004&quot; data-start=&quot;1900&quot;&gt;
&lt;li data-end=&quot;1949&quot; data-start=&quot;1900&quot;&gt;
&lt;p data-end=&quot;1949&quot; data-start=&quot;1902&quot;&gt;&lt;code data-end=&quot;1912&quot; data-start=&quot;1902&quot;&gt;mywebapi&lt;/code&gt; → image name, &lt;code data-end=&quot;1932&quot; data-start=&quot;1927&quot;&gt;1.0&lt;/code&gt; → version tag.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2004&quot; data-start=&quot;1950&quot;&gt;
&lt;p data-end=&quot;2004&quot; data-start=&quot;1952&quot;&gt;Docker reads the Dockerfile and creates the image.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;2009&quot; data-start=&quot;2006&quot; /&gt;
&lt;h3 data-end=&quot;2040&quot; data-start=&quot;2011&quot;&gt;Step 4: Run the Container&lt;/h3&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;2116&quot; data-start=&quot;2041&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-bash&quot;&gt;docker run -d -p 8080:80 --name mywebapi_container mywebapi:1.0
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;ul data-end=&quot;2235&quot; data-start=&quot;2117&quot;&gt;
&lt;li data-end=&quot;2145&quot; data-start=&quot;2117&quot;&gt;
&lt;p data-end=&quot;2145&quot; data-start=&quot;2119&quot;&gt;&lt;code data-end=&quot;2123&quot; data-start=&quot;2119&quot;&gt;-d&lt;/code&gt; → run in background&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2205&quot; data-start=&quot;2146&quot;&gt;
&lt;p data-end=&quot;2205&quot; data-start=&quot;2148&quot;&gt;&lt;code data-end=&quot;2160&quot; data-start=&quot;2148&quot;&gt;-p 8080:80&lt;/code&gt; → map container port 80 to local port 8080&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2235&quot; data-start=&quot;2206&quot;&gt;
&lt;p data-end=&quot;2235&quot; data-start=&quot;2208&quot;&gt;&lt;code data-end=&quot;2216&quot; data-start=&quot;2208&quot;&gt;--name&lt;/code&gt; → container name&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;2320&quot; data-start=&quot;2237&quot;&gt;Now open &lt;code data-end=&quot;2269&quot; data-start=&quot;2246&quot;&gt;http://localhost:8080&lt;/code&gt; → your API is running inside a Docker container!&lt;/p&gt;
&lt;hr data-end=&quot;2325&quot; data-start=&quot;2322&quot; /&gt;
&lt;h3 data-end=&quot;2364&quot; data-start=&quot;2327&quot;&gt;Step 5: (Optional) Docker Compose&lt;/h3&gt;
&lt;ul data-end=&quot;2463&quot; data-start=&quot;2365&quot;&gt;
&lt;li data-end=&quot;2432&quot; data-start=&quot;2365&quot;&gt;
&lt;p data-end=&quot;2432&quot; data-start=&quot;2367&quot;&gt;Useful if you have &lt;strong data-end=&quot;2407&quot; data-start=&quot;2386&quot;&gt;multiple services&lt;/strong&gt; (like API + database).&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2463&quot; data-start=&quot;2433&quot;&gt;
&lt;p data-end=&quot;2463&quot; data-start=&quot;2435&quot;&gt;Create &lt;code data-end=&quot;2462&quot; data-start=&quot;2442&quot;&gt;docker-compose.yml&lt;/code&gt;:&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;2732&quot; data-start=&quot;2464&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-yaml&quot;&gt;&lt;span class=&quot;hljs-attr&quot;&gt;version:&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&#39;3.8&#39;&lt;/span&gt;
&lt;span class=&quot;hljs-attr&quot;&gt;services:&lt;/span&gt;
  &lt;span class=&quot;hljs-attr&quot;&gt;webapi:&lt;/span&gt;
    &lt;span class=&quot;hljs-attr&quot;&gt;image:&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;mywebapi:1.0&lt;/span&gt;
    &lt;span class=&quot;hljs-attr&quot;&gt;ports:&lt;/span&gt;
      &lt;span class=&quot;hljs-bullet&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&quot;8080:80&quot;&lt;/span&gt;
  &lt;span class=&quot;hljs-attr&quot;&gt;db:&lt;/span&gt;
    &lt;span class=&quot;hljs-attr&quot;&gt;image:&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;mcr.microsoft.com/mssql/server:2019-latest&lt;/span&gt;
    &lt;span class=&quot;hljs-attr&quot;&gt;environment:&lt;/span&gt;
      &lt;span class=&quot;hljs-attr&quot;&gt;SA_PASSWORD:&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&quot;Your_password123&quot;&lt;/span&gt;
      &lt;span class=&quot;hljs-attr&quot;&gt;ACCEPT_EULA:&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&quot;Y&quot;&lt;/span&gt;
    &lt;span class=&quot;hljs-attr&quot;&gt;ports:&lt;/span&gt;
      &lt;span class=&quot;hljs-bullet&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&quot;1433:1433&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;ul data-end=&quot;2769&quot; data-start=&quot;2733&quot;&gt;
&lt;li data-end=&quot;2769&quot; data-start=&quot;2733&quot;&gt;
&lt;p data-end=&quot;2769&quot; data-start=&quot;2735&quot;&gt;Run with: &lt;code data-end=&quot;2767&quot; data-start=&quot;2745&quot;&gt;docker-compose up -d&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;2774&quot; data-start=&quot;2771&quot; /&gt;
&lt;h2 data-end=&quot;2790&quot; data-start=&quot;2776&quot;&gt;🟢 4️⃣ Tips&lt;/h2&gt;
&lt;ol data-end=&quot;3043&quot; data-start=&quot;2791&quot;&gt;
&lt;li data-end=&quot;2859&quot; data-start=&quot;2791&quot;&gt;
&lt;p data-end=&quot;2859&quot; data-start=&quot;2794&quot;&gt;Always use &lt;strong data-end=&quot;2831&quot; data-start=&quot;2805&quot;&gt;multi-stage Dockerfile&lt;/strong&gt; → keeps image size small.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2904&quot; data-start=&quot;2860&quot;&gt;
&lt;p data-end=&quot;2904&quot; data-start=&quot;2863&quot;&gt;Expose only needed ports (&lt;code data-end=&quot;2900&quot; data-start=&quot;2889&quot;&gt;EXPOSE 80&lt;/code&gt;).&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2966&quot; data-start=&quot;2905&quot;&gt;
&lt;p data-end=&quot;2966&quot; data-start=&quot;2908&quot;&gt;Use &lt;strong data-end=&quot;2937&quot; data-start=&quot;2912&quot;&gt;environment variables&lt;/strong&gt; for secrets/configuration.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3043&quot; data-start=&quot;2967&quot;&gt;
&lt;p data-end=&quot;3043&quot; data-start=&quot;2970&quot;&gt;Use &lt;strong data-end=&quot;2991&quot; data-start=&quot;2974&quot;&gt;.dockerignore&lt;/strong&gt; to exclude unnecessary files (like &lt;code data-end=&quot;3032&quot; data-start=&quot;3027&quot;&gt;bin&lt;/code&gt;, &lt;code data-end=&quot;3039&quot; data-start=&quot;3034&quot;&gt;obj&lt;/code&gt;).&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;hr data-end=&quot;3048&quot; data-start=&quot;3045&quot; /&gt;
&lt;h3 data-end=&quot;3068&quot; data-start=&quot;3050&quot;&gt;🟢 5️⃣ Summary&lt;/h3&gt;
&lt;ul data-end=&quot;3347&quot; data-start=&quot;3069&quot;&gt;
&lt;li data-end=&quot;3144&quot; data-start=&quot;3069&quot;&gt;
&lt;p data-end=&quot;3144&quot; data-start=&quot;3071&quot;&gt;Docker packages your &lt;strong data-end=&quot;3124&quot; data-start=&quot;3092&quot;&gt;.NET Core app + dependencies&lt;/strong&gt; into a container.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3284&quot; data-start=&quot;3145&quot;&gt;
&lt;p data-end=&quot;3153&quot; data-start=&quot;3147&quot;&gt;Steps:&lt;/p&gt;
&lt;ol data-end=&quot;3284&quot; data-start=&quot;3156&quot;&gt;
&lt;li data-end=&quot;3181&quot; data-start=&quot;3156&quot;&gt;
&lt;p data-end=&quot;3181&quot; data-start=&quot;3159&quot;&gt;Create .NET Core app&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3205&quot; data-start=&quot;3184&quot;&gt;
&lt;p data-end=&quot;3205&quot; data-start=&quot;3187&quot;&gt;Write Dockerfile&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3248&quot; data-start=&quot;3208&quot;&gt;
&lt;p data-end=&quot;3248&quot; data-start=&quot;3211&quot;&gt;Build Docker image (&lt;code data-end=&quot;3245&quot; data-start=&quot;3231&quot;&gt;docker build&lt;/code&gt;)&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3284&quot; data-start=&quot;3251&quot;&gt;
&lt;p data-end=&quot;3284&quot; data-start=&quot;3254&quot;&gt;Run container (&lt;code data-end=&quot;3281&quot; data-start=&quot;3269&quot;&gt;docker run&lt;/code&gt;)&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3347&quot; data-start=&quot;3285&quot;&gt;
&lt;p data-end=&quot;3347&quot; data-start=&quot;3287&quot;&gt;Optional: Use &lt;strong data-end=&quot;3319&quot; data-start=&quot;3301&quot;&gt;Docker Compose&lt;/strong&gt; for multi-container apps.&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;</content><link rel='replies' type='application/atom+xml' href='http://piushshukla.blogspot.com/feeds/3405189702640139020/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://piushshukla.blogspot.com/2025/09/docker.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2159069551745631737/posts/default/3405189702640139020'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2159069551745631737/posts/default/3405189702640139020'/><link rel='alternate' type='text/html' href='http://piushshukla.blogspot.com/2025/09/docker.html' title='Docker'/><author><name>Piush shukla</name><uri>http://www.blogger.com/profile/16392649283296436146</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2159069551745631737.post-7422111931270686083</id><published>2025-09-22T21:39:00.000-07:00</published><updated>2025-09-22T21:39:33.513-07:00</updated><title type='text'>Concurrency</title><content type='html'>&lt;h2 data-end=&quot;138&quot; data-start=&quot;108&quot;&gt;🟢 1️⃣ What is Concurrency?&lt;/h2&gt;
&lt;p data-end=&quot;249&quot; data-start=&quot;140&quot;&gt;&lt;strong data-end=&quot;155&quot; data-start=&quot;140&quot;&gt;Concurrency&lt;/strong&gt; means doing &lt;strong data-end=&quot;204&quot; data-start=&quot;168&quot;&gt;multiple things at the same time&lt;/strong&gt;, or &lt;strong data-end=&quot;230&quot; data-start=&quot;209&quot;&gt;overlapping tasks&lt;/strong&gt; in your program.&lt;/p&gt;
&lt;ul data-end=&quot;400&quot; data-start=&quot;250&quot;&gt;
&lt;li data-end=&quot;320&quot; data-start=&quot;250&quot;&gt;
&lt;p data-end=&quot;320&quot; data-start=&quot;252&quot;&gt;In C#, this usually means using &lt;strong data-end=&quot;304&quot; data-start=&quot;284&quot;&gt;multiple threads&lt;/strong&gt; or &lt;strong data-end=&quot;317&quot; data-start=&quot;308&quot;&gt;tasks&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;400&quot; data-start=&quot;321&quot;&gt;
&lt;p data-end=&quot;400&quot; data-start=&quot;323&quot;&gt;Goal: make your program &lt;strong data-end=&quot;357&quot; data-start=&quot;347&quot;&gt;faster&lt;/strong&gt;, or &lt;strong data-end=&quot;376&quot; data-start=&quot;362&quot;&gt;responsive&lt;/strong&gt; (like not freezing UI).&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;416&quot; data-start=&quot;402&quot;&gt;&lt;strong data-end=&quot;414&quot; data-start=&quot;402&quot;&gt;Example:&lt;/strong&gt;&lt;/p&gt;
&lt;ul data-end=&quot;514&quot; data-start=&quot;417&quot;&gt;
&lt;li data-end=&quot;514&quot; data-start=&quot;417&quot;&gt;
&lt;p data-end=&quot;514&quot; data-start=&quot;419&quot;&gt;Downloading 5 files at once instead of waiting for one file to finish before starting the next.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;519&quot; data-start=&quot;516&quot; /&gt;
&lt;h2 data-end=&quot;571&quot; data-start=&quot;521&quot;&gt;🟢 2️⃣ Ways to Achieve Concurrency in .NET Core&lt;/h2&gt;
&lt;h3 data-end=&quot;611&quot; data-start=&quot;573&quot;&gt;&lt;strong data-end=&quot;611&quot; data-start=&quot;577&quot;&gt;1. Task Parallel Library (TPL)&lt;/strong&gt;&lt;/h3&gt;
&lt;ul data-end=&quot;673&quot; data-start=&quot;612&quot;&gt;
&lt;li data-end=&quot;662&quot; data-start=&quot;612&quot;&gt;
&lt;p data-end=&quot;662&quot; data-start=&quot;614&quot;&gt;Use the &lt;code data-end=&quot;628&quot; data-start=&quot;622&quot;&gt;Task&lt;/code&gt; class to run work asynchronously.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;673&quot; data-start=&quot;663&quot;&gt;
&lt;p data-end=&quot;673&quot; data-start=&quot;665&quot;&gt;Example:&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;1035&quot; data-start=&quot;675&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-csharp&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;using&lt;/span&gt; System;
&lt;span class=&quot;hljs-keyword&quot;&gt;using&lt;/span&gt; System.Threading.Tasks;

&lt;span class=&quot;hljs-keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;Program&lt;/span&gt;
{
    &lt;span class=&quot;hljs-function&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;static&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;Main&lt;/span&gt;()
    {
        Task t1 = Task.Run(() =&amp;gt; Console.WriteLine(&lt;span class=&quot;hljs-string&quot;&gt;&quot;Task 1 running&quot;&lt;/span&gt;));
        Task t2 = Task.Run(() =&amp;gt; Console.WriteLine(&lt;span class=&quot;hljs-string&quot;&gt;&quot;Task 2 running&quot;&lt;/span&gt;));

        Task.WaitAll(t1, t2); &lt;span class=&quot;hljs-comment&quot;&gt;// wait until all tasks finish&lt;/span&gt;
        Console.WriteLine(&lt;span class=&quot;hljs-string&quot;&gt;&quot;All tasks done&quot;&lt;/span&gt;);
    }
}
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;p data-end=&quot;1090&quot; data-start=&quot;1037&quot;&gt;✅ &lt;code data-end=&quot;1051&quot; data-start=&quot;1039&quot;&gt;Task.Run()&lt;/code&gt; runs work on a &lt;strong data-end=&quot;1089&quot; data-start=&quot;1067&quot;&gt;thread pool thread&lt;/strong&gt;.&lt;/p&gt;
&lt;hr data-end=&quot;1095&quot; data-start=&quot;1092&quot; /&gt;
&lt;h3 data-end=&quot;1121&quot; data-start=&quot;1097&quot;&gt;&lt;strong data-end=&quot;1121&quot; data-start=&quot;1101&quot;&gt;2. Async / Await&lt;/strong&gt;&lt;/h3&gt;
&lt;ul data-end=&quot;1216&quot; data-start=&quot;1122&quot;&gt;
&lt;li data-end=&quot;1205&quot; data-start=&quot;1122&quot;&gt;
&lt;p data-end=&quot;1205&quot; data-start=&quot;1124&quot;&gt;For &lt;strong data-end=&quot;1146&quot; data-start=&quot;1128&quot;&gt;IO-bound tasks&lt;/strong&gt; (like reading files, HTTP calls), use &lt;code data-end=&quot;1192&quot; data-start=&quot;1185&quot;&gt;async&lt;/code&gt; and &lt;code data-end=&quot;1204&quot; data-start=&quot;1197&quot;&gt;await&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1216&quot; data-start=&quot;1206&quot;&gt;
&lt;p data-end=&quot;1216&quot; data-start=&quot;1208&quot;&gt;Example:&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;1692&quot; data-start=&quot;1218&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-csharp&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;using&lt;/span&gt; System;
&lt;span class=&quot;hljs-keyword&quot;&gt;using&lt;/span&gt; System.Net.Http;
&lt;span class=&quot;hljs-keyword&quot;&gt;using&lt;/span&gt; System.Threading.Tasks;

&lt;span class=&quot;hljs-keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;Program&lt;/span&gt;
{
    &lt;span class=&quot;hljs-function&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;static&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;async&lt;/span&gt; Task &lt;span class=&quot;hljs-title&quot;&gt;Main&lt;/span&gt;()
    {
        HttpClient client = &lt;span class=&quot;hljs-keyword&quot;&gt;new&lt;/span&gt; HttpClient();

        Task&amp;lt;&lt;span class=&quot;hljs-built_in&quot;&gt;string&lt;/span&gt;&amp;gt; t1 = client.GetStringAsync(&lt;span class=&quot;hljs-string&quot;&gt;&quot;https://example.com&quot;&lt;/span&gt;);
        Task&amp;lt;&lt;span class=&quot;hljs-built_in&quot;&gt;string&lt;/span&gt;&amp;gt; t2 = client.GetStringAsync(&lt;span class=&quot;hljs-string&quot;&gt;&quot;https://example.org&quot;&lt;/span&gt;);

        &lt;span class=&quot;hljs-built_in&quot;&gt;string&lt;/span&gt;[] results = &lt;span class=&quot;hljs-keyword&quot;&gt;await&lt;/span&gt; Task.WhenAll(t1, t2);

        &lt;span class=&quot;hljs-keyword&quot;&gt;foreach&lt;/span&gt; (&lt;span class=&quot;hljs-keyword&quot;&gt;var&lt;/span&gt; r &lt;span class=&quot;hljs-keyword&quot;&gt;in&lt;/span&gt; results)
            Console.WriteLine(r.Substring(&lt;span class=&quot;hljs-number&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;hljs-number&quot;&gt;50&lt;/span&gt;));
    }
}
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;ul data-end=&quot;1784&quot; data-start=&quot;1694&quot;&gt;
&lt;li data-end=&quot;1784&quot; data-start=&quot;1694&quot;&gt;
&lt;p data-end=&quot;1784&quot; data-start=&quot;1696&quot;&gt;&lt;code data-end=&quot;1709&quot; data-start=&quot;1696&quot;&gt;async/await&lt;/code&gt; does not block the thread, so the program can do other work while waiting.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;1789&quot; data-start=&quot;1786&quot; /&gt;
&lt;h3 data-end=&quot;1816&quot; data-start=&quot;1791&quot;&gt;&lt;strong data-end=&quot;1816&quot; data-start=&quot;1795&quot;&gt;3. Parallel Loops&lt;/strong&gt;&lt;/h3&gt;
&lt;ul data-end=&quot;1896&quot; data-start=&quot;1817&quot;&gt;
&lt;li data-end=&quot;1896&quot; data-start=&quot;1817&quot;&gt;
&lt;p data-end=&quot;1896&quot; data-start=&quot;1819&quot;&gt;Use &lt;code data-end=&quot;1837&quot; data-start=&quot;1823&quot;&gt;Parallel.For&lt;/code&gt; or &lt;code data-end=&quot;1859&quot; data-start=&quot;1841&quot;&gt;Parallel.ForEach&lt;/code&gt; to run loop iterations concurrently.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;2140&quot; data-start=&quot;1898&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-csharp&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;using&lt;/span&gt; System;
&lt;span class=&quot;hljs-keyword&quot;&gt;using&lt;/span&gt; System.Threading.Tasks;

&lt;span class=&quot;hljs-keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;Program&lt;/span&gt;
{
    &lt;span class=&quot;hljs-function&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;static&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;Main&lt;/span&gt;()
    {
        Parallel.For(&lt;span class=&quot;hljs-number&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;hljs-number&quot;&gt;5&lt;/span&gt;, i =&amp;gt;
        {
            Console.WriteLine(&lt;span class=&quot;hljs-string&quot;&gt;$&quot;Processing &lt;span class=&quot;hljs-subst&quot;&gt;{i}&lt;/span&gt;&lt;/span&gt; on thread &lt;span class=&quot;hljs-subst&quot;&gt;{Task.CurrentId}&lt;/span&gt;&quot;);
        });
    }
}
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;ul data-end=&quot;2197&quot; data-start=&quot;2142&quot;&gt;
&lt;li data-end=&quot;2197&quot; data-start=&quot;2142&quot;&gt;
&lt;p data-end=&quot;2197&quot; data-start=&quot;2144&quot;&gt;Automatically splits work across available CPU cores.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;2202&quot; data-start=&quot;2199&quot; /&gt;
&lt;h3 data-end=&quot;2237&quot; data-start=&quot;2204&quot;&gt;&lt;strong data-end=&quot;2237&quot; data-start=&quot;2208&quot;&gt;4. Concurrent Collections&lt;/strong&gt;&lt;/h3&gt;
&lt;ul data-end=&quot;2320&quot; data-start=&quot;2238&quot;&gt;
&lt;li data-end=&quot;2320&quot; data-start=&quot;2238&quot;&gt;
&lt;p data-end=&quot;2320&quot; data-start=&quot;2240&quot;&gt;When multiple threads access a collection, use &lt;strong data-end=&quot;2314&quot; data-start=&quot;2287&quot;&gt;thread-safe collections&lt;/strong&gt; like:&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;2648&quot; data-start=&quot;2322&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-csharp&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;using&lt;/span&gt; System;
&lt;span class=&quot;hljs-keyword&quot;&gt;using&lt;/span&gt; System.Collections.Concurrent;
&lt;span class=&quot;hljs-keyword&quot;&gt;using&lt;/span&gt; System.Threading.Tasks;

&lt;span class=&quot;hljs-keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;Program&lt;/span&gt;
{
    &lt;span class=&quot;hljs-function&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;static&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;Main&lt;/span&gt;()
    {
        ConcurrentBag&amp;lt;&lt;span class=&quot;hljs-built_in&quot;&gt;int&lt;/span&gt;&amp;gt; bag = &lt;span class=&quot;hljs-keyword&quot;&gt;new&lt;/span&gt; ConcurrentBag&amp;lt;&lt;span class=&quot;hljs-built_in&quot;&gt;int&lt;/span&gt;&amp;gt;();

        Parallel.For(&lt;span class=&quot;hljs-number&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;hljs-number&quot;&gt;10&lt;/span&gt;, i =&amp;gt; bag.Add(i));

        &lt;span class=&quot;hljs-keyword&quot;&gt;foreach&lt;/span&gt; (&lt;span class=&quot;hljs-keyword&quot;&gt;var&lt;/span&gt; item &lt;span class=&quot;hljs-keyword&quot;&gt;in&lt;/span&gt; bag)
            Console.WriteLine(item);
    }
}
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;ul data-end=&quot;2728&quot; data-start=&quot;2650&quot;&gt;
&lt;li data-end=&quot;2728&quot; data-start=&quot;2650&quot;&gt;
&lt;p data-end=&quot;2728&quot; data-start=&quot;2652&quot;&gt;Other options: &lt;code data-end=&quot;2684&quot; data-start=&quot;2667&quot;&gt;ConcurrentQueue&lt;/code&gt;, &lt;code data-end=&quot;2703&quot; data-start=&quot;2686&quot;&gt;ConcurrentStack&lt;/code&gt;, &lt;code data-end=&quot;2727&quot; data-start=&quot;2705&quot;&gt;ConcurrentDictionary&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;2733&quot; data-start=&quot;2730&quot; /&gt;
&lt;h3 data-end=&quot;2762&quot; data-start=&quot;2735&quot;&gt;&lt;strong data-end=&quot;2762&quot; data-start=&quot;2739&quot;&gt;5. Locks (Optional)&lt;/strong&gt;&lt;/h3&gt;
&lt;ul data-end=&quot;2811&quot; data-start=&quot;2763&quot;&gt;
&lt;li data-end=&quot;2811&quot; data-start=&quot;2763&quot;&gt;
&lt;p data-end=&quot;2811&quot; data-start=&quot;2765&quot;&gt;If you need to protect a resource, use &lt;code data-end=&quot;2810&quot; data-start=&quot;2804&quot;&gt;lock&lt;/code&gt;:&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;3018&quot; data-start=&quot;2813&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-csharp&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;Counter&lt;/span&gt;
{
    &lt;span class=&quot;hljs-keyword&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;hljs-built_in&quot;&gt;int&lt;/span&gt; count = &lt;span class=&quot;hljs-number&quot;&gt;0&lt;/span&gt;;
    &lt;span class=&quot;hljs-keyword&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;hljs-built_in&quot;&gt;object&lt;/span&gt; lockObj = &lt;span class=&quot;hljs-keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;hljs-built_in&quot;&gt;object&lt;/span&gt;();

    &lt;span class=&quot;hljs-function&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;Increment&lt;/span&gt;()
    {
        &lt;span class=&quot;hljs-keyword&quot;&gt;lock&lt;/span&gt;(lockObj)
        {
            count++;
        }
    }
}
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;ul data-end=&quot;3073&quot; data-start=&quot;3020&quot;&gt;
&lt;li data-end=&quot;3073&quot; data-start=&quot;3020&quot;&gt;
&lt;p data-end=&quot;3073&quot; data-start=&quot;3022&quot;&gt;Only &lt;strong data-end=&quot;3041&quot; data-start=&quot;3027&quot;&gt;one thread&lt;/strong&gt; can access the block at a time.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;3078&quot; data-start=&quot;3075&quot; /&gt;
&lt;h2 data-end=&quot;3098&quot; data-start=&quot;3080&quot;&gt;🟢 3️⃣ Key Tips&lt;/h2&gt;
&lt;ol data-end=&quot;3340&quot; data-start=&quot;3099&quot;&gt;
&lt;li data-end=&quot;3151&quot; data-start=&quot;3099&quot;&gt;
&lt;p data-end=&quot;3151&quot; data-start=&quot;3102&quot;&gt;&lt;strong data-end=&quot;3120&quot; data-start=&quot;3102&quot;&gt;CPU-bound work&lt;/strong&gt; → &lt;code data-end=&quot;3133&quot; data-start=&quot;3123&quot;&gt;Task.Run&lt;/code&gt;, &lt;code data-end=&quot;3149&quot; data-start=&quot;3135&quot;&gt;Parallel.For&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3190&quot; data-start=&quot;3152&quot;&gt;
&lt;p data-end=&quot;3190&quot; data-start=&quot;3155&quot;&gt;&lt;strong data-end=&quot;3172&quot; data-start=&quot;3155&quot;&gt;IO-bound work&lt;/strong&gt; → &lt;code data-end=&quot;3188&quot; data-start=&quot;3175&quot;&gt;async/await&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3252&quot; data-start=&quot;3191&quot;&gt;
&lt;p data-end=&quot;3252&quot; data-start=&quot;3194&quot;&gt;&lt;strong data-end=&quot;3209&quot; data-start=&quot;3194&quot;&gt;Shared data&lt;/strong&gt; → use &lt;code data-end=&quot;3228&quot; data-start=&quot;3216&quot;&gt;Concurrent&lt;/code&gt; collections or &lt;code data-end=&quot;3250&quot; data-start=&quot;3244&quot;&gt;lock&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3340&quot; data-start=&quot;3253&quot;&gt;
&lt;p data-end=&quot;3340&quot; data-start=&quot;3256&quot;&gt;Avoid blocking threads unnecessarily; async is usually better than &lt;code data-end=&quot;3337&quot; data-start=&quot;3323&quot;&gt;Thread.Sleep&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;hr data-end=&quot;3345&quot; data-start=&quot;3342&quot; /&gt;
&lt;h3 data-end=&quot;3377&quot; data-start=&quot;3347&quot;&gt;🟢 4️⃣ Quick Summary Table&lt;/h3&gt;
&lt;div class=&quot;_tableContainer_1rjym_1&quot;&gt;&lt;div class=&quot;group _tableWrapper_1rjym_13 flex w-fit flex-col-reverse&quot; tabindex=&quot;-1&quot;&gt;&lt;table class=&quot;w-fit min-w-(--thread-content-width)&quot; data-end=&quot;4080&quot; data-start=&quot;3379&quot;&gt;&lt;thead data-end=&quot;3479&quot; data-start=&quot;3379&quot;&gt;&lt;tr data-end=&quot;3479&quot; data-start=&quot;3379&quot;&gt;&lt;th data-col-size=&quot;sm&quot; data-end=&quot;3399&quot; data-start=&quot;3379&quot;&gt;Type&lt;/th&gt;&lt;th data-col-size=&quot;sm&quot; data-end=&quot;3435&quot; data-start=&quot;3399&quot;&gt;When to Use&lt;/th&gt;&lt;th data-col-size=&quot;sm&quot; data-end=&quot;3479&quot; data-start=&quot;3435&quot;&gt;Example&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody data-end=&quot;4080&quot; data-start=&quot;3580&quot;&gt;&lt;tr data-end=&quot;3679&quot; data-start=&quot;3580&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3600&quot; data-start=&quot;3580&quot;&gt;Task / TPL&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3636&quot; data-start=&quot;3600&quot;&gt;CPU-bound or simple background&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3679&quot; data-start=&quot;3636&quot;&gt;&lt;code data-end=&quot;3664&quot; data-start=&quot;3638&quot;&gt;Task.Run(() =&amp;gt; DoWork())&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;3779&quot; data-start=&quot;3680&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3700&quot; data-start=&quot;3680&quot;&gt;Async / Await&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3736&quot; data-start=&quot;3700&quot;&gt;IO-bound (file, API, DB)&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3779&quot; data-start=&quot;3736&quot;&gt;&lt;code data-end=&quot;3776&quot; data-start=&quot;3738&quot;&gt;await HttpClient.GetStringAsync(url)&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;3877&quot; data-start=&quot;3780&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3800&quot; data-start=&quot;3780&quot;&gt;Parallel.For&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3835&quot; data-start=&quot;3800&quot;&gt;Loop with independent iterations&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3877&quot; data-start=&quot;3835&quot;&gt;&lt;code data-end=&quot;3868&quot; data-start=&quot;3837&quot;&gt;Parallel.For(0, 10, i =&amp;gt; ...)&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;3979&quot; data-start=&quot;3878&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3901&quot; data-start=&quot;3878&quot;&gt;ConcurrentCollection&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3935&quot; data-start=&quot;3901&quot;&gt;Multiple threads accessing data&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3979&quot; data-start=&quot;3935&quot;&gt;&lt;code data-end=&quot;3957&quot; data-start=&quot;3937&quot;&gt;ConcurrentBag&amp;lt;int&amp;gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;4080&quot; data-start=&quot;3980&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;4000&quot; data-start=&quot;3980&quot;&gt;Lock&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;4036&quot; data-start=&quot;4000&quot;&gt;Protect shared resources&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;4080&quot; data-start=&quot;4036&quot;&gt;&lt;code data-end=&quot;4057&quot; data-start=&quot;4038&quot;&gt;lock(obj) { ... }&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;
&lt;hr data-end=&quot;4085&quot; data-start=&quot;4082&quot; /&gt;
&lt;p data-end=&quot;4110&quot; data-start=&quot;4087&quot;&gt;💡 &lt;strong data-end=&quot;4108&quot; data-start=&quot;4090&quot;&gt;Rule of Thumb:&lt;/strong&gt;&lt;/p&gt;
&lt;ul data-end=&quot;4257&quot; data-start=&quot;4111&quot;&gt;
&lt;li data-end=&quot;4153&quot; data-start=&quot;4111&quot;&gt;
&lt;p data-end=&quot;4153&quot; data-start=&quot;4113&quot;&gt;Use &lt;strong data-end=&quot;4132&quot; data-start=&quot;4117&quot;&gt;async/await&lt;/strong&gt; for non-CPU tasks.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;4202&quot; data-start=&quot;4154&quot;&gt;
&lt;p data-end=&quot;4202&quot; data-start=&quot;4156&quot;&gt;Use &lt;strong data-end=&quot;4179&quot; data-start=&quot;4160&quot;&gt;Task / Parallel&lt;/strong&gt; for CPU-heavy tasks.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;4257&quot; data-start=&quot;4203&quot;&gt;
&lt;p data-end=&quot;4257&quot; data-start=&quot;4205&quot;&gt;Use &lt;strong data-end=&quot;4235&quot; data-start=&quot;4209&quot;&gt;concurrent collections&lt;/strong&gt; to safely share data&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;</content><link rel='replies' type='application/atom+xml' href='http://piushshukla.blogspot.com/feeds/7422111931270686083/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://piushshukla.blogspot.com/2025/09/concurrency.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2159069551745631737/posts/default/7422111931270686083'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2159069551745631737/posts/default/7422111931270686083'/><link rel='alternate' type='text/html' href='http://piushshukla.blogspot.com/2025/09/concurrency.html' title='Concurrency'/><author><name>Piush shukla</name><uri>http://www.blogger.com/profile/16392649283296436146</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2159069551745631737.post-9077568660602758429</id><published>2025-09-22T21:33:00.000-07:00</published><updated>2025-09-22T21:33:37.841-07:00</updated><title type='text'>JWT</title><content type='html'>&lt;h2 data-end=&quot;153&quot; data-start=&quot;132&quot;&gt;🟢 1. What is JWT?&lt;/h2&gt;
&lt;ul data-end=&quot;368&quot; data-start=&quot;154&quot;&gt;
&lt;li data-end=&quot;192&quot; data-start=&quot;154&quot;&gt;
&lt;p data-end=&quot;192&quot; data-start=&quot;156&quot;&gt;JWT stands for &lt;strong data-end=&quot;189&quot; data-start=&quot;171&quot;&gt;JSON Web Token&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;291&quot; data-start=&quot;193&quot;&gt;
&lt;p data-end=&quot;291&quot; data-start=&quot;195&quot;&gt;It is a &lt;strong data-end=&quot;241&quot; data-start=&quot;203&quot;&gt;secure way to transmit information&lt;/strong&gt; between a client (like a browser) and a server.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;368&quot; data-start=&quot;292&quot;&gt;
&lt;p data-end=&quot;368&quot; data-start=&quot;294&quot;&gt;The information is &lt;strong data-end=&quot;333&quot; data-start=&quot;313&quot;&gt;digitally signed&lt;/strong&gt; so it &lt;strong data-end=&quot;367&quot; data-start=&quot;340&quot;&gt;cannot be tampered with&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;384&quot; data-start=&quot;370&quot;&gt;&lt;strong data-end=&quot;382&quot; data-start=&quot;370&quot;&gt;Analogy:&lt;/strong&gt;&lt;/p&gt;
&lt;ul data-end=&quot;525&quot; data-start=&quot;385&quot;&gt;
&lt;li data-end=&quot;451&quot; data-start=&quot;385&quot;&gt;
&lt;p data-end=&quot;451&quot; data-start=&quot;387&quot;&gt;Think of JWT like a &lt;strong data-end=&quot;426&quot; data-start=&quot;407&quot;&gt;sealed envelope&lt;/strong&gt; with a message inside.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;525&quot; data-start=&quot;452&quot;&gt;
&lt;p data-end=&quot;525&quot; data-start=&quot;454&quot;&gt;Only the server can verify the seal (signature) to know it’s authentic.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;530&quot; data-start=&quot;527&quot; /&gt;
&lt;h2 data-end=&quot;557&quot; data-start=&quot;532&quot;&gt;🟢 2. Structure of JWT&lt;/h2&gt;
&lt;p data-end=&quot;629&quot; data-start=&quot;558&quot;&gt;A JWT is a &lt;strong data-end=&quot;579&quot; data-start=&quot;569&quot;&gt;string&lt;/strong&gt; divided into &lt;strong data-end=&quot;604&quot; data-start=&quot;593&quot;&gt;3 parts&lt;/strong&gt; separated by dots (&lt;code data-end=&quot;627&quot; data-start=&quot;624&quot;&gt;.&lt;/code&gt;):&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;663&quot; data-start=&quot;631&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre!&quot;&gt;&lt;span class=&quot;hljs-selector-tag&quot;&gt;Header&lt;/span&gt;&lt;span class=&quot;hljs-selector-class&quot;&gt;.Payload&lt;/span&gt;&lt;span class=&quot;hljs-selector-class&quot;&gt;.Signature&lt;/span&gt;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;ol data-end=&quot;1094&quot; data-start=&quot;665&quot;&gt;
&lt;li data-end=&quot;801&quot; data-start=&quot;665&quot;&gt;
&lt;p data-end=&quot;734&quot; data-start=&quot;668&quot;&gt;&lt;strong data-end=&quot;678&quot; data-start=&quot;668&quot;&gt;Header&lt;/strong&gt; – says what type of token it is and the algorithm used.&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;801&quot; data-start=&quot;738&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-json&quot;&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;hljs-attr&quot;&gt;&quot;alg&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&quot;HS256&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;hljs-attr&quot;&gt;&quot;typ&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&quot;JWT&quot;&lt;/span&gt;
&lt;span class=&quot;hljs-punctuation&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li data-end=&quot;963&quot; data-start=&quot;802&quot;&gt;
&lt;p data-end=&quot;860&quot; data-start=&quot;805&quot;&gt;&lt;strong data-end=&quot;816&quot; data-start=&quot;805&quot;&gt;Payload&lt;/strong&gt; – the actual information (claims). Example:&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;963&quot; data-start=&quot;864&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-json&quot;&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;hljs-attr&quot;&gt;&quot;userId&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot;&gt;123&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;hljs-attr&quot;&gt;&quot;email&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&quot;user@example.com&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;hljs-attr&quot;&gt;&quot;role&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&quot;admin&quot;&lt;/span&gt;
&lt;span class=&quot;hljs-punctuation&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1094&quot; data-start=&quot;964&quot;&gt;
&lt;p data-end=&quot;1035&quot; data-start=&quot;967&quot;&gt;&lt;strong data-end=&quot;980&quot; data-start=&quot;967&quot;&gt;Signature&lt;/strong&gt; – a hash created from header + payload + secret key.&lt;/p&gt;
&lt;ul data-end=&quot;1094&quot; data-start=&quot;1039&quot;&gt;
&lt;li data-end=&quot;1094&quot; data-start=&quot;1039&quot;&gt;
&lt;p data-end=&quot;1094&quot; data-start=&quot;1041&quot;&gt;Ensures the token is &lt;strong data-end=&quot;1075&quot; data-start=&quot;1062&quot;&gt;authentic&lt;/strong&gt; and &lt;strong data-end=&quot;1093&quot; data-start=&quot;1080&quot;&gt;unchanged&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;hr data-end=&quot;1099&quot; data-start=&quot;1096&quot; /&gt;
&lt;h2 data-end=&quot;1123&quot; data-start=&quot;1101&quot;&gt;🟢 3. How JWT Works&lt;/h2&gt;
&lt;ol data-end=&quot;1506&quot; data-start=&quot;1124&quot;&gt;
&lt;li data-end=&quot;1163&quot; data-start=&quot;1124&quot;&gt;
&lt;p data-end=&quot;1163&quot; data-start=&quot;1127&quot;&gt;User logs in with username/password.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1195&quot; data-start=&quot;1164&quot;&gt;
&lt;p data-end=&quot;1195&quot; data-start=&quot;1167&quot;&gt;Server verifies credentials.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1271&quot; data-start=&quot;1196&quot;&gt;
&lt;p data-end=&quot;1271&quot; data-start=&quot;1199&quot;&gt;Server generates JWT (with user info in payload) and sends it to client.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1331&quot; data-start=&quot;1272&quot;&gt;
&lt;p data-end=&quot;1331&quot; data-start=&quot;1275&quot;&gt;Client stores JWT (usually in local storage or cookies).&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1435&quot; data-start=&quot;1332&quot;&gt;
&lt;p data-end=&quot;1388&quot; data-start=&quot;1335&quot;&gt;For future requests, client sends JWT in HTTP header:&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;1435&quot; data-start=&quot;1392&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre!&quot;&gt;&lt;span class=&quot;hljs-section&quot;&gt;Authorization: Bearer &amp;lt;token&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1506&quot; data-start=&quot;1436&quot;&gt;
&lt;p data-end=&quot;1506&quot; data-start=&quot;1439&quot;&gt;Server verifies JWT &lt;strong data-end=&quot;1472&quot; data-start=&quot;1459&quot;&gt;signature&lt;/strong&gt;. If valid, user is authenticated.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;hr data-end=&quot;1511&quot; data-start=&quot;1508&quot; /&gt;
&lt;h2 data-end=&quot;1553&quot; data-start=&quot;1513&quot;&gt;🟢 4. JWT in C# (.NET Core / .NET 5+)&lt;/h2&gt;
&lt;h3 data-end=&quot;1588&quot; data-start=&quot;1555&quot;&gt;Step 1: Install NuGet package&lt;/h3&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;1648&quot; data-start=&quot;1589&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-bash&quot;&gt;Install-Package System.IdentityModel.Tokens.Jwt
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;h3 data-end=&quot;1674&quot; data-start=&quot;1650&quot;&gt;Step 2: Create a JWT&lt;/h3&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;2897&quot; data-start=&quot;1675&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-csharp&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;using&lt;/span&gt; System;
&lt;span class=&quot;hljs-keyword&quot;&gt;using&lt;/span&gt; System.IdentityModel.Tokens.Jwt;
&lt;span class=&quot;hljs-keyword&quot;&gt;using&lt;/span&gt; System.Security.Claims;
&lt;span class=&quot;hljs-keyword&quot;&gt;using&lt;/span&gt; Microsoft.IdentityModel.Tokens;
&lt;span class=&quot;hljs-keyword&quot;&gt;using&lt;/span&gt; System.Text;

&lt;span class=&quot;hljs-keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;Program&lt;/span&gt;
{
    &lt;span class=&quot;hljs-function&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;static&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;Main&lt;/span&gt;()
    {
        &lt;span class=&quot;hljs-built_in&quot;&gt;string&lt;/span&gt; secretKey = &lt;span class=&quot;hljs-string&quot;&gt;&quot;my_super_secret_key_123!&quot;&lt;/span&gt;; &lt;span class=&quot;hljs-comment&quot;&gt;// keep it safe&lt;/span&gt;
        &lt;span class=&quot;hljs-keyword&quot;&gt;var&lt;/span&gt; key = Encoding.ASCII.GetBytes(secretKey);

        &lt;span class=&quot;hljs-comment&quot;&gt;// 1. Create claims (user info)&lt;/span&gt;
        &lt;span class=&quot;hljs-keyword&quot;&gt;var&lt;/span&gt; claims = &lt;span class=&quot;hljs-keyword&quot;&gt;new&lt;/span&gt;[]
        {
            &lt;span class=&quot;hljs-keyword&quot;&gt;new&lt;/span&gt; Claim(&lt;span class=&quot;hljs-string&quot;&gt;&quot;userId&quot;&lt;/span&gt;, &lt;span class=&quot;hljs-string&quot;&gt;&quot;123&quot;&lt;/span&gt;),
            &lt;span class=&quot;hljs-keyword&quot;&gt;new&lt;/span&gt; Claim(ClaimTypes.Email, &lt;span class=&quot;hljs-string&quot;&gt;&quot;user@example.com&quot;&lt;/span&gt;),
            &lt;span class=&quot;hljs-keyword&quot;&gt;new&lt;/span&gt; Claim(ClaimTypes.Role, &lt;span class=&quot;hljs-string&quot;&gt;&quot;Admin&quot;&lt;/span&gt;)
        };

        &lt;span class=&quot;hljs-comment&quot;&gt;// 2. Create token descriptor&lt;/span&gt;
        &lt;span class=&quot;hljs-keyword&quot;&gt;var&lt;/span&gt; tokenDescriptor = &lt;span class=&quot;hljs-keyword&quot;&gt;new&lt;/span&gt; SecurityTokenDescriptor
        {
            Subject = &lt;span class=&quot;hljs-keyword&quot;&gt;new&lt;/span&gt; ClaimsIdentity(claims),
            Expires = DateTime.UtcNow.AddHours(&lt;span class=&quot;hljs-number&quot;&gt;1&lt;/span&gt;),
            SigningCredentials = &lt;span class=&quot;hljs-keyword&quot;&gt;new&lt;/span&gt; SigningCredentials(
                &lt;span class=&quot;hljs-keyword&quot;&gt;new&lt;/span&gt; SymmetricSecurityKey(key),
                SecurityAlgorithms.HmacSha256Signature)
        };

        &lt;span class=&quot;hljs-comment&quot;&gt;// 3. Create token&lt;/span&gt;
        &lt;span class=&quot;hljs-keyword&quot;&gt;var&lt;/span&gt; tokenHandler = &lt;span class=&quot;hljs-keyword&quot;&gt;new&lt;/span&gt; JwtSecurityTokenHandler();
        &lt;span class=&quot;hljs-keyword&quot;&gt;var&lt;/span&gt; token = tokenHandler.CreateToken(tokenDescriptor);
        &lt;span class=&quot;hljs-keyword&quot;&gt;var&lt;/span&gt; jwt = tokenHandler.WriteToken(token);

        Console.WriteLine(&lt;span class=&quot;hljs-string&quot;&gt;&quot;JWT Token:&quot;&lt;/span&gt;);
        Console.WriteLine(jwt);
    }
}
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;hr data-end=&quot;2902&quot; data-start=&quot;2899&quot; /&gt;
&lt;h3 data-end=&quot;2928&quot; data-start=&quot;2904&quot;&gt;Step 3: Validate JWT&lt;/h3&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;3554&quot; data-start=&quot;2929&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-csharp&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;var&lt;/span&gt; tokenHandler = &lt;span class=&quot;hljs-keyword&quot;&gt;new&lt;/span&gt; JwtSecurityTokenHandler();
&lt;span class=&quot;hljs-keyword&quot;&gt;var&lt;/span&gt; key = Encoding.ASCII.GetBytes(secretKey);

&lt;span class=&quot;hljs-keyword&quot;&gt;var&lt;/span&gt; validationParameters = &lt;span class=&quot;hljs-keyword&quot;&gt;new&lt;/span&gt; TokenValidationParameters
{
    ValidateIssuerSigningKey = &lt;span class=&quot;hljs-literal&quot;&gt;true&lt;/span&gt;,
    IssuerSigningKey = &lt;span class=&quot;hljs-keyword&quot;&gt;new&lt;/span&gt; SymmetricSecurityKey(key),
    ValidateIssuer = &lt;span class=&quot;hljs-literal&quot;&gt;false&lt;/span&gt;,
    ValidateAudience = &lt;span class=&quot;hljs-literal&quot;&gt;false&lt;/span&gt;,
    ClockSkew = TimeSpan.Zero
};

&lt;span class=&quot;hljs-keyword&quot;&gt;try&lt;/span&gt;
{
    &lt;span class=&quot;hljs-keyword&quot;&gt;var&lt;/span&gt; principal = tokenHandler.ValidateToken(jwt, validationParameters, &lt;span class=&quot;hljs-keyword&quot;&gt;out&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;var&lt;/span&gt; validatedToken);
    Console.WriteLine(&lt;span class=&quot;hljs-string&quot;&gt;&quot;Token is valid!&quot;&lt;/span&gt;);
    Console.WriteLine(&lt;span class=&quot;hljs-string&quot;&gt;&quot;UserId: &quot;&lt;/span&gt; + principal.FindFirst(&lt;span class=&quot;hljs-string&quot;&gt;&quot;userId&quot;&lt;/span&gt;)?.Value);
}
&lt;span class=&quot;hljs-keyword&quot;&gt;catch&lt;/span&gt;
{
    Console.WriteLine(&lt;span class=&quot;hljs-string&quot;&gt;&quot;Invalid Token&quot;&lt;/span&gt;);
}
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;hr data-end=&quot;3559&quot; data-start=&quot;3556&quot; /&gt;
&lt;h2 data-end=&quot;3586&quot; data-start=&quot;3561&quot;&gt;🟢 5. Important Points&lt;/h2&gt;
&lt;ul data-end=&quot;3882&quot; data-start=&quot;3587&quot;&gt;
&lt;li data-end=&quot;3660&quot; data-start=&quot;3587&quot;&gt;
&lt;p data-end=&quot;3660&quot; data-start=&quot;3589&quot;&gt;&lt;strong data-end=&quot;3613&quot; data-start=&quot;3589&quot;&gt;Keep secret key safe&lt;/strong&gt;! If leaked, attackers can create valid tokens.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3768&quot; data-start=&quot;3661&quot;&gt;
&lt;p data-end=&quot;3768&quot; data-start=&quot;3663&quot;&gt;&lt;strong data-end=&quot;3694&quot; data-start=&quot;3663&quot;&gt;Do not store sensitive info&lt;/strong&gt; like passwords in the payload. JWT is only base64 encoded, not encrypted.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3835&quot; data-start=&quot;3769&quot;&gt;
&lt;p data-end=&quot;3835&quot; data-start=&quot;3771&quot;&gt;&lt;strong data-end=&quot;3785&quot; data-start=&quot;3771&quot;&gt;Expiration&lt;/strong&gt; is important. Never issue a token without expiry.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3882&quot; data-start=&quot;3836&quot;&gt;
&lt;p data-end=&quot;3882&quot; data-start=&quot;3838&quot;&gt;&lt;strong data-end=&quot;3854&quot; data-start=&quot;3838&quot;&gt;Bearer token&lt;/strong&gt; in HTTP header is standard.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;3887&quot; data-start=&quot;3884&quot; /&gt;
&lt;h2 data-end=&quot;3902&quot; data-start=&quot;3889&quot;&gt;🟢 Summary&lt;/h2&gt;
&lt;ul data-end=&quot;4114&quot; data-start=&quot;3903&quot;&gt;
&lt;li data-end=&quot;3945&quot; data-start=&quot;3903&quot;&gt;
&lt;p data-end=&quot;3945&quot; data-start=&quot;3905&quot;&gt;JWT = &lt;strong data-end=&quot;3943&quot; data-start=&quot;3911&quot;&gt;Header + Payload + Signature&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3995&quot; data-start=&quot;3946&quot;&gt;
&lt;p data-end=&quot;3995&quot; data-start=&quot;3948&quot;&gt;Used for &lt;strong data-end=&quot;3993&quot; data-start=&quot;3957&quot;&gt;authentication and authorization&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;4033&quot; data-start=&quot;3996&quot;&gt;
&lt;p data-end=&quot;4033&quot; data-start=&quot;3998&quot;&gt;Signed so &lt;strong data-end=&quot;4031&quot; data-start=&quot;4008&quot;&gt;server can trust it&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;4114&quot; data-start=&quot;4034&quot;&gt;
&lt;p data-end=&quot;4114&quot; data-start=&quot;4036&quot;&gt;In C#, use &lt;strong data-end=&quot;4082&quot; data-start=&quot;4047&quot;&gt;System.IdentityModel.Tokens.Jwt&lt;/strong&gt; to &lt;strong data-end=&quot;4105&quot; data-start=&quot;4086&quot;&gt;create &amp;amp; verify&lt;/strong&gt; tokens&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;</content><link rel='replies' type='application/atom+xml' href='http://piushshukla.blogspot.com/feeds/9077568660602758429/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://piushshukla.blogspot.com/2025/09/jwt.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2159069551745631737/posts/default/9077568660602758429'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2159069551745631737/posts/default/9077568660602758429'/><link rel='alternate' type='text/html' href='http://piushshukla.blogspot.com/2025/09/jwt.html' title='JWT'/><author><name>Piush shukla</name><uri>http://www.blogger.com/profile/16392649283296436146</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2159069551745631737.post-2960245912432527486</id><published>2025-09-22T21:30:00.000-07:00</published><updated>2025-09-22T21:30:34.367-07:00</updated><title type='text'>delegate vs event</title><content type='html'>&lt;article class=&quot;text-token-text-primary w-full focus:outline-none scroll-mt-[calc(var(--header-height)+min(200px,max(70px,20svh)))]&quot; data-scroll-anchor=&quot;false&quot; data-testid=&quot;conversation-turn-16&quot; data-turn-id=&quot;request-WEB:7a2eb8aa-35c5-4320-b0a7-629b2682b087-7&quot; data-turn=&quot;assistant&quot; dir=&quot;auto&quot; tabindex=&quot;-1&quot;&gt;&lt;div class=&quot;text-base my-auto mx-auto [--thread-content-margin:--spacing(4)] thread-sm:[--thread-content-margin:--spacing(6)] thread-lg:[--thread-content-margin:--spacing(16)] px-(--thread-content-margin)&quot;&gt;&lt;div class=&quot;[--thread-content-max-width:40rem] thread-lg:[--thread-content-max-width:48rem] mx-auto max-w-(--thread-content-max-width) flex-1 group/turn-messages focus-visible:outline-hidden relative flex w-full min-w-0 flex-col agent-turn&quot; tabindex=&quot;-1&quot;&gt;&lt;div class=&quot;flex max-w-full flex-col grow&quot;&gt;&lt;div class=&quot;min-h-8 text-message relative flex w-full flex-col items-end gap-2 text-start break-words whitespace-normal [.text-message+&amp;amp;]:mt-5&quot; data-message-author-role=&quot;assistant&quot; data-message-id=&quot;072b7fc7-f43a-42c3-b4a2-da199d259554&quot; data-message-model-slug=&quot;gpt-5&quot; dir=&quot;auto&quot;&gt;&lt;div class=&quot;flex w-full flex-col gap-1 empty:hidden first:pt-[3px]&quot;&gt;&lt;div class=&quot;markdown prose dark:prose-invert w-full break-words light markdown-new-styling&quot;&gt;&lt;h2 data-end=&quot;104&quot; data-start=&quot;87&quot;&gt;🟢 1. Delegate&lt;/h2&gt;
&lt;ul data-end=&quot;293&quot; data-start=&quot;105&quot;&gt;
&lt;li data-end=&quot;164&quot; data-start=&quot;105&quot;&gt;
&lt;p data-end=&quot;164&quot; data-start=&quot;107&quot;&gt;&lt;strong data-end=&quot;126&quot; data-start=&quot;107&quot;&gt;Think of it as:&lt;/strong&gt; A &lt;em data-end=&quot;163&quot; data-start=&quot;129&quot;&gt;variable that can store a method&lt;/em&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;218&quot; data-start=&quot;165&quot;&gt;
&lt;p data-end=&quot;218&quot; data-start=&quot;167&quot;&gt;&lt;strong data-end=&quot;179&quot; data-start=&quot;167&quot;&gt;Purpose:&lt;/strong&gt; Let you pass methods around like data.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;293&quot; data-start=&quot;219&quot;&gt;
&lt;p data-end=&quot;293&quot; data-start=&quot;221&quot;&gt;&lt;strong data-end=&quot;233&quot; data-start=&quot;221&quot;&gt;Analogy:&lt;/strong&gt; A remote control that can point to different TVs (methods).&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-end=&quot;306&quot; data-start=&quot;295&quot;&gt;Example&lt;/h3&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;626&quot; data-start=&quot;307&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-csharp&quot;&gt;&lt;span class=&quot;hljs-comment&quot;&gt;// Define a delegate type (method signature)&lt;/span&gt;
&lt;span class=&quot;hljs-function&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;hljs-built_in&quot;&gt;delegate&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;MyDelegate&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot;&gt;&lt;span class=&quot;hljs-built_in&quot;&gt;string&lt;/span&gt;&lt;/span&gt; msg);

&lt;span class=&quot;hljs-keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;Program&lt;/span&gt;
{
    &lt;span class=&quot;hljs-function&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;static&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;Print&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot;&gt;&lt;span class=&quot;hljs-built_in&quot;&gt;string&lt;/span&gt;&lt;/span&gt; m) =&amp;gt; Console.WriteLine(m);

    &lt;span class=&quot;hljs-function&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;static&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;Main&lt;/span&gt;()
    {
        MyDelegate d = Print;  &lt;span class=&quot;hljs-comment&quot;&gt;// store method in delegate&lt;/span&gt;
        d(&lt;span class=&quot;hljs-string&quot;&gt;&quot;Hello from delegate&quot;&lt;/span&gt;); &lt;span class=&quot;hljs-comment&quot;&gt;// call it&lt;/span&gt;
    }
}
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;ul data-end=&quot;705&quot; data-start=&quot;627&quot;&gt;
&lt;li data-end=&quot;705&quot; data-start=&quot;627&quot;&gt;
&lt;p data-end=&quot;705&quot; data-start=&quot;629&quot;&gt;You can &lt;strong data-end=&quot;647&quot; data-start=&quot;637&quot;&gt;assign&lt;/strong&gt;, &lt;strong data-end=&quot;660&quot; data-start=&quot;649&quot;&gt;combine&lt;/strong&gt;, or &lt;strong data-end=&quot;673&quot; data-start=&quot;665&quot;&gt;call&lt;/strong&gt; (&lt;code data-end=&quot;683&quot; data-start=&quot;675&quot;&gt;d(...)&lt;/code&gt;) a delegate directly.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;710&quot; data-start=&quot;707&quot; /&gt;
&lt;h2 data-end=&quot;726&quot; data-start=&quot;712&quot;&gt;🟢 2. Event&lt;/h2&gt;
&lt;ul data-end=&quot;1008&quot; data-start=&quot;727&quot;&gt;
&lt;li data-end=&quot;812&quot; data-start=&quot;727&quot;&gt;
&lt;p data-end=&quot;812&quot; data-start=&quot;729&quot;&gt;&lt;strong data-end=&quot;748&quot; data-start=&quot;729&quot;&gt;Think of it as:&lt;/strong&gt; A &lt;strong data-end=&quot;788&quot; data-start=&quot;751&quot;&gt;special wrapper around a delegate&lt;/strong&gt; used for notifications.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;903&quot; data-start=&quot;813&quot;&gt;
&lt;p data-end=&quot;903&quot; data-start=&quot;815&quot;&gt;&lt;strong data-end=&quot;827&quot; data-start=&quot;815&quot;&gt;Purpose:&lt;/strong&gt; &lt;em data-end=&quot;850&quot; data-start=&quot;828&quot;&gt;Publisher/Subscriber&lt;/em&gt; system — when something happens, tell all listeners.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1008&quot; data-start=&quot;904&quot;&gt;
&lt;p data-end=&quot;1008&quot; data-start=&quot;906&quot;&gt;&lt;strong data-end=&quot;918&quot; data-start=&quot;906&quot;&gt;Analogy:&lt;/strong&gt; A doorbell. Many people can listen (subscribe). Only the house owner can ring (raise) it.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-end=&quot;1021&quot; data-start=&quot;1010&quot;&gt;Example&lt;/h3&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;1447&quot; data-start=&quot;1022&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-csharp&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;using&lt;/span&gt; System;

&lt;span class=&quot;hljs-keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;Door&lt;/span&gt;
{
    &lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;event&lt;/span&gt; Action DoorOpened; &lt;span class=&quot;hljs-comment&quot;&gt;// event based on built-in delegate&lt;/span&gt;

    &lt;span class=&quot;hljs-function&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;Open&lt;/span&gt;()
    {
        Console.WriteLine(&lt;span class=&quot;hljs-string&quot;&gt;&quot;Door opened&quot;&lt;/span&gt;);
        DoorOpened?.Invoke(); &lt;span class=&quot;hljs-comment&quot;&gt;// only Door can trigger&lt;/span&gt;
    }
}

&lt;span class=&quot;hljs-keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;Program&lt;/span&gt;
{
    &lt;span class=&quot;hljs-function&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;static&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;Main&lt;/span&gt;()
    {
        &lt;span class=&quot;hljs-keyword&quot;&gt;var&lt;/span&gt; door = &lt;span class=&quot;hljs-keyword&quot;&gt;new&lt;/span&gt; Door();
        door.DoorOpened += () =&amp;gt; Console.WriteLine(&lt;span class=&quot;hljs-string&quot;&gt;&quot;Guest notified!&quot;&lt;/span&gt;);
        door.Open();
    }
}
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;ul data-end=&quot;1564&quot; data-start=&quot;1448&quot;&gt;
&lt;li data-end=&quot;1499&quot; data-start=&quot;1448&quot;&gt;
&lt;p data-end=&quot;1499&quot; data-start=&quot;1450&quot;&gt;Others use &lt;code data-end=&quot;1465&quot; data-start=&quot;1461&quot;&gt;+=&lt;/code&gt; or &lt;code data-end=&quot;1473&quot; data-start=&quot;1469&quot;&gt;-=&lt;/code&gt; to subscribe/unsubscribe.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1564&quot; data-start=&quot;1500&quot;&gt;
&lt;p data-end=&quot;1564&quot; data-start=&quot;1502&quot;&gt;Only the class that defines the event can raise (&lt;code data-end=&quot;1559&quot; data-start=&quot;1551&quot;&gt;Invoke&lt;/code&gt;) it.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;1569&quot; data-start=&quot;1566&quot; /&gt;
&lt;h2 data-end=&quot;1592&quot; data-start=&quot;1571&quot;&gt;🟢 Key Differences&lt;/h2&gt;
&lt;div class=&quot;_tableContainer_1rjym_1&quot;&gt;&lt;div class=&quot;group _tableWrapper_1rjym_13 flex w-fit flex-col-reverse&quot; tabindex=&quot;-1&quot;&gt;&lt;table class=&quot;w-fit min-w-(--thread-content-width)&quot; data-end=&quot;2446&quot; data-start=&quot;1594&quot;&gt;&lt;thead data-end=&quot;1715&quot; data-start=&quot;1594&quot;&gt;&lt;tr data-end=&quot;1715&quot; data-start=&quot;1594&quot;&gt;&lt;th data-col-size=&quot;sm&quot; data-end=&quot;1619&quot; data-start=&quot;1594&quot;&gt;Feature&lt;/th&gt;&lt;th data-col-size=&quot;sm&quot; data-end=&quot;1660&quot; data-start=&quot;1619&quot;&gt;Delegate&lt;/th&gt;&lt;th data-col-size=&quot;md&quot; data-end=&quot;1715&quot; data-start=&quot;1660&quot;&gt;Event&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody data-end=&quot;2446&quot; data-start=&quot;1838&quot;&gt;&lt;tr data-end=&quot;1959&quot; data-start=&quot;1838&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;1863&quot; data-start=&quot;1838&quot;&gt;What is it?&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;1904&quot; data-start=&quot;1863&quot;&gt;Type-safe reference to a method&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;1959&quot; data-start=&quot;1904&quot;&gt;A delegate with &lt;em data-end=&quot;1957&quot; data-start=&quot;1922&quot;&gt;extra rules for publish/subscribe&lt;/em&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;2081&quot; data-start=&quot;1960&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;1985&quot; data-start=&quot;1960&quot;&gt;Who can call (invoke)?&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2026&quot; data-start=&quot;1985&quot;&gt;Anyone holding the delegate&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;2081&quot; data-start=&quot;2026&quot;&gt;Only the declaring class&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;2203&quot; data-start=&quot;2082&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2107&quot; data-start=&quot;2082&quot;&gt;Usage&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2148&quot; data-start=&quot;2107&quot;&gt;Pass methods as parameters, callbacks&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;2203&quot; data-start=&quot;2148&quot;&gt;Notify subscribers when something happens&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;2325&quot; data-start=&quot;2204&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2229&quot; data-start=&quot;2204&quot;&gt;Subscription&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2270&quot; data-start=&quot;2229&quot;&gt;Not required; can directly assign&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;2325&quot; data-start=&quot;2270&quot;&gt;Must use &lt;code data-end=&quot;2285&quot; data-start=&quot;2281&quot;&gt;+=&lt;/code&gt; or &lt;code data-end=&quot;2293&quot; data-start=&quot;2289&quot;&gt;-=&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;2446&quot; data-start=&quot;2326&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2351&quot; data-start=&quot;2326&quot;&gt;Encapsulation&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2391&quot; data-start=&quot;2351&quot;&gt;None&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;2446&quot; data-start=&quot;2391&quot;&gt;Provides safety: outsiders can’t overwrite the list&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;
&lt;hr data-end=&quot;2451&quot; data-start=&quot;2448&quot; /&gt;
&lt;h2 data-end=&quot;2470&quot; data-start=&quot;2453&quot;&gt;🟢 Simple Rule&lt;/h2&gt;
&lt;ul data-end=&quot;2592&quot; data-start=&quot;2471&quot;&gt;
&lt;li data-end=&quot;2521&quot; data-start=&quot;2471&quot;&gt;
&lt;p data-end=&quot;2521&quot; data-start=&quot;2473&quot;&gt;&lt;strong data-end=&quot;2486&quot; data-start=&quot;2473&quot;&gt;Delegate:&lt;/strong&gt; “Point to a method and call it.”&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2592&quot; data-start=&quot;2522&quot;&gt;
&lt;p data-end=&quot;2592&quot; data-start=&quot;2524&quot;&gt;&lt;strong data-end=&quot;2534&quot; data-start=&quot;2524&quot;&gt;Event:&lt;/strong&gt; “Many listeners can sign up; only the owner can fire it.”&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;2597&quot; data-start=&quot;2594&quot; /&gt;
&lt;h3 data-end=&quot;2615&quot; data-start=&quot;2599&quot;&gt;Tiny Summary&lt;/h3&gt;
&lt;ul data-end=&quot;2769&quot; data-is-last-node=&quot;&quot; data-is-only-node=&quot;&quot; data-start=&quot;2616&quot;&gt;
&lt;li data-end=&quot;2673&quot; data-start=&quot;2616&quot;&gt;
&lt;p data-end=&quot;2673&quot; data-start=&quot;2618&quot;&gt;&lt;strong data-end=&quot;2630&quot; data-start=&quot;2618&quot;&gt;Delegate&lt;/strong&gt; = &lt;em data-end=&quot;2651&quot; data-start=&quot;2633&quot;&gt;function pointer&lt;/em&gt; (method reference).&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2769&quot; data-is-last-node=&quot;&quot; data-start=&quot;2674&quot;&gt;
&lt;p data-end=&quot;2769&quot; data-is-last-node=&quot;&quot; data-start=&quot;2676&quot;&gt;&lt;strong data-end=&quot;2685&quot; data-start=&quot;2676&quot;&gt;Event&lt;/strong&gt; = &lt;em data-end=&quot;2721&quot; data-start=&quot;2688&quot;&gt;delegate used for notifications&lt;/em&gt; with extra safety and &lt;code data-end=&quot;2748&quot; data-start=&quot;2744&quot;&gt;+=&lt;/code&gt; / &lt;code data-end=&quot;2755&quot; data-start=&quot;2751&quot;&gt;-=&lt;/code&gt; subscription.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;flex min-h-[46px] justify-start&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/article&gt;&lt;article class=&quot;text-token-text-primary w-full focus:outline-none scroll-mt-(--header-height)&quot; data-scroll-anchor=&quot;false&quot; data-testid=&quot;conversation-turn-17&quot; data-turn-id=&quot;8c581de8-f221-479f-b6eb-b98c79664084&quot; data-turn=&quot;user&quot; dir=&quot;auto&quot; tabindex=&quot;-1&quot;&gt;&lt;h5 class=&quot;sr-only&quot;&gt;&lt;/h5&gt;&lt;/article&gt;</content><link rel='replies' type='application/atom+xml' href='http://piushshukla.blogspot.com/feeds/2960245912432527486/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://piushshukla.blogspot.com/2025/09/delegate-vs-event.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2159069551745631737/posts/default/2960245912432527486'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2159069551745631737/posts/default/2960245912432527486'/><link rel='alternate' type='text/html' href='http://piushshukla.blogspot.com/2025/09/delegate-vs-event.html' title='delegate vs event'/><author><name>Piush shukla</name><uri>http://www.blogger.com/profile/16392649283296436146</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2159069551745631737.post-4461686192987171787</id><published>2025-09-22T21:26:00.000-07:00</published><updated>2025-09-22T21:26:51.971-07:00</updated><title type='text'>Singleton vs Static</title><content type='html'>&lt;h2 data-end=&quot;114&quot; data-start=&quot;96&quot;&gt;🟢 1. Singleton&lt;/h2&gt;
&lt;ul data-end=&quot;261&quot; data-start=&quot;115&quot;&gt;
&lt;li data-end=&quot;196&quot; data-start=&quot;115&quot;&gt;
&lt;p data-end=&quot;196&quot; data-start=&quot;117&quot;&gt;&lt;strong data-end=&quot;132&quot; data-start=&quot;117&quot;&gt;What it is:&lt;/strong&gt; A &lt;em data-end=&quot;142&quot; data-start=&quot;135&quot;&gt;class&lt;/em&gt; where &lt;strong data-end=&quot;179&quot; data-start=&quot;149&quot;&gt;only one object (instance)&lt;/strong&gt; is ever created.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;261&quot; data-start=&quot;197&quot;&gt;
&lt;p data-end=&quot;261&quot; data-start=&quot;199&quot;&gt;&lt;strong data-end=&quot;218&quot; data-start=&quot;199&quot;&gt;How you use it:&lt;/strong&gt; You &lt;strong data-end=&quot;233&quot; data-start=&quot;223&quot;&gt;create&lt;/strong&gt; and use that single object.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;271&quot; data-start=&quot;263&quot;&gt;Example:&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;579&quot; data-start=&quot;272&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-csharp&quot;&gt;public class AppSettings
{
    private static AppSettings _instance;
    private AppSettings() { }

    public static AppSettings Instance
    {
        get
        {
            if (_instance == null)
                _instance = new AppSettings();
            return _instance;
        }
    }
}
Use: var s = AppSettings.Instance;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;h3 data-end=&quot;595&quot; data-start=&quot;581&quot;&gt;Key Points&lt;/h3&gt;
&lt;ul data-end=&quot;850&quot; data-start=&quot;596&quot;&gt;
&lt;li data-end=&quot;649&quot; data-start=&quot;596&quot;&gt;
&lt;p data-end=&quot;649&quot; data-start=&quot;598&quot;&gt;You &lt;strong data-end=&quot;630&quot; data-start=&quot;602&quot;&gt;can implement interfaces&lt;/strong&gt; (e.g., &lt;code data-end=&quot;647&quot; data-start=&quot;638&quot;&gt;ILogger&lt;/code&gt;).&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;727&quot; data-start=&quot;650&quot;&gt;
&lt;p data-end=&quot;727&quot; data-start=&quot;652&quot;&gt;You can use &lt;strong data-end=&quot;680&quot; data-start=&quot;664&quot;&gt;polymorphism&lt;/strong&gt; (pass it to methods that expect an interface).&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;780&quot; data-start=&quot;728&quot;&gt;
&lt;p data-end=&quot;780&quot; data-start=&quot;730&quot;&gt;&lt;strong data-end=&quot;758&quot; data-start=&quot;730&quot;&gt;Created only when needed&lt;/strong&gt; (lazy load possible).&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;850&quot; data-start=&quot;781&quot;&gt;
&lt;p data-end=&quot;850&quot; data-start=&quot;783&quot;&gt;Lives as long as your app runs, but you &lt;strong data-end=&quot;849&quot; data-start=&quot;823&quot;&gt;control initialization&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;855&quot; data-start=&quot;852&quot; /&gt;
&lt;h2 data-end=&quot;878&quot; data-start=&quot;857&quot;&gt;🟢 2. Static Class&lt;/h2&gt;
&lt;ul data-end=&quot;1061&quot; data-start=&quot;879&quot;&gt;
&lt;li data-end=&quot;986&quot; data-start=&quot;879&quot;&gt;
&lt;p data-end=&quot;986&quot; data-start=&quot;881&quot;&gt;&lt;strong data-end=&quot;896&quot; data-start=&quot;881&quot;&gt;What it is:&lt;/strong&gt; A class that &lt;strong data-end=&quot;943&quot; data-start=&quot;910&quot;&gt;cannot be instantiated at all&lt;/strong&gt;.&lt;br data-end=&quot;947&quot; data-start=&quot;944&quot; /&gt;
All members are automatically static.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1061&quot; data-start=&quot;987&quot;&gt;
&lt;p data-end=&quot;1061&quot; data-start=&quot;989&quot;&gt;&lt;strong data-end=&quot;1008&quot; data-start=&quot;989&quot;&gt;How you use it:&lt;/strong&gt; You call its methods &lt;strong data-end=&quot;1042&quot; data-start=&quot;1030&quot;&gt;directly&lt;/strong&gt;, no object needed.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;1071&quot; data-start=&quot;1063&quot;&gt;Example:&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;1214&quot; data-start=&quot;1072&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-csharp&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;MathHelper&lt;/span&gt;
{
    &lt;span class=&quot;hljs-function&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;hljs-built_in&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;Add&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot;&gt;&lt;span class=&quot;hljs-built_in&quot;&gt;int&lt;/span&gt;&lt;/span&gt; a, &lt;span class=&quot;hljs-built_in&quot;&gt;int&lt;/span&gt; b) =&amp;gt; a + b;
}

&lt;span class=&quot;hljs-comment&quot;&gt;// Use:&lt;/span&gt;
&lt;span class=&quot;hljs-built_in&quot;&gt;int&lt;/span&gt; result = MathHelper.Add(&lt;span class=&quot;hljs-number&quot;&gt;2&lt;/span&gt;, &lt;span class=&quot;hljs-number&quot;&gt;3&lt;/span&gt;);
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;h3 data-end=&quot;1230&quot; data-start=&quot;1216&quot;&gt;Key Points&lt;/h3&gt;
&lt;ul data-end=&quot;1377&quot; data-start=&quot;1231&quot;&gt;
&lt;li data-end=&quot;1263&quot; data-start=&quot;1231&quot;&gt;
&lt;p data-end=&quot;1263&quot; data-start=&quot;1233&quot;&gt;&lt;strong data-end=&quot;1246&quot; data-start=&quot;1233&quot;&gt;No object&lt;/strong&gt; is ever created.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1324&quot; data-start=&quot;1264&quot;&gt;
&lt;p data-end=&quot;1324&quot; data-start=&quot;1266&quot;&gt;Cannot implement interfaces or inherit from other classes.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1377&quot; data-start=&quot;1325&quot;&gt;
&lt;p data-end=&quot;1377&quot; data-start=&quot;1327&quot;&gt;&lt;strong data-end=&quot;1351&quot; data-start=&quot;1327&quot;&gt;Loaded automatically&lt;/strong&gt; when your program starts.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;1382&quot; data-start=&quot;1379&quot; /&gt;
&lt;h2 data-end=&quot;1413&quot; data-start=&quot;1384&quot;&gt;🟢 Side-by-Side Comparison&lt;/h2&gt;
&lt;div class=&quot;_tableContainer_1rjym_1&quot;&gt;&lt;div class=&quot;group _tableWrapper_1rjym_13 flex w-fit flex-col-reverse&quot; tabindex=&quot;-1&quot;&gt;&lt;table class=&quot;w-fit min-w-(--thread-content-width)&quot; data-end=&quot;2538&quot; data-start=&quot;1415&quot;&gt;&lt;thead data-end=&quot;1526&quot; data-start=&quot;1415&quot;&gt;&lt;tr data-end=&quot;1526&quot; data-start=&quot;1415&quot;&gt;&lt;th data-col-size=&quot;sm&quot; data-end=&quot;1440&quot; data-start=&quot;1415&quot;&gt;Feature&lt;/th&gt;&lt;th data-col-size=&quot;md&quot; data-end=&quot;1484&quot; data-start=&quot;1440&quot;&gt;Singleton&lt;/th&gt;&lt;th data-col-size=&quot;sm&quot; data-end=&quot;1526&quot; data-start=&quot;1484&quot;&gt;Static Class&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody data-end=&quot;2538&quot; data-start=&quot;1640&quot;&gt;&lt;tr data-end=&quot;1752&quot; data-start=&quot;1640&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;1665&quot; data-start=&quot;1640&quot;&gt;Object creation&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;1709&quot; data-start=&quot;1665&quot;&gt;One object (single instance)&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;1752&quot; data-start=&quot;1709&quot;&gt;No object&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;1864&quot; data-start=&quot;1753&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;1778&quot; data-start=&quot;1753&quot;&gt;Interfaces / Inherit&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;1822&quot; data-start=&quot;1778&quot;&gt;Yes&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;1864&quot; data-start=&quot;1822&quot;&gt;No&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;1976&quot; data-start=&quot;1865&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;1890&quot; data-start=&quot;1865&quot;&gt;Polymorphism&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;1934&quot; data-start=&quot;1890&quot;&gt;Yes&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;1976&quot; data-start=&quot;1934&quot;&gt;No&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;2088&quot; data-start=&quot;1977&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2002&quot; data-start=&quot;1977&quot;&gt;Lazy initialization&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;2046&quot; data-start=&quot;2002&quot;&gt;Possible&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2088&quot; data-start=&quot;2046&quot;&gt;Not applicable&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;2200&quot; data-start=&quot;2089&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2114&quot; data-start=&quot;2089&quot;&gt;State/data&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;2158&quot; data-start=&quot;2114&quot;&gt;Stored inside the single instance&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2200&quot; data-start=&quot;2158&quot;&gt;Stored in static fields&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;2314&quot; data-start=&quot;2201&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2226&quot; data-start=&quot;2201&quot;&gt;Lifetime&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;2274&quot; data-start=&quot;2226&quot;&gt;Until app ends or GC collects (if not static)&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2314&quot; data-start=&quot;2274&quot;&gt;For whole app domain (always loaded)&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;2426&quot; data-start=&quot;2315&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2340&quot; data-start=&quot;2315&quot;&gt;Testing (mocking)&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;2384&quot; data-start=&quot;2340&quot;&gt;Easy to mock (pass interface)&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2426&quot; data-start=&quot;2384&quot;&gt;Hard to mock&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;2538&quot; data-start=&quot;2427&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2452&quot; data-start=&quot;2427&quot;&gt;Usage example&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;2496&quot; data-start=&quot;2452&quot;&gt;&lt;code data-end=&quot;2483&quot; data-start=&quot;2454&quot;&gt;Logger.Instance.Log(&quot;msg&quot;);&lt;/code&gt;&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2538&quot; data-start=&quot;2496&quot;&gt;&lt;code data-end=&quot;2520&quot; data-start=&quot;2498&quot;&gt;MathHelper.Add(2,3);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;
&lt;hr data-end=&quot;2543&quot; data-start=&quot;2540&quot; /&gt;
&lt;h2 data-end=&quot;2562&quot; data-start=&quot;2545&quot;&gt;🟢 When to Use&lt;/h2&gt;
&lt;ul data-end=&quot;2847&quot; data-start=&quot;2563&quot;&gt;
&lt;li data-end=&quot;2729&quot; data-start=&quot;2563&quot;&gt;
&lt;p data-end=&quot;2729&quot; data-start=&quot;2565&quot;&gt;&lt;strong data-end=&quot;2579&quot; data-start=&quot;2565&quot;&gt;Singleton:&lt;/strong&gt;&lt;br data-end=&quot;2582&quot; data-start=&quot;2579&quot; /&gt;
When you need &lt;strong data-end=&quot;2619&quot; data-start=&quot;2598&quot;&gt;one shared object&lt;/strong&gt; that may hold state or need an interface (e.g., database connection manager, configuration, logging service).&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2847&quot; data-start=&quot;2731&quot;&gt;
&lt;p data-end=&quot;2847&quot; data-start=&quot;2733&quot;&gt;&lt;strong data-end=&quot;2750&quot; data-start=&quot;2733&quot;&gt;Static Class:&lt;/strong&gt;&lt;br data-end=&quot;2753&quot; data-start=&quot;2750&quot; /&gt;
When you only need &lt;strong data-end=&quot;2795&quot; data-start=&quot;2774&quot;&gt;utility functions&lt;/strong&gt; with no state (e.g., math helpers, string helpers).&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;2852&quot; data-start=&quot;2849&quot; /&gt;
&lt;h3 data-end=&quot;2871&quot; data-start=&quot;2854&quot;&gt;👉 Quick Rule&lt;/h3&gt;
&lt;ul data-end=&quot;2982&quot; data-is-last-node=&quot;&quot; data-is-only-node=&quot;&quot; data-start=&quot;2872&quot;&gt;
&lt;li data-end=&quot;2924&quot; data-start=&quot;2872&quot;&gt;
&lt;p data-end=&quot;2924&quot; data-start=&quot;2874&quot;&gt;&lt;strong data-end=&quot;2906&quot; data-start=&quot;2874&quot;&gt;Need a single shared object?&lt;/strong&gt; ➜ &lt;strong data-end=&quot;2922&quot; data-start=&quot;2909&quot;&gt;Singleton&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2982&quot; data-is-last-node=&quot;&quot; data-start=&quot;2925&quot;&gt;
&lt;p data-end=&quot;2982&quot; data-is-last-node=&quot;&quot; data-start=&quot;2927&quot;&gt;&lt;strong data-end=&quot;2963&quot; data-start=&quot;2927&quot;&gt;Need only static helper methods?&lt;/strong&gt; ➜ &lt;strong data-end=&quot;2982&quot; data-is-last-node=&quot;&quot; data-start=&quot;2966&quot;&gt;Static class&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;</content><link rel='replies' type='application/atom+xml' href='http://piushshukla.blogspot.com/feeds/4461686192987171787/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://piushshukla.blogspot.com/2025/09/singleton-vs-static.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2159069551745631737/posts/default/4461686192987171787'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2159069551745631737/posts/default/4461686192987171787'/><link rel='alternate' type='text/html' href='http://piushshukla.blogspot.com/2025/09/singleton-vs-static.html' title='Singleton vs Static'/><author><name>Piush shukla</name><uri>http://www.blogger.com/profile/16392649283296436146</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2159069551745631737.post-5279416849765624668</id><published>2025-09-22T21:21:00.000-07:00</published><updated>2025-09-22T21:21:40.622-07:00</updated><title type='text'>Design Pattern</title><content type='html'>&lt;h2 data-end=&quot;165&quot; data-start=&quot;134&quot;&gt;🟢 What is a Design Pattern?&lt;/h2&gt;
&lt;p data-end=&quot;281&quot; data-start=&quot;166&quot;&gt;A design pattern is a &lt;strong data-end=&quot;240&quot; data-start=&quot;188&quot;&gt;common way to write code to fix a common problem&lt;/strong&gt;.&lt;br data-end=&quot;244&quot; data-start=&quot;241&quot; /&gt;
Think of it as a &lt;strong data-end=&quot;280&quot; data-start=&quot;261&quot;&gt;ready-made plan&lt;/strong&gt;.&lt;/p&gt;
&lt;hr data-end=&quot;286&quot; data-start=&quot;283&quot; /&gt;
&lt;h2 data-end=&quot;316&quot; data-start=&quot;288&quot;&gt;1️⃣ CREATIONAL PATTERNS&lt;/h2&gt;
&lt;p data-end=&quot;342&quot; data-start=&quot;317&quot;&gt;&lt;em data-end=&quot;342&quot; data-start=&quot;317&quot;&gt;(How to create objects)&lt;/em&gt;&lt;/p&gt;
&lt;h3 data-end=&quot;361&quot; data-start=&quot;344&quot;&gt;✅ Singleton&lt;/h3&gt;
&lt;p data-end=&quot;406&quot; data-start=&quot;362&quot;&gt;&lt;strong data-end=&quot;371&quot; data-start=&quot;362&quot;&gt;Goal:&lt;/strong&gt; Only one object of a class exists.&lt;/p&gt;
&lt;p data-end=&quot;460&quot; data-start=&quot;408&quot;&gt;Example: only one settings object for the whole app.&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;771&quot; data-start=&quot;461&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-csharp&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;AppSettings&lt;/span&gt;
{
    &lt;span class=&quot;hljs-keyword&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;static&lt;/span&gt; AppSettings _instance;
    &lt;span class=&quot;hljs-function&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;private&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;AppSettings&lt;/span&gt;() { }

    &lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;static&lt;/span&gt; AppSettings Instance
    {
        &lt;span class=&quot;hljs-keyword&quot;&gt;get&lt;/span&gt;
        {
            &lt;span class=&quot;hljs-keyword&quot;&gt;if&lt;/span&gt; (_instance == &lt;span class=&quot;hljs-literal&quot;&gt;null&lt;/span&gt;)
                _instance = &lt;span class=&quot;hljs-keyword&quot;&gt;new&lt;/span&gt; AppSettings();
            &lt;span class=&quot;hljs-keyword&quot;&gt;return&lt;/span&gt; _instance;
        }
    }
}
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;p data-end=&quot;808&quot; data-start=&quot;772&quot;&gt;Use: &lt;code data-end=&quot;808&quot; data-start=&quot;777&quot;&gt;var s = AppSettings.Instance;&lt;/code&gt;&lt;/p&gt;
&lt;hr data-end=&quot;813&quot; data-start=&quot;810&quot; /&gt;
&lt;h3 data-end=&quot;830&quot; data-start=&quot;815&quot;&gt;✅ Factory&lt;/h3&gt;
&lt;p data-end=&quot;887&quot; data-start=&quot;831&quot;&gt;&lt;strong data-end=&quot;840&quot; data-start=&quot;831&quot;&gt;Goal:&lt;/strong&gt; Decide which object to create inside a method.&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;1280&quot; data-start=&quot;889&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-csharp&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;abstract&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;Animal&lt;/span&gt; { &lt;span class=&quot;hljs-function&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;abstract&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;Speak&lt;/span&gt;(); }
&lt;span class=&quot;hljs-keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;Dog&lt;/span&gt; : &lt;span class=&quot;hljs-title&quot;&gt;Animal&lt;/span&gt; { &lt;span class=&quot;hljs-function&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;override&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;Speak&lt;/span&gt;() =&amp;gt; Console.WriteLine(&lt;span class=&quot;hljs-string&quot;&gt;&quot;Woof&quot;&lt;/span&gt;); }
&lt;span class=&quot;hljs-keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;Cat&lt;/span&gt; : &lt;span class=&quot;hljs-title&quot;&gt;Animal&lt;/span&gt; { &lt;span class=&quot;hljs-function&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;override&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;Speak&lt;/span&gt;() =&amp;gt; Console.WriteLine(&lt;span class=&quot;hljs-string&quot;&gt;&quot;Meow&quot;&lt;/span&gt;); }

&lt;span class=&quot;hljs-keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;AnimalFactory&lt;/span&gt;
{
    &lt;span class=&quot;hljs-function&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;static&lt;/span&gt; Animal &lt;span class=&quot;hljs-title&quot;&gt;Create&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot;&gt;&lt;span class=&quot;hljs-built_in&quot;&gt;string&lt;/span&gt;&lt;/span&gt; type)
    {
        &lt;span class=&quot;hljs-keyword&quot;&gt;if&lt;/span&gt; (type == &lt;span class=&quot;hljs-string&quot;&gt;&quot;dog&quot;&lt;/span&gt;) &lt;span class=&quot;hljs-keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;new&lt;/span&gt; Dog();
        &lt;span class=&quot;hljs-keyword&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;new&lt;/span&gt; Cat();
    }
}
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;p data-end=&quot;1338&quot; data-start=&quot;1281&quot;&gt;Use: &lt;code data-end=&quot;1338&quot; data-start=&quot;1286&quot;&gt;Animal a = AnimalFactory.Create(&quot;dog&quot;); a.Speak();&lt;/code&gt;&lt;/p&gt;
&lt;hr data-end=&quot;1343&quot; data-start=&quot;1340&quot; /&gt;
&lt;h3 data-end=&quot;1360&quot; data-start=&quot;1345&quot;&gt;✅ Builder&lt;/h3&gt;
&lt;p data-end=&quot;1407&quot; data-start=&quot;1361&quot;&gt;&lt;strong data-end=&quot;1370&quot; data-start=&quot;1361&quot;&gt;Goal:&lt;/strong&gt; Build a complex object step by step.&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;1725&quot; data-start=&quot;1409&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-csharp&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;Pizza&lt;/span&gt;
{
    &lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hljs-built_in&quot;&gt;string&lt;/span&gt; Topping;
    &lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hljs-built_in&quot;&gt;string&lt;/span&gt; Size;
}

&lt;span class=&quot;hljs-keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;PizzaBuilder&lt;/span&gt;
{
    &lt;span class=&quot;hljs-keyword&quot;&gt;private&lt;/span&gt; Pizza p = &lt;span class=&quot;hljs-keyword&quot;&gt;new&lt;/span&gt; Pizza();
    &lt;span class=&quot;hljs-function&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt;&lt;/span&gt; PizzaBuilder &lt;span class=&quot;hljs-title&quot;&gt;AddTopping&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot;&gt;&lt;span class=&quot;hljs-built_in&quot;&gt;string&lt;/span&gt;&lt;/span&gt; t){ p.Topping = t; &lt;span class=&quot;hljs-keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;this&lt;/span&gt;; }
    &lt;span class=&quot;hljs-function&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt;&lt;/span&gt; PizzaBuilder &lt;span class=&quot;hljs-title&quot;&gt;SetSize&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot;&gt;&lt;span class=&quot;hljs-built_in&quot;&gt;string&lt;/span&gt;&lt;/span&gt; s){ p.Size = s; &lt;span class=&quot;hljs-keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;this&lt;/span&gt;; }
    &lt;span class=&quot;hljs-function&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt;&lt;/span&gt; Pizza &lt;span class=&quot;hljs-title&quot;&gt;Build&lt;/span&gt;() =&amp;gt; p;
}
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;p data-end=&quot;1730&quot; data-start=&quot;1726&quot;&gt;Use:&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;1822&quot; data-start=&quot;1731&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-csharp&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;var&lt;/span&gt; pizza = &lt;span class=&quot;hljs-keyword&quot;&gt;new&lt;/span&gt; PizzaBuilder().AddTopping(&lt;span class=&quot;hljs-string&quot;&gt;&quot;Cheese&quot;&lt;/span&gt;).SetSize(&lt;span class=&quot;hljs-string&quot;&gt;&quot;Large&quot;&lt;/span&gt;).Build();
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;hr data-end=&quot;1827&quot; data-start=&quot;1824&quot; /&gt;
&lt;h2 data-end=&quot;1857&quot; data-start=&quot;1829&quot;&gt;2️⃣ STRUCTURAL PATTERNS&lt;/h2&gt;
&lt;p data-end=&quot;1889&quot; data-start=&quot;1858&quot;&gt;&lt;em data-end=&quot;1889&quot; data-start=&quot;1858&quot;&gt;(How to join or wrap objects)&lt;/em&gt;&lt;/p&gt;
&lt;h3 data-end=&quot;1906&quot; data-start=&quot;1891&quot;&gt;✅ Adapter&lt;/h3&gt;
&lt;p data-end=&quot;1973&quot; data-start=&quot;1907&quot;&gt;&lt;strong data-end=&quot;1916&quot; data-start=&quot;1907&quot;&gt;Goal:&lt;/strong&gt; Make two classes work together even if they don’t match.&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;2194&quot; data-start=&quot;1975&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-csharp&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;interface&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;INew&lt;/span&gt; { &lt;span class=&quot;hljs-function&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;void&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;DoNew&lt;/span&gt;(); }
&lt;span class=&quot;hljs-keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;Old&lt;/span&gt; { &lt;span class=&quot;hljs-function&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;DoOld&lt;/span&gt;() =&amp;gt; Console.WriteLine(&lt;span class=&quot;hljs-string&quot;&gt;&quot;Old work&quot;&lt;/span&gt;); }

&lt;span class=&quot;hljs-keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;Adapter&lt;/span&gt; : &lt;span class=&quot;hljs-title&quot;&gt;INew&lt;/span&gt;
{
    &lt;span class=&quot;hljs-keyword&quot;&gt;private&lt;/span&gt; Old oldObj = &lt;span class=&quot;hljs-keyword&quot;&gt;new&lt;/span&gt; Old();
    &lt;span class=&quot;hljs-function&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;DoNew&lt;/span&gt;() =&amp;gt; oldObj.DoOld();
}
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;hr data-end=&quot;2199&quot; data-start=&quot;2196&quot; /&gt;
&lt;h3 data-end=&quot;2215&quot; data-start=&quot;2201&quot;&gt;✅ Facade&lt;/h3&gt;
&lt;p data-end=&quot;2266&quot; data-start=&quot;2216&quot;&gt;&lt;strong data-end=&quot;2225&quot; data-start=&quot;2216&quot;&gt;Goal:&lt;/strong&gt; Give a simple interface to complex code.&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;2577&quot; data-start=&quot;2268&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-csharp&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;Engine&lt;/span&gt; { &lt;span class=&quot;hljs-function&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;Start&lt;/span&gt;() =&amp;gt; Console.WriteLine(&lt;span class=&quot;hljs-string&quot;&gt;&quot;Engine on&quot;&lt;/span&gt;); }
&lt;span class=&quot;hljs-keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;Lights&lt;/span&gt; { &lt;span class=&quot;hljs-function&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;On&lt;/span&gt;() =&amp;gt; Console.WriteLine(&lt;span class=&quot;hljs-string&quot;&gt;&quot;Lights on&quot;&lt;/span&gt;); }

&lt;span class=&quot;hljs-keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;CarFacade&lt;/span&gt;
{
    Engine e = &lt;span class=&quot;hljs-keyword&quot;&gt;new&lt;/span&gt; Engine();
    Lights l = &lt;span class=&quot;hljs-keyword&quot;&gt;new&lt;/span&gt; Lights();
    &lt;span class=&quot;hljs-function&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;Drive&lt;/span&gt;() { e.Start(); l.On(); Console.WriteLine(&lt;span class=&quot;hljs-string&quot;&gt;&quot;Ready!&quot;&lt;/span&gt;); }
}
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;p data-end=&quot;2609&quot; data-start=&quot;2578&quot;&gt;Use: &lt;code data-end=&quot;2609&quot; data-start=&quot;2583&quot;&gt;new CarFacade().Drive();&lt;/code&gt;&lt;/p&gt;
&lt;hr data-end=&quot;2614&quot; data-start=&quot;2611&quot; /&gt;
&lt;h3 data-end=&quot;2633&quot; data-start=&quot;2616&quot;&gt;✅ Decorator&lt;/h3&gt;
&lt;p data-end=&quot;2703&quot; data-start=&quot;2634&quot;&gt;&lt;strong data-end=&quot;2643&quot; data-start=&quot;2634&quot;&gt;Goal:&lt;/strong&gt; Add extra features to an object without changing its class.&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;3016&quot; data-start=&quot;2705&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-csharp&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;interface&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;IMessage&lt;/span&gt; { &lt;span class=&quot;hljs-function&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;void&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;Send&lt;/span&gt;(); }
&lt;span class=&quot;hljs-keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;Email&lt;/span&gt; : &lt;span class=&quot;hljs-title&quot;&gt;IMessage&lt;/span&gt; { &lt;span class=&quot;hljs-function&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;Send&lt;/span&gt;() =&amp;gt; Console.WriteLine(&lt;span class=&quot;hljs-string&quot;&gt;&quot;Email&quot;&lt;/span&gt;); }

&lt;span class=&quot;hljs-keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;SmsDecorator&lt;/span&gt; : &lt;span class=&quot;hljs-title&quot;&gt;IMessage&lt;/span&gt;
{
    &lt;span class=&quot;hljs-keyword&quot;&gt;private&lt;/span&gt; IMessage inner;
    &lt;span class=&quot;hljs-function&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;SmsDecorator&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot;&gt;IMessage m&lt;/span&gt;) { inner = m; }
    &lt;span class=&quot;hljs-function&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;Send&lt;/span&gt;() { inner.Send(); Console.WriteLine(&lt;span class=&quot;hljs-string&quot;&gt;&quot;SMS too&quot;&lt;/span&gt;); }
}
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;hr data-end=&quot;3021&quot; data-start=&quot;3018&quot; /&gt;
&lt;h2 data-end=&quot;3051&quot; data-start=&quot;3023&quot;&gt;3️⃣ BEHAVIORAL PATTERNS&lt;/h2&gt;
&lt;p data-end=&quot;3086&quot; data-start=&quot;3052&quot;&gt;&lt;em data-end=&quot;3086&quot; data-start=&quot;3052&quot;&gt;(How objects talk to each other)&lt;/em&gt;&lt;/p&gt;
&lt;h3 data-end=&quot;3104&quot; data-start=&quot;3088&quot;&gt;✅ Observer&lt;/h3&gt;
&lt;p data-end=&quot;3152&quot; data-start=&quot;3105&quot;&gt;&lt;strong data-end=&quot;3114&quot; data-start=&quot;3105&quot;&gt;Goal:&lt;/strong&gt; When one object changes, others know.&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;3346&quot; data-start=&quot;3154&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-csharp&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;News&lt;/span&gt;
{
    &lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;event&lt;/span&gt; Action OnChange;
    &lt;span class=&quot;hljs-function&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;Publish&lt;/span&gt;() =&amp;gt; OnChange?.Invoke();
}
&lt;span class=&quot;hljs-keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;Reader&lt;/span&gt;
{
    &lt;span class=&quot;hljs-function&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;Read&lt;/span&gt;() =&amp;gt; Console.WriteLine(&lt;span class=&quot;hljs-string&quot;&gt;&quot;Reader got news&quot;&lt;/span&gt;);
}
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;p data-end=&quot;3351&quot; data-start=&quot;3347&quot;&gt;Use:&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;3451&quot; data-start=&quot;3352&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-csharp&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;var&lt;/span&gt; news = &lt;span class=&quot;hljs-keyword&quot;&gt;new&lt;/span&gt; News();
&lt;span class=&quot;hljs-keyword&quot;&gt;var&lt;/span&gt; r = &lt;span class=&quot;hljs-keyword&quot;&gt;new&lt;/span&gt; Reader();
news.OnChange += r.Read;
news.Publish();
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;hr data-end=&quot;3456&quot; data-start=&quot;3453&quot; /&gt;
&lt;h3 data-end=&quot;3474&quot; data-start=&quot;3458&quot;&gt;✅ Strategy&lt;/h3&gt;
&lt;p data-end=&quot;3509&quot; data-start=&quot;3475&quot;&gt;&lt;strong data-end=&quot;3484&quot; data-start=&quot;3475&quot;&gt;Goal:&lt;/strong&gt; Switch algorithm easily.&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;3862&quot; data-start=&quot;3511&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-csharp&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;interface&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;ISort&lt;/span&gt; { &lt;span class=&quot;hljs-function&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;void&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;Sort&lt;/span&gt;(); }
&lt;span class=&quot;hljs-keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;QuickSort&lt;/span&gt; : &lt;span class=&quot;hljs-title&quot;&gt;ISort&lt;/span&gt; { &lt;span class=&quot;hljs-function&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;Sort&lt;/span&gt;() =&amp;gt; Console.WriteLine(&lt;span class=&quot;hljs-string&quot;&gt;&quot;QuickSort&quot;&lt;/span&gt;); }
&lt;span class=&quot;hljs-keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;BubbleSort&lt;/span&gt; : &lt;span class=&quot;hljs-title&quot;&gt;ISort&lt;/span&gt; { &lt;span class=&quot;hljs-function&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;Sort&lt;/span&gt;() =&amp;gt; Console.WriteLine(&lt;span class=&quot;hljs-string&quot;&gt;&quot;BubbleSort&quot;&lt;/span&gt;); }

&lt;span class=&quot;hljs-keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;Sorter&lt;/span&gt;
{
    &lt;span class=&quot;hljs-keyword&quot;&gt;private&lt;/span&gt; ISort _strategy;
    &lt;span class=&quot;hljs-function&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;Sorter&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot;&gt;ISort s&lt;/span&gt;) { _strategy = s; }
    &lt;span class=&quot;hljs-function&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;DoSort&lt;/span&gt;() =&amp;gt; _strategy.Sort();
}
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;p data-end=&quot;3867&quot; data-start=&quot;3863&quot;&gt;Use:&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;3919&quot; data-start=&quot;3868&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-csharp&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;new&lt;/span&gt; Sorter(&lt;span class=&quot;hljs-keyword&quot;&gt;new&lt;/span&gt; QuickSort()).DoSort();
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;hr data-end=&quot;3924&quot; data-start=&quot;3921&quot; /&gt;
&lt;h3 data-end=&quot;3941&quot; data-start=&quot;3926&quot;&gt;✅ Command&lt;/h3&gt;
&lt;p data-end=&quot;4004&quot; data-start=&quot;3942&quot;&gt;&lt;strong data-end=&quot;3951&quot; data-start=&quot;3942&quot;&gt;Goal:&lt;/strong&gt; Save an action as an object so you can run it later.&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;4212&quot; data-start=&quot;4006&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-csharp&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;interface&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;ICommand&lt;/span&gt; { &lt;span class=&quot;hljs-function&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;void&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;Execute&lt;/span&gt;(); }
&lt;span class=&quot;hljs-keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;HelloCommand&lt;/span&gt; : &lt;span class=&quot;hljs-title&quot;&gt;ICommand&lt;/span&gt; { &lt;span class=&quot;hljs-function&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;Execute&lt;/span&gt;() =&amp;gt; Console.WriteLine(&lt;span class=&quot;hljs-string&quot;&gt;&quot;Hello&quot;&lt;/span&gt;); }

&lt;span class=&quot;hljs-keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;Invoker&lt;/span&gt;
{
    &lt;span class=&quot;hljs-function&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;Run&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot;&gt;ICommand c&lt;/span&gt;) =&amp;gt; c.Execute();
}
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;hr data-end=&quot;4217&quot; data-start=&quot;4214&quot; /&gt;
&lt;h2 data-end=&quot;4233&quot; data-start=&quot;4219&quot;&gt;Quick Table&lt;/h2&gt;
&lt;div class=&quot;_tableContainer_1rjym_1&quot;&gt;&lt;div class=&quot;group _tableWrapper_1rjym_13 flex w-fit flex-col-reverse&quot; tabindex=&quot;-1&quot;&gt;&lt;table class=&quot;w-fit min-w-(--thread-content-width)&quot; data-end=&quot;4985&quot; data-start=&quot;4235&quot;&gt;&lt;thead data-end=&quot;4304&quot; data-start=&quot;4235&quot;&gt;&lt;tr data-end=&quot;4304&quot; data-start=&quot;4235&quot;&gt;&lt;th data-col-size=&quot;sm&quot; data-end=&quot;4251&quot; data-start=&quot;4235&quot;&gt;Type&lt;/th&gt;&lt;th data-col-size=&quot;sm&quot; data-end=&quot;4266&quot; data-start=&quot;4251&quot;&gt;Pattern&lt;/th&gt;&lt;th data-col-size=&quot;sm&quot; data-end=&quot;4304&quot; data-start=&quot;4266&quot;&gt;Simple Purpose&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody data-end=&quot;4985&quot; data-start=&quot;4374&quot;&gt;&lt;tr data-end=&quot;4441&quot; data-start=&quot;4374&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;4390&quot; data-start=&quot;4374&quot;&gt;Creational&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;4404&quot; data-start=&quot;4390&quot;&gt;Singleton&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;4441&quot; data-start=&quot;4404&quot;&gt;Only one object&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;4509&quot; data-start=&quot;4442&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;4458&quot; data-start=&quot;4442&quot;&gt;&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;4472&quot; data-start=&quot;4458&quot;&gt;Factory&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;4509&quot; data-start=&quot;4472&quot;&gt;Create objects smartly&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;4577&quot; data-start=&quot;4510&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;4526&quot; data-start=&quot;4510&quot;&gt;&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;4540&quot; data-start=&quot;4526&quot;&gt;Builder&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;4577&quot; data-start=&quot;4540&quot;&gt;Build big object step by step&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;4645&quot; data-start=&quot;4578&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;4594&quot; data-start=&quot;4578&quot;&gt;Structural&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;4608&quot; data-start=&quot;4594&quot;&gt;Adapter&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;4645&quot; data-start=&quot;4608&quot;&gt;Connect mismatched classes&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;4713&quot; data-start=&quot;4646&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;4662&quot; data-start=&quot;4646&quot;&gt;&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;4676&quot; data-start=&quot;4662&quot;&gt;Facade&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;4713&quot; data-start=&quot;4676&quot;&gt;Simple front for complex system&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;4781&quot; data-start=&quot;4714&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;4730&quot; data-start=&quot;4714&quot;&gt;&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;4744&quot; data-start=&quot;4730&quot;&gt;Decorator&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;4781&quot; data-start=&quot;4744&quot;&gt;Add features without editing code&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;4849&quot; data-start=&quot;4782&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;4798&quot; data-start=&quot;4782&quot;&gt;Behavioral&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;4812&quot; data-start=&quot;4798&quot;&gt;Observer&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;4849&quot; data-start=&quot;4812&quot;&gt;Notify many when one changes&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;4917&quot; data-start=&quot;4850&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;4866&quot; data-start=&quot;4850&quot;&gt;&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;4880&quot; data-start=&quot;4866&quot;&gt;Strategy&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;4917&quot; data-start=&quot;4880&quot;&gt;Swap algorithms easily&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;4985&quot; data-start=&quot;4918&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;4934&quot; data-start=&quot;4918&quot;&gt;&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;4948&quot; data-start=&quot;4934&quot;&gt;Command&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;4985&quot; data-start=&quot;4948&quot;&gt;Store and run commands later&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;
&lt;hr data-end=&quot;4990&quot; data-start=&quot;4987&quot; /&gt;
&lt;p data-end=&quot;5005&quot; data-start=&quot;4992&quot;&gt;💡 &lt;strong data-end=&quot;5003&quot; data-start=&quot;4995&quot;&gt;Tip:&lt;/strong&gt;&lt;/p&gt;
&lt;ul data-end=&quot;5119&quot; data-is-last-node=&quot;&quot; data-is-only-node=&quot;&quot; data-start=&quot;5006&quot;&gt;
&lt;li data-end=&quot;5047&quot; data-start=&quot;5006&quot;&gt;
&lt;p data-end=&quot;5047&quot; data-start=&quot;5008&quot;&gt;Use patterns only when you need them.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;5119&quot; data-is-last-node=&quot;&quot; data-start=&quot;5048&quot;&gt;
&lt;p data-end=&quot;5119&quot; data-is-last-node=&quot;&quot; data-start=&quot;5050&quot;&gt;They make code &lt;strong data-end=&quot;5074&quot; data-start=&quot;5065&quot;&gt;clean&lt;/strong&gt;, &lt;strong data-end=&quot;5088&quot; data-start=&quot;5076&quot;&gt;flexible&lt;/strong&gt;, and &lt;strong data-end=&quot;5112&quot; data-start=&quot;5094&quot;&gt;easy to change&lt;/strong&gt; later.&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;</content><link rel='replies' type='application/atom+xml' href='http://piushshukla.blogspot.com/feeds/5279416849765624668/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://piushshukla.blogspot.com/2025/09/design-pattern.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2159069551745631737/posts/default/5279416849765624668'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2159069551745631737/posts/default/5279416849765624668'/><link rel='alternate' type='text/html' href='http://piushshukla.blogspot.com/2025/09/design-pattern.html' title='Design Pattern'/><author><name>Piush shukla</name><uri>http://www.blogger.com/profile/16392649283296436146</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2159069551745631737.post-4228650877530416944</id><published>2025-09-22T21:13:00.000-07:00</published><updated>2025-09-22T21:22:08.119-07:00</updated><title type='text'>Parallel Library (TPL)</title><content type='html'>&lt;article class=&quot;text-token-text-primary w-full focus:outline-none scroll-mt-[calc(var(--header-height)+min(200px,max(70px,20svh)))]&quot; data-scroll-anchor=&quot;false&quot; data-testid=&quot;conversation-turn-6&quot; data-turn-id=&quot;10261075-ef73-4c9b-952a-b49190e8d471&quot; data-turn=&quot;assistant&quot; dir=&quot;auto&quot; tabindex=&quot;-1&quot;&gt;&lt;div class=&quot;text-base my-auto mx-auto [--thread-content-margin:--spacing(4)] thread-sm:[--thread-content-margin:--spacing(6)] thread-lg:[--thread-content-margin:--spacing(16)] px-(--thread-content-margin)&quot;&gt;&lt;div class=&quot;[--thread-content-max-width:40rem] thread-lg:[--thread-content-max-width:48rem] mx-auto max-w-(--thread-content-max-width) flex-1 group/turn-messages focus-visible:outline-hidden relative flex w-full min-w-0 flex-col agent-turn&quot; tabindex=&quot;-1&quot;&gt;&lt;div class=&quot;flex max-w-full flex-col grow&quot;&gt;&lt;div class=&quot;min-h-8 text-message relative flex w-full flex-col items-end gap-2 text-start break-words whitespace-normal [.text-message+&amp;amp;]:mt-5&quot; data-message-author-role=&quot;assistant&quot; data-message-id=&quot;4d78c7f1-b0f4-40d6-9352-61a0923a54d2&quot; data-message-model-slug=&quot;gpt-5&quot; dir=&quot;auto&quot;&gt;&lt;div class=&quot;flex w-full flex-col gap-1 empty:hidden first:pt-[3px]&quot;&gt;&lt;div class=&quot;markdown prose dark:prose-invert w-full break-words light markdown-new-styling&quot;&gt;&lt;h2 data-end=&quot;166&quot; data-start=&quot;119&quot;&gt;1️⃣ What Is the Task Parallel Library (TPL)?&lt;/h2&gt;
&lt;ul data-end=&quot;438&quot; data-start=&quot;167&quot;&gt;
&lt;li data-end=&quot;227&quot; data-start=&quot;167&quot;&gt;
&lt;p data-end=&quot;227&quot; data-start=&quot;169&quot;&gt;TPL is part of the &lt;strong data-end=&quot;214&quot; data-start=&quot;188&quot;&gt;System.Threading.Tasks&lt;/strong&gt; namespace.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;354&quot; data-start=&quot;228&quot;&gt;
&lt;p data-end=&quot;354&quot; data-start=&quot;230&quot;&gt;It helps you &lt;strong data-end=&quot;267&quot; data-start=&quot;243&quot;&gt;run code in parallel&lt;/strong&gt; (many things at the same time) or &lt;strong data-end=&quot;320&quot; data-start=&quot;302&quot;&gt;asynchronously&lt;/strong&gt; (not blocking the main thread).&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;438&quot; data-start=&quot;355&quot;&gt;
&lt;p data-end=&quot;438&quot; data-start=&quot;357&quot;&gt;It manages threads for you, so you don’t need to manually create or destroy them.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;443&quot; data-start=&quot;440&quot; /&gt;
&lt;h2 data-end=&quot;464&quot; data-start=&quot;445&quot;&gt;2️⃣ Key Concepts&lt;/h2&gt;
&lt;h3 data-end=&quot;477&quot; data-start=&quot;465&quot;&gt;&lt;strong data-end=&quot;477&quot; data-start=&quot;469&quot;&gt;Task&lt;/strong&gt;&lt;/h3&gt;
&lt;ul data-end=&quot;595&quot; data-start=&quot;478&quot;&gt;
&lt;li data-end=&quot;549&quot; data-start=&quot;478&quot;&gt;
&lt;p data-end=&quot;549&quot; data-start=&quot;480&quot;&gt;Represents a unit of work that runs on a separate thread pool thread.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;595&quot; data-start=&quot;550&quot;&gt;
&lt;p data-end=&quot;595&quot; data-start=&quot;552&quot;&gt;Similar to “a promise to finish some work.”&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;605&quot; data-start=&quot;597&quot;&gt;Example:&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;934&quot; data-start=&quot;606&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-csharp&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;using&lt;/span&gt; System;
&lt;span class=&quot;hljs-keyword&quot;&gt;using&lt;/span&gt; System.Threading.Tasks;

&lt;span class=&quot;hljs-keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;Program&lt;/span&gt;
{
    &lt;span class=&quot;hljs-function&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;static&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;async&lt;/span&gt; Task &lt;span class=&quot;hljs-title&quot;&gt;Main&lt;/span&gt;()
    {
        Task t = Task.Run(() =&amp;gt;
        {
            Console.WriteLine(&lt;span class=&quot;hljs-string&quot;&gt;&quot;Hello from a background task!&quot;&lt;/span&gt;);
        });

        &lt;span class=&quot;hljs-keyword&quot;&gt;await&lt;/span&gt; t; &lt;span class=&quot;hljs-comment&quot;&gt;// waits until t is finished&lt;/span&gt;
        Console.WriteLine(&lt;span class=&quot;hljs-string&quot;&gt;&quot;Task completed.&quot;&lt;/span&gt;);
    }
}
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;hr data-end=&quot;939&quot; data-start=&quot;936&quot; /&gt;
&lt;h2 data-end=&quot;962&quot; data-start=&quot;941&quot;&gt;3️⃣ Starting Tasks&lt;/h2&gt;
&lt;p data-end=&quot;1001&quot; data-start=&quot;963&quot;&gt;You can start tasks in different ways:&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;1100&quot; data-start=&quot;1002&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-csharp&quot;&gt;Task task1 = Task.Run(() =&amp;gt; DoWork());
Task task2 = &lt;span class=&quot;hljs-keyword&quot;&gt;new&lt;/span&gt; Task(DoWork);
task2.Start();
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;p data-end=&quot;1139&quot; data-start=&quot;1101&quot;&gt;&lt;code data-end=&quot;1111&quot; data-start=&quot;1101&quot;&gt;Task.Run&lt;/code&gt; is simpler and recommended.&lt;/p&gt;
&lt;hr data-end=&quot;1144&quot; data-start=&quot;1141&quot; /&gt;
&lt;h2 data-end=&quot;1169&quot; data-start=&quot;1146&quot;&gt;4️⃣ Returning Values&lt;/h2&gt;
&lt;p data-end=&quot;1211&quot; data-start=&quot;1170&quot;&gt;Tasks can return results using &lt;code data-end=&quot;1210&quot; data-start=&quot;1201&quot;&gt;Task&amp;lt;T&amp;gt;&lt;/code&gt;:&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;1333&quot; data-start=&quot;1212&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-csharp&quot;&gt;Task&amp;lt;&lt;span class=&quot;hljs-built_in&quot;&gt;int&lt;/span&gt;&amp;gt; t = Task.Run(() =&amp;gt;
{
    &lt;span class=&quot;hljs-keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-number&quot;&gt;5&lt;/span&gt; + &lt;span class=&quot;hljs-number&quot;&gt;3&lt;/span&gt;;
});

&lt;span class=&quot;hljs-built_in&quot;&gt;int&lt;/span&gt; result = &lt;span class=&quot;hljs-keyword&quot;&gt;await&lt;/span&gt; t;
Console.WriteLine(result); &lt;span class=&quot;hljs-comment&quot;&gt;// 8&lt;/span&gt;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;hr data-end=&quot;1338&quot; data-start=&quot;1335&quot; /&gt;
&lt;h2 data-end=&quot;1369&quot; data-start=&quot;1340&quot;&gt;5️⃣ Waiting for Many Tasks&lt;/h2&gt;
&lt;p data-end=&quot;1402&quot; data-start=&quot;1370&quot;&gt;You can wait for multiple tasks:&lt;/p&gt;
&lt;ul data-end=&quot;1432&quot; data-start=&quot;1404&quot;&gt;
&lt;li data-end=&quot;1432&quot; data-start=&quot;1404&quot;&gt;
&lt;p data-end=&quot;1432&quot; data-start=&quot;1406&quot;&gt;&lt;strong data-end=&quot;1431&quot; data-start=&quot;1406&quot;&gt;All tasks must finish&lt;/strong&gt;:&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;1487&quot; data-start=&quot;1433&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-csharp&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;await&lt;/span&gt; Task.WhenAll(task1, task2, task3);
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;ul data-end=&quot;1518&quot; data-start=&quot;1489&quot;&gt;
&lt;li data-end=&quot;1518&quot; data-start=&quot;1489&quot;&gt;
&lt;p data-end=&quot;1518&quot; data-start=&quot;1491&quot;&gt;&lt;strong data-end=&quot;1517&quot; data-start=&quot;1491&quot;&gt;Any one finishes first&lt;/strong&gt;:&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;1566&quot; data-start=&quot;1519&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-csharp&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;await&lt;/span&gt; Task.WhenAny(task1, task2);
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;hr data-end=&quot;1571&quot; data-start=&quot;1568&quot; /&gt;
&lt;h2 data-end=&quot;1594&quot; data-start=&quot;1573&quot;&gt;6️⃣ Parallel Loops&lt;/h2&gt;
&lt;p data-end=&quot;1641&quot; data-start=&quot;1595&quot;&gt;TPL provides helpers to run loops in parallel:&lt;/p&gt;
&lt;h3 data-end=&quot;1659&quot; data-start=&quot;1643&quot;&gt;Parallel.For&lt;/h3&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;1751&quot; data-start=&quot;1660&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-csharp&quot;&gt;Parallel.For(&lt;span class=&quot;hljs-number&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;hljs-number&quot;&gt;10&lt;/span&gt;, i =&amp;gt;
{
    Console.WriteLine(&lt;span class=&quot;hljs-string&quot;&gt;$&quot;Processing item &lt;span class=&quot;hljs-subst&quot;&gt;{i}&lt;/span&gt;&lt;/span&gt;&quot;);
});
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;h3 data-end=&quot;1773&quot; data-start=&quot;1753&quot;&gt;Parallel.ForEach&lt;/h3&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;1890&quot; data-start=&quot;1774&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-csharp&quot;&gt;&lt;span class=&quot;hljs-built_in&quot;&gt;string&lt;/span&gt;[] names = { &lt;span class=&quot;hljs-string&quot;&gt;&quot;A&quot;&lt;/span&gt;, &lt;span class=&quot;hljs-string&quot;&gt;&quot;B&quot;&lt;/span&gt;, &lt;span class=&quot;hljs-string&quot;&gt;&quot;C&quot;&lt;/span&gt; };
Parallel.ForEach(names, name =&amp;gt;
{
    Console.WriteLine(name);
});
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;p data-end=&quot;1950&quot; data-start=&quot;1892&quot;&gt;These automatically split work across available CPU cores.&lt;/p&gt;
&lt;hr data-end=&quot;1955&quot; data-start=&quot;1952&quot; /&gt;
&lt;h2 data-end=&quot;1983&quot; data-start=&quot;1957&quot;&gt;7️⃣ Handling Exceptions&lt;/h2&gt;
&lt;p data-end=&quot;2015&quot; data-start=&quot;1984&quot;&gt;Use &lt;code data-end=&quot;1999&quot; data-start=&quot;1988&quot;&gt;try/catch&lt;/code&gt; around &lt;code data-end=&quot;2014&quot; data-start=&quot;2007&quot;&gt;await&lt;/code&gt;:&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;2152&quot; data-start=&quot;2016&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-csharp&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;try&lt;/span&gt;
{
    &lt;span class=&quot;hljs-keyword&quot;&gt;await&lt;/span&gt; Task.Run(() =&amp;gt; &lt;span class=&quot;hljs-keyword&quot;&gt;throw&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;new&lt;/span&gt; Exception(&lt;span class=&quot;hljs-string&quot;&gt;&quot;Oops&quot;&lt;/span&gt;));
}
&lt;span class=&quot;hljs-keyword&quot;&gt;catch&lt;/span&gt; (Exception ex)
{
    Console.WriteLine(ex.Message);
}
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;hr data-end=&quot;2157&quot; data-start=&quot;2154&quot; /&gt;
&lt;h2 data-end=&quot;2178&quot; data-start=&quot;2159&quot;&gt;8️⃣ Cancellation&lt;/h2&gt;
&lt;p data-end=&quot;2223&quot; data-start=&quot;2179&quot;&gt;Use &lt;code data-end=&quot;2202&quot; data-start=&quot;2183&quot;&gt;CancellationToken&lt;/code&gt; to stop tasks early.&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;2525&quot; data-start=&quot;2224&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-csharp&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;var&lt;/span&gt; cts = &lt;span class=&quot;hljs-keyword&quot;&gt;new&lt;/span&gt; CancellationTokenSource();
Task t = Task.Run(() =&amp;gt;
{
    &lt;span class=&quot;hljs-keyword&quot;&gt;for&lt;/span&gt; (&lt;span class=&quot;hljs-built_in&quot;&gt;int&lt;/span&gt; i = &lt;span class=&quot;hljs-number&quot;&gt;0&lt;/span&gt;; i &amp;lt; &lt;span class=&quot;hljs-number&quot;&gt;10&lt;/span&gt;; i++)
    {
        cts.Token.ThrowIfCancellationRequested();
        Console.WriteLine(i);
        Task.Delay(&lt;span class=&quot;hljs-number&quot;&gt;500&lt;/span&gt;).Wait();
    }
}, cts.Token);

&lt;span class=&quot;hljs-comment&quot;&gt;// Cancel after 1 second&lt;/span&gt;
cts.CancelAfter(&lt;span class=&quot;hljs-number&quot;&gt;1000&lt;/span&gt;);
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;hr data-end=&quot;2530&quot; data-start=&quot;2527&quot; /&gt;
&lt;h2 data-end=&quot;2553&quot; data-start=&quot;2532&quot;&gt;9️⃣ Best Practices&lt;/h2&gt;
&lt;ul data-end=&quot;2724&quot; data-start=&quot;2554&quot;&gt;
&lt;li data-end=&quot;2608&quot; data-start=&quot;2554&quot;&gt;
&lt;p data-end=&quot;2608&quot; data-start=&quot;2556&quot;&gt;Prefer &lt;code data-end=&quot;2570&quot; data-start=&quot;2563&quot;&gt;await&lt;/code&gt; over &lt;code data-end=&quot;2589&quot; data-start=&quot;2576&quot;&gt;Task.Wait()&lt;/code&gt; to avoid blocking.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2676&quot; data-start=&quot;2609&quot;&gt;
&lt;p data-end=&quot;2676&quot; data-start=&quot;2611&quot;&gt;Avoid creating too many tasks at once; let TPL handle scheduling.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2724&quot; data-start=&quot;2677&quot;&gt;
&lt;p data-end=&quot;2724&quot; data-start=&quot;2679&quot;&gt;Use &lt;code data-end=&quot;2690&quot; data-start=&quot;2683&quot;&gt;async&lt;/code&gt;/&lt;code data-end=&quot;2698&quot; data-start=&quot;2691&quot;&gt;await&lt;/code&gt; for clean, readable code.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;2729&quot; data-start=&quot;2726&quot; /&gt;
&lt;h3 data-end=&quot;2748&quot; data-start=&quot;2731&quot;&gt;Quick Summary&lt;/h3&gt;
&lt;div class=&quot;_tableContainer_1rjym_1&quot;&gt;&lt;div class=&quot;group _tableWrapper_1rjym_13 flex w-fit flex-col-reverse&quot; tabindex=&quot;-1&quot;&gt;&lt;table class=&quot;w-fit min-w-(--thread-content-width)&quot; data-end=&quot;3553&quot; data-start=&quot;2749&quot;&gt;&lt;thead data-end=&quot;2862&quot; data-start=&quot;2749&quot;&gt;&lt;tr data-end=&quot;2862&quot; data-start=&quot;2749&quot;&gt;&lt;th data-col-size=&quot;sm&quot; data-end=&quot;2775&quot; data-start=&quot;2749&quot;&gt;Feature&lt;/th&gt;&lt;th data-col-size=&quot;sm&quot; data-end=&quot;2818&quot; data-start=&quot;2775&quot;&gt;Example&lt;/th&gt;&lt;th data-col-size=&quot;sm&quot; data-end=&quot;2862&quot; data-start=&quot;2818&quot;&gt;Use When&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody data-end=&quot;3553&quot; data-start=&quot;2979&quot;&gt;&lt;tr data-end=&quot;3093&quot; data-start=&quot;2979&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3005&quot; data-start=&quot;2979&quot;&gt;&lt;code data-end=&quot;2991&quot; data-start=&quot;2981&quot;&gt;Task.Run&lt;/code&gt;&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3049&quot; data-start=&quot;3005&quot;&gt;&lt;code data-end=&quot;3030&quot; data-start=&quot;3007&quot;&gt;await Task.Run(Work);&lt;/code&gt;&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3093&quot; data-start=&quot;3049&quot;&gt;Run work in background&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;3208&quot; data-start=&quot;3094&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3120&quot; data-start=&quot;3094&quot;&gt;&lt;code data-end=&quot;3105&quot; data-start=&quot;3096&quot;&gt;Task&amp;lt;T&amp;gt;&lt;/code&gt;&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3164&quot; data-start=&quot;3120&quot;&gt;&lt;code data-end=&quot;3160&quot; data-start=&quot;3122&quot;&gt;var r = await Task.Run(() =&amp;gt; 5 + 3);&lt;/code&gt;&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3208&quot; data-start=&quot;3164&quot;&gt;Need a result from the task&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;3323&quot; data-start=&quot;3209&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3235&quot; data-start=&quot;3209&quot;&gt;&lt;code data-end=&quot;3233&quot; data-start=&quot;3211&quot;&gt;Parallel.For/ForEach&lt;/code&gt;&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3279&quot; data-start=&quot;3235&quot;&gt;&lt;code data-end=&quot;3272&quot; data-start=&quot;3237&quot;&gt;Parallel.For(0, n, i =&amp;gt; Work(i));&lt;/code&gt;&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3323&quot; data-start=&quot;3279&quot;&gt;Process many items in parallel&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;3438&quot; data-start=&quot;3324&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3350&quot; data-start=&quot;3324&quot;&gt;&lt;code data-end=&quot;3340&quot; data-start=&quot;3326&quot;&gt;Task.WhenAll&lt;/code&gt;&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3394&quot; data-start=&quot;3350&quot;&gt;&lt;code data-end=&quot;3381&quot; data-start=&quot;3352&quot;&gt;await Task.WhenAll(t1, t2);&lt;/code&gt;&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3438&quot; data-start=&quot;3394&quot;&gt;Wait for multiple tasks&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;3553&quot; data-start=&quot;3439&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3465&quot; data-start=&quot;3439&quot;&gt;CancellationToken&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3509&quot; data-start=&quot;3465&quot;&gt;&lt;code data-end=&quot;3482&quot; data-start=&quot;3467&quot;&gt;cts.Cancel();&lt;/code&gt;&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3553&quot; data-start=&quot;3509&quot;&gt;Gracefully stop a task if needed&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;
&lt;hr data-end=&quot;3558&quot; data-start=&quot;3555&quot; /&gt;
&lt;p data-end=&quot;3681&quot; data-is-last-node=&quot;&quot; data-is-only-node=&quot;&quot; data-start=&quot;3560&quot;&gt;With these basics, you can start writing parallel or asynchronous code in .NET Core using &lt;strong data-end=&quot;3657&quot; data-start=&quot;3650&quot;&gt;TPL&lt;/strong&gt; safely and effectively.&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;flex min-h-[46px] justify-start&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/article&gt;&lt;article class=&quot;text-token-text-primary w-full focus:outline-none scroll-mt-(--header-height)&quot; data-scroll-anchor=&quot;false&quot; data-testid=&quot;conversation-turn-7&quot; data-turn-id=&quot;3119b821-0e70-48f7-af40-a849be7ab685&quot; data-turn=&quot;user&quot; dir=&quot;auto&quot; tabindex=&quot;-1&quot;&gt;&lt;h5 class=&quot;sr-only&quot;&gt;You said:&lt;/h5&gt;&lt;div class=&quot;text-base my-auto mx-auto pt-12 [--thread-content-margin:--spacing(4)] thread-sm:[--thread-content-margin:--spacing(6)] thread-lg:[--thread-content-margin:--spacing(16)] px-(--thread-content-margin)&quot;&gt;&lt;div class=&quot;[--thread-content-max-width:40rem] thread-lg:[--thread-content-max-width:48rem] mx-auto max-w-(--thread-content-max-width) flex-1 group/turn-messages focus-visible:outline-hidden relative flex w-full min-w-0 flex-col&quot; tabindex=&quot;-1&quot;&gt;&lt;div class=&quot;flex max-w-full flex-col grow&quot;&gt;&lt;div class=&quot;min-h-8 text-message relative flex w-full flex-col items-end gap-2 text-start break-words whitespace-normal [.text-message+&amp;amp;]:mt-5&quot; data-message-author-role=&quot;user&quot; data-message-id=&quot;3119b821-0e70-48f7-af40-a849be7ab685&quot; dir=&quot;auto&quot;&gt;&lt;div class=&quot;flex w-full flex-col gap-1 empty:hidden items-end rtl:items-start&quot;&gt;&lt;div class=&quot;user-message-bubble-color relative rounded-[18px] px-4 py-1.5 data-[multiline]:py-3 max-w-[var(--user-chat-width,70%)]&quot;&gt;&lt;div class=&quot;whitespace-pre-wrap&quot;&gt;more simple and details way &lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;flex justify-end&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/article&gt;&lt;article class=&quot;text-token-text-primary w-full focus:outline-none scroll-mt-[calc(var(--header-height)+min(200px,max(70px,20svh)))]&quot; data-scroll-anchor=&quot;true&quot; data-testid=&quot;conversation-turn-8&quot; data-turn-id=&quot;request-WEB:7a2eb8aa-35c5-4320-b0a7-629b2682b087-3&quot; data-turn=&quot;assistant&quot; dir=&quot;auto&quot; tabindex=&quot;-1&quot;&gt;&lt;h6 class=&quot;sr-only&quot;&gt;ChatGPT said:&lt;/h6&gt;&lt;div class=&quot;text-base my-auto mx-auto pb-10 [--thread-content-margin:--spacing(4)] thread-sm:[--thread-content-margin:--spacing(6)] thread-lg:[--thread-content-margin:--spacing(16)] px-(--thread-content-margin)&quot;&gt;&lt;div class=&quot;[--thread-content-max-width:40rem] thread-lg:[--thread-content-max-width:48rem] mx-auto max-w-(--thread-content-max-width) flex-1 group/turn-messages focus-visible:outline-hidden relative flex w-full min-w-0 flex-col agent-turn&quot; tabindex=&quot;-1&quot;&gt;&lt;div class=&quot;flex max-w-full flex-col grow&quot;&gt;&lt;div class=&quot;min-h-8 text-message relative flex w-full flex-col items-end gap-2 text-start break-words whitespace-normal [.text-message+&amp;amp;]:mt-5&quot; data-message-author-role=&quot;assistant&quot; data-message-id=&quot;68f15080-3ff6-4887-8743-048f098c2230&quot; data-message-model-slug=&quot;gpt-5&quot; dir=&quot;auto&quot;&gt;&lt;div class=&quot;flex w-full flex-col gap-1 empty:hidden first:pt-[3px]&quot;&gt;&lt;div class=&quot;markdown prose dark:prose-invert w-full break-words light markdown-new-styling&quot;&gt;&lt;p data-end=&quot;115&quot; data-start=&quot;0&quot;&gt;Sure! Let’s break the &lt;strong data-end=&quot;53&quot; data-start=&quot;22&quot;&gt;Task Parallel Library (TPL)&lt;/strong&gt; into &lt;strong data-end=&quot;80&quot; data-start=&quot;59&quot;&gt;very simple words&lt;/strong&gt; and add more step-by-step details.&lt;/p&gt;
&lt;hr data-end=&quot;120&quot; data-start=&quot;117&quot; /&gt;
&lt;h2 data-end=&quot;143&quot; data-start=&quot;122&quot;&gt;🟢 1. What is TPL?&lt;/h2&gt;
&lt;ul data-end=&quot;366&quot; data-start=&quot;144&quot;&gt;
&lt;li data-end=&quot;184&quot; data-start=&quot;144&quot;&gt;
&lt;p data-end=&quot;184&quot; data-start=&quot;146&quot;&gt;&lt;strong data-end=&quot;160&quot; data-start=&quot;146&quot;&gt;Full name:&lt;/strong&gt; Task Parallel Library&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;289&quot; data-start=&quot;185&quot;&gt;
&lt;p data-end=&quot;289&quot; data-start=&quot;187&quot;&gt;&lt;strong data-end=&quot;199&quot; data-start=&quot;187&quot;&gt;Purpose:&lt;/strong&gt; Run many pieces of code &lt;strong data-end=&quot;244&quot; data-start=&quot;224&quot;&gt;at the same time&lt;/strong&gt; or &lt;strong data-end=&quot;268&quot; data-start=&quot;248&quot;&gt;without blocking&lt;/strong&gt; your main program.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;366&quot; data-start=&quot;290&quot;&gt;
&lt;p data-end=&quot;366&quot; data-start=&quot;292&quot;&gt;Think of it as asking helpers to finish small jobs while you keep working.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;491&quot; data-start=&quot;368&quot;&gt;Without TPL: you write code → wait → write next code.&lt;br data-end=&quot;424&quot; data-start=&quot;421&quot; /&gt;
With TPL: you write code → ask helpers to do work → you keep going.&lt;/p&gt;
&lt;hr data-end=&quot;496&quot; data-start=&quot;493&quot; /&gt;
&lt;h2 data-end=&quot;531&quot; data-start=&quot;498&quot;&gt;🟢 2. Important Word: &lt;strong data-end=&quot;531&quot; data-start=&quot;523&quot;&gt;Task&lt;/strong&gt;&lt;/h2&gt;
&lt;ul data-end=&quot;638&quot; data-start=&quot;532&quot;&gt;
&lt;li data-end=&quot;578&quot; data-start=&quot;532&quot;&gt;
&lt;p data-end=&quot;578&quot; data-start=&quot;534&quot;&gt;A &lt;strong data-end=&quot;544&quot; data-start=&quot;536&quot;&gt;Task&lt;/strong&gt; is just “a job” for the computer.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;638&quot; data-start=&quot;579&quot;&gt;
&lt;p data-end=&quot;638&quot; data-start=&quot;581&quot;&gt;You tell .NET: &lt;em data-end=&quot;638&quot; data-start=&quot;596&quot;&gt;“Please run this job in the background.”&lt;/em&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;643&quot; data-start=&quot;640&quot; /&gt;
&lt;h2 data-end=&quot;672&quot; data-start=&quot;645&quot;&gt;🟢 3. How to Make a Task&lt;/h2&gt;
&lt;h3 data-end=&quot;701&quot; data-start=&quot;674&quot;&gt;Example 1: Start a task&lt;/h3&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;1021&quot; data-start=&quot;702&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-csharp&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;using&lt;/span&gt; System;
&lt;span class=&quot;hljs-keyword&quot;&gt;using&lt;/span&gt; System.Threading.Tasks;

&lt;span class=&quot;hljs-keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;Program&lt;/span&gt;
{
    &lt;span class=&quot;hljs-function&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;static&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;async&lt;/span&gt; Task &lt;span class=&quot;hljs-title&quot;&gt;Main&lt;/span&gt;()
    {
        Task t = Task.Run(() =&amp;gt;
        {
            Console.WriteLine(&lt;span class=&quot;hljs-string&quot;&gt;&quot;Job running in background&quot;&lt;/span&gt;);
        });

        &lt;span class=&quot;hljs-keyword&quot;&gt;await&lt;/span&gt; t; &lt;span class=&quot;hljs-comment&quot;&gt;// Wait until the job finishes&lt;/span&gt;
        Console.WriteLine(&lt;span class=&quot;hljs-string&quot;&gt;&quot;Job done&quot;&lt;/span&gt;);
    }
}
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;p data-end=&quot;1040&quot; data-start=&quot;1022&quot;&gt;&lt;strong data-end=&quot;1038&quot; data-start=&quot;1022&quot;&gt;Explanation:&lt;/strong&gt;&lt;/p&gt;
&lt;ul data-end=&quot;1107&quot; data-start=&quot;1041&quot;&gt;
&lt;li data-end=&quot;1071&quot; data-start=&quot;1041&quot;&gt;
&lt;p data-end=&quot;1071&quot; data-start=&quot;1043&quot;&gt;&lt;code data-end=&quot;1053&quot; data-start=&quot;1043&quot;&gt;Task.Run&lt;/code&gt; starts the job.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1107&quot; data-start=&quot;1072&quot;&gt;
&lt;p data-end=&quot;1107&quot; data-start=&quot;1074&quot;&gt;&lt;code data-end=&quot;1083&quot; data-start=&quot;1074&quot;&gt;await t&lt;/code&gt; waits until it is done.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;1112&quot; data-start=&quot;1109&quot; /&gt;
&lt;h2 data-end=&quot;1148&quot; data-start=&quot;1114&quot;&gt;🟢 4. Task that Returns a Value&lt;/h2&gt;
&lt;p data-end=&quot;1194&quot; data-start=&quot;1149&quot;&gt;You can get a result back, like a calculator.&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;1323&quot; data-start=&quot;1195&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-csharp&quot;&gt;Task&amp;lt;&lt;span class=&quot;hljs-built_in&quot;&gt;int&lt;/span&gt;&amp;gt; t = Task.Run(() =&amp;gt;
{
    &lt;span class=&quot;hljs-keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-number&quot;&gt;5&lt;/span&gt; + &lt;span class=&quot;hljs-number&quot;&gt;3&lt;/span&gt;;
});

&lt;span class=&quot;hljs-built_in&quot;&gt;int&lt;/span&gt; answer = &lt;span class=&quot;hljs-keyword&quot;&gt;await&lt;/span&gt; t;
Console.WriteLine(answer); &lt;span class=&quot;hljs-comment&quot;&gt;// prints 8&lt;/span&gt;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;p data-end=&quot;1388&quot; data-start=&quot;1324&quot;&gt;Here &lt;code data-end=&quot;1340&quot; data-start=&quot;1329&quot;&gt;Task&amp;lt;int&amp;gt;&lt;/code&gt; means &lt;strong data-end=&quot;1387&quot; data-start=&quot;1347&quot;&gt;the job will give back an int number&lt;/strong&gt;.&lt;/p&gt;
&lt;hr data-end=&quot;1393&quot; data-start=&quot;1390&quot; /&gt;
&lt;h2 data-end=&quot;1427&quot; data-start=&quot;1395&quot;&gt;🟢 5. Run Many Tasks Together&lt;/h2&gt;
&lt;p data-end=&quot;1479&quot; data-start=&quot;1428&quot;&gt;You can start many jobs and wait for all to finish.&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;1685&quot; data-start=&quot;1481&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-csharp&quot;&gt;Task t1 = Task.Run(() =&amp;gt; Console.WriteLine(&lt;span class=&quot;hljs-string&quot;&gt;&quot;Job 1&quot;&lt;/span&gt;));
Task t2 = Task.Run(() =&amp;gt; Console.WriteLine(&lt;span class=&quot;hljs-string&quot;&gt;&quot;Job 2&quot;&lt;/span&gt;));

&lt;span class=&quot;hljs-keyword&quot;&gt;await&lt;/span&gt; Task.WhenAll(t1, t2); &lt;span class=&quot;hljs-comment&quot;&gt;// waits for both&lt;/span&gt;
Console.WriteLine(&lt;span class=&quot;hljs-string&quot;&gt;&quot;All jobs done&quot;&lt;/span&gt;);
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;ul data-end=&quot;1786&quot; data-start=&quot;1687&quot;&gt;
&lt;li data-end=&quot;1731&quot; data-start=&quot;1687&quot;&gt;
&lt;p data-end=&quot;1731&quot; data-start=&quot;1689&quot;&gt;&lt;strong data-end=&quot;1700&quot; data-start=&quot;1689&quot;&gt;WhenAll&lt;/strong&gt; → wait until &lt;strong data-end=&quot;1721&quot; data-start=&quot;1714&quot;&gt;all&lt;/strong&gt; are done.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1786&quot; data-start=&quot;1732&quot;&gt;
&lt;p data-end=&quot;1786&quot; data-start=&quot;1734&quot;&gt;&lt;strong data-end=&quot;1745&quot; data-start=&quot;1734&quot;&gt;WhenAny&lt;/strong&gt; → wait until &lt;strong data-end=&quot;1776&quot; data-start=&quot;1759&quot;&gt;the first one&lt;/strong&gt; finishes.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;1791&quot; data-start=&quot;1788&quot; /&gt;
&lt;h2 data-end=&quot;1816&quot; data-start=&quot;1793&quot;&gt;🟢 6. Parallel Loops&lt;/h2&gt;
&lt;p data-end=&quot;1858&quot; data-start=&quot;1817&quot;&gt;If you want to process many items faster:&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;1939&quot; data-start=&quot;1860&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-csharp&quot;&gt;Parallel.For(&lt;span class=&quot;hljs-number&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;hljs-number&quot;&gt;5&lt;/span&gt;, i =&amp;gt;
{
    Console.WriteLine(&lt;span class=&quot;hljs-string&quot;&gt;$&quot;Item &lt;span class=&quot;hljs-subst&quot;&gt;{i}&lt;/span&gt;&lt;/span&gt;&quot;);
});
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;ul data-end=&quot;1995&quot; data-start=&quot;1940&quot;&gt;
&lt;li data-end=&quot;1995&quot; data-start=&quot;1940&quot;&gt;
&lt;p data-end=&quot;1995&quot; data-start=&quot;1942&quot;&gt;It splits the numbers 0–4 across different CPU cores.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;2007&quot; data-start=&quot;1997&quot;&gt;For lists:&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;2118&quot; data-start=&quot;2008&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-csharp&quot;&gt;&lt;span class=&quot;hljs-built_in&quot;&gt;string&lt;/span&gt;[] names = { &lt;span class=&quot;hljs-string&quot;&gt;&quot;A&quot;&lt;/span&gt;, &lt;span class=&quot;hljs-string&quot;&gt;&quot;B&quot;&lt;/span&gt;, &lt;span class=&quot;hljs-string&quot;&gt;&quot;C&quot;&lt;/span&gt; };
Parallel.ForEach(names, n =&amp;gt;
{
    Console.WriteLine(n);
});
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;hr data-end=&quot;2123&quot; data-start=&quot;2120&quot; /&gt;
&lt;h2 data-end=&quot;2147&quot; data-start=&quot;2125&quot;&gt;🟢 7. Cancel a Task&lt;/h2&gt;
&lt;p data-end=&quot;2189&quot; data-start=&quot;2148&quot;&gt;Sometimes you need to stop a running job.&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;2493&quot; data-start=&quot;2191&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-csharp&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;var&lt;/span&gt; cts = &lt;span class=&quot;hljs-keyword&quot;&gt;new&lt;/span&gt; CancellationTokenSource();

Task t = Task.Run(() =&amp;gt;
{
    &lt;span class=&quot;hljs-keyword&quot;&gt;for&lt;/span&gt; (&lt;span class=&quot;hljs-built_in&quot;&gt;int&lt;/span&gt; i = &lt;span class=&quot;hljs-number&quot;&gt;0&lt;/span&gt;; i &amp;lt; &lt;span class=&quot;hljs-number&quot;&gt;10&lt;/span&gt;; i++)
    {
        cts.Token.ThrowIfCancellationRequested();
        Console.WriteLine(i);
        Task.Delay(&lt;span class=&quot;hljs-number&quot;&gt;500&lt;/span&gt;).Wait();
    }
}, cts.Token);

&lt;span class=&quot;hljs-comment&quot;&gt;// cancel after 1 second&lt;/span&gt;
cts.CancelAfter(&lt;span class=&quot;hljs-number&quot;&gt;1000&lt;/span&gt;);
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;p data-end=&quot;2544&quot; data-start=&quot;2495&quot;&gt;&lt;code data-end=&quot;2520&quot; data-start=&quot;2495&quot;&gt;CancellationTokenSource&lt;/code&gt; sends a signal to stop.&lt;/p&gt;
&lt;hr data-end=&quot;2549&quot; data-start=&quot;2546&quot; /&gt;
&lt;h2 data-end=&quot;2573&quot; data-start=&quot;2551&quot;&gt;🟢 8. Handle Errors&lt;/h2&gt;
&lt;p data-end=&quot;2627&quot; data-start=&quot;2574&quot;&gt;Tasks can throw errors (exceptions). Use &lt;code data-end=&quot;2626&quot; data-start=&quot;2615&quot;&gt;try…catch&lt;/code&gt;:&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;2776&quot; data-start=&quot;2629&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-csharp&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;try&lt;/span&gt;
{
    &lt;span class=&quot;hljs-keyword&quot;&gt;await&lt;/span&gt; Task.Run(() =&amp;gt; &lt;span class=&quot;hljs-keyword&quot;&gt;throw&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;new&lt;/span&gt; Exception(&lt;span class=&quot;hljs-string&quot;&gt;&quot;Something broke&quot;&lt;/span&gt;));
}
&lt;span class=&quot;hljs-keyword&quot;&gt;catch&lt;/span&gt; (Exception ex)
{
    Console.WriteLine(ex.Message);
}
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;hr data-end=&quot;2781&quot; data-start=&quot;2778&quot; /&gt;
&lt;h2 data-end=&quot;2801&quot; data-start=&quot;2783&quot;&gt;🟢 9. Best Tips&lt;/h2&gt;
&lt;ul data-end=&quot;3008&quot; data-start=&quot;2802&quot;&gt;
&lt;li data-end=&quot;2871&quot; data-start=&quot;2802&quot;&gt;
&lt;p data-end=&quot;2871&quot; data-start=&quot;2804&quot;&gt;&lt;strong data-end=&quot;2819&quot; data-start=&quot;2804&quot;&gt;Use &lt;code data-end=&quot;2817&quot; data-start=&quot;2810&quot;&gt;await&lt;/code&gt;&lt;/strong&gt; (not &lt;code data-end=&quot;2836&quot; data-start=&quot;2825&quot;&gt;Task.Wait&lt;/code&gt;) so the main thread isn’t blocked.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2928&quot; data-start=&quot;2872&quot;&gt;
&lt;p data-end=&quot;2928&quot; data-start=&quot;2874&quot;&gt;Let TPL manage threads—you rarely need &lt;code data-end=&quot;2921&quot; data-start=&quot;2913&quot;&gt;Thread&lt;/code&gt; class.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3008&quot; data-start=&quot;2929&quot;&gt;
&lt;p data-end=&quot;3008&quot; data-start=&quot;2931&quot;&gt;Too many tasks at once may slow you down.&lt;br data-end=&quot;2975&quot; data-start=&quot;2972&quot; /&gt;
Start only as many as you need.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;3013&quot; data-start=&quot;3010&quot; /&gt;
&lt;h2 data-end=&quot;3042&quot; data-start=&quot;3015&quot;&gt;🟢 10. Quick Cheat Sheet&lt;/h2&gt;
&lt;div class=&quot;_tableContainer_1rjym_1&quot;&gt;&lt;div class=&quot;group _tableWrapper_1rjym_13 flex w-fit flex-col-reverse&quot; tabindex=&quot;-1&quot;&gt;&lt;table class=&quot;w-fit min-w-(--thread-content-width)&quot; data-end=&quot;3604&quot; data-start=&quot;3044&quot;&gt;&lt;thead data-end=&quot;3113&quot; data-start=&quot;3044&quot;&gt;&lt;tr data-end=&quot;3113&quot; data-start=&quot;3044&quot;&gt;&lt;th data-col-size=&quot;sm&quot; data-end=&quot;3072&quot; data-start=&quot;3044&quot;&gt;Action&lt;/th&gt;&lt;th data-col-size=&quot;sm&quot; data-end=&quot;3113&quot; data-start=&quot;3072&quot;&gt;Code Example&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody data-end=&quot;3604&quot; data-start=&quot;3185&quot;&gt;&lt;tr data-end=&quot;3254&quot; data-start=&quot;3185&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3213&quot; data-start=&quot;3185&quot;&gt;Run simple task&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3254&quot; data-start=&quot;3213&quot;&gt;&lt;code data-end=&quot;3246&quot; data-start=&quot;3215&quot;&gt;await Task.Run(() =&amp;gt; Work());&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;3324&quot; data-start=&quot;3255&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3283&quot; data-start=&quot;3255&quot;&gt;Get result&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3324&quot; data-start=&quot;3283&quot;&gt;&lt;code data-end=&quot;3321&quot; data-start=&quot;3285&quot;&gt;int r = await Task.Run(() =&amp;gt; 5+3);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;3394&quot; data-start=&quot;3325&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3353&quot; data-start=&quot;3325&quot;&gt;Wait for many&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3394&quot; data-start=&quot;3353&quot;&gt;&lt;code data-end=&quot;3384&quot; data-start=&quot;3355&quot;&gt;await Task.WhenAll(t1, t2);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;3464&quot; data-start=&quot;3395&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3423&quot; data-start=&quot;3395&quot;&gt;Loop in parallel&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3464&quot; data-start=&quot;3423&quot;&gt;&lt;code data-end=&quot;3460&quot; data-start=&quot;3425&quot;&gt;Parallel.For(0, n, i =&amp;gt; Work(i));&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;3534&quot; data-start=&quot;3465&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3493&quot; data-start=&quot;3465&quot;&gt;Stop a task&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3534&quot; data-start=&quot;3493&quot;&gt;&lt;code data-end=&quot;3510&quot; data-start=&quot;3495&quot;&gt;cts.Cancel();&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;3604&quot; data-start=&quot;3535&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3563&quot; data-start=&quot;3535&quot;&gt;Handle errors&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3604&quot; data-start=&quot;3563&quot;&gt;&lt;code data-end=&quot;3596&quot; data-start=&quot;3565&quot;&gt;try { await task; } catch { }&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;
&lt;hr data-end=&quot;3609&quot; data-start=&quot;3606&quot; /&gt;
&lt;h3 data-end=&quot;3630&quot; data-start=&quot;3611&quot;&gt;🟢 In One Line:&lt;/h3&gt;
&lt;p data-end=&quot;3760&quot; data-start=&quot;3631&quot;&gt;&lt;strong data-end=&quot;3638&quot; data-start=&quot;3631&quot;&gt;TPL&lt;/strong&gt; = “Ask .NET to run jobs in the background, in parallel, and give you the result when ready—without you managing threads.”&lt;/p&gt;
&lt;p data-end=&quot;3880&quot; data-is-last-node=&quot;&quot; data-is-only-node=&quot;&quot; data-start=&quot;3762&quot;&gt;With these basics and code snippets, you can safely start using &lt;strong data-end=&quot;3851&quot; data-start=&quot;3826&quot;&gt;Task Parallel Library&lt;/strong&gt; in .NET Core with simple C#.&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/article&gt;</content><link rel='replies' type='application/atom+xml' href='http://piushshukla.blogspot.com/feeds/4228650877530416944/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://piushshukla.blogspot.com/2025/09/ask-parallel-library-tpl.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2159069551745631737/posts/default/4228650877530416944'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2159069551745631737/posts/default/4228650877530416944'/><link rel='alternate' type='text/html' href='http://piushshukla.blogspot.com/2025/09/ask-parallel-library-tpl.html' title='Parallel Library (TPL)'/><author><name>Piush shukla</name><uri>http://www.blogger.com/profile/16392649283296436146</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2159069551745631737.post-3059459389457782399</id><published>2025-09-22T09:09:00.000-07:00</published><updated>2025-09-22T09:09:21.546-07:00</updated><title type='text'>.Net Performance Improvement</title><content type='html'>&lt;h2 data-end=&quot;187&quot; data-start=&quot;154&quot;&gt;1️⃣ Optimize Code &amp;amp; Algorithms&lt;/h2&gt;
&lt;ul data-end=&quot;501&quot; data-start=&quot;188&quot;&gt;
&lt;li data-end=&quot;310&quot; data-start=&quot;188&quot;&gt;
&lt;p data-end=&quot;229&quot; data-start=&quot;190&quot;&gt;&lt;strong data-end=&quot;227&quot; data-start=&quot;190&quot;&gt;Choose the right data structures.&lt;/strong&gt;&lt;/p&gt;
&lt;ul data-end=&quot;310&quot; data-start=&quot;232&quot;&gt;
&lt;li data-end=&quot;310&quot; data-start=&quot;232&quot;&gt;
&lt;p data-end=&quot;310&quot; data-start=&quot;234&quot;&gt;Use &lt;code data-end=&quot;247&quot; data-start=&quot;238&quot;&gt;List&amp;lt;T&amp;gt;&lt;/code&gt; instead of &lt;code data-end=&quot;270&quot; data-start=&quot;259&quot;&gt;ArrayList&lt;/code&gt;, &lt;code data-end=&quot;297&quot; data-start=&quot;272&quot;&gt;Dictionary&amp;lt;TKey,TValue&amp;gt;&lt;/code&gt; for lookups.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li data-end=&quot;389&quot; data-start=&quot;311&quot;&gt;
&lt;p data-end=&quot;343&quot; data-start=&quot;313&quot;&gt;&lt;strong data-end=&quot;341&quot; data-start=&quot;313&quot;&gt;Reduce unnecessary work.&lt;/strong&gt;&lt;/p&gt;
&lt;ul data-end=&quot;389&quot; data-start=&quot;346&quot;&gt;
&lt;li data-end=&quot;389&quot; data-start=&quot;346&quot;&gt;
&lt;p data-end=&quot;389&quot; data-start=&quot;348&quot;&gt;Avoid repeated calculations inside loops.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li data-end=&quot;501&quot; data-start=&quot;390&quot;&gt;
&lt;p data-end=&quot;421&quot; data-start=&quot;392&quot;&gt;&lt;strong data-end=&quot;419&quot; data-start=&quot;392&quot;&gt;Use async/await for I/O&lt;/strong&gt;&lt;/p&gt;
&lt;ul data-end=&quot;501&quot; data-start=&quot;424&quot;&gt;
&lt;li data-end=&quot;501&quot; data-start=&quot;424&quot;&gt;
&lt;p data-end=&quot;501&quot; data-start=&quot;426&quot;&gt;Let the thread handle other requests while waiting for database or network.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;506&quot; data-start=&quot;503&quot; /&gt;
&lt;h2 data-end=&quot;536&quot; data-start=&quot;508&quot;&gt;2️⃣ Manage Memory Smartly&lt;/h2&gt;
&lt;ul data-end=&quot;865&quot; data-start=&quot;537&quot;&gt;
&lt;li data-end=&quot;644&quot; data-start=&quot;537&quot;&gt;
&lt;p data-end=&quot;644&quot; data-start=&quot;539&quot;&gt;&lt;strong data-end=&quot;558&quot; data-start=&quot;539&quot;&gt;Dispose objects&lt;/strong&gt; implementing &lt;code data-end=&quot;585&quot; data-start=&quot;572&quot;&gt;IDisposable&lt;/code&gt; (e.g., &lt;code data-end=&quot;608&quot; data-start=&quot;593&quot;&gt;SqlConnection&lt;/code&gt;, &lt;code data-end=&quot;622&quot; data-start=&quot;610&quot;&gt;FileStream&lt;/code&gt;) with &lt;code data-end=&quot;636&quot; data-start=&quot;629&quot;&gt;using&lt;/code&gt; blocks.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;788&quot; data-start=&quot;645&quot;&gt;
&lt;p data-end=&quot;672&quot; data-start=&quot;647&quot;&gt;&lt;strong data-end=&quot;670&quot; data-start=&quot;647&quot;&gt;Avoid memory leaks.&lt;/strong&gt;&lt;/p&gt;
&lt;ul data-end=&quot;788&quot; data-start=&quot;675&quot;&gt;
&lt;li data-end=&quot;701&quot; data-start=&quot;675&quot;&gt;
&lt;p data-end=&quot;701&quot; data-start=&quot;677&quot;&gt;Unsubscribe from events.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;788&quot; data-start=&quot;704&quot;&gt;
&lt;p data-end=&quot;788&quot; data-start=&quot;706&quot;&gt;Remove references you no longer need so the Garbage Collector (GC) can clean them.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li data-end=&quot;865&quot; data-start=&quot;789&quot;&gt;
&lt;p data-end=&quot;865&quot; data-start=&quot;791&quot;&gt;&lt;strong data-end=&quot;813&quot; data-start=&quot;791&quot;&gt;Use object pooling&lt;/strong&gt; (e.g., &lt;code data-end=&quot;835&quot; data-start=&quot;821&quot;&gt;ArrayPool&amp;lt;T&amp;gt;&lt;/code&gt;) for frequently used buffers.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;870&quot; data-start=&quot;867&quot; /&gt;
&lt;h2 data-end=&quot;902&quot; data-start=&quot;872&quot;&gt;3️⃣ Improve Database Access&lt;/h2&gt;
&lt;ul data-end=&quot;1152&quot; data-start=&quot;903&quot;&gt;
&lt;li data-end=&quot;957&quot; data-start=&quot;903&quot;&gt;
&lt;p data-end=&quot;957&quot; data-start=&quot;905&quot;&gt;&lt;strong data-end=&quot;934&quot; data-start=&quot;905&quot;&gt;Use async EF Core methods&lt;/strong&gt; (&lt;code data-end=&quot;949&quot; data-start=&quot;936&quot;&gt;ToListAsync&lt;/code&gt;, etc.).&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1035&quot; data-start=&quot;958&quot;&gt;
&lt;p data-end=&quot;1035&quot; data-start=&quot;960&quot;&gt;&lt;strong data-end=&quot;980&quot; data-start=&quot;960&quot;&gt;Optimize queries&lt;/strong&gt;: fetch only what you need (&lt;code data-end=&quot;1016&quot; data-start=&quot;1008&quot;&gt;SELECT&lt;/code&gt; specific columns).&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1101&quot; data-start=&quot;1036&quot;&gt;
&lt;p data-end=&quot;1101&quot; data-start=&quot;1038&quot;&gt;&lt;strong data-end=&quot;1068&quot; data-start=&quot;1038&quot;&gt;Cache frequently used data&lt;/strong&gt; (e.g., with MemoryCache, Redis).&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1152&quot; data-start=&quot;1102&quot;&gt;
&lt;p data-end=&quot;1152&quot; data-start=&quot;1104&quot;&gt;&lt;strong data-end=&quot;1130&quot; data-start=&quot;1104&quot;&gt;Use connection pooling&lt;/strong&gt; (default in ADO.NET).&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;1157&quot; data-start=&quot;1154&quot; /&gt;
&lt;h2 data-end=&quot;1184&quot; data-start=&quot;1159&quot;&gt;4️⃣ Caching Strategies&lt;/h2&gt;
&lt;ul data-end=&quot;1421&quot; data-start=&quot;1185&quot;&gt;
&lt;li data-end=&quot;1283&quot; data-start=&quot;1185&quot;&gt;
&lt;p data-end=&quot;1236&quot; data-start=&quot;1187&quot;&gt;&lt;strong data-end=&quot;1206&quot; data-start=&quot;1187&quot;&gt;In-memory cache&lt;/strong&gt; for small/fast-changing data:&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;1283&quot; data-start=&quot;1239&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-csharp&quot;&gt;services.AddMemoryCache();
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1350&quot; data-start=&quot;1284&quot;&gt;
&lt;p data-end=&quot;1350&quot; data-start=&quot;1286&quot;&gt;&lt;strong data-end=&quot;1307&quot; data-start=&quot;1286&quot;&gt;Distributed cache&lt;/strong&gt; like Redis for web farms or microservices.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1421&quot; data-start=&quot;1351&quot;&gt;
&lt;p data-end=&quot;1421&quot; data-start=&quot;1353&quot;&gt;Cache heavy results (like product lists) to reduce repeated DB hits.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;1426&quot; data-start=&quot;1423&quot; /&gt;
&lt;h2 data-end=&quot;1466&quot; data-start=&quot;1428&quot;&gt;5️⃣ Configure the Garbage Collector&lt;/h2&gt;
&lt;ul data-end=&quot;1665&quot; data-start=&quot;1467&quot;&gt;
&lt;li data-end=&quot;1572&quot; data-start=&quot;1467&quot;&gt;
&lt;p data-end=&quot;1572&quot; data-start=&quot;1469&quot;&gt;Prefer &lt;strong data-end=&quot;1489&quot; data-start=&quot;1476&quot;&gt;Server GC&lt;/strong&gt; for web/multi-core servers (&lt;code data-end=&quot;1546&quot; data-start=&quot;1518&quot;&gt;&amp;lt;gcServer enabled=&quot;true&quot;/&amp;gt;&lt;/code&gt; in &lt;code data-end=&quot;1570&quot; data-start=&quot;1550&quot;&gt;runtimeconfig.json&lt;/code&gt;).&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1665&quot; data-start=&quot;1573&quot;&gt;
&lt;p data-end=&quot;1665&quot; data-start=&quot;1575&quot;&gt;Minimize &lt;strong data-end=&quot;1605&quot; data-start=&quot;1584&quot;&gt;large object heap&lt;/strong&gt; allocations (avoid repeatedly creating big arrays/strings).&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;1670&quot; data-start=&quot;1667&quot; /&gt;
&lt;h2 data-end=&quot;1717&quot; data-start=&quot;1672&quot;&gt;6️⃣ Use Asynchronous &amp;amp; Parallel Processing&lt;/h2&gt;
&lt;ul data-end=&quot;1874&quot; data-start=&quot;1718&quot;&gt;
&lt;li data-end=&quot;1805&quot; data-start=&quot;1718&quot;&gt;
&lt;p data-end=&quot;1805&quot; data-start=&quot;1720&quot;&gt;Use &lt;code data-end=&quot;1734&quot; data-start=&quot;1724&quot;&gt;Task.Run&lt;/code&gt;, &lt;code data-end=&quot;1754&quot; data-start=&quot;1736&quot;&gt;Parallel.ForEach&lt;/code&gt;, or &lt;code data-end=&quot;1773&quot; data-start=&quot;1759&quot;&gt;TPL Dataflow&lt;/code&gt; when tasks can run in parallel.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1874&quot; data-start=&quot;1806&quot;&gt;
&lt;p data-end=&quot;1874&quot; data-start=&quot;1808&quot;&gt;Avoid blocking calls like &lt;code data-end=&quot;1843&quot; data-start=&quot;1834&quot;&gt;.Result&lt;/code&gt; or &lt;code data-end=&quot;1856&quot; data-start=&quot;1847&quot;&gt;.Wait()&lt;/code&gt; on async methods.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;1879&quot; data-start=&quot;1876&quot; /&gt;
&lt;h2 data-end=&quot;1914&quot; data-start=&quot;1881&quot;&gt;7️⃣ Tune ASP.NET Core Settings&lt;/h2&gt;
&lt;ul data-end=&quot;2173&quot; data-start=&quot;1915&quot;&gt;
&lt;li data-end=&quot;1975&quot; data-start=&quot;1915&quot;&gt;
&lt;p data-end=&quot;1975&quot; data-start=&quot;1917&quot;&gt;&lt;strong data-end=&quot;1941&quot; data-start=&quot;1917&quot;&gt;Response Compression&lt;/strong&gt; middleware for smaller responses.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2044&quot; data-start=&quot;1976&quot;&gt;
&lt;p data-end=&quot;2044&quot; data-start=&quot;1978&quot;&gt;&lt;strong data-end=&quot;1989&quot; data-start=&quot;1978&quot;&gt;Kestrel&lt;/strong&gt; tuning: increase max concurrent connections if needed.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2097&quot; data-start=&quot;2045&quot;&gt;
&lt;p data-end=&quot;2097&quot; data-start=&quot;2047&quot;&gt;Enable &lt;strong data-end=&quot;2064&quot; data-start=&quot;2054&quot;&gt;HTTP/2&lt;/strong&gt; for faster multiplexed requests.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2173&quot; data-start=&quot;2098&quot;&gt;
&lt;p data-end=&quot;2173&quot; data-start=&quot;2100&quot;&gt;Use &lt;code data-end=&quot;2120&quot; data-start=&quot;2104&quot;&gt;IHostedService&lt;/code&gt; for background work instead of blocking controllers.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;2178&quot; data-start=&quot;2175&quot; /&gt;
&lt;h2 data-end=&quot;2218&quot; data-start=&quot;2180&quot;&gt;8️⃣ Minimize Serialization Overhead&lt;/h2&gt;
&lt;ul data-end=&quot;2317&quot; data-start=&quot;2219&quot;&gt;
&lt;li data-end=&quot;2274&quot; data-start=&quot;2219&quot;&gt;
&lt;p data-end=&quot;2274&quot; data-start=&quot;2221&quot;&gt;Use &lt;code data-end=&quot;2243&quot; data-start=&quot;2225&quot;&gt;System.Text.Json&lt;/code&gt; (faster than Newtonsoft.Json).&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2317&quot; data-start=&quot;2275&quot;&gt;
&lt;p data-end=&quot;2317&quot; data-start=&quot;2277&quot;&gt;Reuse &lt;code data-end=&quot;2306&quot; data-start=&quot;2283&quot;&gt;JsonSerializerOptions&lt;/code&gt; instances.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;2322&quot; data-start=&quot;2319&quot; /&gt;
&lt;h2 data-end=&quot;2369&quot; data-start=&quot;2324&quot;&gt;9️⃣ Frontend / Network Tips (for web apps)&lt;/h2&gt;
&lt;ul data-end=&quot;2483&quot; data-start=&quot;2370&quot;&gt;
&lt;li data-end=&quot;2407&quot; data-start=&quot;2370&quot;&gt;
&lt;p data-end=&quot;2407&quot; data-start=&quot;2372&quot;&gt;Enable &lt;strong data-end=&quot;2406&quot; data-start=&quot;2379&quot;&gt;gzip/brotli compression&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2439&quot; data-start=&quot;2408&quot;&gt;
&lt;p data-end=&quot;2439&quot; data-start=&quot;2410&quot;&gt;Use &lt;strong data-end=&quot;2421&quot; data-start=&quot;2414&quot;&gt;CDN&lt;/strong&gt; for static files.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2483&quot; data-start=&quot;2440&quot;&gt;
&lt;p data-end=&quot;2483&quot; data-start=&quot;2442&quot;&gt;Cache static content with proper headers.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;2488&quot; data-start=&quot;2485&quot; /&gt;
&lt;h2 data-end=&quot;2518&quot; data-start=&quot;2490&quot;&gt;🔟 Profiling &amp;amp; Monitoring&lt;/h2&gt;
&lt;ul data-end=&quot;2791&quot; data-start=&quot;2519&quot;&gt;
&lt;li data-end=&quot;2733&quot; data-start=&quot;2519&quot;&gt;
&lt;p data-end=&quot;2536&quot; data-start=&quot;2521&quot;&gt;Use tools like:&lt;/p&gt;
&lt;ul data-end=&quot;2733&quot; data-start=&quot;2539&quot;&gt;
&lt;li data-end=&quot;2587&quot; data-start=&quot;2539&quot;&gt;
&lt;p data-end=&quot;2587&quot; data-start=&quot;2541&quot;&gt;&lt;strong data-end=&quot;2575&quot; data-start=&quot;2541&quot;&gt;dotnet-trace / dotnet-counters&lt;/strong&gt; (built-in).&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2663&quot; data-start=&quot;2590&quot;&gt;
&lt;p data-end=&quot;2663&quot; data-start=&quot;2592&quot;&gt;&lt;strong data-end=&quot;2604&quot; data-start=&quot;2592&quot;&gt;PerfView&lt;/strong&gt;, &lt;strong data-end=&quot;2634&quot; data-start=&quot;2606&quot;&gt;JetBrains Rider profiler&lt;/strong&gt;, &lt;strong data-end=&quot;2662&quot; data-start=&quot;2636&quot;&gt;Visual Studio Profiler&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2733&quot; data-start=&quot;2666&quot;&gt;
&lt;p data-end=&quot;2733&quot; data-start=&quot;2668&quot;&gt;&lt;strong data-end=&quot;2692&quot; data-start=&quot;2668&quot;&gt;Application Insights&lt;/strong&gt; or &lt;strong data-end=&quot;2718&quot; data-start=&quot;2696&quot;&gt;Prometheus/Grafana&lt;/strong&gt; in production.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2791&quot; data-start=&quot;2734&quot;&gt;
&lt;p data-end=&quot;2791&quot; data-start=&quot;2736&quot;&gt;Identify slow methods, memory leaks, or high CPU usage.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;2796&quot; data-start=&quot;2793&quot; /&gt;
&lt;h2 data-end=&quot;2826&quot; data-start=&quot;2798&quot;&gt;1️⃣1️⃣ Deployment &amp;amp; Build&lt;/h2&gt;
&lt;ul data-end=&quot;3054&quot; data-start=&quot;2827&quot;&gt;
&lt;li data-end=&quot;2862&quot; data-start=&quot;2827&quot;&gt;
&lt;p data-end=&quot;2862&quot; data-start=&quot;2829&quot;&gt;Use &lt;strong data-end=&quot;2850&quot; data-start=&quot;2833&quot;&gt;Release build&lt;/strong&gt;, not Debug.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2917&quot; data-start=&quot;2863&quot;&gt;
&lt;p data-end=&quot;2917&quot; data-start=&quot;2865&quot;&gt;Enable &lt;strong data-end=&quot;2886&quot; data-start=&quot;2872&quot;&gt;ReadyToRun&lt;/strong&gt; or &lt;strong data-end=&quot;2902&quot; data-start=&quot;2890&quot;&gt;Crossgen&lt;/strong&gt; to precompile.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2993&quot; data-start=&quot;2918&quot;&gt;
&lt;p data-end=&quot;2993&quot; data-start=&quot;2920&quot;&gt;Consider &lt;strong data-end=&quot;2952&quot; data-start=&quot;2929&quot;&gt;Ahead-of-Time (AOT)&lt;/strong&gt; for .NET 8+ if startup time is critical.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3054&quot; data-start=&quot;2994&quot;&gt;
&lt;p data-end=&quot;3054&quot; data-start=&quot;2996&quot;&gt;Publish as &lt;strong data-end=&quot;3025&quot; data-start=&quot;3007&quot;&gt;self-contained&lt;/strong&gt; to control runtime versions.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;3059&quot; data-start=&quot;3056&quot; /&gt;
&lt;h2 data-end=&quot;3081&quot; data-start=&quot;3061&quot;&gt;✅ Quick Checklist&lt;/h2&gt;
&lt;div class=&quot;_tableContainer_1rjym_1&quot;&gt;&lt;div class=&quot;group _tableWrapper_1rjym_13 flex w-fit flex-col-reverse&quot; tabindex=&quot;-1&quot;&gt;&lt;table class=&quot;w-fit min-w-(--thread-content-width)&quot; data-end=&quot;3701&quot; data-start=&quot;3083&quot;&gt;&lt;thead data-end=&quot;3158&quot; data-start=&quot;3083&quot;&gt;&lt;tr data-end=&quot;3158&quot; data-start=&quot;3083&quot;&gt;&lt;th data-col-size=&quot;sm&quot; data-end=&quot;3104&quot; data-start=&quot;3083&quot;&gt;Area&lt;/th&gt;&lt;th data-col-size=&quot;md&quot; data-end=&quot;3158&quot; data-start=&quot;3104&quot;&gt;Tip&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody data-end=&quot;3701&quot; data-start=&quot;3236&quot;&gt;&lt;tr data-end=&quot;3312&quot; data-start=&quot;3236&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3256&quot; data-start=&quot;3236&quot;&gt;&lt;strong data-end=&quot;3246&quot; data-start=&quot;3238&quot;&gt;Code&lt;/strong&gt;&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;3312&quot; data-start=&quot;3256&quot;&gt;Minimize loops, use async I/O&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;3389&quot; data-start=&quot;3313&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3333&quot; data-start=&quot;3313&quot;&gt;&lt;strong data-end=&quot;3325&quot; data-start=&quot;3315&quot;&gt;Memory&lt;/strong&gt;&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;3389&quot; data-start=&quot;3333&quot;&gt;Dispose, avoid leaks, object pool&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;3466&quot; data-start=&quot;3390&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3410&quot; data-start=&quot;3390&quot;&gt;&lt;strong data-end=&quot;3404&quot; data-start=&quot;3392&quot;&gt;Database&lt;/strong&gt;&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;3466&quot; data-start=&quot;3410&quot;&gt;Optimize queries, cache results&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;3543&quot; data-start=&quot;3467&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3487&quot; data-start=&quot;3467&quot;&gt;&lt;strong data-end=&quot;3480&quot; data-start=&quot;3469&quot;&gt;Caching&lt;/strong&gt;&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;3543&quot; data-start=&quot;3487&quot;&gt;MemoryCache or Redis&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;3620&quot; data-start=&quot;3544&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3564&quot; data-start=&quot;3544&quot;&gt;&lt;strong data-end=&quot;3557&quot; data-start=&quot;3546&quot;&gt;Web/API&lt;/strong&gt;&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;3620&quot; data-start=&quot;3564&quot;&gt;Response compression, HTTP/2, Kestrel tuning&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;3701&quot; data-start=&quot;3621&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3641&quot; data-start=&quot;3621&quot;&gt;&lt;strong data-end=&quot;3636&quot; data-start=&quot;3623&quot;&gt;Profiling&lt;/strong&gt;&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;3701&quot; data-start=&quot;3641&quot;&gt;Use dotnet-counters, Visual Studio, Application Insights&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;
&lt;hr data-end=&quot;3706&quot; data-start=&quot;3703&quot; /&gt;
&lt;h3 data-end=&quot;3727&quot; data-start=&quot;3708&quot;&gt;🏁 Key Takeaway&lt;/h3&gt;
&lt;p data-end=&quot;3751&quot; data-start=&quot;3728&quot;&gt;Performance comes from:&lt;/p&gt;
&lt;ol data-end=&quot;3922&quot; data-start=&quot;3752&quot;&gt;
&lt;li data-end=&quot;3802&quot; data-start=&quot;3752&quot;&gt;
&lt;p data-end=&quot;3802&quot; data-start=&quot;3755&quot;&gt;&lt;strong data-end=&quot;3773&quot; data-start=&quot;3755&quot;&gt;Efficient code&lt;/strong&gt; (algorithms + async/await)&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3864&quot; data-start=&quot;3803&quot;&gt;
&lt;p data-end=&quot;3864&quot; data-start=&quot;3806&quot;&gt;&lt;strong data-end=&quot;3834&quot; data-start=&quot;3806&quot;&gt;Optimized resource usage&lt;/strong&gt; (memory, database, network)&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3922&quot; data-start=&quot;3865&quot;&gt;
&lt;p data-end=&quot;3922&quot; data-start=&quot;3868&quot;&gt;&lt;strong data-end=&quot;3896&quot; data-start=&quot;3868&quot;&gt;Monitoring and profiling&lt;/strong&gt; to find real bottlenecks.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p data-end=&quot;4019&quot; data-is-last-node=&quot;&quot; data-is-only-node=&quot;&quot; data-start=&quot;3924&quot;&gt;Focus first on &lt;strong data-end=&quot;3952&quot; data-start=&quot;3939&quot;&gt;measuring&lt;/strong&gt; (profiling), then apply these improvements where they matter most.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://piushshukla.blogspot.com/feeds/3059459389457782399/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://piushshukla.blogspot.com/2025/09/net-performance-improvement.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2159069551745631737/posts/default/3059459389457782399'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2159069551745631737/posts/default/3059459389457782399'/><link rel='alternate' type='text/html' href='http://piushshukla.blogspot.com/2025/09/net-performance-improvement.html' title='.Net Performance Improvement'/><author><name>Piush shukla</name><uri>http://www.blogger.com/profile/16392649283296436146</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2159069551745631737.post-1248409851644332981</id><published>2025-09-22T09:06:00.000-07:00</published><updated>2025-09-22T09:06:08.622-07:00</updated><title type='text'>Lazy Loading </title><content type='html'>&lt;h2 data-end=&quot;143&quot; data-start=&quot;105&quot;&gt;💡 What is Lazy Loading in General?&lt;/h2&gt;
&lt;p data-end=&quot;218&quot; data-start=&quot;144&quot;&gt;Lazy loading means &lt;strong data-end=&quot;216&quot; data-start=&quot;163&quot;&gt;“load or create something only when it’s needed.”&lt;/strong&gt;&lt;/p&gt;
&lt;ul data-end=&quot;329&quot; data-start=&quot;219&quot;&gt;
&lt;li data-end=&quot;276&quot; data-start=&quot;219&quot;&gt;
&lt;p data-end=&quot;276&quot; data-start=&quot;221&quot;&gt;🕑 &lt;strong data-end=&quot;239&quot; data-start=&quot;224&quot;&gt;Not upfront&lt;/strong&gt;: Don’t load everything at the start.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;329&quot; data-start=&quot;277&quot;&gt;
&lt;p data-end=&quot;329&quot; data-start=&quot;279&quot;&gt;✅ &lt;strong data-end=&quot;294&quot; data-start=&quot;281&quot;&gt;On demand&lt;/strong&gt;: Load it the moment it’s required.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;376&quot; data-start=&quot;331&quot;&gt;This saves &lt;strong data-end=&quot;375&quot; data-start=&quot;342&quot;&gt;memory, CPU, and startup time&lt;/strong&gt;.&lt;/p&gt;
&lt;hr data-end=&quot;381&quot; data-start=&quot;378&quot; /&gt;
&lt;h1 data-end=&quot;406&quot; data-start=&quot;383&quot;&gt;🟢 Lazy Loading in C#&lt;/h1&gt;
&lt;h3 data-end=&quot;418&quot; data-start=&quot;408&quot;&gt;✅ Idea&lt;/h3&gt;
&lt;p data-end=&quot;533&quot; data-start=&quot;419&quot;&gt;In C#, lazy loading means &lt;strong data-end=&quot;532&quot; data-start=&quot;445&quot;&gt;delay the creation or loading of an object until the first time you actually use it&lt;/strong&gt;.&lt;/p&gt;
&lt;h3 data-end=&quot;562&quot; data-start=&quot;535&quot;&gt;🔎 Example Without Lazy&lt;/h3&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;746&quot; data-start=&quot;563&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-csharp&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;Customer&lt;/span&gt; {
    &lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; CustomerProfile Profile { &lt;span class=&quot;hljs-keyword&quot;&gt;get&lt;/span&gt;; &lt;span class=&quot;hljs-keyword&quot;&gt;set&lt;/span&gt;; }

    &lt;span class=&quot;hljs-function&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;Customer&lt;/span&gt;() {
        Profile = &lt;span class=&quot;hljs-keyword&quot;&gt;new&lt;/span&gt; CustomerProfile(); &lt;span class=&quot;hljs-comment&quot;&gt;// Created immediately&lt;/span&gt;
    }
}
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;p data-end=&quot;793&quot; data-start=&quot;747&quot;&gt;Even if you never use &lt;code data-end=&quot;778&quot; data-start=&quot;769&quot;&gt;Profile&lt;/code&gt;, it’s created.&lt;/p&gt;
&lt;hr data-end=&quot;798&quot; data-start=&quot;795&quot; /&gt;
&lt;h3 data-end=&quot;814&quot; data-start=&quot;800&quot;&gt;🔑 Lazy&amp;lt;T&amp;gt;&lt;/h3&gt;
&lt;p data-end=&quot;884&quot; data-start=&quot;815&quot;&gt;The &lt;code data-end=&quot;828&quot; data-start=&quot;819&quot;&gt;Lazy&amp;lt;T&amp;gt;&lt;/code&gt; class lets you create an object &lt;strong data-end=&quot;883&quot; data-start=&quot;861&quot;&gt;only when accessed&lt;/strong&gt;.&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;1081&quot; data-start=&quot;886&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-csharp&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;Customer&lt;/span&gt;
{
    &lt;span class=&quot;hljs-keyword&quot;&gt;private&lt;/span&gt; Lazy&amp;lt;CustomerProfile&amp;gt; _profile = &lt;span class=&quot;hljs-keyword&quot;&gt;new&lt;/span&gt; Lazy&amp;lt;CustomerProfile&amp;gt;(() =&amp;gt; &lt;span class=&quot;hljs-keyword&quot;&gt;new&lt;/span&gt; CustomerProfile());

    &lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; CustomerProfile Profile =&amp;gt; _profile.Value;
}
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;ul data-end=&quot;1323&quot; data-start=&quot;1083&quot;&gt;
&lt;li data-end=&quot;1240&quot; data-start=&quot;1083&quot;&gt;
&lt;p data-end=&quot;1240&quot; data-start=&quot;1085&quot;&gt;&lt;code data-end=&quot;1141&quot; data-start=&quot;1085&quot;&gt;new Lazy&amp;lt;CustomerProfile&amp;gt;(() =&amp;gt; new CustomerProfile())&lt;/code&gt;&lt;br data-end=&quot;1144&quot; data-start=&quot;1141&quot; /&gt;
means: &lt;em data-end=&quot;1240&quot; data-start=&quot;1153&quot;&gt;“Don’t create &lt;code data-end=&quot;1185&quot; data-start=&quot;1168&quot;&gt;CustomerProfile&lt;/code&gt; now. Create it only when &lt;code data-end=&quot;1219&quot; data-start=&quot;1211&quot;&gt;.Value&lt;/code&gt; is first accessed.”&lt;/em&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1323&quot; data-start=&quot;1242&quot;&gt;
&lt;p data-end=&quot;1323&quot; data-start=&quot;1244&quot;&gt;If you never call &lt;code data-end=&quot;1271&quot; data-start=&quot;1262&quot;&gt;Profile&lt;/code&gt;, the &lt;code data-end=&quot;1294&quot; data-start=&quot;1277&quot;&gt;CustomerProfile&lt;/code&gt; object is &lt;strong data-end=&quot;1322&quot; data-start=&quot;1305&quot;&gt;never created&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;1328&quot; data-start=&quot;1325&quot; /&gt;
&lt;h3 data-end=&quot;1353&quot; data-start=&quot;1330&quot;&gt;🏗️ Where It’s Used&lt;/h3&gt;
&lt;ul data-end=&quot;1514&quot; data-start=&quot;1354&quot;&gt;
&lt;li data-end=&quot;1437&quot; data-start=&quot;1354&quot;&gt;
&lt;p data-end=&quot;1437&quot; data-start=&quot;1356&quot;&gt;Loading related data in Entity Framework (Lazy Loading of navigation properties).&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1488&quot; data-start=&quot;1438&quot;&gt;
&lt;p data-end=&quot;1488&quot; data-start=&quot;1440&quot;&gt;Heavy objects like configuration data or images.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1514&quot; data-start=&quot;1489&quot;&gt;
&lt;p data-end=&quot;1514&quot; data-start=&quot;1491&quot;&gt;Expensive computations.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;1519&quot; data-start=&quot;1516&quot; /&gt;
&lt;h1 data-end=&quot;1549&quot; data-start=&quot;1521&quot;&gt;🟠 Lazy Loading in Angular&lt;/h1&gt;
&lt;h3 data-end=&quot;1561&quot; data-start=&quot;1551&quot;&gt;✅ Idea&lt;/h3&gt;
&lt;p data-end=&quot;1737&quot; data-start=&quot;1562&quot;&gt;In Angular, lazy loading means &lt;strong data-end=&quot;1686&quot; data-start=&quot;1593&quot;&gt;load feature modules (or components) only when the user navigates to that part of the app&lt;/strong&gt;—instead of loading the entire app code at startup.&lt;/p&gt;
&lt;h3 data-end=&quot;1751&quot; data-start=&quot;1739&quot;&gt;🏎️ Why?&lt;/h3&gt;
&lt;ul data-end=&quot;1855&quot; data-start=&quot;1752&quot;&gt;
&lt;li data-end=&quot;1820&quot; data-start=&quot;1752&quot;&gt;
&lt;p data-end=&quot;1820&quot; data-start=&quot;1754&quot;&gt;&lt;strong data-end=&quot;1777&quot; data-start=&quot;1754&quot;&gt;Faster initial load&lt;/strong&gt;: Only the code for the current page loads.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1855&quot; data-start=&quot;1821&quot;&gt;
&lt;p data-end=&quot;1855&quot; data-start=&quot;1823&quot;&gt;Better performance for big apps.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;1860&quot; data-start=&quot;1857&quot; /&gt;
&lt;h3 data-end=&quot;1897&quot; data-start=&quot;1862&quot;&gt;🔎 Example Without Lazy Loading&lt;/h3&gt;
&lt;p data-end=&quot;1940&quot; data-start=&quot;1898&quot;&gt;In &lt;code data-end=&quot;1916&quot; data-start=&quot;1901&quot;&gt;app.module.ts&lt;/code&gt; you import all modules:&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;2085&quot; data-start=&quot;1941&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-ts&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; { &lt;span class=&quot;hljs-title class_&quot;&gt;AdminModule&lt;/span&gt; } &lt;span class=&quot;hljs-keyword&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&#39;./admin/admin.module&#39;&lt;/span&gt;;

&lt;span class=&quot;hljs-meta&quot;&gt;@NgModule&lt;/span&gt;({
  &lt;span class=&quot;hljs-attr&quot;&gt;imports&lt;/span&gt;: [&lt;span class=&quot;hljs-title class_&quot;&gt;BrowserModule&lt;/span&gt;, &lt;span class=&quot;hljs-title class_&quot;&gt;AdminModule&lt;/span&gt;],
})
&lt;span class=&quot;hljs-keyword&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title class_&quot;&gt;AppModule&lt;/span&gt; {}
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;p data-end=&quot;2156&quot; data-start=&quot;2086&quot;&gt;Even if user never visits &lt;code data-end=&quot;2120&quot; data-start=&quot;2112&quot;&gt;/admin&lt;/code&gt;, its code is downloaded at startup.&lt;/p&gt;
&lt;hr data-end=&quot;2161&quot; data-start=&quot;2158&quot; /&gt;
&lt;h3 data-end=&quot;2195&quot; data-start=&quot;2163&quot;&gt;🚀 Lazy Loading with Routing&lt;/h3&gt;
&lt;p data-end=&quot;2265&quot; data-start=&quot;2196&quot;&gt;You split features into separate modules and &lt;strong data-end=&quot;2264&quot; data-start=&quot;2241&quot;&gt;load them on demand&lt;/strong&gt;.&lt;/p&gt;
&lt;p data-end=&quot;2290&quot; data-start=&quot;2267&quot;&gt;&lt;code data-end=&quot;2290&quot; data-start=&quot;2267&quot;&gt;app-routing.module.ts&lt;/code&gt;&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;2430&quot; data-start=&quot;2291&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-ts&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;hljs-attr&quot;&gt;routes&lt;/span&gt;: &lt;span class=&quot;hljs-title class_&quot;&gt;Routes&lt;/span&gt; = [
  { &lt;span class=&quot;hljs-attr&quot;&gt;path&lt;/span&gt;: &lt;span class=&quot;hljs-string&quot;&gt;&#39;admin&#39;&lt;/span&gt;, 
    &lt;span class=&quot;hljs-attr&quot;&gt;loadChildren&lt;/span&gt;: &lt;span class=&quot;hljs-function&quot;&gt;() =&amp;gt;&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt;(&lt;span class=&quot;hljs-string&quot;&gt;&#39;./admin/admin.module&#39;&lt;/span&gt;).&lt;span class=&quot;hljs-title function_&quot;&gt;then&lt;/span&gt;(&lt;span class=&quot;hljs-function&quot;&gt;&lt;span class=&quot;hljs-params&quot;&gt;m&lt;/span&gt;&lt;/span&gt; =&amp;gt; m.&lt;span class=&quot;hljs-property&quot;&gt;AdminModule&lt;/span&gt;) }
];
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;ul data-end=&quot;2509&quot; data-start=&quot;2431&quot;&gt;
&lt;li data-end=&quot;2509&quot; data-start=&quot;2431&quot;&gt;
&lt;p data-end=&quot;2509&quot; data-start=&quot;2433&quot;&gt;Angular will download &lt;code data-end=&quot;2472&quot; data-start=&quot;2455&quot;&gt;admin.module.js&lt;/code&gt; &lt;strong data-end=&quot;2508&quot; data-start=&quot;2473&quot;&gt;only when user goes to &lt;code data-end=&quot;2506&quot; data-start=&quot;2498&quot;&gt;/admin&lt;/code&gt;&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;2514&quot; data-start=&quot;2511&quot; /&gt;
&lt;h3 data-end=&quot;2529&quot; data-start=&quot;2516&quot;&gt;🛠️ Steps&lt;/h3&gt;
&lt;ol data-end=&quot;2656&quot; data-start=&quot;2530&quot;&gt;
&lt;li data-end=&quot;2577&quot; data-start=&quot;2530&quot;&gt;
&lt;p data-end=&quot;2577&quot; data-start=&quot;2533&quot;&gt;Create a feature module, e.g. &lt;code data-end=&quot;2576&quot; data-start=&quot;2563&quot;&gt;AdminModule&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2620&quot; data-start=&quot;2578&quot;&gt;
&lt;p data-end=&quot;2620&quot; data-start=&quot;2581&quot;&gt;Remove it from &lt;code data-end=&quot;2611&quot; data-start=&quot;2596&quot;&gt;app.module.ts&lt;/code&gt; imports.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2656&quot; data-start=&quot;2621&quot;&gt;
&lt;p data-end=&quot;2656&quot; data-start=&quot;2624&quot;&gt;Use &lt;code data-end=&quot;2642&quot; data-start=&quot;2628&quot;&gt;loadChildren&lt;/code&gt; in the route.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;hr data-end=&quot;2661&quot; data-start=&quot;2658&quot; /&gt;
&lt;h3 data-end=&quot;2698&quot; data-start=&quot;2663&quot;&gt;🧩 Component-level Lazy Loading&lt;/h3&gt;
&lt;p data-end=&quot;2746&quot; data-start=&quot;2699&quot;&gt;You can also load standalone components lazily:&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;2862&quot; data-start=&quot;2747&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-ts&quot;&gt;{
  &lt;span class=&quot;hljs-attr&quot;&gt;path&lt;/span&gt;: &lt;span class=&quot;hljs-string&quot;&gt;&#39;about&#39;&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;loadComponent&lt;/span&gt;: &lt;span class=&quot;hljs-function&quot;&gt;() =&amp;gt;&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt;(&lt;span class=&quot;hljs-string&quot;&gt;&#39;./about/about.component&#39;&lt;/span&gt;).&lt;span class=&quot;hljs-title function_&quot;&gt;then&lt;/span&gt;(&lt;span class=&quot;hljs-function&quot;&gt;&lt;span class=&quot;hljs-params&quot;&gt;m&lt;/span&gt;&lt;/span&gt; =&amp;gt; m.&lt;span class=&quot;hljs-property&quot;&gt;AboutComponent&lt;/span&gt;)
}
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;hr data-end=&quot;2867&quot; data-start=&quot;2864&quot; /&gt;
&lt;h3 data-end=&quot;2880&quot; data-start=&quot;2869&quot;&gt;🔑 Tips&lt;/h3&gt;
&lt;ul data-end=&quot;3030&quot; data-start=&quot;2881&quot;&gt;
&lt;li data-end=&quot;2941&quot; data-start=&quot;2881&quot;&gt;
&lt;p data-end=&quot;2941&quot; data-start=&quot;2883&quot;&gt;Keep shared/common components in a separate shared module.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2983&quot; data-start=&quot;2942&quot;&gt;
&lt;p data-end=&quot;2983&quot; data-start=&quot;2944&quot;&gt;Combine with route guards for security.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3030&quot; data-start=&quot;2984&quot;&gt;
&lt;p data-end=&quot;3030&quot; data-start=&quot;2986&quot;&gt;Works great with Angular CLI code splitting.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;3035&quot; data-start=&quot;3032&quot; /&gt;
&lt;h2 data-end=&quot;3061&quot; data-start=&quot;3037&quot;&gt;🆚 Quick Side-by-Side&lt;/h2&gt;
&lt;div class=&quot;_tableContainer_1rjym_1&quot;&gt;&lt;div class=&quot;group _tableWrapper_1rjym_13 flex w-fit flex-col-reverse&quot; tabindex=&quot;-1&quot;&gt;&lt;table class=&quot;w-fit min-w-(--thread-content-width)&quot; data-end=&quot;3846&quot; data-start=&quot;3063&quot;&gt;&lt;thead data-end=&quot;3191&quot; data-start=&quot;3063&quot;&gt;&lt;tr data-end=&quot;3191&quot; data-start=&quot;3063&quot;&gt;&lt;th data-col-size=&quot;sm&quot; data-end=&quot;3084&quot; data-start=&quot;3063&quot;&gt;Feature&lt;/th&gt;&lt;th data-col-size=&quot;sm&quot; data-end=&quot;3134&quot; data-start=&quot;3084&quot;&gt;&lt;strong data-end=&quot;3105&quot; data-start=&quot;3086&quot;&gt;C# Lazy Loading&lt;/strong&gt;&lt;/th&gt;&lt;th data-col-size=&quot;md&quot; data-end=&quot;3191&quot; data-start=&quot;3134&quot;&gt;&lt;strong data-end=&quot;3160&quot; data-start=&quot;3136&quot;&gt;Angular Lazy Loading&lt;/strong&gt;&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody data-end=&quot;3846&quot; data-start=&quot;3323&quot;&gt;&lt;tr data-end=&quot;3453&quot; data-start=&quot;3323&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3344&quot; data-start=&quot;3323&quot;&gt;Purpose&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3395&quot; data-start=&quot;3344&quot;&gt;Delay &lt;strong data-end=&quot;3384&quot; data-start=&quot;3352&quot;&gt;object creation/data loading&lt;/strong&gt;&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;3453&quot; data-start=&quot;3395&quot;&gt;Delay &lt;strong data-end=&quot;3437&quot; data-start=&quot;3403&quot;&gt;module/component code download&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;3584&quot; data-start=&quot;3454&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3475&quot; data-start=&quot;3454&quot;&gt;Trigger&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3526&quot; data-start=&quot;3475&quot;&gt;First time property is accessed&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;3584&quot; data-start=&quot;3526&quot;&gt;User navigates to a specific route&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;3715&quot; data-start=&quot;3585&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3606&quot; data-start=&quot;3585&quot;&gt;Benefit&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3657&quot; data-start=&quot;3606&quot;&gt;Save memory &amp;amp; CPU until needed&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;3715&quot; data-start=&quot;3657&quot;&gt;Faster initial page load, smaller bundle size&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;3846&quot; data-start=&quot;3716&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3737&quot; data-start=&quot;3716&quot;&gt;Example Tool&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3788&quot; data-start=&quot;3737&quot;&gt;&lt;code data-end=&quot;3748&quot; data-start=&quot;3739&quot;&gt;Lazy&amp;lt;T&amp;gt;&lt;/code&gt; class, EF Lazy Loading&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;3846&quot; data-start=&quot;3788&quot;&gt;&lt;code data-end=&quot;3804&quot; data-start=&quot;3790&quot;&gt;loadChildren&lt;/code&gt; in Angular Router&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;
&lt;hr data-end=&quot;3851&quot; data-start=&quot;3848&quot; /&gt;
&lt;h3 data-end=&quot;3872&quot; data-start=&quot;3853&quot;&gt;🏁 In One Line:&lt;/h3&gt;
&lt;ul data-end=&quot;4012&quot; data-start=&quot;3873&quot;&gt;
&lt;li data-end=&quot;3939&quot; data-start=&quot;3873&quot;&gt;
&lt;p data-end=&quot;3939&quot; data-start=&quot;3875&quot;&gt;&lt;strong data-end=&quot;3881&quot; data-start=&quot;3875&quot;&gt;C#&lt;/strong&gt;: &lt;em data-end=&quot;3937&quot; data-start=&quot;3883&quot;&gt;“Don’t create the object until someone asks for it.”&lt;/em&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;4012&quot; data-start=&quot;3940&quot;&gt;
&lt;p data-end=&quot;4012&quot; data-start=&quot;3942&quot;&gt;&lt;strong data-end=&quot;3953&quot; data-start=&quot;3942&quot;&gt;Angular&lt;/strong&gt;: &lt;em data-end=&quot;4012&quot; data-start=&quot;3955&quot;&gt;“Don’t download code until the user goes to that page.”&lt;/em&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;4121&quot; data-is-last-node=&quot;&quot; data-is-only-node=&quot;&quot; data-start=&quot;4014&quot;&gt;That’s &lt;strong data-end=&quot;4037&quot; data-start=&quot;4021&quot;&gt;Lazy Loading&lt;/strong&gt; explained for both C# and Angular in simple English with all the important details.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://piushshukla.blogspot.com/feeds/1248409851644332981/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://piushshukla.blogspot.com/2025/09/lazy-loading.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2159069551745631737/posts/default/1248409851644332981'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2159069551745631737/posts/default/1248409851644332981'/><link rel='alternate' type='text/html' href='http://piushshukla.blogspot.com/2025/09/lazy-loading.html' title='Lazy Loading '/><author><name>Piush shukla</name><uri>http://www.blogger.com/profile/16392649283296436146</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2159069551745631737.post-3984071393111366881</id><published>2025-09-22T08:36:00.000-07:00</published><updated>2025-09-22T08:36:42.163-07:00</updated><title type='text'>mergeMap, switchMap, concatMap, and (for completeness) exhaustMap</title><content type='html'>&lt;h2 data-end=&quot;216&quot; data-start=&quot;197&quot;&gt;🎯 The Situation&lt;/h2&gt;
&lt;p data-end=&quot;390&quot; data-start=&quot;217&quot;&gt;You have a &lt;strong data-end=&quot;249&quot; data-start=&quot;228&quot;&gt;source Observable&lt;/strong&gt; that emits events (like button clicks or search text).&lt;br data-end=&quot;307&quot; data-start=&quot;304&quot; /&gt;
For each event, you need to start a &lt;strong data-end=&quot;367&quot; data-start=&quot;343&quot;&gt;new inner Observable&lt;/strong&gt; (like an HTTP call).&lt;/p&gt;
&lt;p data-end=&quot;463&quot; data-start=&quot;392&quot;&gt;These operators decide &lt;strong data-end=&quot;462&quot; data-start=&quot;415&quot;&gt;how to subscribe to those inner Observables&lt;/strong&gt;.&lt;/p&gt;
&lt;hr data-end=&quot;468&quot; data-start=&quot;465&quot; /&gt;
&lt;h2 data-end=&quot;489&quot; data-start=&quot;470&quot;&gt;1️⃣ &lt;strong data-end=&quot;489&quot; data-start=&quot;477&quot;&gt;mergeMap&lt;/strong&gt;&lt;/h2&gt;
&lt;blockquote data-end=&quot;575&quot; data-start=&quot;490&quot;&gt;
&lt;p data-end=&quot;575&quot; data-start=&quot;492&quot;&gt;“Start all inner Observables &lt;strong data-end=&quot;536&quot; data-start=&quot;521&quot;&gt;in parallel&lt;/strong&gt; and merge their results as they come.”&lt;/p&gt;
&lt;/blockquote&gt;
&lt;ul data-end=&quot;754&quot; data-start=&quot;577&quot;&gt;
&lt;li data-end=&quot;626&quot; data-start=&quot;577&quot;&gt;
&lt;p data-end=&quot;626&quot; data-start=&quot;579&quot;&gt;&lt;strong data-end=&quot;598&quot; data-start=&quot;579&quot;&gt;Does NOT cancel&lt;/strong&gt; previous inner Observables.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;671&quot; data-start=&quot;627&quot;&gt;
&lt;p data-end=&quot;671&quot; data-start=&quot;629&quot;&gt;Fast because everything runs concurrently.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;754&quot; data-start=&quot;672&quot;&gt;
&lt;p data-end=&quot;754&quot; data-start=&quot;674&quot;&gt;Good for: Fire-and-forget tasks, multiple HTTP calls where order doesn’t matter.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;860&quot; data-start=&quot;756&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-ts&quot;&gt;clicks$.&lt;span class=&quot;hljs-title function_&quot;&gt;pipe&lt;/span&gt;(
  &lt;span class=&quot;hljs-title function_&quot;&gt;mergeMap&lt;/span&gt;(&lt;span class=&quot;hljs-function&quot;&gt;() =&amp;gt;&lt;/span&gt; http.&lt;span class=&quot;hljs-title function_&quot;&gt;get&lt;/span&gt;(&lt;span class=&quot;hljs-string&quot;&gt;&#39;/data&#39;&lt;/span&gt;))
)
.&lt;span class=&quot;hljs-title function_&quot;&gt;subscribe&lt;/span&gt;(&lt;span class=&quot;hljs-function&quot;&gt;&lt;span class=&quot;hljs-params&quot;&gt;result&lt;/span&gt;&lt;/span&gt; =&amp;gt; &lt;span class=&quot;hljs-variable language_&quot;&gt;console&lt;/span&gt;.&lt;span class=&quot;hljs-title function_&quot;&gt;log&lt;/span&gt;(result));
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;p data-end=&quot;982&quot; data-start=&quot;861&quot;&gt;➡ If you click 3 times quickly, &lt;strong data-end=&quot;928&quot; data-start=&quot;893&quot;&gt;3 requests run at the same time&lt;/strong&gt;, and you get responses in whatever order they arrive.&lt;/p&gt;
&lt;hr data-end=&quot;987&quot; data-start=&quot;984&quot; /&gt;
&lt;h2 data-end=&quot;1009&quot; data-start=&quot;989&quot;&gt;2️⃣ &lt;strong data-end=&quot;1009&quot; data-start=&quot;996&quot;&gt;switchMap&lt;/strong&gt;&lt;/h2&gt;
&lt;blockquote data-end=&quot;1079&quot; data-start=&quot;1010&quot;&gt;
&lt;p data-end=&quot;1079&quot; data-start=&quot;1012&quot;&gt;“Switch to the &lt;strong data-end=&quot;1037&quot; data-start=&quot;1027&quot;&gt;latest&lt;/strong&gt; inner Observable and cancel the old one.”&lt;/p&gt;
&lt;/blockquote&gt;
&lt;ul data-end=&quot;1217&quot; data-start=&quot;1081&quot;&gt;
&lt;li data-end=&quot;1134&quot; data-start=&quot;1081&quot;&gt;
&lt;p data-end=&quot;1134&quot; data-start=&quot;1083&quot;&gt;Cancels previous request when a new value comes in.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1217&quot; data-start=&quot;1135&quot;&gt;
&lt;p data-end=&quot;1217&quot; data-start=&quot;1137&quot;&gt;Good for: Live search/autocomplete, where you only care about the newest result.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;1342&quot; data-start=&quot;1219&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-ts&quot;&gt;searchText$.&lt;span class=&quot;hljs-title function_&quot;&gt;pipe&lt;/span&gt;(
  &lt;span class=&quot;hljs-title function_&quot;&gt;switchMap&lt;/span&gt;(&lt;span class=&quot;hljs-function&quot;&gt;&lt;span class=&quot;hljs-params&quot;&gt;text&lt;/span&gt;&lt;/span&gt; =&amp;gt; http.&lt;span class=&quot;hljs-title function_&quot;&gt;get&lt;/span&gt;(&lt;span class=&quot;hljs-string&quot;&gt;`/search?q=&lt;span class=&quot;hljs-subst&quot;&gt;${text}&lt;/span&gt;&lt;/span&gt;`))
)
.&lt;span class=&quot;hljs-title function_&quot;&gt;subscribe&lt;/span&gt;(&lt;span class=&quot;hljs-function&quot;&gt;&lt;span class=&quot;hljs-params&quot;&gt;result&lt;/span&gt;&lt;/span&gt; =&amp;gt; &lt;span class=&quot;hljs-variable language_&quot;&gt;console&lt;/span&gt;.&lt;span class=&quot;hljs-title function_&quot;&gt;log&lt;/span&gt;(result));
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;p data-end=&quot;1450&quot; data-start=&quot;1343&quot;&gt;➡ If user types “a”, then “ab”, then “abc”, only the request for “abc” is kept. Older ones are &lt;strong data-end=&quot;1449&quot; data-start=&quot;1438&quot;&gt;aborted&lt;/strong&gt;.&lt;/p&gt;
&lt;hr data-end=&quot;1455&quot; data-start=&quot;1452&quot; /&gt;
&lt;h2 data-end=&quot;1477&quot; data-start=&quot;1457&quot;&gt;3️⃣ &lt;strong data-end=&quot;1477&quot; data-start=&quot;1464&quot;&gt;concatMap&lt;/strong&gt;&lt;/h2&gt;
&lt;blockquote data-end=&quot;1551&quot; data-start=&quot;1478&quot;&gt;
&lt;p data-end=&quot;1551&quot; data-start=&quot;1480&quot;&gt;“Queue inner Observables and run them &lt;strong data-end=&quot;1539&quot; data-start=&quot;1518&quot;&gt;one after another&lt;/strong&gt;, in order.”&lt;/p&gt;
&lt;/blockquote&gt;
&lt;ul data-end=&quot;1722&quot; data-start=&quot;1553&quot;&gt;
&lt;li data-end=&quot;1582&quot; data-start=&quot;1553&quot;&gt;
&lt;p data-end=&quot;1582&quot; data-start=&quot;1555&quot;&gt;Ensures order is preserved.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1642&quot; data-start=&quot;1583&quot;&gt;
&lt;p data-end=&quot;1642&quot; data-start=&quot;1585&quot;&gt;Each inner Observable must finish before the next starts.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1722&quot; data-start=&quot;1643&quot;&gt;
&lt;p data-end=&quot;1722&quot; data-start=&quot;1645&quot;&gt;Good for: Operations that must be sequential (like saving data step by step).&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;1840&quot; data-start=&quot;1724&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-ts&quot;&gt;tasks$.&lt;span class=&quot;hljs-title function_&quot;&gt;pipe&lt;/span&gt;(
  &lt;span class=&quot;hljs-title function_&quot;&gt;concatMap&lt;/span&gt;(&lt;span class=&quot;hljs-function&quot;&gt;&lt;span class=&quot;hljs-params&quot;&gt;task&lt;/span&gt;&lt;/span&gt; =&amp;gt; http.&lt;span class=&quot;hljs-title function_&quot;&gt;post&lt;/span&gt;(&lt;span class=&quot;hljs-string&quot;&gt;&#39;/process&#39;&lt;/span&gt;, task))
)
.&lt;span class=&quot;hljs-title function_&quot;&gt;subscribe&lt;/span&gt;(&lt;span class=&quot;hljs-function&quot;&gt;&lt;span class=&quot;hljs-params&quot;&gt;result&lt;/span&gt;&lt;/span&gt; =&amp;gt; &lt;span class=&quot;hljs-variable language_&quot;&gt;console&lt;/span&gt;.&lt;span class=&quot;hljs-title function_&quot;&gt;log&lt;/span&gt;(result));
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;p data-end=&quot;1914&quot; data-start=&quot;1841&quot;&gt;➡ If 3 tasks come quickly, they run &lt;strong data-end=&quot;1894&quot; data-start=&quot;1877&quot;&gt;one at a time&lt;/strong&gt;, in the same order.&lt;/p&gt;
&lt;hr data-end=&quot;1919&quot; data-start=&quot;1916&quot; /&gt;
&lt;h2 data-end=&quot;1950&quot; data-start=&quot;1921&quot;&gt;4️⃣ (Bonus) &lt;strong data-end=&quot;1950&quot; data-start=&quot;1936&quot;&gt;exhaustMap&lt;/strong&gt;&lt;/h2&gt;
&lt;blockquote data-end=&quot;2017&quot; data-start=&quot;1951&quot;&gt;
&lt;p data-end=&quot;2017&quot; data-start=&quot;1953&quot;&gt;“Ignore new values until the current inner Observable finishes.”&lt;/p&gt;
&lt;/blockquote&gt;
&lt;ul data-end=&quot;2129&quot; data-start=&quot;2019&quot;&gt;
&lt;li data-end=&quot;2129&quot; data-start=&quot;2019&quot;&gt;
&lt;p data-end=&quot;2129&quot; data-start=&quot;2021&quot;&gt;Useful when you want to &lt;strong data-end=&quot;2063&quot; data-start=&quot;2045&quot;&gt;block re-entry&lt;/strong&gt;, e.g., ignore extra button clicks while a request is in progress.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;2200&quot; data-start=&quot;2131&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-ts&quot;&gt;saveClicks$.&lt;span class=&quot;hljs-title function_&quot;&gt;pipe&lt;/span&gt;(
  &lt;span class=&quot;hljs-title function_&quot;&gt;exhaustMap&lt;/span&gt;(&lt;span class=&quot;hljs-function&quot;&gt;() =&amp;gt;&lt;/span&gt; http.&lt;span class=&quot;hljs-title function_&quot;&gt;post&lt;/span&gt;(&lt;span class=&quot;hljs-string&quot;&gt;&#39;/save&#39;&lt;/span&gt;))
);
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;p data-end=&quot;2290&quot; data-start=&quot;2201&quot;&gt;➡ Click many times fast → only the &lt;strong data-end=&quot;2245&quot; data-start=&quot;2236&quot;&gt;first&lt;/strong&gt; click triggers a request until it completes.&lt;/p&gt;
&lt;hr data-end=&quot;2295&quot; data-start=&quot;2292&quot; /&gt;
&lt;h2 data-end=&quot;2319&quot; data-start=&quot;2297&quot;&gt;🔑 Comparison Table&lt;/h2&gt;
&lt;div class=&quot;_tableContainer_1rjym_1&quot;&gt;&lt;div class=&quot;group _tableWrapper_1rjym_13 flex w-fit flex-col-reverse&quot; tabindex=&quot;-1&quot;&gt;&lt;table class=&quot;w-fit min-w-(--thread-content-width)&quot; data-end=&quot;2788&quot; data-start=&quot;2321&quot;&gt;&lt;thead data-end=&quot;2418&quot; data-start=&quot;2321&quot;&gt;&lt;tr data-end=&quot;2418&quot; data-start=&quot;2321&quot;&gt;&lt;th data-col-size=&quot;sm&quot; data-end=&quot;2335&quot; data-start=&quot;2321&quot;&gt;Operator&lt;/th&gt;&lt;th data-col-size=&quot;sm&quot; data-end=&quot;2349&quot; data-start=&quot;2335&quot;&gt;Starts New?&lt;/th&gt;&lt;th data-col-size=&quot;sm&quot; data-end=&quot;2364&quot; data-start=&quot;2349&quot;&gt;Cancels Old?&lt;/th&gt;&lt;th data-col-size=&quot;sm&quot; data-end=&quot;2384&quot; data-start=&quot;2364&quot;&gt;Runs in Parallel?&lt;/th&gt;&lt;th data-col-size=&quot;sm&quot; data-end=&quot;2399&quot; data-start=&quot;2384&quot;&gt;Keeps Order?&lt;/th&gt;&lt;th data-col-size=&quot;sm&quot; data-end=&quot;2418&quot; data-start=&quot;2399&quot;&gt;Common Use Case&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody data-end=&quot;2788&quot; data-start=&quot;2514&quot;&gt;&lt;tr data-end=&quot;2575&quot; data-start=&quot;2514&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2529&quot; data-start=&quot;2514&quot;&gt;&lt;strong data-end=&quot;2528&quot; data-start=&quot;2516&quot;&gt;mergeMap&lt;/strong&gt;&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2533&quot; data-start=&quot;2529&quot;&gt;✅&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2537&quot; data-start=&quot;2533&quot;&gt;❌&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2541&quot; data-start=&quot;2537&quot;&gt;✅&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2545&quot; data-start=&quot;2541&quot;&gt;❌&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2575&quot; data-start=&quot;2545&quot;&gt;Multiple independent calls&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;2641&quot; data-start=&quot;2576&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2591&quot; data-start=&quot;2576&quot;&gt;&lt;strong data-end=&quot;2591&quot; data-start=&quot;2578&quot;&gt;switchMap&lt;/strong&gt;&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2595&quot; data-start=&quot;2591&quot;&gt;✅&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2599&quot; data-start=&quot;2595&quot;&gt;✅&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2616&quot; data-start=&quot;2599&quot;&gt;⚠️ only latest&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2620&quot; data-start=&quot;2616&quot;&gt;❌&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2641&quot; data-start=&quot;2620&quot;&gt;Type-ahead search&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;2712&quot; data-start=&quot;2642&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2657&quot; data-start=&quot;2642&quot;&gt;&lt;strong data-end=&quot;2657&quot; data-start=&quot;2644&quot;&gt;concatMap&lt;/strong&gt;&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2661&quot; data-start=&quot;2657&quot;&gt;✅&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2665&quot; data-start=&quot;2661&quot;&gt;❌&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2682&quot; data-start=&quot;2665&quot;&gt;❌ (sequential)&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2686&quot; data-start=&quot;2682&quot;&gt;✅&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2712&quot; data-start=&quot;2686&quot;&gt;Save tasks in sequence&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;2788&quot; data-start=&quot;2713&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2729&quot; data-start=&quot;2713&quot;&gt;&lt;strong data-end=&quot;2729&quot; data-start=&quot;2715&quot;&gt;exhaustMap&lt;/strong&gt;&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2748&quot; data-start=&quot;2729&quot;&gt;❌ (while active)&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2752&quot; data-start=&quot;2748&quot;&gt;—&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2756&quot; data-start=&quot;2752&quot;&gt;❌&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2762&quot; data-start=&quot;2756&quot;&gt;N/A&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2788&quot; data-start=&quot;2762&quot;&gt;Prevent double submits&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;
&lt;hr data-end=&quot;2793&quot; data-start=&quot;2790&quot; /&gt;
&lt;h2 data-end=&quot;2821&quot; data-start=&quot;2795&quot;&gt;🏁 Quick Rules of Thumb&lt;/h2&gt;
&lt;ul data-end=&quot;3044&quot; data-start=&quot;2822&quot;&gt;
&lt;li data-end=&quot;2880&quot; data-start=&quot;2822&quot;&gt;
&lt;p data-end=&quot;2880&quot; data-start=&quot;2824&quot;&gt;&lt;strong data-end=&quot;2863&quot; data-start=&quot;2824&quot;&gt;Need all results, order unimportant&lt;/strong&gt; → &lt;strong data-end=&quot;2878&quot; data-start=&quot;2866&quot;&gt;mergeMap&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2937&quot; data-start=&quot;2881&quot;&gt;
&lt;p data-end=&quot;2937&quot; data-start=&quot;2883&quot;&gt;&lt;strong data-end=&quot;2919&quot; data-start=&quot;2883&quot;&gt;Only care about the latest event&lt;/strong&gt; → &lt;strong data-end=&quot;2935&quot; data-start=&quot;2922&quot;&gt;switchMap&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2992&quot; data-start=&quot;2938&quot;&gt;
&lt;p data-end=&quot;2992&quot; data-start=&quot;2940&quot;&gt;&lt;strong data-end=&quot;2974&quot; data-start=&quot;2940&quot;&gt;Must keep order, one at a time&lt;/strong&gt; → &lt;strong data-end=&quot;2990&quot; data-start=&quot;2977&quot;&gt;concatMap&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3044&quot; data-start=&quot;2993&quot;&gt;
&lt;p data-end=&quot;3044&quot; data-start=&quot;2995&quot;&gt;&lt;strong data-end=&quot;3027&quot; data-start=&quot;2995&quot;&gt;Ignore new events until done&lt;/strong&gt; → &lt;strong data-end=&quot;3044&quot; data-start=&quot;3030&quot;&gt;exhaustMap&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;3191&quot; data-is-last-node=&quot;&quot; data-is-only-node=&quot;&quot; data-start=&quot;3046&quot;&gt;These patterns help you choose the &lt;strong data-end=&quot;3099&quot; data-start=&quot;3081&quot;&gt;right operator&lt;/strong&gt; when dealing with streams that trigger async work like HTTP requests or long-running tasks.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://piushshukla.blogspot.com/feeds/3984071393111366881/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://piushshukla.blogspot.com/2025/09/mergemap-switchmap-concatmap-and-for.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2159069551745631737/posts/default/3984071393111366881'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2159069551745631737/posts/default/3984071393111366881'/><link rel='alternate' type='text/html' href='http://piushshukla.blogspot.com/2025/09/mergemap-switchmap-concatmap-and-for.html' title='mergeMap, switchMap, concatMap, and (for completeness) exhaustMap'/><author><name>Piush shukla</name><uri>http://www.blogger.com/profile/16392649283296436146</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2159069551745631737.post-9035160253869102119</id><published>2025-09-22T08:34:00.000-07:00</published><updated>2025-09-22T08:34:24.984-07:00</updated><title type='text'>change detection</title><content type='html'>&lt;h2 data-end=&quot;126&quot; data-start=&quot;84&quot;&gt;1️⃣  What does “change detection” mean?&lt;/h2&gt;
&lt;p data-end=&quot;171&quot; data-start=&quot;127&quot;&gt;Imagine your web page shows a person’s name:&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;200&quot; data-start=&quot;173&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-html&quot;&gt;&lt;span class=&quot;hljs-tag&quot;&gt;&amp;lt;&lt;span class=&quot;hljs-name&quot;&gt;p&lt;/span&gt;&lt;/span&gt;&amp;gt;{{name}}&lt;span class=&quot;hljs-tag&quot;&gt;&amp;lt;/&lt;span class=&quot;hljs-name&quot;&gt;p&lt;/span&gt;&lt;/span&gt;&amp;gt;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;p data-end=&quot;402&quot; data-start=&quot;202&quot;&gt;If the variable &lt;code data-end=&quot;224&quot; data-start=&quot;218&quot;&gt;name&lt;/code&gt; changes from “Sam” to “Alex,” Angular needs to &lt;strong data-end=&quot;282&quot; data-start=&quot;272&quot;&gt;detect&lt;/strong&gt; that change and update the screen.&lt;br data-end=&quot;320&quot; data-start=&quot;317&quot; /&gt;
The process of checking data and updating the HTML is called &lt;strong data-end=&quot;401&quot; data-start=&quot;381&quot;&gt;change detection&lt;/strong&gt;.&lt;/p&gt;
&lt;hr data-end=&quot;407&quot; data-start=&quot;404&quot; /&gt;
&lt;h2 data-end=&quot;447&quot; data-start=&quot;409&quot;&gt;2️⃣  Two main strategies in Angular&lt;/h2&gt;
&lt;p data-end=&quot;523&quot; data-start=&quot;448&quot;&gt;Angular gives you two modes to decide &lt;strong data-end=&quot;494&quot; data-start=&quot;486&quot;&gt;when&lt;/strong&gt; it should check for changes:&lt;/p&gt;
&lt;h3 data-end=&quot;571&quot; data-start=&quot;525&quot;&gt;🟢 &lt;strong data-end=&quot;571&quot; data-start=&quot;532&quot;&gt;Default (also called “CheckAlways”)&lt;/strong&gt;&lt;/h3&gt;
&lt;ul data-end=&quot;960&quot; data-start=&quot;572&quot;&gt;
&lt;li data-end=&quot;798&quot; data-start=&quot;572&quot;&gt;
&lt;p data-end=&quot;686&quot; data-start=&quot;574&quot;&gt;Angular will &lt;strong data-end=&quot;597&quot; data-start=&quot;587&quot;&gt;always&lt;/strong&gt; look for changes in this component &lt;strong data-end=&quot;661&quot; data-start=&quot;633&quot;&gt;and all child components&lt;/strong&gt; after almost any action:&lt;/p&gt;
&lt;ul data-end=&quot;798&quot; data-start=&quot;689&quot;&gt;
&lt;li data-end=&quot;704&quot; data-start=&quot;689&quot;&gt;
&lt;p data-end=&quot;704&quot; data-start=&quot;691&quot;&gt;Button clicks&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;723&quot; data-start=&quot;707&quot;&gt;
&lt;p data-end=&quot;723&quot; data-start=&quot;709&quot;&gt;HTTP responses&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;764&quot; data-start=&quot;726&quot;&gt;
&lt;p data-end=&quot;764&quot; data-start=&quot;728&quot;&gt;Timers (&lt;code data-end=&quot;748&quot; data-start=&quot;736&quot;&gt;setTimeout&lt;/code&gt;, &lt;code data-end=&quot;763&quot; data-start=&quot;750&quot;&gt;setInterval&lt;/code&gt;)&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;798&quot; data-start=&quot;767&quot;&gt;
&lt;p data-end=&quot;798&quot; data-start=&quot;769&quot;&gt;Browser events like scrolling&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li data-end=&quot;854&quot; data-start=&quot;799&quot;&gt;
&lt;p data-end=&quot;854&quot; data-start=&quot;801&quot;&gt;Easy to use because you don’t have to think about it.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;960&quot; data-start=&quot;855&quot;&gt;
&lt;p data-end=&quot;960&quot; data-start=&quot;857&quot;&gt;But it can be &lt;strong data-end=&quot;881&quot; data-start=&quot;871&quot;&gt;slower&lt;/strong&gt; if your app is very big, because Angular keeps checking everything many times.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;965&quot; data-start=&quot;962&quot; /&gt;
&lt;h3 data-end=&quot;984&quot; data-start=&quot;967&quot;&gt;🟡 &lt;strong data-end=&quot;984&quot; data-start=&quot;974&quot;&gt;OnPush&lt;/strong&gt;&lt;/h3&gt;
&lt;ul data-end=&quot;1559&quot; data-start=&quot;985&quot;&gt;
&lt;li data-end=&quot;1392&quot; data-start=&quot;985&quot;&gt;
&lt;p data-end=&quot;1055&quot; data-start=&quot;987&quot;&gt;Angular will check the component &lt;strong data-end=&quot;1054&quot; data-start=&quot;1020&quot;&gt;only when one of these happens&lt;/strong&gt;:&lt;/p&gt;
&lt;ol data-end=&quot;1392&quot; data-start=&quot;1058&quot;&gt;
&lt;li data-end=&quot;1239&quot; data-start=&quot;1058&quot;&gt;
&lt;p data-end=&quot;1115&quot; data-start=&quot;1061&quot;&gt;&lt;strong data-end=&quot;1113&quot; data-start=&quot;1061&quot;&gt;An &lt;code data-end=&quot;1076&quot; data-start=&quot;1066&quot;&gt;@Input()&lt;/code&gt; value gets a new object reference.&lt;/strong&gt;&lt;/p&gt;
&lt;blockquote data-end=&quot;1239&quot; data-start=&quot;1121&quot;&gt;
&lt;p data-end=&quot;1239&quot; data-start=&quot;1123&quot;&gt;Important: if you just change a property inside the object, Angular will &lt;em data-end=&quot;1201&quot; data-start=&quot;1196&quot;&gt;not&lt;/em&gt; notice. You must create a new object.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1306&quot; data-start=&quot;1242&quot;&gt;
&lt;p data-end=&quot;1306&quot; data-start=&quot;1245&quot;&gt;&lt;strong data-end=&quot;1284&quot; data-start=&quot;1245&quot;&gt;An event inside the component fires&lt;/strong&gt;, like a button click.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1392&quot; data-start=&quot;1309&quot;&gt;
&lt;p data-end=&quot;1392&quot; data-start=&quot;1312&quot;&gt;&lt;strong data-end=&quot;1350&quot; data-start=&quot;1312&quot;&gt;You tell Angular to check manually&lt;/strong&gt; using &lt;code data-end=&quot;1391&quot; data-start=&quot;1357&quot;&gt;ChangeDetectorRef.markForCheck()&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1468&quot; data-start=&quot;1394&quot;&gt;
&lt;p data-end=&quot;1468&quot; data-start=&quot;1396&quot;&gt;This makes the app &lt;strong data-end=&quot;1425&quot; data-start=&quot;1415&quot;&gt;faster&lt;/strong&gt;, because Angular skips unnecessary checks.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1559&quot; data-start=&quot;1469&quot;&gt;
&lt;p data-end=&quot;1559&quot; data-start=&quot;1471&quot;&gt;But you must follow an &lt;strong data-end=&quot;1512&quot; data-start=&quot;1494&quot;&gt;immutable data&lt;/strong&gt; style (don’t mutate objects, create new ones).&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;1564&quot; data-start=&quot;1561&quot; /&gt;
&lt;h2 data-end=&quot;1588&quot; data-start=&quot;1566&quot;&gt;3️⃣  Simple Example&lt;/h2&gt;
&lt;h3 data-end=&quot;1607&quot; data-start=&quot;1590&quot;&gt;Using Default&lt;/h3&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;1767&quot; data-start=&quot;1608&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-typescript&quot;&gt;&lt;span class=&quot;hljs-meta&quot;&gt;@Component&lt;/span&gt;({
  &lt;span class=&quot;hljs-attr&quot;&gt;selector&lt;/span&gt;: &lt;span class=&quot;hljs-string&quot;&gt;&#39;app-user&#39;&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;template&lt;/span&gt;: &lt;span class=&quot;hljs-string&quot;&gt;`&amp;lt;p&amp;gt;{{user.name}}&amp;lt;/p&amp;gt;`&lt;/span&gt;
})
&lt;span class=&quot;hljs-keyword&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title class_&quot;&gt;UserComponent&lt;/span&gt; {
  &lt;span class=&quot;hljs-meta&quot;&gt;@Input&lt;/span&gt;() user!: { &lt;span class=&quot;hljs-attr&quot;&gt;name&lt;/span&gt;: &lt;span class=&quot;hljs-built_in&quot;&gt;string&lt;/span&gt; };
}
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;p data-end=&quot;1778&quot; data-start=&quot;1768&quot;&gt;If you do:&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;1821&quot; data-start=&quot;1779&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-typescript&quot;&gt;&lt;span class=&quot;hljs-variable language_&quot;&gt;this&lt;/span&gt;.&lt;span class=&quot;hljs-property&quot;&gt;user&lt;/span&gt;.&lt;span class=&quot;hljs-property&quot;&gt;name&lt;/span&gt; = &lt;span class=&quot;hljs-string&quot;&gt;&#39;Alex&#39;&lt;/span&gt;;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;p data-end=&quot;1857&quot; data-start=&quot;1822&quot;&gt;✅ The screen updates automatically.&lt;/p&gt;
&lt;hr data-end=&quot;1862&quot; data-start=&quot;1859&quot; /&gt;
&lt;h3 data-end=&quot;1880&quot; data-start=&quot;1864&quot;&gt;Using OnPush&lt;/h3&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;2091&quot; data-start=&quot;1881&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-typescript&quot;&gt;&lt;span class=&quot;hljs-meta&quot;&gt;@Component&lt;/span&gt;({
  &lt;span class=&quot;hljs-attr&quot;&gt;selector&lt;/span&gt;: &lt;span class=&quot;hljs-string&quot;&gt;&#39;app-user&#39;&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;template&lt;/span&gt;: &lt;span class=&quot;hljs-string&quot;&gt;`&amp;lt;p&amp;gt;{{user.name}}&amp;lt;/p&amp;gt;`&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;changeDetection&lt;/span&gt;: &lt;span class=&quot;hljs-title class_&quot;&gt;ChangeDetectionStrategy&lt;/span&gt;.&lt;span class=&quot;hljs-property&quot;&gt;OnPush&lt;/span&gt;
})
&lt;span class=&quot;hljs-keyword&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title class_&quot;&gt;UserComponent&lt;/span&gt; {
  &lt;span class=&quot;hljs-meta&quot;&gt;@Input&lt;/span&gt;() user!: { &lt;span class=&quot;hljs-attr&quot;&gt;name&lt;/span&gt;: &lt;span class=&quot;hljs-built_in&quot;&gt;string&lt;/span&gt; };
}
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;p data-end=&quot;2102&quot; data-start=&quot;2092&quot;&gt;If you do:&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;2145&quot; data-start=&quot;2103&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-typescript&quot;&gt;&lt;span class=&quot;hljs-variable language_&quot;&gt;this&lt;/span&gt;.&lt;span class=&quot;hljs-property&quot;&gt;user&lt;/span&gt;.&lt;span class=&quot;hljs-property&quot;&gt;name&lt;/span&gt; = &lt;span class=&quot;hljs-string&quot;&gt;&#39;Alex&#39;&lt;/span&gt;;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;p data-end=&quot;2223&quot; data-start=&quot;2146&quot;&gt;❌ The screen &lt;strong data-end=&quot;2178&quot; data-start=&quot;2159&quot;&gt;will NOT update&lt;/strong&gt;, because the &lt;code data-end=&quot;2198&quot; data-start=&quot;2192&quot;&gt;user&lt;/code&gt; reference didn’t change.&lt;/p&gt;
&lt;p data-end=&quot;2239&quot; data-start=&quot;2225&quot;&gt;✅ Correct way:&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;2301&quot; data-start=&quot;2240&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-typescript&quot;&gt;&lt;span class=&quot;hljs-variable language_&quot;&gt;this&lt;/span&gt;.&lt;span class=&quot;hljs-property&quot;&gt;user&lt;/span&gt; = { ...&lt;span class=&quot;hljs-variable language_&quot;&gt;this&lt;/span&gt;.&lt;span class=&quot;hljs-property&quot;&gt;user&lt;/span&gt;, &lt;span class=&quot;hljs-attr&quot;&gt;name&lt;/span&gt;: &lt;span class=&quot;hljs-string&quot;&gt;&#39;Alex&#39;&lt;/span&gt; };
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;p data-end=&quot;2353&quot; data-start=&quot;2302&quot;&gt;Now Angular sees a new object and updates the view.&lt;/p&gt;
&lt;hr data-end=&quot;2358&quot; data-start=&quot;2355&quot; /&gt;
&lt;h2 data-end=&quot;2385&quot; data-start=&quot;2360&quot;&gt;4️⃣  When to Use Which&lt;/h2&gt;
&lt;ul data-end=&quot;2584&quot; data-start=&quot;2386&quot;&gt;
&lt;li data-end=&quot;2484&quot; data-start=&quot;2386&quot;&gt;
&lt;p data-end=&quot;2484&quot; data-start=&quot;2388&quot;&gt;&lt;strong data-end=&quot;2399&quot; data-start=&quot;2388&quot;&gt;Default&lt;/strong&gt;: Small or medium apps, or when you don’t want to worry about change detection rules.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2584&quot; data-start=&quot;2485&quot;&gt;
&lt;p data-end=&quot;2584&quot; data-start=&quot;2487&quot;&gt;&lt;strong data-end=&quot;2497&quot; data-start=&quot;2487&quot;&gt;OnPush&lt;/strong&gt;: Large apps or performance-critical pages where you want to reduce unnecessary checks.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;2589&quot; data-start=&quot;2586&quot; /&gt;
&lt;h2 data-end=&quot;2624&quot; data-start=&quot;2591&quot;&gt;5️⃣  Manual Control (optional)&lt;/h2&gt;
&lt;p data-end=&quot;2684&quot; data-start=&quot;2625&quot;&gt;If you use &lt;strong data-end=&quot;2646&quot; data-start=&quot;2636&quot;&gt;OnPush&lt;/strong&gt; and need to trigger a check yourself:&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;2866&quot; data-start=&quot;2685&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-typescript&quot;&gt;&lt;span class=&quot;hljs-title function_&quot;&gt;constructor&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;private&lt;/span&gt;&lt;/span&gt; cd: ChangeDetectorRef) {}

&lt;span class=&quot;hljs-title function_&quot;&gt;someAsyncWork&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot;&gt;&lt;/span&gt;) {
  &lt;span class=&quot;hljs-comment&quot;&gt;// after getting new data&lt;/span&gt;
  &lt;span class=&quot;hljs-variable language_&quot;&gt;this&lt;/span&gt;.&lt;span class=&quot;hljs-property&quot;&gt;cd&lt;/span&gt;.&lt;span class=&quot;hljs-title function_&quot;&gt;markForCheck&lt;/span&gt;(); &lt;span class=&quot;hljs-comment&quot;&gt;// tell Angular to re-check this component&lt;/span&gt;
}
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;hr data-end=&quot;2871&quot; data-start=&quot;2868&quot; /&gt;
&lt;h3 data-end=&quot;2887&quot; data-start=&quot;2873&quot;&gt;🏁 Summary&lt;/h3&gt;
&lt;ul data-end=&quot;3101&quot; data-start=&quot;2888&quot;&gt;
&lt;li data-end=&quot;2962&quot; data-start=&quot;2888&quot;&gt;
&lt;p data-end=&quot;2962&quot; data-start=&quot;2890&quot;&gt;&lt;strong data-end=&quot;2901&quot; data-start=&quot;2890&quot;&gt;Default&lt;/strong&gt;: Angular checks everything, every time → easier but heavier.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3101&quot; data-start=&quot;2963&quot;&gt;
&lt;p data-end=&quot;3101&quot; data-start=&quot;2965&quot;&gt;&lt;strong data-end=&quot;2975&quot; data-start=&quot;2965&quot;&gt;OnPush&lt;/strong&gt;: Angular checks only on input reference change, internal event, or manual trigger → faster but needs immutable data handling.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;3194&quot; data-is-last-node=&quot;&quot; data-is-only-node=&quot;&quot; data-start=&quot;3103&quot;&gt;This is the whole idea of &lt;strong data-end=&quot;3166&quot; data-start=&quot;3129&quot;&gt;Angular Change Detection Strategy&lt;/strong&gt; in simple everyday English.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://piushshukla.blogspot.com/feeds/9035160253869102119/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://piushshukla.blogspot.com/2025/09/change-detection.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2159069551745631737/posts/default/9035160253869102119'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2159069551745631737/posts/default/9035160253869102119'/><link rel='alternate' type='text/html' href='http://piushshukla.blogspot.com/2025/09/change-detection.html' title='change detection'/><author><name>Piush shukla</name><uri>http://www.blogger.com/profile/16392649283296436146</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2159069551745631737.post-1423949895361760482</id><published>2025-09-22T08:29:00.000-07:00</published><updated>2025-09-22T08:29:39.002-07:00</updated><title type='text'>Angular Lifecycle</title><content type='html'>&lt;h2 data-end=&quot;222&quot; data-start=&quot;186&quot;&gt;🧩 What Is the Angular Lifecycle?&lt;/h2&gt;
&lt;p data-end=&quot;298&quot; data-start=&quot;223&quot;&gt;Every Angular component (or directive) goes through a &lt;strong data-end=&quot;297&quot; data-start=&quot;277&quot;&gt;series of stages&lt;/strong&gt;:&lt;/p&gt;
&lt;ol data-end=&quot;412&quot; data-start=&quot;299&quot;&gt;
&lt;li data-end=&quot;310&quot; data-start=&quot;299&quot;&gt;
&lt;p data-end=&quot;310&quot; data-start=&quot;302&quot;&gt;Creation&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;342&quot; data-start=&quot;311&quot;&gt;
&lt;p data-end=&quot;342&quot; data-start=&quot;314&quot;&gt;Change detection &amp;amp; rendering&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;371&quot; data-start=&quot;343&quot;&gt;
&lt;p data-end=&quot;371&quot; data-start=&quot;346&quot;&gt;Updates when data changes&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;412&quot; data-start=&quot;372&quot;&gt;
&lt;p data-end=&quot;412&quot; data-start=&quot;375&quot;&gt;Cleanup when the component is removed&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p data-end=&quot;529&quot; data-start=&quot;414&quot;&gt;Angular provides &lt;strong data-end=&quot;450&quot; data-start=&quot;431&quot;&gt;lifecycle hooks&lt;/strong&gt;—special methods you can add to your component class to run code at each stage.&lt;/p&gt;
&lt;hr data-end=&quot;534&quot; data-start=&quot;531&quot; /&gt;
&lt;h2 data-end=&quot;566&quot; data-start=&quot;536&quot;&gt;📜 The Full Lifecycle Order&lt;/h2&gt;
&lt;p data-end=&quot;636&quot; data-start=&quot;568&quot;&gt;Below is the order Angular calls these hooks, plus what they’re for:&lt;/p&gt;
&lt;div class=&quot;_tableContainer_1rjym_1&quot;&gt;&lt;div class=&quot;group _tableWrapper_1rjym_13 flex w-fit flex-col-reverse&quot; tabindex=&quot;-1&quot;&gt;&lt;table class=&quot;w-fit min-w-(--thread-content-width)&quot; data-end=&quot;1999&quot; data-start=&quot;638&quot;&gt;&lt;thead data-end=&quot;678&quot; data-start=&quot;638&quot;&gt;&lt;tr data-end=&quot;678&quot; data-start=&quot;638&quot;&gt;&lt;th data-col-size=&quot;sm&quot; data-end=&quot;645&quot; data-start=&quot;638&quot;&gt;Hook&lt;/th&gt;&lt;th data-col-size=&quot;md&quot; data-end=&quot;660&quot; data-start=&quot;645&quot;&gt;When It Runs&lt;/th&gt;&lt;th data-col-size=&quot;md&quot; data-end=&quot;678&quot; data-start=&quot;660&quot;&gt;Why/What to Do&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody data-end=&quot;1999&quot; data-start=&quot;719&quot;&gt;&lt;tr data-end=&quot;911&quot; data-start=&quot;719&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;765&quot; data-start=&quot;719&quot;&gt;&lt;strong data-end=&quot;738&quot; data-start=&quot;721&quot;&gt;&lt;code data-end=&quot;736&quot; data-start=&quot;723&quot;&gt;constructor&lt;/code&gt;&lt;/strong&gt; &lt;em data-end=&quot;764&quot; data-start=&quot;739&quot;&gt;(not a hook, but first)&lt;/em&gt;&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;848&quot; data-start=&quot;765&quot;&gt;When the component class is instantiated (before Angular sets input properties).&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;911&quot; data-start=&quot;848&quot;&gt;Only lightweight setup—don’t rely on &lt;code data-end=&quot;897&quot; data-start=&quot;887&quot;&gt;@Input()&lt;/code&gt; values yet.&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;1059&quot; data-start=&quot;912&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;941&quot; data-start=&quot;912&quot;&gt;&lt;strong data-end=&quot;940&quot; data-start=&quot;914&quot;&gt;&lt;code data-end=&quot;938&quot; data-start=&quot;916&quot;&gt;ngOnChanges(changes)&lt;/code&gt;&lt;/strong&gt;&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;1023&quot; data-start=&quot;941&quot;&gt;Every time an &lt;code data-end=&quot;965&quot; data-start=&quot;957&quot;&gt;@Input&lt;/code&gt; property changes (called first, even before &lt;code data-end=&quot;1020&quot; data-start=&quot;1010&quot;&gt;ngOnInit&lt;/code&gt;).&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;1059&quot; data-start=&quot;1023&quot;&gt;React to input property changes.&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;1191&quot; data-start=&quot;1060&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;1079&quot; data-start=&quot;1060&quot;&gt;&lt;strong data-end=&quot;1078&quot; data-start=&quot;1062&quot;&gt;&lt;code data-end=&quot;1076&quot; data-start=&quot;1064&quot;&gt;ngOnInit()&lt;/code&gt;&lt;/strong&gt;&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;1124&quot; data-start=&quot;1079&quot;&gt;Called once after the first &lt;code data-end=&quot;1122&quot; data-start=&quot;1109&quot;&gt;ngOnChanges&lt;/code&gt;.&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;1191&quot; data-start=&quot;1124&quot;&gt;Good place for initial data loading (HTTP calls, set up state).&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;1321&quot; data-start=&quot;1192&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;1212&quot; data-start=&quot;1192&quot;&gt;&lt;strong data-end=&quot;1211&quot; data-start=&quot;1194&quot;&gt;&lt;code data-end=&quot;1209&quot; data-start=&quot;1196&quot;&gt;ngDoCheck()&lt;/code&gt;&lt;/strong&gt;&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;1268&quot; data-start=&quot;1212&quot;&gt;Called on every Angular change-detection run (often).&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;1321&quot; data-start=&quot;1268&quot;&gt;Custom change detection beyond Angular’s default.&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;1478&quot; data-start=&quot;1322&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;1351&quot; data-start=&quot;1322&quot;&gt;&lt;strong data-end=&quot;1350&quot; data-start=&quot;1324&quot;&gt;&lt;code data-end=&quot;1348&quot; data-start=&quot;1326&quot;&gt;ngAfterContentInit()&lt;/code&gt;&lt;/strong&gt;&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;1430&quot; data-start=&quot;1351&quot;&gt;After Angular projects external content into the component’s &lt;code data-end=&quot;1428&quot; data-start=&quot;1414&quot;&gt;&amp;lt;ng-content&amp;gt;&lt;/code&gt;.&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;1478&quot; data-start=&quot;1430&quot;&gt;Run logic that depends on projected content.&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;1589&quot; data-start=&quot;1479&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;1511&quot; data-start=&quot;1479&quot;&gt;&lt;strong data-end=&quot;1510&quot; data-start=&quot;1481&quot;&gt;&lt;code data-end=&quot;1508&quot; data-start=&quot;1483&quot;&gt;ngAfterContentChecked()&lt;/code&gt;&lt;/strong&gt;&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;1553&quot; data-start=&quot;1511&quot;&gt;After every check of projected content.&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;1589&quot; data-start=&quot;1553&quot;&gt;Respond if that content changes.&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;1733&quot; data-start=&quot;1590&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;1616&quot; data-start=&quot;1590&quot;&gt;&lt;strong data-end=&quot;1615&quot; data-start=&quot;1592&quot;&gt;&lt;code data-end=&quot;1613&quot; data-start=&quot;1594&quot;&gt;ngAfterViewInit()&lt;/code&gt;&lt;/strong&gt;&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;1686&quot; data-start=&quot;1616&quot;&gt;After the component’s view (and child views) are fully initialized.&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;1733&quot; data-start=&quot;1686&quot;&gt;Safely access &lt;code data-end=&quot;1714&quot; data-start=&quot;1702&quot;&gt;@ViewChild&lt;/code&gt; elements or DOM.&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;1851&quot; data-start=&quot;1734&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;1763&quot; data-start=&quot;1734&quot;&gt;&lt;strong data-end=&quot;1762&quot; data-start=&quot;1736&quot;&gt;&lt;code data-end=&quot;1760&quot; data-start=&quot;1738&quot;&gt;ngAfterViewChecked()&lt;/code&gt;&lt;/strong&gt;&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;1808&quot; data-start=&quot;1763&quot;&gt;After every check of the component’s view.&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;1851&quot; data-start=&quot;1808&quot;&gt;Rarely needed; respond to view changes.&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;1999&quot; data-start=&quot;1852&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;1874&quot; data-start=&quot;1852&quot;&gt;&lt;strong data-end=&quot;1873&quot; data-start=&quot;1854&quot;&gt;&lt;code data-end=&quot;1871&quot; data-start=&quot;1856&quot;&gt;ngOnDestroy()&lt;/code&gt;&lt;/strong&gt;&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;1920&quot; data-start=&quot;1874&quot;&gt;Right before Angular removes the component.&lt;/td&gt;&lt;td data-col-size=&quot;md&quot; data-end=&quot;1999&quot; data-start=&quot;1920&quot;&gt;Cleanup: unsubscribe from Observables, stop timers, detach event listeners.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;
&lt;hr data-end=&quot;2004&quot; data-start=&quot;2001&quot; /&gt;
&lt;h3 data-end=&quot;2024&quot; data-start=&quot;2006&quot;&gt;📊 Visual Flow&lt;/h3&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;2319&quot; data-start=&quot;2026&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre!&quot;&gt;&lt;span class=&quot;hljs-selector-tag&quot;&gt;constructor&lt;/span&gt;
   ↓
&lt;span class=&quot;hljs-selector-tag&quot;&gt;ngOnChanges&lt;/span&gt;  (if &lt;span class=&quot;hljs-variable&quot;&gt;@Input&lt;/span&gt; present)
   ↓
&lt;span class=&quot;hljs-selector-tag&quot;&gt;ngOnInit&lt;/span&gt;
   ↓
&lt;span class=&quot;hljs-selector-tag&quot;&gt;ngDoCheck&lt;/span&gt;
   ↓
&lt;span class=&quot;hljs-selector-tag&quot;&gt;ngAfterContentInit&lt;/span&gt;
   ↓
&lt;span class=&quot;hljs-selector-tag&quot;&gt;ngAfterContentChecked&lt;/span&gt;
   ↓
&lt;span class=&quot;hljs-selector-tag&quot;&gt;ngAfterViewInit&lt;/span&gt;
   ↓
&lt;span class=&quot;hljs-selector-tag&quot;&gt;ngAfterViewChecked&lt;/span&gt;
   ↓
&lt;span class=&quot;hljs-selector-attr&quot;&gt;[ ... repeats ngDoCheck, ngAfterContentChecked, ngAfterViewChecked as data changes ... ]&lt;/span&gt;
   ↓
&lt;span class=&quot;hljs-selector-tag&quot;&gt;ngOnDestroy&lt;/span&gt;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;hr data-end=&quot;2324&quot; data-start=&quot;2321&quot; /&gt;
&lt;h2 data-end=&quot;2350&quot; data-start=&quot;2326&quot;&gt;🛠️ Example Component&lt;/h2&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;3323&quot; data-start=&quot;2352&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-typescript&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;import&lt;/span&gt; { 
  &lt;span class=&quot;hljs-title class_&quot;&gt;Component&lt;/span&gt;, &lt;span class=&quot;hljs-title class_&quot;&gt;Input&lt;/span&gt;, &lt;span class=&quot;hljs-title class_&quot;&gt;OnInit&lt;/span&gt;, &lt;span class=&quot;hljs-title class_&quot;&gt;OnChanges&lt;/span&gt;, &lt;span class=&quot;hljs-title class_&quot;&gt;DoCheck&lt;/span&gt;,
  &lt;span class=&quot;hljs-title class_&quot;&gt;AfterContentInit&lt;/span&gt;, &lt;span class=&quot;hljs-title class_&quot;&gt;AfterContentChecked&lt;/span&gt;,
  &lt;span class=&quot;hljs-title class_&quot;&gt;AfterViewInit&lt;/span&gt;, &lt;span class=&quot;hljs-title class_&quot;&gt;AfterViewChecked&lt;/span&gt;, &lt;span class=&quot;hljs-title class_&quot;&gt;OnDestroy&lt;/span&gt;, &lt;span class=&quot;hljs-title class_&quot;&gt;SimpleChanges&lt;/span&gt;
} &lt;span class=&quot;hljs-keyword&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&#39;@angular/core&#39;&lt;/span&gt;;

&lt;span class=&quot;hljs-meta&quot;&gt;@Component&lt;/span&gt;({
  &lt;span class=&quot;hljs-attr&quot;&gt;selector&lt;/span&gt;: &lt;span class=&quot;hljs-string&quot;&gt;&#39;app-demo&#39;&lt;/span&gt;,
  &lt;span class=&quot;hljs-attr&quot;&gt;template&lt;/span&gt;: &lt;span class=&quot;hljs-string&quot;&gt;`&amp;lt;p&amp;gt;{{message}}&amp;lt;/p&amp;gt;`&lt;/span&gt;
})
&lt;span class=&quot;hljs-keyword&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title class_&quot;&gt;DemoComponent&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;implements&lt;/span&gt;
  &lt;span class=&quot;hljs-title class_&quot;&gt;OnInit&lt;/span&gt;, &lt;span class=&quot;hljs-title class_&quot;&gt;OnChanges&lt;/span&gt;, &lt;span class=&quot;hljs-title class_&quot;&gt;DoCheck&lt;/span&gt;,
  &lt;span class=&quot;hljs-title class_&quot;&gt;AfterContentInit&lt;/span&gt;, &lt;span class=&quot;hljs-title class_&quot;&gt;AfterContentChecked&lt;/span&gt;,
  &lt;span class=&quot;hljs-title class_&quot;&gt;AfterViewInit&lt;/span&gt;, &lt;span class=&quot;hljs-title class_&quot;&gt;AfterViewChecked&lt;/span&gt;,
  &lt;span class=&quot;hljs-title class_&quot;&gt;OnDestroy&lt;/span&gt; {

  &lt;span class=&quot;hljs-meta&quot;&gt;@Input&lt;/span&gt;() message = &lt;span class=&quot;hljs-string&quot;&gt;&#39;&#39;&lt;/span&gt;;

  &lt;span class=&quot;hljs-title function_&quot;&gt;constructor&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot;&gt;&lt;/span&gt;) { &lt;span class=&quot;hljs-variable language_&quot;&gt;console&lt;/span&gt;.&lt;span class=&quot;hljs-title function_&quot;&gt;log&lt;/span&gt;(&lt;span class=&quot;hljs-string&quot;&gt;&#39;constructor&#39;&lt;/span&gt;); }

  &lt;span class=&quot;hljs-title function_&quot;&gt;ngOnChanges&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot;&gt;changes: SimpleChanges&lt;/span&gt;) { &lt;span class=&quot;hljs-variable language_&quot;&gt;console&lt;/span&gt;.&lt;span class=&quot;hljs-title function_&quot;&gt;log&lt;/span&gt;(&lt;span class=&quot;hljs-string&quot;&gt;&#39;ngOnChanges&#39;&lt;/span&gt;, changes); }
  &lt;span class=&quot;hljs-title function_&quot;&gt;ngOnInit&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot;&gt;&lt;/span&gt;) { &lt;span class=&quot;hljs-variable language_&quot;&gt;console&lt;/span&gt;.&lt;span class=&quot;hljs-title function_&quot;&gt;log&lt;/span&gt;(&lt;span class=&quot;hljs-string&quot;&gt;&#39;ngOnInit&#39;&lt;/span&gt;); }
  &lt;span class=&quot;hljs-title function_&quot;&gt;ngDoCheck&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot;&gt;&lt;/span&gt;) { &lt;span class=&quot;hljs-variable language_&quot;&gt;console&lt;/span&gt;.&lt;span class=&quot;hljs-title function_&quot;&gt;log&lt;/span&gt;(&lt;span class=&quot;hljs-string&quot;&gt;&#39;ngDoCheck&#39;&lt;/span&gt;); }
  &lt;span class=&quot;hljs-title function_&quot;&gt;ngAfterContentInit&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot;&gt;&lt;/span&gt;) { &lt;span class=&quot;hljs-variable language_&quot;&gt;console&lt;/span&gt;.&lt;span class=&quot;hljs-title function_&quot;&gt;log&lt;/span&gt;(&lt;span class=&quot;hljs-string&quot;&gt;&#39;ngAfterContentInit&#39;&lt;/span&gt;); }
  &lt;span class=&quot;hljs-title function_&quot;&gt;ngAfterContentChecked&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot;&gt;&lt;/span&gt;) { &lt;span class=&quot;hljs-variable language_&quot;&gt;console&lt;/span&gt;.&lt;span class=&quot;hljs-title function_&quot;&gt;log&lt;/span&gt;(&lt;span class=&quot;hljs-string&quot;&gt;&#39;ngAfterContentChecked&#39;&lt;/span&gt;); }
  &lt;span class=&quot;hljs-title function_&quot;&gt;ngAfterViewInit&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot;&gt;&lt;/span&gt;) { &lt;span class=&quot;hljs-variable language_&quot;&gt;console&lt;/span&gt;.&lt;span class=&quot;hljs-title function_&quot;&gt;log&lt;/span&gt;(&lt;span class=&quot;hljs-string&quot;&gt;&#39;ngAfterViewInit&#39;&lt;/span&gt;); }
  &lt;span class=&quot;hljs-title function_&quot;&gt;ngAfterViewChecked&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot;&gt;&lt;/span&gt;) { &lt;span class=&quot;hljs-variable language_&quot;&gt;console&lt;/span&gt;.&lt;span class=&quot;hljs-title function_&quot;&gt;log&lt;/span&gt;(&lt;span class=&quot;hljs-string&quot;&gt;&#39;ngAfterViewChecked&#39;&lt;/span&gt;); }
  &lt;span class=&quot;hljs-title function_&quot;&gt;ngOnDestroy&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot;&gt;&lt;/span&gt;) { &lt;span class=&quot;hljs-variable language_&quot;&gt;console&lt;/span&gt;.&lt;span class=&quot;hljs-title function_&quot;&gt;log&lt;/span&gt;(&lt;span class=&quot;hljs-string&quot;&gt;&#39;ngOnDestroy&#39;&lt;/span&gt;); }
}
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;p data-end=&quot;3386&quot; data-start=&quot;3325&quot;&gt;Check the browser console to see the call order in real time.&lt;/p&gt;
&lt;hr data-end=&quot;3391&quot; data-start=&quot;3388&quot; /&gt;
&lt;h2 data-end=&quot;3413&quot; data-start=&quot;3393&quot;&gt;🏆 Best Practices&lt;/h2&gt;
&lt;ul data-end=&quot;3690&quot; data-start=&quot;3414&quot;&gt;
&lt;li data-end=&quot;3471&quot; data-start=&quot;3414&quot;&gt;
&lt;p data-end=&quot;3471&quot; data-start=&quot;3416&quot;&gt;&lt;strong data-end=&quot;3449&quot; data-start=&quot;3416&quot;&gt;Initialize data in &lt;code data-end=&quot;3447&quot; data-start=&quot;3437&quot;&gt;ngOnInit&lt;/code&gt;&lt;/strong&gt;, not the constructor.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3547&quot; data-start=&quot;3472&quot;&gt;
&lt;p data-end=&quot;3547&quot; data-start=&quot;3474&quot;&gt;&lt;strong data-end=&quot;3503&quot; data-start=&quot;3474&quot;&gt;Clean up in &lt;code data-end=&quot;3501&quot; data-start=&quot;3488&quot;&gt;ngOnDestroy&lt;/code&gt;&lt;/strong&gt; (unsubscribe Observables, clear intervals).&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3607&quot; data-start=&quot;3548&quot;&gt;
&lt;p data-end=&quot;3607&quot; data-start=&quot;3550&quot;&gt;Use &lt;strong data-end=&quot;3571&quot; data-start=&quot;3554&quot;&gt;&lt;code data-end=&quot;3569&quot; data-start=&quot;3556&quot;&gt;ngOnChanges&lt;/code&gt;&lt;/strong&gt; to react to input property changes.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3690&quot; data-start=&quot;3608&quot;&gt;
&lt;p data-end=&quot;3690&quot; data-start=&quot;3610&quot;&gt;Use view-related hooks (&lt;code data-end=&quot;3651&quot; data-start=&quot;3634&quot;&gt;ngAfterViewInit&lt;/code&gt;) only when you need direct DOM access.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;3695&quot; data-start=&quot;3692&quot; /&gt;
&lt;h3 data-end=&quot;3715&quot; data-start=&quot;3697&quot;&gt;🏁 Quick Recap&lt;/h3&gt;
&lt;p data-end=&quot;3760&quot; data-start=&quot;3716&quot;&gt;Angular’s component lifecycle is a sequence:&lt;/p&gt;
&lt;ol data-end=&quot;3916&quot; data-start=&quot;3761&quot;&gt;
&lt;li data-end=&quot;3811&quot; data-start=&quot;3761&quot;&gt;
&lt;p data-end=&quot;3811&quot; data-start=&quot;3764&quot;&gt;&lt;strong data-end=&quot;3774&quot; data-start=&quot;3764&quot;&gt;Create&lt;/strong&gt; → constructor, ngOnChanges, ngOnInit&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3874&quot; data-start=&quot;3812&quot;&gt;
&lt;p data-end=&quot;3874&quot; data-start=&quot;3815&quot;&gt;&lt;strong data-end=&quot;3833&quot; data-start=&quot;3815&quot;&gt;Check &amp;amp; update&lt;/strong&gt; → ngDoCheck, ngAfterContent*/View* hooks&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3916&quot; data-start=&quot;3875&quot;&gt;
&lt;p data-end=&quot;3916&quot; data-start=&quot;3878&quot;&gt;&lt;strong data-end=&quot;3889&quot; data-start=&quot;3878&quot;&gt;Destroy&lt;/strong&gt; → ngOnDestroy for cleanup.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p data-end=&quot;4049&quot; data-is-last-node=&quot;&quot; data-is-only-node=&quot;&quot; data-start=&quot;3918&quot;&gt;Knowing these hooks helps you &lt;strong data-end=&quot;4021&quot; data-start=&quot;3948&quot;&gt;load data at the right time, manage resources, and avoid memory leaks&lt;/strong&gt; in any Angular application.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://piushshukla.blogspot.com/feeds/1423949895361760482/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://piushshukla.blogspot.com/2025/09/angular-lifecycle.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2159069551745631737/posts/default/1423949895361760482'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2159069551745631737/posts/default/1423949895361760482'/><link rel='alternate' type='text/html' href='http://piushshukla.blogspot.com/2025/09/angular-lifecycle.html' title='Angular Lifecycle'/><author><name>Piush shukla</name><uri>http://www.blogger.com/profile/16392649283296436146</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2159069551745631737.post-3102295059809943360</id><published>2025-09-22T08:23:00.000-07:00</published><updated>2025-09-22T08:23:30.422-07:00</updated><title type='text'>Azure Function</title><content type='html'>&lt;h2 data-end=&quot;133&quot; data-start=&quot;101&quot;&gt;💡 What is an Azure Function?&lt;/h2&gt;
&lt;p data-end=&quot;188&quot; data-start=&quot;134&quot;&gt;Azure Functions is a &lt;strong data-end=&quot;185&quot; data-start=&quot;155&quot;&gt;serverless compute service&lt;/strong&gt;.&lt;/p&gt;
&lt;ul data-end=&quot;368&quot; data-start=&quot;189&quot;&gt;
&lt;li data-end=&quot;259&quot; data-start=&quot;189&quot;&gt;
&lt;p data-end=&quot;259&quot; data-start=&quot;191&quot;&gt;You write small pieces of code (“functions”) that run &lt;strong data-end=&quot;258&quot; data-start=&quot;245&quot;&gt;on demand&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;325&quot; data-start=&quot;260&quot;&gt;
&lt;p data-end=&quot;325&quot; data-start=&quot;262&quot;&gt;Microsoft manages all the servers, scaling, and infrastructure.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;368&quot; data-start=&quot;326&quot;&gt;
&lt;p data-end=&quot;368&quot; data-start=&quot;328&quot;&gt;You pay only for the &lt;strong data-end=&quot;367&quot; data-start=&quot;349&quot;&gt;execution time&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;373&quot; data-start=&quot;370&quot; /&gt;
&lt;h2 data-end=&quot;393&quot; data-start=&quot;375&quot;&gt;🚀 Key Features&lt;/h2&gt;
&lt;ul data-end=&quot;641&quot; data-start=&quot;394&quot;&gt;
&lt;li data-end=&quot;497&quot; data-start=&quot;394&quot;&gt;
&lt;p data-end=&quot;497&quot; data-start=&quot;396&quot;&gt;&lt;strong data-end=&quot;412&quot; data-start=&quot;396&quot;&gt;Event-driven&lt;/strong&gt;: Triggered by events like HTTP requests, a queue message, a timer, or a blob upload.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;556&quot; data-start=&quot;498&quot;&gt;
&lt;p data-end=&quot;556&quot; data-start=&quot;500&quot;&gt;&lt;strong data-end=&quot;521&quot; data-start=&quot;500&quot;&gt;Automatic scaling&lt;/strong&gt;: Runs as many instances as needed.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;641&quot; data-start=&quot;557&quot;&gt;
&lt;p data-end=&quot;641&quot; data-start=&quot;559&quot;&gt;&lt;strong data-end=&quot;591&quot; data-start=&quot;559&quot;&gt;Multiple triggers &amp;amp; bindings&lt;/strong&gt;: Connect to storage, Service Bus, Cosmos DB, etc.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;646&quot; data-start=&quot;643&quot; /&gt;
&lt;h2 data-end=&quot;699&quot; data-start=&quot;648&quot;&gt;🏗️ Create a Simple HTTP-Triggered Function (C#)&lt;/h2&gt;
&lt;h3 data-end=&quot;722&quot; data-start=&quot;701&quot;&gt;1️⃣ Prerequisites&lt;/h3&gt;
&lt;ul data-end=&quot;906&quot; data-start=&quot;723&quot;&gt;
&lt;li data-end=&quot;764&quot; data-start=&quot;723&quot;&gt;
&lt;p data-end=&quot;764&quot; data-start=&quot;725&quot;&gt;&lt;strong data-end=&quot;743&quot; data-start=&quot;725&quot;&gt;.NET 6/7/8 SDK&lt;/strong&gt; (latest recommended)&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;797&quot; data-start=&quot;765&quot;&gt;
&lt;p data-end=&quot;797&quot; data-start=&quot;767&quot;&gt;&lt;strong data-end=&quot;797&quot; data-start=&quot;767&quot;&gt;Azure Functions Core Tools&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;868&quot; data-start=&quot;798&quot;&gt;
&lt;p data-end=&quot;868&quot; data-start=&quot;800&quot;&gt;&lt;strong data-end=&quot;822&quot; data-start=&quot;800&quot;&gt;Visual Studio 2022&lt;/strong&gt; or &lt;strong data-end=&quot;837&quot; data-start=&quot;826&quot;&gt;VS Code&lt;/strong&gt; with Azure Functions extension&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;906&quot; data-start=&quot;869&quot;&gt;
&lt;p data-end=&quot;906&quot; data-start=&quot;871&quot;&gt;Azure subscription (for deployment)&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;911&quot; data-start=&quot;908&quot; /&gt;
&lt;h3 data-end=&quot;939&quot; data-start=&quot;913&quot;&gt;2️⃣ Create the Project&lt;/h3&gt;
&lt;p data-end=&quot;959&quot; data-start=&quot;940&quot;&gt;With Visual Studio:&lt;/p&gt;
&lt;ol data-end=&quot;1158&quot; data-start=&quot;960&quot;&gt;
&lt;li data-end=&quot;1004&quot; data-start=&quot;960&quot;&gt;
&lt;p data-end=&quot;1004&quot; data-start=&quot;963&quot;&gt;&lt;strong data-end=&quot;1004&quot; data-start=&quot;963&quot;&gt;New Project → Azure Functions → Next.&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1064&quot; data-start=&quot;1005&quot;&gt;
&lt;p data-end=&quot;1064&quot; data-start=&quot;1008&quot;&gt;Name it, choose &lt;strong data-end=&quot;1063&quot; data-start=&quot;1024&quot;&gt;.NET 6/7/8 (Isolated or In-Process)&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1107&quot; data-start=&quot;1065&quot;&gt;
&lt;p data-end=&quot;1107&quot; data-start=&quot;1068&quot;&gt;Choose &lt;strong data-end=&quot;1106&quot; data-start=&quot;1075&quot;&gt;Trigger type = HTTP Trigger&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1158&quot; data-start=&quot;1108&quot;&gt;
&lt;p data-end=&quot;1158&quot; data-start=&quot;1111&quot;&gt;Authorization level: &lt;em data-end=&quot;1143&quot; data-start=&quot;1132&quot;&gt;Anonymous&lt;/em&gt; (for testing).&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p data-end=&quot;1204&quot; data-start=&quot;1160&quot;&gt;This generates a default function file like:&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;1649&quot; data-start=&quot;1206&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-csharp&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;using&lt;/span&gt; System.Net;

&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;HelloFunction&lt;/span&gt;
{
    [&lt;span class=&quot;hljs-meta&quot;&gt;FunctionName(&lt;span class=&quot;hljs-string&quot;&gt;&quot;HelloFunction&quot;&lt;/span&gt;&lt;/span&gt;)]
    &lt;span class=&quot;hljs-function&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;static&lt;/span&gt; IActionResult &lt;span class=&quot;hljs-title&quot;&gt;Run&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot;&gt;
        [HttpTrigger(AuthorizationLevel.Function, &lt;/span&gt;&lt;span class=&quot;hljs-string&quot;&gt;&quot;get&quot;&lt;/span&gt;, &lt;span class=&quot;hljs-string&quot;&gt;&quot;post&quot;&lt;/span&gt;)] HttpRequest req,
        ILogger log)
    {
        log.LogInformation(&lt;span class=&quot;hljs-string&quot;&gt;&quot;C# HTTP trigger function processed a request.&quot;&lt;/span&gt;);

        &lt;span class=&quot;hljs-built_in&quot;&gt;string&lt;/span&gt; name = req.Query[&lt;span class=&quot;hljs-string&quot;&gt;&quot;name&quot;&lt;/span&gt;];
        &lt;span class=&quot;hljs-keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;new&lt;/span&gt; OkObjectResult(&lt;span class=&quot;hljs-string&quot;&gt;$&quot;Hello, &lt;span class=&quot;hljs-subst&quot;&gt;{name ?? &lt;span class=&quot;hljs-string&quot;&gt;&quot;world&quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;}!&quot;);
    }
}
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;hr data-end=&quot;1654&quot; data-start=&quot;1651&quot; /&gt;
&lt;h3 data-end=&quot;1675&quot; data-start=&quot;1656&quot;&gt;3️⃣ Run Locally&lt;/h3&gt;
&lt;ul data-end=&quot;1824&quot; data-start=&quot;1676&quot;&gt;
&lt;li data-end=&quot;1747&quot; data-start=&quot;1676&quot;&gt;
&lt;p data-end=&quot;1718&quot; data-start=&quot;1678&quot;&gt;Press &lt;strong data-end=&quot;1690&quot; data-start=&quot;1684&quot;&gt;F5&lt;/strong&gt; (Visual Studio) or use CLI:&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;1747&quot; data-start=&quot;1721&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-bash&quot;&gt;func start
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1824&quot; data-start=&quot;1748&quot;&gt;
&lt;p data-end=&quot;1824&quot; data-start=&quot;1750&quot;&gt;Test in browser:&lt;br data-end=&quot;1769&quot; data-start=&quot;1766&quot; /&gt;
&lt;code data-end=&quot;1824&quot; data-start=&quot;1771&quot;&gt;http://localhost:7071/api/HelloFunction?name=Shivan&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;1829&quot; data-start=&quot;1826&quot; /&gt;
&lt;h3 data-end=&quot;1854&quot; data-start=&quot;1831&quot;&gt;4️⃣ Deploy to Azure&lt;/h3&gt;
&lt;ol data-end=&quot;2021&quot; data-start=&quot;1855&quot;&gt;
&lt;li data-end=&quot;1900&quot; data-start=&quot;1855&quot;&gt;
&lt;p data-end=&quot;1900&quot; data-start=&quot;1858&quot;&gt;Right-click project → &lt;strong data-end=&quot;1899&quot; data-start=&quot;1880&quot;&gt;Publish → Azure&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1970&quot; data-start=&quot;1901&quot;&gt;
&lt;p data-end=&quot;1970&quot; data-start=&quot;1904&quot;&gt;Choose an existing or new Function App in your Azure subscription.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2021&quot; data-start=&quot;1971&quot;&gt;
&lt;p data-end=&quot;2021&quot; data-start=&quot;1974&quot;&gt;After deployment, Azure gives you a public URL.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;hr data-end=&quot;2026&quot; data-start=&quot;2023&quot; /&gt;
&lt;h2 data-end=&quot;2055&quot; data-start=&quot;2028&quot;&gt;⏱️ Other Common Triggers&lt;/h2&gt;
&lt;ul data-end=&quot;2240&quot; data-start=&quot;2056&quot;&gt;
&lt;li data-end=&quot;2113&quot; data-start=&quot;2056&quot;&gt;
&lt;p data-end=&quot;2113&quot; data-start=&quot;2058&quot;&gt;&lt;strong data-end=&quot;2075&quot; data-start=&quot;2058&quot;&gt;Timer Trigger&lt;/strong&gt;: Run on a schedule (like a cron job).&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2174&quot; data-start=&quot;2114&quot;&gt;
&lt;p data-end=&quot;2174&quot; data-start=&quot;2116&quot;&gt;&lt;strong data-end=&quot;2145&quot; data-start=&quot;2116&quot;&gt;Queue/Service Bus Trigger&lt;/strong&gt;: Run when a message arrives.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2240&quot; data-start=&quot;2175&quot;&gt;
&lt;p data-end=&quot;2240&quot; data-start=&quot;2177&quot;&gt;&lt;strong data-end=&quot;2193&quot; data-start=&quot;2177&quot;&gt;Blob Trigger&lt;/strong&gt;: Run when a file is uploaded to Azure Storage.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;2264&quot; data-start=&quot;2242&quot;&gt;Example Timer Trigger:&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;2461&quot; data-start=&quot;2265&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-csharp&quot;&gt;[&lt;span class=&quot;hljs-meta&quot;&gt;FunctionName(&lt;span class=&quot;hljs-string&quot;&gt;&quot;DailyCleanup&quot;&lt;/span&gt;&lt;/span&gt;)]
&lt;span class=&quot;hljs-function&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;Run&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot;&gt;[TimerTrigger(&lt;span class=&quot;hljs-string&quot;&gt;&quot;0 0 2 * * *&quot;&lt;/span&gt;&lt;/span&gt;)]TimerInfo myTimer, ILogger log)
{
    log.LogInformation(&lt;span class=&quot;hljs-string&quot;&gt;$&quot;Cleanup executed at: &lt;span class=&quot;hljs-subst&quot;&gt;{DateTime.Now}&lt;/span&gt;&lt;/span&gt;&quot;);
}
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;hr data-end=&quot;2466&quot; data-start=&quot;2463&quot; /&gt;
&lt;h2 data-end=&quot;2499&quot; data-start=&quot;2468&quot;&gt;🔌 Input and Output Bindings&lt;/h2&gt;
&lt;p data-end=&quot;2567&quot; data-start=&quot;2500&quot;&gt;Bindings connect your function to other services with minimal code.&lt;/p&gt;
&lt;p data-end=&quot;2616&quot; data-start=&quot;2569&quot;&gt;Example: Save an HTTP request body to Cosmos DB&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;3063&quot; data-start=&quot;2617&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-csharp&quot;&gt;[&lt;span class=&quot;hljs-meta&quot;&gt;FunctionName(&lt;span class=&quot;hljs-string&quot;&gt;&quot;SaveOrder&quot;&lt;/span&gt;&lt;/span&gt;)]
&lt;span class=&quot;hljs-function&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;async&lt;/span&gt; Task&amp;lt;IActionResult&amp;gt; &lt;span class=&quot;hljs-title&quot;&gt;Run&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot;&gt;
    [HttpTrigger(&lt;/span&gt;&lt;span class=&quot;hljs-string&quot;&gt;&quot;post&quot;&lt;/span&gt;)] HttpRequest req,
    [&lt;span class=&quot;hljs-title&quot;&gt;CosmosDB&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot;&gt;
        databaseName: &lt;/span&gt;&lt;span class=&quot;hljs-string&quot;&gt;&quot;OrdersDb&quot;&lt;/span&gt;,
        containerName: &lt;span class=&quot;hljs-string&quot;&gt;&quot;Orders&quot;&lt;/span&gt;,
        Connection = &lt;span class=&quot;hljs-string&quot;&gt;&quot;CosmosDBConnection&quot;&lt;/span&gt;)] IAsyncCollector&amp;lt;Order&amp;gt; ordersOut,
    ILogger log)
{
    &lt;span class=&quot;hljs-keyword&quot;&gt;var&lt;/span&gt; order = &lt;span class=&quot;hljs-keyword&quot;&gt;await&lt;/span&gt; JsonSerializer.DeserializeAsync&amp;lt;Order&amp;gt;(req.Body);
    &lt;span class=&quot;hljs-keyword&quot;&gt;await&lt;/span&gt; ordersOut.AddAsync(order);
    &lt;span class=&quot;hljs-keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;new&lt;/span&gt; OkResult();
}
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;p data-end=&quot;3121&quot; data-start=&quot;3064&quot;&gt;No explicit Cosmos client code required—Azure handles it.&lt;/p&gt;
&lt;hr data-end=&quot;3126&quot; data-start=&quot;3123&quot; /&gt;
&lt;h2 data-end=&quot;3147&quot; data-start=&quot;3128&quot;&gt;⚙️ Hosting Plans&lt;/h2&gt;
&lt;ul data-end=&quot;3333&quot; data-start=&quot;3148&quot;&gt;
&lt;li data-end=&quot;3217&quot; data-start=&quot;3148&quot;&gt;
&lt;p data-end=&quot;3217&quot; data-start=&quot;3150&quot;&gt;&lt;strong data-end=&quot;3165&quot; data-start=&quot;3150&quot;&gt;Consumption&lt;/strong&gt; (default): Pay per execution, scales automatically.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3263&quot; data-start=&quot;3218&quot;&gt;
&lt;p data-end=&quot;3263&quot; data-start=&quot;3220&quot;&gt;&lt;strong data-end=&quot;3231&quot; data-start=&quot;3220&quot;&gt;Premium&lt;/strong&gt;: Always warm, more performance.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3333&quot; data-start=&quot;3264&quot;&gt;
&lt;p data-end=&quot;3333&quot; data-start=&quot;3266&quot;&gt;&lt;strong data-end=&quot;3298&quot; data-start=&quot;3266&quot;&gt;Dedicated (App Service Plan)&lt;/strong&gt;: Fixed compute, for special cases.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;3338&quot; data-start=&quot;3335&quot; /&gt;
&lt;h2 data-end=&quot;3355&quot; data-start=&quot;3340&quot;&gt;✅ Key Points&lt;/h2&gt;
&lt;ul data-end=&quot;3610&quot; data-start=&quot;3356&quot;&gt;
&lt;li data-end=&quot;3411&quot; data-start=&quot;3356&quot;&gt;
&lt;p data-end=&quot;3411&quot; data-start=&quot;3358&quot;&gt;&lt;strong data-end=&quot;3387&quot; data-start=&quot;3358&quot;&gt;Event-driven &amp;amp; serverless&lt;/strong&gt; → write only the logic.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3491&quot; data-start=&quot;3412&quot;&gt;
&lt;p data-end=&quot;3491&quot; data-start=&quot;3414&quot;&gt;Supports many triggers/bindings (HTTP, Timer, Queue, Blob, Event Grid, etc.).&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3555&quot; data-start=&quot;3492&quot;&gt;
&lt;p data-end=&quot;3555&quot; data-start=&quot;3494&quot;&gt;Write in C# (in-process or isolated process) with .NET 6/7/8.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3610&quot; data-start=&quot;3556&quot;&gt;
&lt;p data-end=&quot;3610&quot; data-start=&quot;3558&quot;&gt;Local dev → test → deploy to Azure with one command.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;3615&quot; data-start=&quot;3612&quot; /&gt;
&lt;h3 data-end=&quot;3631&quot; data-start=&quot;3617&quot;&gt;🏁 Summary&lt;/h3&gt;
&lt;p data-end=&quot;3788&quot; data-start=&quot;3632&quot;&gt;An &lt;strong data-end=&quot;3659&quot; data-start=&quot;3635&quot;&gt;Azure Function in C#&lt;/strong&gt; is just a small method decorated with a &lt;code data-end=&quot;3716&quot; data-start=&quot;3700&quot;&gt;[FunctionName]&lt;/code&gt; attribute that responds to a trigger (HTTP, Timer, Queue, etc.).&lt;br data-end=&quot;3784&quot; data-start=&quot;3781&quot; /&gt;
You:&lt;/p&gt;
&lt;ol data-end=&quot;3874&quot; data-start=&quot;3789&quot;&gt;
&lt;li data-end=&quot;3818&quot; data-start=&quot;3789&quot;&gt;
&lt;p data-end=&quot;3818&quot; data-start=&quot;3792&quot;&gt;Create a Function project,&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3847&quot; data-start=&quot;3819&quot;&gt;
&lt;p data-end=&quot;3847&quot; data-start=&quot;3822&quot;&gt;Write the function logic,&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3874&quot; data-start=&quot;3848&quot;&gt;
&lt;p data-end=&quot;3874&quot; data-start=&quot;3851&quot;&gt;Run locally and deploy.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p data-end=&quot;3985&quot; data-is-last-node=&quot;&quot; data-is-only-node=&quot;&quot; data-start=&quot;3876&quot;&gt;This makes it perfect for &lt;strong data-end=&quot;3959&quot; data-start=&quot;3902&quot;&gt;microservices, scheduled jobs, or quick API endpoints&lt;/strong&gt; without managing servers.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://piushshukla.blogspot.com/feeds/3102295059809943360/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://piushshukla.blogspot.com/2025/09/azure-function.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2159069551745631737/posts/default/3102295059809943360'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2159069551745631737/posts/default/3102295059809943360'/><link rel='alternate' type='text/html' href='http://piushshukla.blogspot.com/2025/09/azure-function.html' title='Azure Function'/><author><name>Piush shukla</name><uri>http://www.blogger.com/profile/16392649283296436146</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2159069551745631737.post-8455950771948707463</id><published>2025-09-22T08:19:00.000-07:00</published><updated>2025-09-22T08:19:11.169-07:00</updated><title type='text'>What are key differences between .NET Framework and .NET 8+ (.NET Core)?</title><content type='html'>&lt;p data-end=&quot;145&quot; data-start=&quot;0&quot;&gt;Here’s a &lt;strong data-end=&quot;113&quot; data-start=&quot;9&quot;&gt;clear comparison of the classic .NET Framework vs. modern .NET (a.k.a. .NET Core / .NET 5+ / .NET 8)&lt;/strong&gt; so you can see how they differ:&lt;/p&gt;
&lt;div class=&quot;_tableContainer_1rjym_1&quot;&gt;&lt;div class=&quot;group _tableWrapper_1rjym_13 flex w-fit flex-col-reverse&quot; tabindex=&quot;-1&quot;&gt;&lt;table class=&quot;w-fit min-w-(--thread-content-width)&quot; data-end=&quot;2125&quot; data-start=&quot;147&quot;&gt;&lt;thead data-end=&quot;230&quot; data-start=&quot;147&quot;&gt;&lt;tr data-end=&quot;230&quot; data-start=&quot;147&quot;&gt;&lt;th data-col-size=&quot;sm&quot; data-end=&quot;166&quot; data-start=&quot;147&quot;&gt;Feature / Aspect&lt;/th&gt;&lt;th data-col-size=&quot;lg&quot; data-end=&quot;187&quot; data-start=&quot;166&quot;&gt;&lt;strong data-end=&quot;186&quot; data-start=&quot;168&quot;&gt;.NET Framework&lt;/strong&gt;&lt;/th&gt;&lt;th data-col-size=&quot;lg&quot; data-end=&quot;230&quot; data-start=&quot;187&quot;&gt;&lt;strong data-end=&quot;228&quot; data-start=&quot;189&quot;&gt;.NET 8+ (a.k.a. “.NET Core” family)&lt;/strong&gt;&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody data-end=&quot;2125&quot; data-start=&quot;314&quot;&gt;&lt;tr data-end=&quot;499&quot; data-start=&quot;314&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;336&quot; data-start=&quot;314&quot;&gt;&lt;strong data-end=&quot;335&quot; data-start=&quot;316&quot;&gt;Release history&lt;/strong&gt;&lt;/td&gt;&lt;td data-col-size=&quot;lg&quot; data-end=&quot;408&quot; data-start=&quot;336&quot;&gt;2002 (v1.0) → last major version 4.8 (2019). Now in maintenance mode.&lt;/td&gt;&lt;td data-col-size=&quot;lg&quot; data-end=&quot;499&quot; data-start=&quot;408&quot;&gt;Started as .NET Core 1.0 (2016). Unified into “.NET 5” and now continues as .NET 6/7/8…&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;632&quot; data-start=&quot;500&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;523&quot; data-start=&quot;500&quot;&gt;&lt;strong data-end=&quot;522&quot; data-start=&quot;502&quot;&gt;Platform support&lt;/strong&gt;&lt;/td&gt;&lt;td data-col-size=&quot;lg&quot; data-end=&quot;569&quot; data-start=&quot;523&quot;&gt;&lt;strong data-end=&quot;541&quot; data-start=&quot;525&quot;&gt;Windows-only&lt;/strong&gt; (depends on Windows APIs).&lt;/td&gt;&lt;td data-col-size=&quot;lg&quot; data-end=&quot;632&quot; data-start=&quot;569&quot;&gt;&lt;strong data-end=&quot;589&quot; data-start=&quot;571&quot;&gt;Cross-platform&lt;/strong&gt;: Windows, Linux, macOS, plus containers.&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;826&quot; data-start=&quot;633&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;652&quot; data-start=&quot;633&quot;&gt;&lt;strong data-end=&quot;651&quot; data-start=&quot;635&quot;&gt;Architecture&lt;/strong&gt;&lt;/td&gt;&lt;td data-col-size=&quot;lg&quot; data-end=&quot;750&quot; data-start=&quot;652&quot;&gt;Monolithic runtime + libraries installed at the OS level (Global Assembly Cache, machine-wide).&lt;/td&gt;&lt;td data-col-size=&quot;lg&quot; data-end=&quot;826&quot; data-start=&quot;750&quot;&gt;Modular, self-contained runtime—you can bundle the runtime with the app.&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;1017&quot; data-start=&quot;827&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;844&quot; data-start=&quot;827&quot;&gt;&lt;strong data-end=&quot;843&quot; data-start=&quot;829&quot;&gt;Deployment&lt;/strong&gt;&lt;/td&gt;&lt;td data-col-size=&quot;lg&quot; data-end=&quot;917&quot; data-start=&quot;844&quot;&gt;Needs the correct .NET Framework version pre-installed on the machine.&lt;/td&gt;&lt;td data-col-size=&quot;lg&quot; data-end=&quot;1017&quot; data-start=&quot;917&quot;&gt;Can publish as self-contained (no system-wide install) or framework-dependent. Great for Docker.&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;1165&quot; data-start=&quot;1018&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;1036&quot; data-start=&quot;1018&quot;&gt;&lt;strong data-end=&quot;1035&quot; data-start=&quot;1020&quot;&gt;Performance&lt;/strong&gt;&lt;/td&gt;&lt;td data-col-size=&quot;lg&quot; data-end=&quot;1074&quot; data-start=&quot;1036&quot;&gt;Older JIT, larger memory footprint.&lt;/td&gt;&lt;td data-col-size=&quot;lg&quot; data-end=&quot;1165&quot; data-start=&quot;1074&quot;&gt;Modern JIT (RyuJIT), better GC, ahead-of-time (AOT) options → &lt;strong data-end=&quot;1162&quot; data-start=&quot;1138&quot;&gt;significantly faster&lt;/strong&gt;.&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;1434&quot; data-start=&quot;1166&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;1189&quot; data-start=&quot;1166&quot;&gt;&lt;strong data-end=&quot;1188&quot; data-start=&quot;1168&quot;&gt;APIs / Libraries&lt;/strong&gt;&lt;/td&gt;&lt;td data-col-size=&quot;lg&quot; data-end=&quot;1302&quot; data-start=&quot;1189&quot;&gt;Full Framework APIs including older Windows-specific ones (WCF server, WebForms, System.Drawing tied to GDI+).&lt;/td&gt;&lt;td data-col-size=&quot;lg&quot; data-end=&quot;1434&quot; data-start=&quot;1302&quot;&gt;Unified Base Class Library (BCL). Adds new APIs, Span&amp;lt;T&amp;gt;, minimal APIs, modern async I/O. Some legacy APIs missing or replaced.&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;1606&quot; data-start=&quot;1435&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;1452&quot; data-start=&quot;1435&quot;&gt;&lt;strong data-end=&quot;1451&quot; data-start=&quot;1437&quot;&gt;App models&lt;/strong&gt;&lt;/td&gt;&lt;td data-col-size=&quot;lg&quot; data-end=&quot;1512&quot; data-start=&quot;1452&quot;&gt;ASP.NET WebForms, WCF, Windows Forms, WPF (Windows only).&lt;/td&gt;&lt;td data-col-size=&quot;lg&quot; data-end=&quot;1606&quot; data-start=&quot;1512&quot;&gt;ASP.NET Core, Blazor, MAUI (.NET Multi-platform App UI), modern console &amp;amp; worker services.&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;1740&quot; data-start=&quot;1607&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;1621&quot; data-start=&quot;1607&quot;&gt;&lt;strong data-end=&quot;1620&quot; data-start=&quot;1609&quot;&gt;Tooling&lt;/strong&gt;&lt;/td&gt;&lt;td data-col-size=&quot;lg&quot; data-end=&quot;1660&quot; data-start=&quot;1621&quot;&gt;Works with Visual Studio on Windows.&lt;/td&gt;&lt;td data-col-size=&quot;lg&quot; data-end=&quot;1740&quot; data-start=&quot;1660&quot;&gt;Works with Visual Studio, VS Code, JetBrains Rider on Windows, macOS, Linux.&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;1862&quot; data-start=&quot;1741&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;1759&quot; data-start=&quot;1741&quot;&gt;&lt;strong data-end=&quot;1758&quot; data-start=&quot;1743&quot;&gt;Open Source&lt;/strong&gt;&lt;/td&gt;&lt;td data-col-size=&quot;lg&quot; data-end=&quot;1809&quot; data-start=&quot;1759&quot;&gt;Mostly closed source (some parts later opened).&lt;/td&gt;&lt;td data-col-size=&quot;lg&quot; data-end=&quot;1862&quot; data-start=&quot;1809&quot;&gt;Entirely open source on GitHub, community-driven.&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;2000&quot; data-start=&quot;1863&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;1886&quot; data-start=&quot;1863&quot;&gt;&lt;strong data-end=&quot;1885&quot; data-start=&quot;1865&quot;&gt;Long-term future&lt;/strong&gt;&lt;/td&gt;&lt;td data-col-size=&quot;lg&quot; data-end=&quot;1930&quot; data-start=&quot;1886&quot;&gt;Only security/bug fixes. No new features.&lt;/td&gt;&lt;td data-col-size=&quot;lg&quot; data-end=&quot;2000&quot; data-start=&quot;1930&quot;&gt;Actively developed: new releases every year (LTS every two years).&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;2125&quot; data-start=&quot;2001&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2026&quot; data-start=&quot;2001&quot;&gt;&lt;strong data-end=&quot;2025&quot; data-start=&quot;2003&quot;&gt;Cloud &amp;amp; containers&lt;/strong&gt;&lt;/td&gt;&lt;td data-col-size=&quot;lg&quot; data-end=&quot;2050&quot; data-start=&quot;2026&quot;&gt;Possible but heavier.&lt;/td&gt;&lt;td data-col-size=&quot;lg&quot; data-end=&quot;2125&quot; data-start=&quot;2050&quot;&gt;Designed for cloud-native &amp;amp; microservices, excellent container support.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;
&lt;hr data-end=&quot;2130&quot; data-start=&quot;2127&quot; /&gt;
&lt;h3 data-end=&quot;2149&quot; data-start=&quot;2132&quot;&gt;Key Takeaways&lt;/h3&gt;
&lt;ul data-end=&quot;2486&quot; data-start=&quot;2150&quot;&gt;
&lt;li data-end=&quot;2329&quot; data-start=&quot;2150&quot;&gt;
&lt;p data-end=&quot;2187&quot; data-start=&quot;2152&quot;&gt;&lt;strong data-end=&quot;2185&quot; data-start=&quot;2152&quot;&gt;Use .NET 8+ for new projects.&lt;/strong&gt;&lt;/p&gt;
&lt;ul data-end=&quot;2329&quot; data-start=&quot;2190&quot;&gt;
&lt;li data-end=&quot;2234&quot; data-start=&quot;2190&quot;&gt;
&lt;p data-end=&quot;2234&quot; data-start=&quot;2192&quot;&gt;Cross-platform, faster, actively evolving.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2329&quot; data-start=&quot;2237&quot;&gt;
&lt;p data-end=&quot;2329&quot; data-start=&quot;2239&quot;&gt;Ideal for microservices, cloud, containers, web APIs, and modern desktop/mobile with MAUI.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2486&quot; data-start=&quot;2330&quot;&gt;
&lt;p data-end=&quot;2486&quot; data-start=&quot;2332&quot;&gt;&lt;strong data-end=&quot;2371&quot; data-start=&quot;2332&quot;&gt;.NET Framework only for legacy apps&lt;/strong&gt; that depend on Windows-only tech (e.g., classic ASP.NET WebForms or WCF server features) and can’t easily migrate.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;2491&quot; data-start=&quot;2488&quot; /&gt;
&lt;p data-end=&quot;2508&quot; data-start=&quot;2493&quot;&gt;&lt;strong data-end=&quot;2506&quot; data-start=&quot;2493&quot;&gt;In short:&lt;/strong&gt;&lt;/p&gt;
&lt;ul data-end=&quot;2639&quot; data-is-last-node=&quot;&quot; data-is-only-node=&quot;&quot; data-start=&quot;2509&quot;&gt;
&lt;li data-end=&quot;2573&quot; data-start=&quot;2509&quot;&gt;
&lt;p data-end=&quot;2573&quot; data-start=&quot;2511&quot;&gt;&lt;strong data-end=&quot;2571&quot; data-start=&quot;2511&quot;&gt;.NET Framework = Windows-only, legacy, maintenance mode.&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2639&quot; data-is-last-node=&quot;&quot; data-start=&quot;2574&quot;&gt;
&lt;p data-end=&quot;2639&quot; data-is-last-node=&quot;&quot; data-start=&quot;2576&quot;&gt;&lt;strong data-end=&quot;2639&quot; data-is-last-node=&quot;&quot; data-start=&quot;2576&quot;&gt;.NET 8+ = cross-platform, high-performance, future of .NET.&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;</content><link rel='replies' type='application/atom+xml' href='http://piushshukla.blogspot.com/feeds/8455950771948707463/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://piushshukla.blogspot.com/2025/09/what-are-key-differences-between-net.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2159069551745631737/posts/default/8455950771948707463'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2159069551745631737/posts/default/8455950771948707463'/><link rel='alternate' type='text/html' href='http://piushshukla.blogspot.com/2025/09/what-are-key-differences-between-net.html' title='What are key differences between .NET Framework and .NET 8+ (.NET Core)?'/><author><name>Piush shukla</name><uri>http://www.blogger.com/profile/16392649283296436146</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2159069551745631737.post-8532873367361816799</id><published>2025-09-22T08:16:00.000-07:00</published><updated>2025-09-22T08:16:42.696-07:00</updated><title type='text'>Caching</title><content type='html'>&lt;h2 data-end=&quot;136&quot; data-start=&quot;114&quot;&gt;💡 What Is Caching?&lt;/h2&gt;
&lt;p data-end=&quot;296&quot; data-start=&quot;137&quot;&gt;Caching means &lt;strong data-end=&quot;236&quot; data-start=&quot;151&quot;&gt;storing frequently used data in a fast place (memory or a dedicated cache server)&lt;/strong&gt; so you don’t have to recalculate or re-fetch it every time.&lt;/p&gt;
&lt;p data-end=&quot;404&quot; data-start=&quot;298&quot;&gt;Think of it like &lt;strong data-end=&quot;360&quot; data-start=&quot;315&quot;&gt;keeping your most-used tools on your desk&lt;/strong&gt; instead of running to the garage each time.&lt;/p&gt;
&lt;hr data-end=&quot;409&quot; data-start=&quot;406&quot; /&gt;
&lt;h2 data-end=&quot;433&quot; data-start=&quot;411&quot;&gt;🎯 Why Use Caching?&lt;/h2&gt;
&lt;ul data-end=&quot;620&quot; data-start=&quot;434&quot;&gt;
&lt;li data-end=&quot;476&quot; data-start=&quot;434&quot;&gt;
&lt;p data-end=&quot;476&quot; data-start=&quot;436&quot;&gt;⚡ &lt;strong data-end=&quot;447&quot; data-start=&quot;438&quot;&gt;Speed&lt;/strong&gt;: Faster responses for users.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;534&quot; data-start=&quot;477&quot;&gt;
&lt;p data-end=&quot;534&quot; data-start=&quot;479&quot;&gt;💰 &lt;strong data-end=&quot;490&quot; data-start=&quot;482&quot;&gt;Cost&lt;/strong&gt;: Fewer database or API calls → saves money.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;620&quot; data-start=&quot;535&quot;&gt;
&lt;p data-end=&quot;620&quot; data-start=&quot;537&quot;&gt;🔒 &lt;strong data-end=&quot;554&quot; data-start=&quot;540&quot;&gt;Resilience&lt;/strong&gt;: Can serve data even if the database is slow or temporarily down.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;625&quot; data-start=&quot;622&quot; /&gt;
&lt;h2 data-end=&quot;657&quot; data-start=&quot;627&quot;&gt;🏷️ Common Types of Caching&lt;/h2&gt;
&lt;h3 data-end=&quot;685&quot; data-start=&quot;659&quot;&gt;1. &lt;strong data-end=&quot;685&quot; data-start=&quot;666&quot;&gt;In-Memory Cache&lt;/strong&gt;&lt;/h3&gt;
&lt;ul data-end=&quot;870&quot; data-start=&quot;686&quot;&gt;
&lt;li data-end=&quot;730&quot; data-start=&quot;686&quot;&gt;
&lt;p data-end=&quot;730&quot; data-start=&quot;688&quot;&gt;Data stored inside the app’s memory (RAM).&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;812&quot; data-start=&quot;731&quot;&gt;
&lt;p data-end=&quot;812&quot; data-start=&quot;733&quot;&gt;Super fast but cleared when the app restarts or scales out to multiple servers.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;870&quot; data-start=&quot;813&quot;&gt;
&lt;p data-end=&quot;870&quot; data-start=&quot;815&quot;&gt;.NET Example: &lt;code data-end=&quot;843&quot; data-start=&quot;829&quot;&gt;IMemoryCache&lt;/code&gt; (built into ASP.NET Core).&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;912&quot; data-start=&quot;872&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-csharp&quot;&gt;services.AddMemoryCache();
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;1342&quot; data-start=&quot;913&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-csharp&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;ProductService&lt;/span&gt;
{
    &lt;span class=&quot;hljs-keyword&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;readonly&lt;/span&gt; IMemoryCache _cache;

    &lt;span class=&quot;hljs-function&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;ProductService&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot;&gt;IMemoryCache cache&lt;/span&gt;)
    {
        _cache = cache;
    }

    &lt;span class=&quot;hljs-function&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt;&lt;/span&gt; Product &lt;span class=&quot;hljs-title&quot;&gt;GetProduct&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot;&gt;&lt;span class=&quot;hljs-built_in&quot;&gt;int&lt;/span&gt;&lt;/span&gt; id)
    {
        &lt;span class=&quot;hljs-keyword&quot;&gt;return&lt;/span&gt; _cache.GetOrCreate(&lt;span class=&quot;hljs-string&quot;&gt;$&quot;product_&lt;span class=&quot;hljs-subst&quot;&gt;{id}&lt;/span&gt;&lt;/span&gt;&quot;, entry =&amp;gt;
        {
            entry.AbsoluteExpirationRelativeToNow = TimeSpan.FromMinutes(&lt;span class=&quot;hljs-number&quot;&gt;10&lt;/span&gt;);
            &lt;span class=&quot;hljs-keyword&quot;&gt;return&lt;/span&gt; LoadProductFromDatabase(id);
        });
    }
}
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;hr data-end=&quot;1347&quot; data-start=&quot;1344&quot; /&gt;
&lt;h3 data-end=&quot;1377&quot; data-start=&quot;1349&quot;&gt;2. &lt;strong data-end=&quot;1377&quot; data-start=&quot;1356&quot;&gt;Distributed Cache&lt;/strong&gt;&lt;/h3&gt;
&lt;ul data-end=&quot;1521&quot; data-start=&quot;1378&quot;&gt;
&lt;li data-end=&quot;1424&quot; data-start=&quot;1378&quot;&gt;
&lt;p data-end=&quot;1424&quot; data-start=&quot;1380&quot;&gt;Shared cache for multiple servers/instances.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1464&quot; data-start=&quot;1425&quot;&gt;
&lt;p data-end=&quot;1464&quot; data-start=&quot;1427&quot;&gt;Good for cloud or load-balanced apps.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1521&quot; data-start=&quot;1465&quot;&gt;
&lt;p data-end=&quot;1521&quot; data-start=&quot;1467&quot;&gt;Examples: &lt;strong data-end=&quot;1486&quot; data-start=&quot;1477&quot;&gt;Redis&lt;/strong&gt;, &lt;strong data-end=&quot;1508&quot; data-start=&quot;1488&quot;&gt;SQL Server cache&lt;/strong&gt;, &lt;strong data-end=&quot;1520&quot; data-start=&quot;1510&quot;&gt;NCache&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;1635&quot; data-start=&quot;1523&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-csharp&quot;&gt;services.AddStackExchangeRedisCache(options =&amp;gt;
{
    options.Configuration = &lt;span class=&quot;hljs-string&quot;&gt;&quot;localhost:6379&quot;&lt;/span&gt;;
});
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;hr data-end=&quot;1640&quot; data-start=&quot;1637&quot; /&gt;
&lt;h3 data-end=&quot;1676&quot; data-start=&quot;1642&quot;&gt;3. &lt;strong data-end=&quot;1676&quot; data-start=&quot;1649&quot;&gt;Output/Response Caching&lt;/strong&gt;&lt;/h3&gt;
&lt;ul data-end=&quot;1765&quot; data-start=&quot;1677&quot;&gt;
&lt;li data-end=&quot;1713&quot; data-start=&quot;1677&quot;&gt;
&lt;p data-end=&quot;1713&quot; data-start=&quot;1679&quot;&gt;Cache the &lt;strong data-end=&quot;1712&quot; data-start=&quot;1689&quot;&gt;whole HTTP response&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1765&quot; data-start=&quot;1714&quot;&gt;
&lt;p data-end=&quot;1765&quot; data-start=&quot;1716&quot;&gt;Useful for pages or APIs that don’t change often.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;1865&quot; data-start=&quot;1767&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-csharp&quot;&gt;[&lt;span class=&quot;hljs-meta&quot;&gt;ResponseCache(Duration = 60)&lt;/span&gt;]
&lt;span class=&quot;hljs-function&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt;&lt;/span&gt; IActionResult &lt;span class=&quot;hljs-title&quot;&gt;GetWeather&lt;/span&gt;() =&amp;gt; Ok(weatherData);
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;hr data-end=&quot;1870&quot; data-start=&quot;1867&quot; /&gt;
&lt;h3 data-end=&quot;1908&quot; data-start=&quot;1872&quot;&gt;4. &lt;strong data-end=&quot;1908&quot; data-start=&quot;1879&quot;&gt;Client-Side/Browser Cache&lt;/strong&gt;&lt;/h3&gt;
&lt;ul data-end=&quot;2038&quot; data-start=&quot;1909&quot;&gt;
&lt;li data-end=&quot;1980&quot; data-start=&quot;1909&quot;&gt;
&lt;p data-end=&quot;1980&quot; data-start=&quot;1911&quot;&gt;Store static files (images, CSS, JS) or API responses in the browser.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2038&quot; data-start=&quot;1981&quot;&gt;
&lt;p data-end=&quot;2038&quot; data-start=&quot;1983&quot;&gt;Controlled with HTTP headers (&lt;code data-end=&quot;2028&quot; data-start=&quot;2013&quot;&gt;Cache-Control&lt;/code&gt;, &lt;code data-end=&quot;2036&quot; data-start=&quot;2030&quot;&gt;ETag&lt;/code&gt;).&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;2043&quot; data-start=&quot;2040&quot; /&gt;
&lt;h2 data-end=&quot;2067&quot; data-start=&quot;2045&quot;&gt;🧠 Cache Strategies&lt;/h2&gt;
&lt;ul data-end=&quot;2435&quot; data-start=&quot;2068&quot;&gt;
&lt;li data-end=&quot;2147&quot; data-start=&quot;2068&quot;&gt;
&lt;p data-end=&quot;2147&quot; data-start=&quot;2070&quot;&gt;&lt;strong data-end=&quot;2093&quot; data-start=&quot;2070&quot;&gt;Absolute Expiration&lt;/strong&gt;: Cache expires after a fixed time (e.g., 10 minutes).&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2222&quot; data-start=&quot;2148&quot;&gt;
&lt;p data-end=&quot;2222&quot; data-start=&quot;2150&quot;&gt;&lt;strong data-end=&quot;2172&quot; data-start=&quot;2150&quot;&gt;Sliding Expiration&lt;/strong&gt;: Reset the timer every time the data is accessed.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2326&quot; data-start=&quot;2223&quot;&gt;
&lt;p data-end=&quot;2326&quot; data-start=&quot;2225&quot;&gt;&lt;strong data-end=&quot;2255&quot; data-start=&quot;2225&quot;&gt;Cache Aside (Lazy Loading)&lt;/strong&gt;: Check cache first; if not present, load from source and add to cache.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2435&quot; data-start=&quot;2327&quot;&gt;
&lt;p data-end=&quot;2435&quot; data-start=&quot;2329&quot;&gt;&lt;strong data-end=&quot;2361&quot; data-start=&quot;2329&quot;&gt;Write-Through / Write-Behind&lt;/strong&gt;: Write data to the cache and database at the same time or asynchronously.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;2440&quot; data-start=&quot;2437&quot; /&gt;
&lt;h2 data-end=&quot;2463&quot; data-start=&quot;2442&quot;&gt;⚠️ Things to Watch&lt;/h2&gt;
&lt;ul data-end=&quot;2665&quot; data-start=&quot;2464&quot;&gt;
&lt;li data-end=&quot;2531&quot; data-start=&quot;2464&quot;&gt;
&lt;p data-end=&quot;2531&quot; data-start=&quot;2466&quot;&gt;&lt;strong data-end=&quot;2480&quot; data-start=&quot;2466&quot;&gt;Stale Data&lt;/strong&gt;: Data might become outdated—set expiration wisely.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2600&quot; data-start=&quot;2532&quot;&gt;
&lt;p data-end=&quot;2600&quot; data-start=&quot;2534&quot;&gt;&lt;strong data-end=&quot;2556&quot; data-start=&quot;2534&quot;&gt;Cache Invalidation&lt;/strong&gt;: Decide how/when to remove or refresh data.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2665&quot; data-start=&quot;2601&quot;&gt;
&lt;p data-end=&quot;2665&quot; data-start=&quot;2603&quot;&gt;&lt;strong data-end=&quot;2620&quot; data-start=&quot;2603&quot;&gt;Memory Limits&lt;/strong&gt;: Monitor size to avoid crashes or evictions.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;2670&quot; data-start=&quot;2667&quot; /&gt;
&lt;h2 data-end=&quot;2697&quot; data-start=&quot;2672&quot;&gt;✅ Quick Best Practices&lt;/h2&gt;
&lt;ul data-end=&quot;2911&quot; data-start=&quot;2698&quot;&gt;
&lt;li data-end=&quot;2753&quot; data-start=&quot;2698&quot;&gt;
&lt;p data-end=&quot;2753&quot; data-start=&quot;2700&quot;&gt;Cache only &lt;strong data-end=&quot;2724&quot; data-start=&quot;2711&quot;&gt;expensive&lt;/strong&gt; or &lt;strong data-end=&quot;2747&quot; data-start=&quot;2728&quot;&gt;frequently used&lt;/strong&gt; data.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2806&quot; data-start=&quot;2754&quot;&gt;
&lt;p data-end=&quot;2806&quot; data-start=&quot;2756&quot;&gt;Use &lt;strong data-end=&quot;2783&quot; data-start=&quot;2760&quot;&gt;distributed caching&lt;/strong&gt; for scalable web apps.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2849&quot; data-start=&quot;2807&quot;&gt;
&lt;p data-end=&quot;2849&quot; data-start=&quot;2809&quot;&gt;Monitor hit/miss rates and memory usage.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2911&quot; data-start=&quot;2850&quot;&gt;
&lt;p data-end=&quot;2911&quot; data-start=&quot;2852&quot;&gt;Protect sensitive data—don’t cache private info carelessly.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;2916&quot; data-start=&quot;2913&quot; /&gt;
&lt;h2 data-end=&quot;2929&quot; data-start=&quot;2918&quot;&gt;🏁 Recap&lt;/h2&gt;
&lt;p data-end=&quot;2989&quot; data-start=&quot;2930&quot;&gt;&lt;strong data-end=&quot;2941&quot; data-start=&quot;2930&quot;&gt;Caching&lt;/strong&gt; = storing frequently used data for quick reuse.&lt;/p&gt;
&lt;div class=&quot;_tableContainer_1rjym_1&quot;&gt;&lt;div class=&quot;group _tableWrapper_1rjym_13 flex w-fit flex-col-reverse&quot; tabindex=&quot;-1&quot;&gt;&lt;table class=&quot;w-fit min-w-(--thread-content-width)&quot; data-end=&quot;3368&quot; data-start=&quot;2991&quot;&gt;&lt;thead data-end=&quot;3053&quot; data-start=&quot;2991&quot;&gt;&lt;tr data-end=&quot;3053&quot; data-start=&quot;2991&quot;&gt;&lt;th data-col-size=&quot;sm&quot; data-end=&quot;3011&quot; data-start=&quot;2991&quot;&gt;Type&lt;/th&gt;&lt;th data-col-size=&quot;sm&quot; data-end=&quot;3032&quot; data-start=&quot;3011&quot;&gt;Where stored&lt;/th&gt;&lt;th data-col-size=&quot;sm&quot; data-end=&quot;3053&quot; data-start=&quot;3032&quot;&gt;Example in .NET&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody data-end=&quot;3368&quot; data-start=&quot;3117&quot;&gt;&lt;tr data-end=&quot;3179&quot; data-start=&quot;3117&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3137&quot; data-start=&quot;3117&quot;&gt;In-Memory&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3158&quot; data-start=&quot;3137&quot;&gt;App memory&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3179&quot; data-start=&quot;3158&quot;&gt;&lt;code data-end=&quot;3174&quot; data-start=&quot;3160&quot;&gt;IMemoryCache&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;3242&quot; data-start=&quot;3180&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3200&quot; data-start=&quot;3180&quot;&gt;Distributed&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3221&quot; data-start=&quot;3200&quot;&gt;External server&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3242&quot; data-start=&quot;3221&quot;&gt;Redis, SQL Server&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;3305&quot; data-start=&quot;3243&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3263&quot; data-start=&quot;3243&quot;&gt;Output/Response&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3284&quot; data-start=&quot;3263&quot;&gt;Web/API responses&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3305&quot; data-start=&quot;3284&quot;&gt;&lt;code data-end=&quot;3303&quot; data-start=&quot;3286&quot;&gt;[ResponseCache]&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;3368&quot; data-start=&quot;3306&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3326&quot; data-start=&quot;3306&quot;&gt;Client/Browser&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3347&quot; data-start=&quot;3326&quot;&gt;User’s browser&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3368&quot; data-start=&quot;3347&quot;&gt;Cache headers&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p data-end=&quot;3487&quot; data-is-last-node=&quot;&quot; data-is-only-node=&quot;&quot; data-start=&quot;3370&quot;&gt;By combining the right caching type and strategy, you can make your .NET apps &lt;strong data-end=&quot;3486&quot; data-start=&quot;3448&quot;&gt;faster, cheaper, and more reliable&lt;/strong&gt;.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://piushshukla.blogspot.com/feeds/8532873367361816799/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://piushshukla.blogspot.com/2025/09/caching.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2159069551745631737/posts/default/8532873367361816799'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2159069551745631737/posts/default/8532873367361816799'/><link rel='alternate' type='text/html' href='http://piushshukla.blogspot.com/2025/09/caching.html' title='Caching'/><author><name>Piush shukla</name><uri>http://www.blogger.com/profile/16392649283296436146</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2159069551745631737.post-8511958016588421044</id><published>2025-09-22T08:14:00.000-07:00</published><updated>2025-09-22T08:14:50.838-07:00</updated><title type='text'>Circuit Breaker Pattern</title><content type='html'>&lt;h2 data-end=&quot;144&quot; data-start=&quot;102&quot;&gt;💡 What Is the Circuit Breaker Pattern?&lt;/h2&gt;
&lt;p data-end=&quot;379&quot; data-start=&quot;145&quot;&gt;The &lt;strong data-end=&quot;168&quot; data-start=&quot;149&quot;&gt;Circuit Breaker&lt;/strong&gt; is a reliability pattern used when one service calls another (e.g., your API calling a payment gateway).&lt;br data-end=&quot;276&quot; data-start=&quot;273&quot; /&gt;
It &lt;strong data-end=&quot;325&quot; data-start=&quot;279&quot;&gt;stops repeatedly calling a failing service&lt;/strong&gt; to avoid wasting resources and causing more failures.&lt;/p&gt;
&lt;p data-end=&quot;522&quot; data-start=&quot;381&quot;&gt;Think of it like an &lt;strong data-end=&quot;431&quot; data-start=&quot;401&quot;&gt;electrical circuit breaker&lt;/strong&gt; in your house:&lt;br data-end=&quot;449&quot; data-start=&quot;446&quot; /&gt;
If there’s a problem, it “trips” and cuts the flow until things are safe.&lt;/p&gt;
&lt;hr data-end=&quot;527&quot; data-start=&quot;524&quot; /&gt;
&lt;h2 data-end=&quot;550&quot; data-start=&quot;529&quot;&gt;🏷️ Why We Need It&lt;/h2&gt;
&lt;ul data-end=&quot;755&quot; data-start=&quot;551&quot;&gt;
&lt;li data-end=&quot;606&quot; data-start=&quot;551&quot;&gt;
&lt;p data-end=&quot;606&quot; data-start=&quot;553&quot;&gt;Prevents &lt;strong data-end=&quot;584&quot; data-start=&quot;562&quot;&gt;cascading failures&lt;/strong&gt; across microservices.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;655&quot; data-start=&quot;607&quot;&gt;
&lt;p data-end=&quot;655&quot; data-start=&quot;609&quot;&gt;Gives the failing service &lt;strong data-end=&quot;654&quot; data-start=&quot;635&quot;&gt;time to recover&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;755&quot; data-start=&quot;656&quot;&gt;
&lt;p data-end=&quot;755&quot; data-start=&quot;658&quot;&gt;Improves user experience (you can show a quick fallback message instead of waiting for timeouts).&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;760&quot; data-start=&quot;757&quot; /&gt;
&lt;h2 data-end=&quot;780&quot; data-start=&quot;762&quot;&gt;⚙️ How It Works&lt;/h2&gt;
&lt;p data-end=&quot;821&quot; data-start=&quot;782&quot;&gt;A circuit breaker has &lt;strong data-end=&quot;820&quot; data-start=&quot;804&quot;&gt;three states&lt;/strong&gt;:&lt;/p&gt;
&lt;ol data-end=&quot;1277&quot; data-start=&quot;823&quot;&gt;
&lt;li data-end=&quot;973&quot; data-start=&quot;823&quot;&gt;
&lt;p data-end=&quot;847&quot; data-start=&quot;826&quot;&gt;&lt;strong data-end=&quot;836&quot; data-start=&quot;826&quot;&gt;Closed&lt;/strong&gt; (normal)&lt;/p&gt;
&lt;ul data-end=&quot;973&quot; data-start=&quot;851&quot;&gt;
&lt;li data-end=&quot;879&quot; data-start=&quot;851&quot;&gt;
&lt;p data-end=&quot;879&quot; data-start=&quot;853&quot;&gt;All requests pass through.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;973&quot; data-start=&quot;883&quot;&gt;
&lt;p data-end=&quot;973&quot; data-start=&quot;885&quot;&gt;If calls keep failing beyond a threshold (e.g., 5 failures in 30 seconds), it &lt;strong data-end=&quot;972&quot; data-start=&quot;963&quot;&gt;opens&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1118&quot; data-start=&quot;975&quot;&gt;
&lt;p data-end=&quot;998&quot; data-start=&quot;978&quot;&gt;&lt;strong data-end=&quot;986&quot; data-start=&quot;978&quot;&gt;Open&lt;/strong&gt; (tripped)&lt;/p&gt;
&lt;ul data-end=&quot;1118&quot; data-start=&quot;1002&quot;&gt;
&lt;li data-end=&quot;1065&quot; data-start=&quot;1002&quot;&gt;
&lt;p data-end=&quot;1065&quot; data-start=&quot;1004&quot;&gt;Requests are blocked immediately (or a fallback is returned).&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1118&quot; data-start=&quot;1069&quot;&gt;
&lt;p data-end=&quot;1118&quot; data-start=&quot;1071&quot;&gt;The system waits a fixed time (e.g., 1 minute).&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1277&quot; data-start=&quot;1120&quot;&gt;
&lt;p data-end=&quot;1138&quot; data-start=&quot;1123&quot;&gt;&lt;strong data-end=&quot;1136&quot; data-start=&quot;1123&quot;&gt;Half-Open&lt;/strong&gt;&lt;/p&gt;
&lt;ul data-end=&quot;1277&quot; data-start=&quot;1142&quot;&gt;
&lt;li data-end=&quot;1196&quot; data-start=&quot;1142&quot;&gt;
&lt;p data-end=&quot;1196&quot; data-start=&quot;1144&quot;&gt;After the wait, it lets a few test requests through.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1239&quot; data-start=&quot;1200&quot;&gt;
&lt;p data-end=&quot;1239&quot; data-start=&quot;1202&quot;&gt;If they succeed → back to &lt;strong data-end=&quot;1238&quot; data-start=&quot;1228&quot;&gt;Closed&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1277&quot; data-start=&quot;1243&quot;&gt;
&lt;p data-end=&quot;1277&quot; data-start=&quot;1245&quot;&gt;If they fail → back to &lt;strong data-end=&quot;1276&quot; data-start=&quot;1268&quot;&gt;Open&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;hr data-end=&quot;1282&quot; data-start=&quot;1279&quot; /&gt;
&lt;h3 data-end=&quot;1302&quot; data-start=&quot;1284&quot;&gt;Simple Diagram&lt;/h3&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;1456&quot; data-start=&quot;1304&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre!&quot;&gt;&lt;span class=&quot;hljs-selector-attr&quot;&gt;[Closed]&lt;/span&gt; -- too many failures --&amp;gt; &lt;span class=&quot;hljs-selector-attr&quot;&gt;[Open]&lt;/span&gt;
&lt;span class=&quot;hljs-selector-attr&quot;&gt;[Open]&lt;/span&gt; -- wait &amp;amp; try --&amp;gt; &lt;span class=&quot;hljs-selector-attr&quot;&gt;[Half-Open]&lt;/span&gt;
&lt;span class=&quot;hljs-selector-attr&quot;&gt;[Half-Open]&lt;/span&gt; -- success --&amp;gt; &lt;span class=&quot;hljs-selector-attr&quot;&gt;[Closed]&lt;/span&gt;
&lt;span class=&quot;hljs-selector-attr&quot;&gt;[Half-Open]&lt;/span&gt; -- fail --&amp;gt; &lt;span class=&quot;hljs-selector-attr&quot;&gt;[Open]&lt;/span&gt;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;hr data-end=&quot;1461&quot; data-start=&quot;1458&quot; /&gt;
&lt;h2 data-end=&quot;1496&quot; data-start=&quot;1463&quot;&gt;🛠️ Using in .NET (with Polly)&lt;/h2&gt;
&lt;p data-end=&quot;1582&quot; data-start=&quot;1497&quot;&gt;&lt;a class=&quot;decorated-link&quot; data-end=&quot;1540&quot; data-start=&quot;1497&quot; href=&quot;https://github.com/App-vNext/Polly&quot; rel=&quot;noopener&quot; target=&quot;_new&quot;&gt;Polly&lt;span aria-hidden=&quot;true&quot; class=&quot;ms-0.5 inline-block align-middle leading-none&quot;&gt;&lt;svg class=&quot;block h-[0.75em] w-[0.75em] stroke-current stroke-[0.75]&quot; data-rtl-flip=&quot;&quot; fill=&quot;currentColor&quot; height=&quot;20&quot; viewbox=&quot;0 0 20 20&quot; width=&quot;20&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;path d=&quot;M14.3349 13.3301V6.60645L5.47065 15.4707C5.21095 15.7304 4.78895 15.7304 4.52925 15.4707C4.26955 15.211 4.26955 14.789 4.52925 14.5293L13.3935 5.66504H6.66011C6.29284 5.66504 5.99507 5.36727 5.99507 5C5.99507 4.63273 6.29284 4.33496 6.66011 4.33496H14.9999L15.1337 4.34863C15.4369 4.41057 15.665 4.67857 15.665 5V13.3301C15.6649 13.6973 15.3672 13.9951 14.9999 13.9951C14.6327 13.9951 14.335 13.6973 14.3349 13.3301Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/a&gt; is a popular .NET library for resilience.&lt;/p&gt;
&lt;p data-end=&quot;1592&quot; data-start=&quot;1584&quot;&gt;Example:&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;2020&quot; data-start=&quot;1594&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-csharp&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;using&lt;/span&gt; Polly;
&lt;span class=&quot;hljs-keyword&quot;&gt;using&lt;/span&gt; Polly.CircuitBreaker;

&lt;span class=&quot;hljs-keyword&quot;&gt;var&lt;/span&gt; circuitBreaker = Policy
    .Handle&amp;lt;HttpRequestException&amp;gt;()
    .CircuitBreakerAsync(
        exceptionsAllowedBeforeBreaking: &lt;span class=&quot;hljs-number&quot;&gt;3&lt;/span&gt;,
        durationOfBreak: TimeSpan.FromSeconds(&lt;span class=&quot;hljs-number&quot;&gt;30&lt;/span&gt;)
    );

&lt;span class=&quot;hljs-keyword&quot;&gt;await&lt;/span&gt; circuitBreaker.ExecuteAsync(&lt;span class=&quot;hljs-keyword&quot;&gt;async&lt;/span&gt; () =&amp;gt;
{
    &lt;span class=&quot;hljs-comment&quot;&gt;// Your external call, e.g., HTTP to payment service&lt;/span&gt;
    &lt;span class=&quot;hljs-keyword&quot;&gt;await&lt;/span&gt; httpClient.GetAsync(&lt;span class=&quot;hljs-string&quot;&gt;&quot;https://payment.example.com/process&quot;&lt;/span&gt;);
});
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;p data-end=&quot;2034&quot; data-start=&quot;2022&quot;&gt;Explanation:&lt;/p&gt;
&lt;ul data-end=&quot;2141&quot; data-start=&quot;2035&quot;&gt;
&lt;li data-end=&quot;2085&quot; data-start=&quot;2035&quot;&gt;
&lt;p data-end=&quot;2085&quot; data-start=&quot;2037&quot;&gt;After &lt;strong data-end=&quot;2057&quot; data-start=&quot;2043&quot;&gt;3 failures&lt;/strong&gt;, the circuit goes &lt;strong data-end=&quot;2084&quot; data-start=&quot;2076&quot;&gt;Open&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2141&quot; data-start=&quot;2086&quot;&gt;
&lt;p data-end=&quot;2141&quot; data-start=&quot;2088&quot;&gt;It stays open for &lt;strong data-end=&quot;2120&quot; data-start=&quot;2106&quot;&gt;30 seconds&lt;/strong&gt; before trying again.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;2146&quot; data-start=&quot;2143&quot; /&gt;
&lt;h2 data-end=&quot;2167&quot; data-start=&quot;2148&quot;&gt;✅ Best Practices&lt;/h2&gt;
&lt;ul data-end=&quot;2389&quot; data-start=&quot;2168&quot;&gt;
&lt;li data-end=&quot;2225&quot; data-start=&quot;2168&quot;&gt;
&lt;p data-end=&quot;2225&quot; data-start=&quot;2170&quot;&gt;&lt;strong data-end=&quot;2198&quot; data-start=&quot;2170&quot;&gt;Set realistic thresholds&lt;/strong&gt; (failure count, duration).&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2287&quot; data-start=&quot;2226&quot;&gt;
&lt;p data-end=&quot;2287&quot; data-start=&quot;2228&quot;&gt;Provide &lt;strong data-end=&quot;2254&quot; data-start=&quot;2236&quot;&gt;fallback logic&lt;/strong&gt; (cached data, default response).&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2320&quot; data-start=&quot;2288&quot;&gt;
&lt;p data-end=&quot;2320&quot; data-start=&quot;2290&quot;&gt;Monitor and log state changes.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2389&quot; data-start=&quot;2321&quot;&gt;
&lt;p data-end=&quot;2389&quot; data-start=&quot;2323&quot;&gt;Combine with &lt;strong data-end=&quot;2345&quot; data-start=&quot;2336&quot;&gt;retry&lt;/strong&gt; (exponential backoff) for transient errors.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;2394&quot; data-start=&quot;2391&quot; /&gt;
&lt;h2 data-end=&quot;2415&quot; data-start=&quot;2396&quot;&gt;🔑 Summary Table&lt;/h2&gt;
&lt;div class=&quot;_tableContainer_1rjym_1&quot;&gt;&lt;div class=&quot;group _tableWrapper_1rjym_13 flex w-fit flex-col-reverse&quot; tabindex=&quot;-1&quot;&gt;&lt;table class=&quot;w-fit min-w-(--thread-content-width)&quot; data-end=&quot;2698&quot; data-start=&quot;2417&quot;&gt;&lt;thead data-end=&quot;2472&quot; data-start=&quot;2417&quot;&gt;&lt;tr data-end=&quot;2472&quot; data-start=&quot;2417&quot;&gt;&lt;th data-col-size=&quot;sm&quot; data-end=&quot;2431&quot; data-start=&quot;2417&quot;&gt;State&lt;/th&gt;&lt;th data-col-size=&quot;sm&quot; data-end=&quot;2472&quot; data-start=&quot;2431&quot;&gt;What Happens&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody data-end=&quot;2698&quot; data-start=&quot;2529&quot;&gt;&lt;tr data-end=&quot;2584&quot; data-start=&quot;2529&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2543&quot; data-start=&quot;2529&quot;&gt;&lt;strong data-end=&quot;2541&quot; data-start=&quot;2531&quot;&gt;Closed&lt;/strong&gt;&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2584&quot; data-start=&quot;2543&quot;&gt;Normal, calls go through.&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;2640&quot; data-start=&quot;2585&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2599&quot; data-start=&quot;2585&quot;&gt;&lt;strong data-end=&quot;2595&quot; data-start=&quot;2587&quot;&gt;Open&lt;/strong&gt;&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2640&quot; data-start=&quot;2599&quot;&gt;Calls fail fast, no external calls.&lt;/td&gt;&lt;/tr&gt;&lt;tr data-end=&quot;2698&quot; data-start=&quot;2641&quot;&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2657&quot; data-start=&quot;2641&quot;&gt;&lt;strong data-end=&quot;2656&quot; data-start=&quot;2643&quot;&gt;Half-Open&lt;/strong&gt;&lt;/td&gt;&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2698&quot; data-start=&quot;2657&quot;&gt;Test a few requests to check recovery.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;
&lt;hr data-end=&quot;2703&quot; data-start=&quot;2700&quot; /&gt;
&lt;h3 data-end=&quot;2723&quot; data-start=&quot;2705&quot;&gt;🏁 Quick Recap&lt;/h3&gt;
&lt;p data-end=&quot;2756&quot; data-start=&quot;2724&quot;&gt;The &lt;strong data-end=&quot;2755&quot; data-start=&quot;2728&quot;&gt;Circuit Breaker pattern&lt;/strong&gt;:&lt;/p&gt;
&lt;ul data-end=&quot;2975&quot; data-start=&quot;2757&quot;&gt;
&lt;li data-end=&quot;2820&quot; data-start=&quot;2757&quot;&gt;
&lt;p data-end=&quot;2820&quot; data-start=&quot;2759&quot;&gt;&lt;strong data-end=&quot;2788&quot; data-start=&quot;2759&quot;&gt;Detects repeated failures&lt;/strong&gt; when calling external services.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2871&quot; data-start=&quot;2821&quot;&gt;
&lt;p data-end=&quot;2871&quot; data-start=&quot;2823&quot;&gt;&lt;strong data-end=&quot;2832&quot; data-start=&quot;2823&quot;&gt;Opens&lt;/strong&gt; the circuit to stop calls temporarily.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2926&quot; data-start=&quot;2872&quot;&gt;
&lt;p data-end=&quot;2926&quot; data-start=&quot;2874&quot;&gt;&lt;strong data-end=&quot;2888&quot; data-start=&quot;2874&quot;&gt;Half-opens&lt;/strong&gt; to test if the service has recovered.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2975&quot; data-start=&quot;2927&quot;&gt;
&lt;p data-end=&quot;2975&quot; data-start=&quot;2929&quot;&gt;In .NET, use &lt;strong data-end=&quot;2951&quot; data-start=&quot;2942&quot;&gt;Polly&lt;/strong&gt; to implement it easily.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;3106&quot; data-is-last-node=&quot;&quot; data-is-only-node=&quot;&quot; data-start=&quot;2977&quot;&gt;This protects your microservices or APIs from &lt;strong data-end=&quot;3044&quot; data-start=&quot;3023&quot;&gt;cascading outages&lt;/strong&gt; and keeps your system responsive even when dependencies fail.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://piushshukla.blogspot.com/feeds/8511958016588421044/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://piushshukla.blogspot.com/2025/09/circuit-breaker-pattern.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2159069551745631737/posts/default/8511958016588421044'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2159069551745631737/posts/default/8511958016588421044'/><link rel='alternate' type='text/html' href='http://piushshukla.blogspot.com/2025/09/circuit-breaker-pattern.html' title='Circuit Breaker Pattern'/><author><name>Piush shukla</name><uri>http://www.blogger.com/profile/16392649283296436146</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2159069551745631737.post-5347977599785005902</id><published>2025-09-22T08:12:00.000-07:00</published><updated>2025-09-22T08:12:21.843-07:00</updated><title type='text'>Domain-Driven Design (DDD)</title><content type='html'>&lt;h2 data-end=&quot;139&quot; data-start=&quot;120&quot;&gt;1️⃣ What is DDD?&lt;/h2&gt;
&lt;p data-end=&quot;308&quot; data-start=&quot;140&quot;&gt;&lt;strong data-end=&quot;164&quot; data-start=&quot;140&quot;&gt;Domain-Driven Design&lt;/strong&gt; is a way to build software by focusing first on the &lt;strong data-end=&quot;236&quot; data-start=&quot;217&quot;&gt;business domain&lt;/strong&gt;—the real-world problem you’re solving—before worrying about technology.&lt;/p&gt;
&lt;ul data-end=&quot;514&quot; data-start=&quot;310&quot;&gt;
&lt;li data-end=&quot;390&quot; data-start=&quot;310&quot;&gt;
&lt;p data-end=&quot;390&quot; data-start=&quot;312&quot;&gt;&lt;strong data-end=&quot;322&quot; data-start=&quot;312&quot;&gt;Domain&lt;/strong&gt; = the business area (e.g., e-commerce orders, banking, healthcare).&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;514&quot; data-start=&quot;391&quot;&gt;
&lt;p data-end=&quot;514&quot; data-start=&quot;393&quot;&gt;Goal: Make the code match the business language and rules so developers and business experts speak the &lt;strong data-end=&quot;513&quot; data-start=&quot;496&quot;&gt;same language&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;561&quot; data-start=&quot;516&quot;&gt;Think: &lt;em data-end=&quot;561&quot; data-start=&quot;523&quot;&gt;“Code that reads like the business.”&lt;/em&gt;&lt;/p&gt;
&lt;hr data-end=&quot;566&quot; data-start=&quot;563&quot; /&gt;
&lt;h2 data-end=&quot;585&quot; data-start=&quot;568&quot;&gt;2️⃣ Core Ideas&lt;/h2&gt;
&lt;h3 data-end=&quot;615&quot; data-start=&quot;586&quot;&gt;🗣️ Ubiquitous Language&lt;/h3&gt;
&lt;ul data-end=&quot;788&quot; data-start=&quot;616&quot;&gt;
&lt;li data-end=&quot;686&quot; data-start=&quot;616&quot;&gt;
&lt;p data-end=&quot;686&quot; data-start=&quot;618&quot;&gt;Use the same terms everywhere—requirements, conversations, and code.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;788&quot; data-start=&quot;687&quot;&gt;
&lt;p data-end=&quot;788&quot; data-start=&quot;689&quot;&gt;Example: If business says “Order must be Shipped,” use &lt;code data-end=&quot;758&quot; data-start=&quot;744&quot;&gt;Order.Ship()&lt;/code&gt; in code, not &lt;code data-end=&quot;787&quot; data-start=&quot;772&quot;&gt;ProcessData()&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-end=&quot;814&quot; data-start=&quot;790&quot;&gt;📦 Bounded Context&lt;/h3&gt;
&lt;ul data-end=&quot;1001&quot; data-start=&quot;815&quot;&gt;
&lt;li data-end=&quot;902&quot; data-start=&quot;815&quot;&gt;
&lt;p data-end=&quot;902&quot; data-start=&quot;817&quot;&gt;Break a large system into smaller &lt;strong data-end=&quot;863&quot; data-start=&quot;851&quot;&gt;contexts&lt;/strong&gt;, each with its own model and database.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1001&quot; data-start=&quot;903&quot;&gt;
&lt;p data-end=&quot;915&quot; data-start=&quot;905&quot;&gt;Example:&lt;/p&gt;
&lt;ul data-end=&quot;1001&quot; data-start=&quot;918&quot;&gt;
&lt;li data-end=&quot;959&quot; data-start=&quot;918&quot;&gt;
&lt;p data-end=&quot;959&quot; data-start=&quot;920&quot;&gt;&lt;em data-end=&quot;938&quot; data-start=&quot;920&quot;&gt;Ordering Context&lt;/em&gt; (Orders, Payments)&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1001&quot; data-start=&quot;962&quot;&gt;
&lt;p data-end=&quot;1001&quot; data-start=&quot;964&quot;&gt;&lt;em data-end=&quot;983&quot; data-start=&quot;964&quot;&gt;Inventory Context&lt;/em&gt; (Products, Stock)&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-end=&quot;1036&quot; data-start=&quot;1003&quot;&gt;🧱 Entities and Value Objects&lt;/h3&gt;
&lt;ul data-end=&quot;1193&quot; data-start=&quot;1037&quot;&gt;
&lt;li data-end=&quot;1103&quot; data-start=&quot;1037&quot;&gt;
&lt;p data-end=&quot;1103&quot; data-start=&quot;1039&quot;&gt;&lt;strong data-end=&quot;1049&quot; data-start=&quot;1039&quot;&gt;Entity&lt;/strong&gt;: Has an ID and lifecycle (e.g., &lt;code data-end=&quot;1089&quot; data-start=&quot;1082&quot;&gt;Order&lt;/code&gt;, &lt;code data-end=&quot;1101&quot; data-start=&quot;1091&quot;&gt;Customer&lt;/code&gt;).&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1193&quot; data-start=&quot;1104&quot;&gt;
&lt;p data-end=&quot;1193&quot; data-start=&quot;1106&quot;&gt;&lt;strong data-end=&quot;1122&quot; data-start=&quot;1106&quot;&gt;Value Object&lt;/strong&gt;: Describes something by value, no identity (e.g., &lt;code data-end=&quot;1182&quot; data-start=&quot;1173&quot;&gt;Address&lt;/code&gt;, &lt;code data-end=&quot;1191&quot; data-start=&quot;1184&quot;&gt;Money&lt;/code&gt;).&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-end=&quot;1212&quot; data-start=&quot;1195&quot;&gt;🎯 Aggregates&lt;/h3&gt;
&lt;ul data-end=&quot;1369&quot; data-start=&quot;1213&quot;&gt;
&lt;li data-end=&quot;1263&quot; data-start=&quot;1213&quot;&gt;
&lt;p data-end=&quot;1263&quot; data-start=&quot;1215&quot;&gt;A group of related entities treated as one unit.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1320&quot; data-start=&quot;1264&quot;&gt;
&lt;p data-end=&quot;1320&quot; data-start=&quot;1266&quot;&gt;Has a &lt;strong data-end=&quot;1280&quot; data-start=&quot;1272&quot;&gt;root&lt;/strong&gt; (Aggregate Root) that controls changes.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1369&quot; data-start=&quot;1321&quot;&gt;
&lt;p data-end=&quot;1369&quot; data-start=&quot;1323&quot;&gt;Example: &lt;code data-end=&quot;1339&quot; data-start=&quot;1332&quot;&gt;Order&lt;/code&gt; (root) contains &lt;code data-end=&quot;1368&quot; data-start=&quot;1356&quot;&gt;OrderItems&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-end=&quot;1391&quot; data-start=&quot;1371&quot;&gt;🛠️ Repositories&lt;/h3&gt;
&lt;ul data-end=&quot;1460&quot; data-start=&quot;1392&quot;&gt;
&lt;li data-end=&quot;1460&quot; data-start=&quot;1392&quot;&gt;
&lt;p data-end=&quot;1460&quot; data-start=&quot;1394&quot;&gt;Interfaces for saving/loading aggregates, hiding database details.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-end=&quot;1484&quot; data-start=&quot;1462&quot;&gt;🧩 Domain Services&lt;/h3&gt;
&lt;ul data-end=&quot;1594&quot; data-start=&quot;1485&quot;&gt;
&lt;li data-end=&quot;1541&quot; data-start=&quot;1485&quot;&gt;
&lt;p data-end=&quot;1541&quot; data-start=&quot;1487&quot;&gt;Business logic that doesn’t belong to a single entity.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1594&quot; data-start=&quot;1542&quot;&gt;
&lt;p data-end=&quot;1594&quot; data-start=&quot;1544&quot;&gt;Example: &lt;code data-end=&quot;1569&quot; data-start=&quot;1553&quot;&gt;PaymentService&lt;/code&gt; to handle payment rules.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;1599&quot; data-start=&quot;1596&quot; /&gt;
&lt;h2 data-end=&quot;1640&quot; data-start=&quot;1601&quot;&gt;3️⃣ DDD Layers in a Typical .NET App&lt;/h2&gt;
&lt;p data-end=&quot;1676&quot; data-start=&quot;1641&quot;&gt;A clean structure often looks like:&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;1894&quot; data-start=&quot;1678&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre!&quot;&gt;src/
 ├─ Domain        &lt;span class=&quot;hljs-comment&quot;&gt;// Entities, Value Objects, Domain Events&lt;/span&gt;
 ├─ Application   &lt;span class=&quot;hljs-comment&quot;&gt;// Use cases, commands/queries&lt;/span&gt;
 ├─ Infrastructure&lt;span class=&quot;hljs-comment&quot;&gt;// EF Core, DB, external services&lt;/span&gt;
 └─ WebAPI        &lt;span class=&quot;hljs-comment&quot;&gt;// Controllers, DI setup&lt;/span&gt;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;ul data-end=&quot;2036&quot; data-start=&quot;1896&quot;&gt;
&lt;li data-end=&quot;1955&quot; data-start=&quot;1896&quot;&gt;
&lt;p data-end=&quot;1955&quot; data-start=&quot;1898&quot;&gt;&lt;strong data-end=&quot;1914&quot; data-start=&quot;1898&quot;&gt;Domain layer&lt;/strong&gt; has &lt;em data-end=&quot;1923&quot; data-start=&quot;1919&quot;&gt;no&lt;/em&gt; dependencies on database or UI.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2036&quot; data-start=&quot;1956&quot;&gt;
&lt;p data-end=&quot;2036&quot; data-start=&quot;1958&quot;&gt;Infrastructure implements repository interfaces defined in Domain/Application.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;2041&quot; data-start=&quot;2038&quot; /&gt;
&lt;h2 data-end=&quot;2070&quot; data-start=&quot;2043&quot;&gt;4️⃣ Example in Simple C#&lt;/h2&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;2509&quot; data-start=&quot;2071&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-csharp&quot;&gt;&lt;span class=&quot;hljs-comment&quot;&gt;// Value Object&lt;/span&gt;
&lt;span class=&quot;hljs-function&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;record&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;Money&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot;&gt;&lt;span class=&quot;hljs-built_in&quot;&gt;decimal&lt;/span&gt;&lt;/span&gt; Amount, &lt;span class=&quot;hljs-built_in&quot;&gt;string&lt;/span&gt; Currency);

&lt;span class=&quot;hljs-comment&quot;&gt;// Entity / Aggregate Root&lt;/span&gt;
&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;Order&lt;/span&gt;
{
    &lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; Guid Id { &lt;span class=&quot;hljs-keyword&quot;&gt;get&lt;/span&gt;; &lt;span class=&quot;hljs-keyword&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;set&lt;/span&gt;; }
    &lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; List&amp;lt;OrderItem&amp;gt; Items { &lt;span class=&quot;hljs-keyword&quot;&gt;get&lt;/span&gt;; &lt;span class=&quot;hljs-keyword&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;set&lt;/span&gt;; } = &lt;span class=&quot;hljs-keyword&quot;&gt;new&lt;/span&gt;();

    &lt;span class=&quot;hljs-function&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;AddItem&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot;&gt;&lt;span class=&quot;hljs-built_in&quot;&gt;string&lt;/span&gt;&lt;/span&gt; product, &lt;span class=&quot;hljs-built_in&quot;&gt;int&lt;/span&gt; qty, Money price)
    {
        Items.Add(&lt;span class=&quot;hljs-keyword&quot;&gt;new&lt;/span&gt; OrderItem(product, qty, price));
    }
}

&lt;span class=&quot;hljs-function&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;record&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;OrderItem&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot;&gt;&lt;span class=&quot;hljs-built_in&quot;&gt;string&lt;/span&gt;&lt;/span&gt; Product, &lt;span class=&quot;hljs-built_in&quot;&gt;int&lt;/span&gt; Quantity, Money Price);
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;ul data-end=&quot;2577&quot; data-start=&quot;2511&quot;&gt;
&lt;li data-end=&quot;2577&quot; data-start=&quot;2511&quot;&gt;
&lt;p data-end=&quot;2577&quot; data-start=&quot;2513&quot;&gt;Notice: &lt;strong data-end=&quot;2535&quot; data-start=&quot;2521&quot;&gt;no EF Core&lt;/strong&gt; or UI code here—just pure business logic.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;2582&quot; data-start=&quot;2579&quot; /&gt;
&lt;h2 data-end=&quot;2599&quot; data-start=&quot;2584&quot;&gt;5️⃣ Benefits&lt;/h2&gt;
&lt;ul data-end=&quot;2743&quot; data-start=&quot;2600&quot;&gt;
&lt;li data-end=&quot;2658&quot; data-start=&quot;2600&quot;&gt;
&lt;p data-end=&quot;2658&quot; data-start=&quot;2602&quot;&gt;✅ Code matches business concepts → easier communication.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2705&quot; data-start=&quot;2659&quot;&gt;
&lt;p data-end=&quot;2705&quot; data-start=&quot;2661&quot;&gt;✅ Easier to change or extend business rules.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2743&quot; data-start=&quot;2706&quot;&gt;
&lt;p data-end=&quot;2743&quot; data-start=&quot;2708&quot;&gt;✅ Scales well with complex domains.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;2748&quot; data-start=&quot;2745&quot; /&gt;
&lt;h2 data-end=&quot;2772&quot; data-start=&quot;2750&quot;&gt;6️⃣ When to Use DDD&lt;/h2&gt;
&lt;ul data-end=&quot;2901&quot; data-start=&quot;2773&quot;&gt;
&lt;li data-end=&quot;2863&quot; data-start=&quot;2773&quot;&gt;
&lt;p data-end=&quot;2863&quot; data-start=&quot;2775&quot;&gt;Great for &lt;strong data-end=&quot;2796&quot; data-start=&quot;2785&quot;&gt;complex&lt;/strong&gt; business domains with rich rules (banking, insurance, e-commerce).&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2901&quot; data-start=&quot;2864&quot;&gt;
&lt;p data-end=&quot;2901&quot; data-start=&quot;2866&quot;&gt;Overkill for very simple CRUD apps.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;2906&quot; data-start=&quot;2903&quot; /&gt;
&lt;h2 data-end=&quot;2927&quot; data-start=&quot;2908&quot;&gt;7️⃣ How to Start&lt;/h2&gt;
&lt;ol data-end=&quot;3197&quot; data-start=&quot;2928&quot;&gt;
&lt;li data-end=&quot;2995&quot; data-start=&quot;2928&quot;&gt;
&lt;p data-end=&quot;2995&quot; data-start=&quot;2931&quot;&gt;&lt;strong data-end=&quot;2957&quot; data-start=&quot;2931&quot;&gt;Talk to domain experts&lt;/strong&gt; → gather key concepts and vocabulary.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3049&quot; data-start=&quot;2996&quot;&gt;
&lt;p data-end=&quot;3049&quot; data-start=&quot;2999&quot;&gt;Identify &lt;strong data-end=&quot;3028&quot; data-start=&quot;3008&quot;&gt;bounded contexts&lt;/strong&gt; and main aggregates.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3103&quot; data-start=&quot;3050&quot;&gt;
&lt;p data-end=&quot;3103&quot; data-start=&quot;3053&quot;&gt;Create the domain model (entities, value objects).&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3143&quot; data-start=&quot;3104&quot;&gt;
&lt;p data-end=&quot;3143&quot; data-start=&quot;3107&quot;&gt;Implement repositories and services.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3197&quot; data-start=&quot;3144&quot;&gt;
&lt;p data-end=&quot;3197&quot; data-start=&quot;3147&quot;&gt;Keep the domain layer free of infrastructure code.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;hr data-end=&quot;3202&quot; data-start=&quot;3199&quot; /&gt;
&lt;h3 data-end=&quot;3222&quot; data-start=&quot;3204&quot;&gt;🚀 Quick Recap&lt;/h3&gt;
&lt;p data-end=&quot;3281&quot; data-start=&quot;3223&quot;&gt;Domain-Driven Design = &lt;strong data-end=&quot;3280&quot; data-start=&quot;3246&quot;&gt;business-first software design&lt;/strong&gt;:&lt;/p&gt;
&lt;ul data-end=&quot;3461&quot; data-start=&quot;3282&quot;&gt;
&lt;li data-end=&quot;3308&quot; data-start=&quot;3282&quot;&gt;
&lt;p data-end=&quot;3308&quot; data-start=&quot;3284&quot;&gt;Speak a common language.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3339&quot; data-start=&quot;3309&quot;&gt;
&lt;p data-end=&quot;3339&quot; data-start=&quot;3311&quot;&gt;Split into bounded contexts.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3404&quot; data-start=&quot;3340&quot;&gt;
&lt;p data-end=&quot;3404&quot; data-start=&quot;3342&quot;&gt;Model the domain with entities, value objects, and aggregates.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;3461&quot; data-start=&quot;3405&quot;&gt;
&lt;p data-end=&quot;3461&quot; data-start=&quot;3407&quot;&gt;Keep business logic independent from databases and UI.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;3597&quot; data-is-last-node=&quot;&quot; data-is-only-node=&quot;&quot; data-start=&quot;3463&quot;&gt;This approach fits naturally with &lt;strong data-end=&quot;3519&quot; data-start=&quot;3497&quot;&gt;Clean Architecture&lt;/strong&gt; and .NET (ASP.NET Core + EF Core) to build maintainable, long-term solutions.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://piushshukla.blogspot.com/feeds/5347977599785005902/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://piushshukla.blogspot.com/2025/09/domain-driven-design-ddd.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2159069551745631737/posts/default/5347977599785005902'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2159069551745631737/posts/default/5347977599785005902'/><link rel='alternate' type='text/html' href='http://piushshukla.blogspot.com/2025/09/domain-driven-design-ddd.html' title='Domain-Driven Design (DDD)'/><author><name>Piush shukla</name><uri>http://www.blogger.com/profile/16392649283296436146</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2159069551745631737.post-1544409650992921935</id><published>2025-09-22T08:08:00.000-07:00</published><updated>2025-09-22T08:08:17.479-07:00</updated><title type='text'>Webhook</title><content type='html'>&lt;h2 data-end=&quot;138&quot; data-start=&quot;113&quot;&gt;1️⃣ What Is a Webhook?&lt;/h2&gt;
&lt;p data-end=&quot;219&quot; data-start=&quot;139&quot;&gt;A &lt;strong data-end=&quot;152&quot; data-start=&quot;141&quot;&gt;webhook&lt;/strong&gt; is an automatic &lt;strong data-end=&quot;186&quot; data-start=&quot;169&quot;&gt;HTTP callback&lt;/strong&gt; from one application to another.&lt;/p&gt;
&lt;ul data-end=&quot;368&quot; data-start=&quot;221&quot;&gt;
&lt;li data-end=&quot;368&quot; data-start=&quot;221&quot;&gt;
&lt;p data-end=&quot;255&quot; data-start=&quot;223&quot;&gt;Think of it like a &lt;strong data-end=&quot;254&quot; data-start=&quot;242&quot;&gt;doorbell&lt;/strong&gt;:&lt;/p&gt;
&lt;ul data-end=&quot;368&quot; data-start=&quot;258&quot;&gt;
&lt;li data-end=&quot;306&quot; data-start=&quot;258&quot;&gt;
&lt;p data-end=&quot;306&quot; data-start=&quot;260&quot;&gt;You don’t keep checking if someone is outside.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;368&quot; data-start=&quot;309&quot;&gt;
&lt;p data-end=&quot;368&quot; data-start=&quot;311&quot;&gt;Instead, the doorbell (webhook) notifies you immediately.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;388&quot; data-start=&quot;370&quot;&gt;In software terms:&lt;/p&gt;
&lt;ul data-end=&quot;540&quot; data-start=&quot;389&quot;&gt;
&lt;li data-end=&quot;483&quot; data-start=&quot;389&quot;&gt;
&lt;p data-end=&quot;483&quot; data-start=&quot;391&quot;&gt;App A sends an &lt;strong data-end=&quot;419&quot; data-start=&quot;406&quot;&gt;HTTP POST&lt;/strong&gt; request to a URL you provide whenever a specific event happens.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;540&quot; data-start=&quot;484&quot;&gt;
&lt;p data-end=&quot;540&quot; data-start=&quot;486&quot;&gt;Your app receives the data instantly, without polling.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;545&quot; data-start=&quot;542&quot; /&gt;
&lt;h2 data-end=&quot;572&quot; data-start=&quot;547&quot;&gt;2️⃣ Real-Life Examples&lt;/h2&gt;
&lt;ul data-end=&quot;792&quot; data-start=&quot;573&quot;&gt;
&lt;li data-end=&quot;653&quot; data-start=&quot;573&quot;&gt;
&lt;p data-end=&quot;653&quot; data-start=&quot;575&quot;&gt;&lt;strong data-end=&quot;594&quot; data-start=&quot;575&quot;&gt;Payment Gateway&lt;/strong&gt;: Stripe or PayPal sends a webhook when a payment succeeds.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;725&quot; data-start=&quot;654&quot;&gt;
&lt;p data-end=&quot;725&quot; data-start=&quot;656&quot;&gt;&lt;strong data-end=&quot;666&quot; data-start=&quot;656&quot;&gt;GitHub&lt;/strong&gt;: Sends a webhook when someone pushes code to a repository.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;792&quot; data-start=&quot;726&quot;&gt;
&lt;p data-end=&quot;792&quot; data-start=&quot;728&quot;&gt;&lt;strong data-end=&quot;741&quot; data-start=&quot;728&quot;&gt;Chat Apps&lt;/strong&gt;: Slack sends a webhook when a new message arrives.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;797&quot; data-start=&quot;794&quot; /&gt;
&lt;h2 data-end=&quot;832&quot; data-start=&quot;799&quot;&gt;3️⃣ How It Works (Simple Flow)&lt;/h2&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;991&quot; data-start=&quot;834&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre!&quot;&gt;Event Happens in Service A
        |
Service A sends HTTP &lt;span class=&quot;hljs-title function_&quot;&gt;POST&lt;/span&gt; &lt;span class=&quot;hljs-params&quot;&gt;(JSON)&lt;/span&gt;
        |
  Your Webhook &lt;span class=&quot;hljs-title function_&quot;&gt;Endpoint&lt;/span&gt; &lt;span class=&quot;hljs-params&quot;&gt;(Service B)&lt;/span&gt;
        |
   You process the data
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;h3 data-end=&quot;1003&quot; data-start=&quot;993&quot;&gt;Steps:&lt;/h3&gt;
&lt;ol data-end=&quot;1262&quot; data-start=&quot;1004&quot;&gt;
&lt;li data-end=&quot;1076&quot; data-start=&quot;1004&quot;&gt;
&lt;p data-end=&quot;1076&quot; data-start=&quot;1007&quot;&gt;You give Service A a URL (e.g., &lt;code data-end=&quot;1074&quot; data-start=&quot;1039&quot;&gt;https://yourapp.com/webhook/order&lt;/code&gt;).&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1130&quot; data-start=&quot;1077&quot;&gt;
&lt;p data-end=&quot;1130&quot; data-start=&quot;1080&quot;&gt;Service A triggers an event (e.g., order created).&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1190&quot; data-start=&quot;1131&quot;&gt;
&lt;p data-end=&quot;1190&quot; data-start=&quot;1134&quot;&gt;It sends a POST request with a JSON payload to your URL.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1262&quot; data-start=&quot;1191&quot;&gt;
&lt;p data-end=&quot;1262&quot; data-start=&quot;1194&quot;&gt;Your server reads it and takes action (update DB, send email, etc.).&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;hr data-end=&quot;1267&quot; data-start=&quot;1264&quot; /&gt;
&lt;h2 data-end=&quot;1311&quot; data-start=&quot;1269&quot;&gt;4️⃣ Creating a Webhook Receiver in .NET&lt;/h2&gt;
&lt;p data-end=&quot;1351&quot; data-start=&quot;1313&quot;&gt;Here’s a minimal ASP.NET Core example:&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;1897&quot; data-start=&quot;1353&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-csharp&quot;&gt;[&lt;span class=&quot;hljs-meta&quot;&gt;ApiController&lt;/span&gt;]
[&lt;span class=&quot;hljs-meta&quot;&gt;Route(&lt;span class=&quot;hljs-string&quot;&gt;&quot;webhook&quot;&lt;/span&gt;&lt;/span&gt;)]
&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;WebhookController&lt;/span&gt; : &lt;span class=&quot;hljs-title&quot;&gt;ControllerBase&lt;/span&gt;
{
    [&lt;span class=&quot;hljs-meta&quot;&gt;HttpPost(&lt;span class=&quot;hljs-string&quot;&gt;&quot;order&quot;&lt;/span&gt;&lt;/span&gt;)]
    &lt;span class=&quot;hljs-function&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;async&lt;/span&gt; Task&amp;lt;IActionResult&amp;gt; &lt;span class=&quot;hljs-title&quot;&gt;Receive&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot;&gt;[FromBody] OrderEvent payload&lt;/span&gt;)
    {
        &lt;span class=&quot;hljs-comment&quot;&gt;// Process the incoming event&lt;/span&gt;
        &lt;span class=&quot;hljs-comment&quot;&gt;// e.g., save to database, trigger another service&lt;/span&gt;
        Console.WriteLine(&lt;span class=&quot;hljs-string&quot;&gt;$&quot;Order received: &lt;span class=&quot;hljs-subst&quot;&gt;{payload.OrderId}&lt;/span&gt;&lt;/span&gt;&quot;);
        &lt;span class=&quot;hljs-keyword&quot;&gt;return&lt;/span&gt; Ok(); &lt;span class=&quot;hljs-comment&quot;&gt;// Reply 200 so sender knows you got it&lt;/span&gt;
    }
}

&lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;OrderEvent&lt;/span&gt;
{
    &lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hljs-built_in&quot;&gt;string&lt;/span&gt; OrderId { &lt;span class=&quot;hljs-keyword&quot;&gt;get&lt;/span&gt;; &lt;span class=&quot;hljs-keyword&quot;&gt;set&lt;/span&gt;; }
    &lt;span class=&quot;hljs-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;hljs-built_in&quot;&gt;decimal&lt;/span&gt; Amount { &lt;span class=&quot;hljs-keyword&quot;&gt;get&lt;/span&gt;; &lt;span class=&quot;hljs-keyword&quot;&gt;set&lt;/span&gt;; }
}
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;p data-end=&quot;1916&quot; data-start=&quot;1899&quot;&gt;&lt;strong data-end=&quot;1916&quot; data-start=&quot;1899&quot;&gt;Steps to use:&lt;/strong&gt;&lt;/p&gt;
&lt;ol data-end=&quot;2100&quot; data-start=&quot;1917&quot;&gt;
&lt;li data-end=&quot;1970&quot; data-start=&quot;1917&quot;&gt;
&lt;p data-end=&quot;1970&quot; data-start=&quot;1920&quot;&gt;Deploy your app so it has a public HTTPS endpoint.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2023&quot; data-start=&quot;1971&quot;&gt;
&lt;p data-end=&quot;2023&quot; data-start=&quot;1974&quot;&gt;Give that URL to the service sending the webhook.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2100&quot; data-start=&quot;2024&quot;&gt;
&lt;p data-end=&quot;2100&quot; data-start=&quot;2027&quot;&gt;Test with a tool like &lt;strong data-end=&quot;2058&quot; data-start=&quot;2049&quot;&gt;ngrok&lt;/strong&gt; (to expose local development) or Postman.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;hr data-end=&quot;2105&quot; data-start=&quot;2102&quot; /&gt;
&lt;h2 data-end=&quot;2158&quot; data-start=&quot;2107&quot;&gt;5️⃣ Sending a Webhook (If Your App Triggers One)&lt;/h2&gt;
&lt;p data-end=&quot;2191&quot; data-start=&quot;2160&quot;&gt;If &lt;em data-end=&quot;2168&quot; data-start=&quot;2163&quot;&gt;you&lt;/em&gt; want to notify others:&lt;/p&gt;
&lt;pre class=&quot;overflow-visible!&quot; data-end=&quot;2356&quot; data-start=&quot;2193&quot;&gt;&lt;div class=&quot;contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary&quot;&gt;&lt;div class=&quot;sticky top-9&quot;&gt;&lt;div class=&quot;absolute end-0 bottom-0 flex h-9 items-center pe-2&quot;&gt;&lt;div class=&quot;bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;whitespace-pre! language-csharp&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;using&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;var&lt;/span&gt; http = &lt;span class=&quot;hljs-keyword&quot;&gt;new&lt;/span&gt; HttpClient();
&lt;span class=&quot;hljs-keyword&quot;&gt;await&lt;/span&gt; http.PostAsJsonAsync(&lt;span class=&quot;hljs-string&quot;&gt;&quot;https://partner.com/webhook/receive&quot;&lt;/span&gt;, &lt;span class=&quot;hljs-keyword&quot;&gt;new&lt;/span&gt; {
    OrderId = &lt;span class=&quot;hljs-number&quot;&gt;123&lt;/span&gt;,
    Amount = &lt;span class=&quot;hljs-number&quot;&gt;99.99&lt;/span&gt;M
});
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;hr data-end=&quot;2361&quot; data-start=&quot;2358&quot; /&gt;
&lt;h2 data-end=&quot;2384&quot; data-start=&quot;2363&quot;&gt;6️⃣ Best Practices&lt;/h2&gt;
&lt;ul data-end=&quot;2713&quot; data-start=&quot;2385&quot;&gt;
&lt;li data-end=&quot;2474&quot; data-start=&quot;2385&quot;&gt;
&lt;p data-end=&quot;2474&quot; data-start=&quot;2387&quot;&gt;&lt;strong data-end=&quot;2399&quot; data-start=&quot;2387&quot;&gt;Security&lt;/strong&gt;: Verify signatures or use a secret token to ensure the request is genuine.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2570&quot; data-start=&quot;2475&quot;&gt;
&lt;p data-end=&quot;2570&quot; data-start=&quot;2477&quot;&gt;&lt;strong data-end=&quot;2498&quot; data-start=&quot;2477&quot;&gt;Retry/Idempotency&lt;/strong&gt;: Handle duplicate messages—sender may retry if it doesn’t get a 200 OK.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2625&quot; data-start=&quot;2571&quot;&gt;
&lt;p data-end=&quot;2625&quot; data-start=&quot;2573&quot;&gt;&lt;strong data-end=&quot;2584&quot; data-start=&quot;2573&quot;&gt;Logging&lt;/strong&gt;: Log every received event for debugging.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2713&quot; data-start=&quot;2626&quot;&gt;
&lt;p data-end=&quot;2713&quot; data-start=&quot;2628&quot;&gt;&lt;strong data-end=&quot;2640&quot; data-start=&quot;2628&quot;&gt;Timeouts&lt;/strong&gt;: Reply quickly; heavy work should be queued or processed asynchronously.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;2718&quot; data-start=&quot;2715&quot; /&gt;
&lt;h2 data-end=&quot;2738&quot; data-start=&quot;2720&quot;&gt;7️⃣ Quick Recap&lt;/h2&gt;
&lt;ul data-end=&quot;2960&quot; data-start=&quot;2739&quot;&gt;
&lt;li data-end=&quot;2800&quot; data-start=&quot;2739&quot;&gt;
&lt;p data-end=&quot;2800&quot; data-start=&quot;2741&quot;&gt;&lt;strong data-end=&quot;2800&quot; data-start=&quot;2741&quot;&gt;Webhook = “We push data to you when something happens.”&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2845&quot; data-start=&quot;2801&quot;&gt;
&lt;p data-end=&quot;2845&quot; data-start=&quot;2803&quot;&gt;Sender: service that triggers the event.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2904&quot; data-start=&quot;2846&quot;&gt;
&lt;p data-end=&quot;2904&quot; data-start=&quot;2848&quot;&gt;Receiver: your endpoint that processes the POST request.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-end=&quot;2960&quot; data-start=&quot;2905&quot;&gt;
&lt;p data-end=&quot;2960&quot; data-start=&quot;2907&quot;&gt;Great for real-time updates without constant polling.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;3051&quot; data-is-last-node=&quot;&quot; data-is-only-node=&quot;&quot; data-start=&quot;2962&quot;&gt;In .NET, it’s just an ASP.NET Core controller action that accepts an HTTP POST with JSON.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://piushshukla.blogspot.com/feeds/1544409650992921935/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://piushshukla.blogspot.com/2025/09/webhook.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2159069551745631737/posts/default/1544409650992921935'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2159069551745631737/posts/default/1544409650992921935'/><link rel='alternate' type='text/html' href='http://piushshukla.blogspot.com/2025/09/webhook.html' title='Webhook'/><author><name>Piush shukla</name><uri>http://www.blogger.com/profile/16392649283296436146</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>