Category: continuous-integration-deployment-development

Setup Firebase account with React App
Feb 23, 2024 4 min read

Establishing your account on Firebase and connecting it with your React APP encompasses multiple steps, such as initiating a Firebase project, adjusting your project settings, and acquiring your Firebase configuration details. Below is a comprehensive, step-by-step guide:    Step 1: Go to the Firebase Console  From this link, you can go to the Firebase console app  https://console.firebase.google.com/    Step 2: Sign in or create a Google Account  If you have a Google account you can directly sign in and  if you don’t have then you need to create one to sign in    Step 3: Create a new Firebase Project  Click on the Create a Project button.       Enter a Project name.          And Click on the Continue button.  Enable Google Analytics (Optional)          From here you can enable or disable the Google Analytics option. It is recommended to enable Google Analytics for better insights.  Once you click on the Continue button, firebase will set your project and redirect you to the Project dashboard.           Add an app to your project:  Click on the Project Settings button and from there you can see the configuration of your project.           Choose the platform for your app (iOS, Android, or Web).                 Enter an app nickname (optional) and click on Register app.          Obtain Firebase configuration details.    For a web app, Firebase will provide you with a configuration object containing keys like apiKey, authDomain, projectId, etc. Copy this information as you'll need it in your application.  Step 4: Create database  For Creating the database, go to the build option and click on the “FireStore Database” option     Once you navigate to Firestore Database, click on “Create database” button.    Step 5: Install the Firebase Package  After creating your React app, change directory to your project's root folder and install the Firebase package by running:  npm install firebase    Step 6: Initialize Firebase in your React APP  Create a new folder inside your project src directory. You can call this firebase_setup. Next, create a firebase.js file inside that folder. Then paste the code generated earlier into this file. Thus, you can fine-tune the generated code as follows: import { initializeApp } from "firebase/app";  import { getFirestore } from "@firebase/firestore"    const firebaseConfig = {  apiKey: process.env.REACT_APP_apiKey,  authDomain: process.env.REACT_APP_authDomain,  projectId: process.env.REACT_APP_projectId,  storageBucket: process.env.REACT_APP_storageBucket,  messagingSenderId: process.env.REACT_APP_messagingSenderId,  appId: process.env.REACT_APP_appId,  measurementId: process.env.REACT_APP_measurementId  };    const app = initializeApp(firebaseConfig);  export const firestore = getFirestore(app)    Step 7: Test Your Firebase Connection  You can test the connection by submitting dummy data to Firestore. Start by creating a handles folder inside your project's src directory. Create a submit handler inside this file. You can call this handlesubmit.js, for instance:  import { doc, setDoc } from "@firebase/firestore"  import { firestore } from "../firebase_setup/firebase"  const handleSubmit = async(testdata) => {  const handleSubmit = async(employeeData) => { try { const employeeDocRef = doc(firestore, 'EmployeeDb', 'Employee_tbl'); await setDoc(employeeDocRef, employeeData); console.log("Added employee data successfully"); } catch(e) { console.error("Error adding data employee", e); } } export default handleSubmit  //Then inside App.js:  import './App.css';  import handleSubmit from "./handler/handlesubmit.js"; import { useState} from 'react';  function App() {  const [employee, setEmployee] = useState({ name: "", age: "", position: "", }); // Function to handle input changes const handleChange = (e) => { const { name, value } = e.target; setEmployee({ ...employee, [name]: value }); }; const submithandler = (e) => { e.preventDefault(); handleSubmit(employee); };   return ( <> <div className="form-container" onSubmit={submithandler}> <form action="#" > <div className="form-group"> <label >Employee Data:</label> <input type="text" name="name" placeholder="Name" value={employee.name} onChange={handleChange} /> <input type="text" name="age" placeholder="Age" value={employee.age} onChange={handleChange} /> <input type="text" name="position" placeholder="Position" value={employee.position} onChange={handleChange} /> <input type="submit" value="Submit" /> </div> </form> </div> </> ); }    export default App;    Run your React app and try submitting data via the form. Refresh the Firebase database console to see the submitted information in your collection.  When you run your React app it will look like this. Here when you add all the details of the employee and click on the Submit button Whatever you entered in the form it will be reflected in your Firestore database. Fantastic! You have effectively established your Firebase account and configured it in your react application.  

