Friday, December 31, 2021

Blocks

Submisssion Summary && Submission Editor  :  Submission Combo Block

Role Editor : Role Editor Block



Monday, November 29, 2021

Implement CQRS with MediatR in ASP.NET Core Web API

 


https://www.youtube.com/watch?v=bgoGtkmUAQg
https://www.youtube.com/watch?v=T1qyGmdgSQE
The Command and Query Responsibility Segregation(CQRS) is an architectural pattern that separates the read and writes operations of a data source
Mediator is used to reduce communication complexity between multiple objects or classes. This pattern provides a mediator class which normally handles all the communications between different classes and supports easy maintenance of the code by loose coupling. Mediator pattern falls under behavioural pattern category.
 
Basically, a Mediator perform 2 operations.
  • · Accept the incoming request
  • · Handles the incoming request and provide the response.
CQRS Mediator Patterns are prefered over large projects.

Advantages of CQRS

  1. Independent scaling
  2. Optimized data transfer objects
  3. Provides separation of concern
  4. High scalability

 





Sunday, November 14, 2021

Angular Help

https://nodejs.org/en/download/



Publish : ng build is the command you use when you're ready to build your application and deploy it.
  1. Run the command npm install in the terminal. This command will read the package.json file and install all the required dependencies into a node_modules folder in your project.











 C:\>node -v

c:\users\ng --version

c:\users>npm install @angular/cli

npm install -g @angular/cli@1.0.0  //npm install @angular/cli@latest   //npm install -g @angular/cli@latest

ng serve -- open

npm start

open vs project in VS code: code .

npm install -g @angular/cli@9.1.11

npm uninstall -g @angular/cli                                            

 Angular CLI Commands   : https://www.c-sharpcorner.com/article/quick-preview-angular-cli-commands/

ng generate module/component/service/class name

ng generate component login //ng generate component register

ng g c login

ng generate module user-auth //1 file

ng g c user-auth/sign-in // component under module

ng g class Dummy

ng g service  api-service

ng g service user-auth/test-service //service under module

ng build --prod   //ng build --dev


ngOnInit :

Executes after the constructor and after ngOnChange hook for the first time. It is most commonly used for component initialisation and retrieving data from a database


<form (submit)="onSubmit()"> <input [(ngModel)]="playerName"> </form> let playerName: string; onSubmit() { return this.playerName; }

Interview: https://www.youtube.com/watch?v=-jeoyDJDsSM














develop & debug applications using latest features of Angular. Candidate should have knowledge of below:
Angular 18/19
New features of Angular 18/19
Services in Angular
Components, Modules, Routing, forms, reactive programming.
Components & their life cycle
Templates & data binding, directives
Change Detection Mechanism
Zone less strategy
Pipes and different types of pipes
Signals in Angular
Passing data from One component to another
Observables
Auth guards
Flex box in CSS
Prototypes, callbacks
JavaScript, TypeScript




Sunday, August 22, 2021

Strategy_Pattern

 namespace WindowsFormsApp

{

    public interface IEmployeeSal

    {

         float GetSalary(int basic,float dividend,float commission);

    }

}

namespace WindowsFormsApp

{

    public class HRDeptSalary : IEmployeeSal

    {

       // @Override 

        public float GetSalary(int basic, float dividend, float commission)

        {

            return basic + dividend+commission;

        }

    }

    public class SalesDept : IEmployeeSal

    {

        // @Override 

        public float GetSalary(int basic, float dividend, float commission)

        {

            return basic + dividend+commission;

        }

    }

    public class PurchaseDept : IEmployeeSal

    {

        // @Override 

        public float GetSalary(int basic, float dividend, float commission)

        {

            return basic + dividend;

        }

    }

}

namespace WindowsFormsApp

{

    public class EmployeeSalary

    {

        public string EmployeeName { get; set; }

        public int Basic { get; set; }


        private IEmployeeSal _iEmployeeSal;


        public EmployeeSalary(IEmployeeSal iEmployeeSal)

        {

            this._iEmployeeSal = iEmployeeSal;

        }


        public float CalculateSalry(int basic, float dividend, float commission)

        {

            return _iEmployeeSal.GetSalary( basic,  dividend,  commission);

        }

    }

}

private void button1_Click(object sender, EventArgs e)

        {

            //Use the EmployeeSalary to see change in behaviour when it changes its Strategy.

            EmployeeSalary objEmpSal = null;

            objEmpSal = new EmployeeSalary(new HRDeptSalary());


           textBox1.Text = objEmpSal.CalculateSalry(9000,500,50).ToString();

            objEmpSal = new EmployeeSalary(new PurchaseDept());


            textBox2.Text = objEmpSal.CalculateSalry(5000, 200, 20).ToString();


        }

Saturday, January 30, 2021

microservices

 

What are microservices?

Microservices - also known as the microservice architecture - is an architectural style that structures an application as a collection of services that are

  • Highly maintainable and testable
  • Loosely coupled
  • Independently deployable
  • Organized around business capabilities
  • Owned by a small team
The microservice architecture enables the rapid, frequent and reliable delivery of large, complex applications. It also enables an organization to evolve its technology stack.

Microservices break down the application into smaller, independent services. Each service (e.g., Catalog API, Basket API) is dedicated to a specific function and can be scaled or updated independently. It connects with databases like MongoDB, Redis, and MySQL, and uses messaging tools like RabbitMQ to stay efficient.












Installing on Windowshttps://www.rabbitmq.com/install-windows.html 




Stop then start
C:\Program Files\RabbitMQ Server\rabbitmq_server-3.12.11\sbin>
rabbitmq-plugins.bat list
C:\Program Files\RabbitMQ Server\rabbitmq_server-3.12.11\sbin>rabbitmq-plugins.bat enable rabbitmq_management


















MSMQ:
If you want to check the message queue paths directly from Windows without using code, you can also: 1. Open **Computer Management** (right-click on "This PC" or "My Computer" and select "Manage"). 2. Navigate to **Services and Applications** > **Message Queuing** to see the list of available queues.







Driving

 https://youtube.com/shorts/5Ac2qZHrApU?si=_X-G7pJFHiZoD-s7 https://www.youtube.com/watch?v=f6pSsex87oU