Monday, November 29, 2021

Implement CQRS with MediatR in ASP.NET Core Web API

What is CQRS?

English Answer

CQRS (Command Query Responsibility Segregation) is a design pattern that separates write operations (Commands) from read operations (Queries). Commands modify data, while Queries only retrieve data.

বাংলা উত্তর

CQRS (Command Query Responsibility Segregation) হলো একটি Design Pattern যেখানে Write Operation (Command) এবং Read Operation (Query) আলাদা করা হয়। Command Data পরিবর্তন করে এবং Query শুধুমাত্র Data পড়ে।

What is the main goal of CQRS?

English Answer

The main goal of CQRS is to separate read and write responsibilities to improve scalability, maintainability, and performance.

বাংলা উত্তর

CQRS-এর প্রধান উদ্দেশ্য হলো Read ও Write Responsibility আলাদা করে Application-কে আরও Maintainable, Scalable এবং Performant করা।

English

Clean Architecture separates the application into Presentation, Application, Domain, and Infrastructure layers. Domain contains business entities and rules. Application contains CQRS commands, queries, handlers, DTOs, and use cases. Infrastructure handles EF Core, repositories, and external services. Presentation contains APIs and controllers. Dependencies always point inward, making the application maintainable, scalable, and testable.

বাংলা

Clean Architecture-এ Application-কে Presentation, Application, Domain এবং Infrastructure Layer-এ ভাগ করা হয়। Domain Layer-এ Business Rules ও Entities থাকে। Application Layer-এ CQRS Commands, Queries, Handlers এবং Business Logic থাকে। Infrastructure Layer Database ও External Services Handle করে। Presentation Layer API ও Controller নিয়ে গঠিত। Dependency সবসময় ভিতরের Layer-এর দিকে যায়, ফলে Application Maintainable, Scalable এবং Testable হয়।

What is MediatR?

English Answer

MediatR is a .NET library that implements the Mediator Pattern. It helps decouple Controllers from Handlers.

বাংলা উত্তর

MediatR হলো একটি .NET Library যা Mediator Pattern Implement করে এবং Controller ও Business Logic-এর মধ্যে Decoupling তৈরি করে। 


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




Project OverView

 21H_LeakTesting   DashPerm  EWI_Assembly APQP Management System DynaShippingPortal KitValidation DAVIE API Guided Picking 21H_LeakTesting W...