Simplified Swagger Integration in .NET Core
Feb 22, 2024 1 min read

Introduction: In the realm of modern APIs, the provision of clear and comprehensive documentation plays a pivotal role in facilitating developer adoption and ensuring efficient utilization. Swagger, aligned with the OpenAPI Initiative, stands out as a prominent solution, offering machine-readable documentation and a user-friendly interactive interface. In this guide, we'll delve into the seamless integration of Swagger into your .NET Core API. Step 1: Install the necessary packages Add Swashbuckle.AspNetCore NuGet package to a project: dotnet add package Swashbuckle.AspNetCore Add Swashbuckle.AspNetCore.SwaggerUI NuGet package to a project: dotnet add package Swashbuckle.AspNetCore.SwaggerUI Step 2: Add services in program.cs In the program.cs file, include the following service additions: builder.Services.AddEndpointsApiExplorer(); builder.Services.AddSwaggerGen(); Additionally, add middleware in program.cs to enable Swagger in the development environment:   if (app.Environment.IsDevelopment()) { app.UseSwagger(); app.UseSwaggerUI(); } Step 3: Run the API project and access the Swagger UI at: https://your-api-base-url/swagger Ensure the API project is running, and navigate to the provided URL to explore and interact with the Swagger UI seamlessly. Step 3:  Execute the APIs and test.  

ASP .NET Core Two-Factor Authentication
Feb 21, 2024 6 min read

What is Authentication?  Authentication is the process of validating the identity of a user or system attempting to access a protected resource. In C# programming, authentication is commonly implemented in various scenarios, including web applications, desktop applications, and services.  Types of Authentications  Basic Authentication  Password-based Authentication  Multi-Factor Authentication  Token-based Authentication  Let’s understand authentication with example. Here I am taking one example of MFA (Two-factor authentication).  Step 1: Create the MVC Web Application  Open Visual Studio and select File >> New >> Project. After selecting the project, a “New Project” dialog will open. Select ASP.NET Core web app (Model-View-Controller) and press Next and enter project name and click Next.      Choose 'Individual Account' as the authentication type and click 'Create' to generate the project.      Step 2: Adding QR Codes to configure two-factor authentication  We will be using a QR code to configure and sync the Google authenticator app with our web app. Download the qrcode.js JavaScript library from https://davidshimjs.github.io/qrcodejs/ and put it into the “wwwroot\lib” folder in your application. Now, your “wwwroot” folder will have the following structure.      Now, Add new scaffolded item in your project by right click on Area folder and select New scaffolded Item under Add section.  Select Identity section on left sidebar and click on Add.      Now, Select the identity files that you have to add to your project but select file “Account/Manage/EnableAuthenticator” is compulsory for 2FA.  Select the DbContext Class of your project and click on add.   Open the “Views\Manage\EnableAuthenticator.cshtml” file. You will find @section Scripts at the end of the file. Put the following code in it.  @section Scripts { @await Html.PartialAsync("_ValidationScriptsPartial") <script src="~/lib/qrcode/qrcode.js"></script> <script type="text/javascript"> new QRCode(document.getElementById("qrCode"), { text: "@Html.Raw(Model.AuthenticatorUri)", width: 200, height: 200 }); </script> }   Note: Change your script path as per your folder structure.  This “EnableAuthenticator.cshtml” file already has a div with the id “qrCode” (see the code snippet below). We are generating a QR code inside that div using the qrcode.js library. We are also defining the dimensions of the QR code in terms of width and height.  So finally, your “EnableAuthenticator.cshtml” file will look like this. @page @model EnableAuthenticatorModel @{ ViewData["Title"] = "Configure authenticator app"; ViewData["ActivePage"] = ManageNavPages.TwoFactorAuthentication; } <partial name="_StatusMessage" for="StatusMessage" /> <h3>@ViewData["Title"]</h3> <div> <p>To use an authenticator app go through the following steps:</p> <ol class="list"> <li> <p> Download a two-factor authenticator app like Microsoft Authenticator for <a href="https://go.microsoft.com/fwlink/?Linkid=825072">Android</a> and <a href="https://go.microsoft.com/fwlink/?Linkid=825073">iOS</a> or Google Authenticator for <a href="https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2&amp;hl=en">Android</a> and <a href="https://itunes.apple.com/us/app/google-authenticator/id388497605?mt=8">iOS</a>. </p> </li> <li> <p>Scan the QR Code or enter this key <kbd>@Model.SharedKey</kbd> into your two factor authenticator app. Spaces and casing do not matter.</p> <div class="alert alert-info">Learn how to <a href="https://go.microsoft.com/fwlink/?Linkid=852423">enable QR code generation</a>.</div> <div id="qrCode"></div> <div id="qrCodeData" data-url="@Model.AuthenticatorUri"></div> </li> <li> <p> Once you have scanned the QR code or input the key above, your two factor authentication app will provide you with a unique code. Enter the code in the confirmation box below. </p> <div class="row"> <div class="col-md-6"> <form id="send-code" method="post"> <div class="form-floating mb-3"> <input asp-for="Input.Code" class="form-control" autocomplete="off" placeholder="Please enter the code."/> <label asp-for="Input.Code" class="control-label form-label">Verification Code</label> <span asp-validation-for="Input.Code" class="text-danger"></span> </div> <button type="submit" class="w-100 btn btn-lg btn-primary">Verify</button> <div asp-validation-summary="ModelOnly" class="text-danger" role="alert"></div> </form> </div> </div> </li> </ol> </div> @section Scripts { @await Html.PartialAsync("_ValidationScriptsPartial") <script src="~/lib/qrcode/qrcode.js"></script> <script type="text/javascript"> new QRCode(document.getElementById("qrCode"), { text: "@Html.Raw(Model.AuthenticatorUri)", width: 200, height: 200 }); </script> } When we execute the program, a QR code will be generated in this View. Then you can set up two factor authentication using the Google authenticator with the help of this QR code.  Step 3: Configure two-factor authentication  Before running the application, we need to apply migrations to our app. Navigate to Tools >> NuGet Package Manager >> Package Manager Console. It will open the Package Manager Console. Put in the “Update-Database” command and hit Enter. This will update the database using Entity Framework Code First Migrations. Run the application and click on “Register” in the top right corner of the homepage. You can see a user registration page. Fill in the details and click on the “Register” button as shown in the image below.  Upon successful registration, you will be logged into the application and navigated to the home page. Here, you can see your registered Email id at the top right corner of the page. Click on it to navigate to the “Manage your account” page. Select “TwoFactorAuthentication” from the left menu. You will see a page similar to that shown below.       Click on the “Set up authenticator app” button. You can see a QR code generated on your screen — it is asking for a “Verification Code”, also as shown in the image below.    You need to install the Google Authenticator/Microsoft Authenticator app on your smartphone. It will allow you to scan this QR code in order to generate a Verification Code and complete a two-factor authentication setup.  Open Microsoft Authenticator and click on verified IDs at the bottom. Click on “Scan a barcode” and scan the QR code generated by the web app. This will add a new account to Microsoft authenticator and generate a six-digit pin on your mobile screen. This is our two-factor authentication code. This is a TOTP ( time-based one-time password). You can observe that it keeps on changing frequently (life span of 30 seconds).  Put this pin in the Verification Code textbox and click on verify. Upon successful verification, you will see a screen similar to the one shown below. This will give you the recovery codes for your account that will help to recover your account in case you are locked out. Take a note of these codes and keep them somewhere safe.    Logout of the application and click on login again. Enter your registered email id and password and click on login.    Now you can see a the two-factor authentication screen asking for the Authenticator code. Put in the code that is generated in your Google Authenticator app and click on Login. You will be successfully logged into the application and navigated to the home page. 

MagnusMinds' Commitment to Growth: Never-ending Learning
Feb 19, 2024 3 min read

Introduction:  At MagnusMinds, we passionately believe that the key to success lies in the relentless pursuit of knowledge and growth. Our commitment to fostering a culture of continuous development is not just a statement; it is a way of life for our employees. In this blog, we will delve into the core of MagnusMinds' ethos, exploring the various avenues through which we empower our team members to thrive and excel in their professional journeys.    Investing in Knowledge:  At the heart of MagnusMinds' commitment to continuous development is our robust investment in training programs. We understand that staying ahead in today's dynamic business landscape requires a workforce equipped with the latest skills and knowledge. From specialized workshops to industry conferences, we provide our employees with diverse opportunities to enhance their expertise and stay abreast of emerging trends.    Mentorship Matters:  MagnusMinds places great emphasis on the power of mentorship. Our mentorship programs are designed to foster meaningful connections between experienced professionals and those looking to navigate their career paths. Seasoned mentors not only share their insights but also provide guidance, support, and encouragement, creating an environment where learning is a two-way street.    Tailored Development Plans:  Recognizing that each employee is on a unique professional journey, MagnusMinds takes a personalized approach to development. We work collaboratively with our team members to create tailored development plans that align with their career goals and aspirations. Whether it is acquiring new technical skills or honing leadership capabilities, we ensure that everyone's growth trajectory is supported.    Learning Beyond Boundaries:  MagnusMinds encourages its employees to explore learning opportunities beyond their immediate roles. Cross-functional exposure is not just welcomed; it is actively promoted. This approach not only broadens the skill sets of our team members but also fosters a culture of collaboration and innovation, where diverse perspectives are valued.    Learning from Each Other:  The strength of MagnusMinds lies in its diverse talent pool. We believe that everyone has something unique to offer and learning from each other is a continuous process. Whether through informal knowledge-sharing sessions, collaborative projects, or internal forums, we create spaces where employees can tap into the collective intelligence of the organization.    Celebrating Milestones:  Acknowledging and celebrating milestones is an integral part of MagnusMinds' culture. Whether it is completing a certification, leading a successful project, or achieving a personal development goal, we take pride in recognizing and applauding the efforts of our team members. These celebrations not only motivate individuals but also contribute to a positive and supportive work environment.    Conclusion:  In conclusion, MagnusMinds' culture of continuous development is not just about keeping up with the pace of change; it is about setting the pace. By investing in knowledge, promoting mentorship, offering tailored development plans, encouraging cross-functional learning, fostering knowledge-sharing, and celebrating achievements, we are building a workforce that is not just skilled but also passionate about their professional growth.    At MagnusMinds, learning never stops because our commitment to development is ingrained in our DNA. As we empower our employees to reach new heights, we are not just investing in their future; we are shaping the future of MagnusMinds itself. Join us on this journey of perpetual growth, where every day is an opportunity to learn, evolve, and succeed. 

Exploring Microsoft Power Automate
Feb 15, 2024 3 min read

Microsoft Power Automate Microsoft Power Automate is a cloud-based automation platform that lets users create workflows to automate repetitive tasks and streamline business processes without extensive coding knowledge. Users can connect different applications and services to design workflows visually. Power Automate improves efficiency by automating manual tasks.   How Does Power Automate Work? Power Automate workflow, or flows, are based on triggers and actions. A Trigger initiates the flow, such as receiving an email from a key project stakeholder. An Action is what occurs once the flow is triggered. This may involve creating a task when an email marked as high-importance is received. A flow can have one or more actions.   There are five main types of Power Automate flows, categorized as cloud flows, desktop flows, or business process flows. Cloud flows include: Automated, a flow triggered by an event, for example, sends an email if an item in a SharePoint list is changed. Instant  flows allow users to manually trigger a flow from the mobile or desktop app with the click of a button. As an example, easily send a reminder email to your team before a meeting. Scheduled, which runs at certain times.  Desktop flows are used to automate tasks on the web or your desktop with Power Automate Desktop. Business process flows provide a guide for individuals to complete tasks efficiently. They offer a streamlined user experience, guiding users through organizational processes defined for interactions needing advancement to a specific conclusion. An example of a business process might be "Client Onboarding."   Power Automate Use Cases   You can generate your flow by adding information about what you want to automate.   There are three ways to create your automated flow. You can create your flow from scratch.   Automate tasks or processes using custom templates for cloud flows in Power Automate.   Easily connect to your apps, data, and services using connectors    The Scenario  Our product's effectiveness relies on swift order processing. To achieve this, we've automated the retrieval of new orders from our database's Orders table, ensuring instant access to updated information. This enhances our ability to monitor and manage orders efficiently, optimizing our workflow for seamless operations.   Step-by-Step Guide Microsoft Power Automate provides a pre-built task for sending an email when an item is created in SQL Server. Note: - If your data is stored on-premises, the gateway should be in active mode with the same user logged in. Add New SQL Connection: -  Configure with SQL Server, adding the required details along with the gateway (If your data is stored on-premises).   Add the required parameters to the action.   Add the SQL Server name, and database name, along with the table data you want to include in the email. Schedule the flow as per requirements   Set the email address and dynamic SQL fields you want to send in a mail. The flow is ready. When new data is updated in the table, the flow is triggered at the selected time, and an email will be sent to the users.   Conclusion: By automating the retrieval of newly added order details from our database's Orders table, we have streamlined our order processing workflow significantly. This automated process ensures timely access to updated order information, enabling us to monitor and manage our orders more efficiently. As a result, our organization can better meet customer demands, improve overall productivity, and enhance the quality of our services.

The Ultimate Angular vs React Comparison
Feb 08, 2024 3 min read

Overview  In the ever-evolving landscape of web development, the choice of a JavaScript framework can be akin to selecting the right tool for a complex job. Among the myriad options available, two stalwarts, Angular and React, have risen to prominence, captivating the developer community with their unique approaches to building modern, dynamic user interfaces. By examining factors such as performance, learning curve, and project requirements, we aim to equip you with the insights needed to crack the JavaScript conundrum and make an informed choice for your next project.    What is Angular?  Angular is an open-source JavaScript framework written in TypeScript maintained by Google and its primary purpose is to develop single-page applications. It provides a collection of well-integrated libraries that cover a wide variety of features, including routing, forms management, client-server communication, and more. You can write, compile, test, and update your code with the aid of its development tools.    Key features and concepts of Angular include:  Cross-Platform  Component-Based Architecture  Dependency Injection  Directives  RxJS (Reactive Extensions for JavaScript)  Two-way Data Binding    Advantages of Angular Angular promotes a modular architecture, allowing developers to organize code into separate and reusable modules.  Angular extends HTML syntax. With directives.  Angular uses two-way data binding, meaning that the model state changes automatically whenever any interface element changes.  Angular uses a powerful dependency injection system, making it easier to manage and test components.  Angular is built using TypeScript, a statically typed superset of JavaScript. TypeScript adds static typing, interfaces, and other features that enhance code quality, readability, and maintainability.  Angular provides a powerful CLI that streamlines common development tasks.    What is React?  React is a JavaScript-based UI development library that aims to simplify the intricate process of building interactive user interfaces. It is primarily used for building user interfaces (UIs) for single-page applications where the user interface needs to be dynamic and highly responsive. Developed and maintained by Facebook, React has gained widespread adoption in the web development community due to its declarative and efficient approach to building UI components.   Key features and concepts of React include:  Virtual DOM  JSX Syntax  Component based architecture  Declarative Syntax  Props  Hooks    Advantages of React React uses a virtual DOM to optimize rendering performance. Updates to a virtual version of the DOM are triggered by changes in the UI, and React determines the most effective way to update the real DOM to minimize needless re-renders. It has faster updates with both server-side and front-end support.  Easier debugging with declarative views.  React.js promotes the concept of reusable components, which are self-contained modules that can be used across different parts of an application.  React.js has a large and active community of developers who constantly contribute to its growth and improvement.  React.js is highly scalable and flexible, making it suitable for building applications of any size or complexity.    Quick comparison between Angular and React      Angular vs. React: When to choose which?     Angular or React which is best?  Ultimately, the choice between Angular and React is subjective and depends on the specific needs of your project and your team's preferences and expertise. It's also worth noting that both Angular and React have been widely adopted in the industry and have proven successful in building modern and scalable web applications. 

Database Migration to Microsoft SQL Server
Feb 07, 2024 3 min read

Introduction Migrating Microsoft SQL Server databases from one server to another is a critical task that requires careful planning and execution. Overseeing this migration project, it's essential to have a detailed checklist to ensure a smooth and successful transition. In this blog, we will explore the key steps involved in migrating SQL Server databases and provide a comprehensive checklist to guide you through the process.   Checklist for SQL Server Database Migration 1. Assessment and Planning: Database Inventory: Identify all databases to be migrated. Document database sizes, configurations, and dependencies. Compatibility Check: Verify the compatibility of SQL Server versions. Check for deprecated features or components. Backup Strategy: Ensure full backups of all databases are taken before migration. Confirm the backup and restore processes are working correctly.   2. Server Environment Preparation: Server Infrastructure: Verify that the new server meets hardware and software requirements. Install the necessary SQL Server version on the new server. Security Considerations: Plan for server-level security, including logins and permissions. Transfer relevant security configurations from the old server. Firewall and Networking: Update firewall rules to allow communication between old and new servers. Confirm network configurations to avoid connectivity issues.   3. Database Schema and Data Migration: Schema Scripting: Generate scripts for database schema (tables, views, stored procedures, etc.). Validate the scripts in a test environment. Data Migration: Choose an appropriate method for data migration (Backup and Restore, Detach and Attach, or SQL Server Integration Services - SSIS). Perform a trial data migration to identify and address potential issues.??????? Restore Strategy: Ensure full backups of all databases are available on the new server. Restore databases and confirm the processes are working correctly.   4. Application and Dependency Testing: Application Compatibility: Test the application with the new SQL Server to ensure compatibility. Address any issues related to SQL Server version changes. Dependency Verification: Confirm that linked servers, jobs, database mail, and maintenance plans are updated. Test connectivity to other applications relying on the database.   5. Post-Migration Validation: Data Integrity Check: Execute DBCC CHECKDB to ensure the integrity of the migrated databases. Address any issues identified during the integrity check. Performance Testing: Conduct performance testing to ensure the new server meets performance expectations. Optimize queries or configurations if needed. User Acceptance Testing (UAT): Involve end-users in testing to validate the functionality of the migrated databases. Address any user-reported issues promptly.     Conclusion A successful Microsoft SQL Server database migration requires meticulous planning, thorough testing, and effective communication. Following this comprehensive checklist will help ensure a smooth transition from one server to another while minimizing disruptions to business operations. Regularly communicate with your team and stakeholders throughout the migration process to address any challenges promptly and ensure a successful outcome. Download Checklist for MSSQL Server Migration

Group Ranking with DAX in Power BI
Feb 06, 2024 2 min read

Data visualization and analysis in today's fast-paced business environment require not only precision but also a deep understanding of the tools at our disposal. Power BI, a potent tool in Microsoft's suite, stands out for its ability to handle complex data scenarios. One such scenario is ranking data with multiple grouping dimensions, such as state, city, and revenue. This blog post will guide you through this process in Power BI.    Understanding the Basics  Before we dive into the specifics, let's ensure we have a clear understanding of some key Power BI concepts:    Ranking: This involves sorting data in ascending or descending order. In Power BI, we can use DAX functions like RANKX to achieve this.  Grouping: This refers to categorizing data into segments. Power BI allows grouping in visuals or more advanced grouping in DAX.  DAX (Data Analysis Expressions): A library of functions and operators used in Power BI for creating custom calculations.    The Scenario  Imagine we have a dataset containing sales information across different states and cities over several years. Our objective is to rank these cities within each state based on their annual revenue.    Step-by-Step Guide  Prepare Your Data: Ensure your dataset is properly structured with columns for State, City, Year, and Revenue.  Load Data into Power BI: Import your dataset into Power BI Desktop.  Creating the Rank Measure:  Go to the Data view.  Create a new Measure to calculate the rank. You can do this by using the DAX formula:    Building the Visual:  Switch to the Report view.  Create a table or matrix visual.  Add State, City, Revenue, and the newly created Rank column to the visual.  Conclusion  Ranking and grouping in Power BI offer powerful ways to dissect and understand your data more effectively. By following the steps outlined in this blog, you can now rank cities within states based on revenue, offering valuable insights into regional sales performance.  Remember, the key to mastering Power BI lies in practice and experimentation, so don’t hesitate to try different variations of rankings and groupings to suit your specific data needs.   

API Response Fix: Simple Solutions
Feb 03, 2024 4 min read

Simplifying API Responses with AutoWrapper.Core in .NET Core. Handling API responses effectively is a crucial aspect of building robust and user-friendly applications. In .NET Core applications, the AutoWrapper.Core library comes to the rescue, providing a streamlined way to structure and standardize API responses. In this blog post, we'll explore how to use AutoWrapper.Core to create fixed responses for different status codes in your API. Firstly, you'll need to install the AutoWrapper.Core NuGet package. Add the following line to your project's .csproj file: <PackageReference Include="AutoWrapper.Core" Version="4.5.1" /> This package simplifies the process of handling API responses and ensures a consistent format for success, error, and data messages.   Example: Login Method Let's consider a common scenario, the login method, where we want to ensure fixed responses for both successful and unsuccessful attempts. [HttpPost("Login")] public async Task<ApiResponse> Login([FromBody] Login model) { var user = await _userService.GetUserByName(model.UserName); if (user != null && await _userService.CheckUserPassword(user, model.Password)) { var userResponse = await _tokenService.GenerateToken(user); return new ApiResponse(message: "Login Successfully.", result: userResponse, statusCode: 200); } return new ApiResponse(message: "Invalid Credential.", result: null, statusCode: 401); } In this example, we're using AutoWrapper.Core's ApiResponse class to encapsulate our responses. For a successful login attempt (status code 200), we return a positive message along with the user response. In case of invalid credentials (status code 401), an appropriate error message is provided. ApiResponse Class Now, let's take a closer look at the ApiResponse class from AutoWrapper.Core: namespace AutoWrapper.Wrappers; public class ApiResponse { public string Version { get; set; } [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] public int StatusCode { get; set; } public string Message { get; set; } [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] public bool? IsError { get; set; } public object ResponseException { get; set; } public object Result { get; set; } [JsonConstructor] public ApiResponse(string message, object result = null, int statusCode = 200, string apiVersion = "1.0.0.0") { StatusCode = statusCode; Message = message; Result = result; Version = apiVersion; } public ApiResponse(object result, int statusCode = 200) { StatusCode = statusCode; Result = result; } public ApiResponse(int statusCode, object apiError) { StatusCode = statusCode; ResponseException = apiError; IsError = true; } public ApiResponse() { } } The ApiResponse class provides flexibility in constructing responses with different components such as the message, result, and status code. It helps maintain a standardized format for all API responses. Create a Custom Wrapper: AutoWrapper allows you to create a custom wrapper by implementing the IApiResponse interface. You can create a class that implements this interface to customize the fixed response. Here's an example: Create a Custom Wrapper: AutoWrapper allows you to create a custom wrapper by implementing the IApiResponse interface. You can create a class that implements this interface to customize the fixed response. Here's an example: using AutoWrapper.Wrappers; public class CustomApiResponse<T> : ApiResponse<T> { public string CustomProperty { get; set; } public CustomApiResponse(T result, string customProperty) : base(result) { CustomProperty = customProperty; } } Configure AutoWrapper: In your Startup.cs file, configure AutoWrapper to use your custom wrapper. You can do this in the ConfigureServices method: services.AddAutoWrapper(config => { config.UseCustomSchema<CustomApiResponse<object>>(); }); Replace CustomApiResponse<object> with the custom wrapper class you created. Use Custom Wrapper in Controller Actions: Now, you can use your custom wrapper in your controller actions. For example: [ApiController] [Route("api/[controller]")] public class MyController : ControllerBase { [HttpGet] public IActionResult Get() { // Your logic here var data = new { Message = "Hello, World!" }; // Use the custom wrapper var response = new CustomApiResponse<object>(data, "CustomProperty"); return Ok(response); } } Customize the CustomApiResponse according to your needs, and use it in your controller actions. This way, you can integrate AutoWrapper with other packages and customize the fixed response format in your .NET application.   In conclusion, by incorporating AutoWrapper.Core into your .NET Core applications, you can simplify the handling of API responses, making your code more readable, maintainable, and user-friendly. Consider adopting this approach to enhance the overall developer experience and ensure consistency in your API communication.