You are on page 1of 10

Practical No: 1

Date: 24/02/2023

Aim: Installation of .NET SDK & Building First Console Application.

Description:

The .NET SDK is a set of libraries and tools that allow developers to create .NET
applications and libraries. It contains the following components that are used to build
and run applications:
● The .NET CLI:
The .NET command-line interface (CLI) is a cross-platform toolchain for
developing, building, running, and publishing .NET applications.
● The .NET runtime and libraries:
The .NET runtime, which is installed on a machine for use by
framework-dependent apps, has an expansive standard set of class libraries,
known as runtime libraries, framework libraries, or the base class library
(BCL).
● The dotnet driver:
The driver is named dotnet and has two responsibilities, either running a
framework-dependent app or executing a command.

.NET Core and .NET 5 and later projects are associated with a software development
kit (SDK). Each project SDK is a set of MSBuild targets and associated tasks that are
responsible for compiling, packing, and publishing code. A project that references a
project SDK is sometimes referred to as an SDK-style project.

.NET CLI commands:


● new
● restore
● build
● publish
● run
● test
● vstest
● pack
● migrate
● clean
● sln
● help
● store
● watch
● Format

Practical No: 2

Date: 21/03/2023

Aim: Building First ASP.NET MVC Application.

Description:

The Model-View-Controller (MVC) is a software design pattern that separates an


application's data, user interface, and control logic into three interconnected
components. The goal of the pattern is to achieve separation of concerns, making it
easier to develop and maintain complex applications.

The three components of the MVC pattern are:


1. Model: The model represents the application's data and business logic. It is
responsible for managing the data, processing it, and providing it to the other
components. The model responds to requests from the controller and updates
its state accordingly.
2. View: The view is responsible for presenting the data to the user in a
user-friendly format. It retrieves data from the model and presents it to the user
in a way that makes sense to them. The view also sends user input back to the
controller for processing.
3. Controller: The controller is responsible for handling user input, updating the
model, and updating the view. It receives input from the user via the view and
updates the model accordingly. It also updates the view to reflect any changes
in the model.

The MVC pattern provides several benefits, including:


1. Separation of concerns: The pattern separates the application's data, user
interface, and control logic into distinct components, making it easier to
develop, test, and maintain.
2. Code reusability: Each component of the pattern can be reused in other
applications, making it easier to develop new applications.
3. Scalability: The pattern can be scaled to handle large applications with complex
data structures.

Overall, the MVC pattern is a popular software design pattern that provides a clear
separation of concerns and promotes code reusability and scalability.
Practical No: 3

Date: 10/04/2023
Aim: Working with Docker hub.

Description:
Give Overview of Docker:
Docker is an open-source platform that allows developers to package and deploy
applications in lightweight, portable containers. These containers provide a consistent
runtime environment, regardless of the underlying infrastructure.

Docker uses containerization technology to create isolated environments for


applications and their dependencies, allowing for easy deployment across different
operating systems and cloud platforms. With Docker, developers can build, test, and
deploy applications quickly and efficiently.

One of the key benefits of Docker is its portability. Containers can be easily moved
between environments, such as development, testing, and production, without
requiring changes to the application code. This makes it easier to maintain consistency
and reduce the risk of configuration issues.

Docker also provides a centralized repository for storing and sharing container
images, called Docker Hub. Developers can use pre-built images from Docker Hub to
quickly spin up new instances of applications or build their own images and share
them with others.

Overall, Docker simplifies the process of deploying and managing applications,


making it a popular choice for modern software development and deployment
workflows.
Practical No: 4

Date: 11/04/2023
Aim: Working with Docker Desktop App.

Description:
Give Overview of Docker Desktop App

Container:
A container packages up code and its dependencies so the application runs quickly
and reliably from one computing environment to another. 
By default, a container is relatively well isolated from other containers and its host
machine. You can control how isolated a container’s network, storage, or other
underlying subsystems are from other containers or from the host machine. 

Image:
An image is a read-only template with instructions for creating a Docker container. 
You might create your own images or you might only use those created by others and
published in a registry. To build your own image, you create a Dockerfile with a
simple syntax for defining the steps needed to create the image and run it. 

Volumes:
Volumes are the preferred mechanism for persisting data generated by and used by
Docker containers. 
Volumes are easier to back up or migrate than bind mounts. 
You can manage volumes using Docker CLI commands or the Docker API. 
Volumes work on both Linux and Windows containers. 
Volumes can be more safely shared among multiple containers. 
Volume drivers let you store volumes on remote hosts or cloud providers, to encrypt
the contents of volumes, or to add other functionality. 
New volumes can have their content pre-populated by a container. 
Volumes on Docker Desktop have much higher performance than bind mounts from
Mac and Windows hosts. 
Practical No: 5

Date: 12/04/2023
Aim: Building ASP.Net core REST API

Description:
ASP.NET Core is a modern, cross-platform framework for building web applications,
including RESTful APIs. REST (Representational State Transfer) is a software
architectural style that defines a set of constraints for creating web services. RESTful
APIs are a popular approach for creating web services that conform to these
constraints, making them simple, scalable, and loosely coupled.

ASP.NET Core REST APIs use HTTP methods (GET, POST, PUT, DELETE) to
perform CRUD (Create, Read, Update, Delete) operations on resources exposed by
the API. The framework provides an easy way to build APIs with features such as
routing, input validation, and serialization of JSON/XML data.

The API can be consumed by clients such as web applications, mobile apps, or other
services. Clients send requests to the API and receive responses in the requested
format. The responses can be in JSON, XML, or other formats. APIs can also provide
authentication and authorization mechanisms to control access to resources.

Overall, ASP.NET Core REST APIs are a powerful and flexible way to build modern
web services that can be consumed by a wide range of clients. With its rich features
and cross-platform support, ASP.NET Core is a popular choice for developing
RESTful APIs in the .NET ecosystem.
Practical No: 6

Date: 13/04/2023
Aim: Working with Members API of TeamService

Description:
The Members API of TeamService is a RESTful API that allows users to perform
CRUD (Create, Read, Update, Delete) operations on the members of a team. The API
appears to be using the HTTP protocol with JSON as the data format.

The API allows users to create new members with an ID, first name, and last name, as
well as retrieve member details by ID or retrieve all members of a specific team. It
also supports updating member details, such as changing their first or last name, and
deleting members from a team.

● Clients can create a new member by sending a POST request to the endpoint
‘/teams/{teamId}/members’ with a JSON payload containing the member's details.
● Clients can retrieve all members of a team by sending a GET request to the
endpoint ‘/teams/{teamId}/members’, or
Retrieve the details of a specific member by sending a GET request to the endpoint
‘/teams/{teamId}/members/{memberId}’.
● Clients can update the details of a member by sending a PUT request to the
endpoint ‘/teams/{teamId}/members/{memberId}’ with a JSON payload
containing the updated details.
● Clients can delete a member by sending a DELETE request to the endpoint
‘/teams/{teamId}/members/{memberId}’.

Overall, the Members API of TeamService provides a simple and straight-forward


way for users to manage the members of a team.
Practical No: 7

Date: 17/04/2023
Aim: Running Location Service

Description:
Building the services:
• We also want to maintain and query the locations of all of our team members.
• Upgrade the team service to contain locations.
• It makes more sense to put the responsibility of location management into its
own service.
• This service will manage the location history of individuals (without regard for
their team membership).
• We can add location events to a person, query location history, and as a
convenience we can also query for the current location of any individual for
whom we have location data.
• Eg: the public API for the location service

REST API for location service

Resource Method Description


[locations/{nemberID)/latest GET Retrieves the most current location of a
member.
[locations/{nemberID) POST Adds a location record to a member.
[locations/{nemberID) GET Retrieves the location history of a
member.
Practical No: 8  
 
Date: 18/04/2023 
Aim: Create a backing Service using ASP .NET  

Description:  

Give Overview of Event Sourcing  


 Event Sourcing Defined:
Number of requirements for an event-sourced system.
1. Ordered:
Event streams are ordered. Performing calculations against the same set of
events but in a different sequence will produce different output.
2. Idempotent:
Any function that operates on an event stream must always return the exact
same result for identical ordered event streams.
3. Isolated:
Any function that produces a result based on an event stream cannot make use
of external information.
All data required for calculations must be present in the events.
4. Past tense:
Events take place in the past.
This should be reflected in your variable names, structure names, and
architecture.
Event processors run calculations against a chronologically ordered sequence
of events that have already happened.Put mathematically, a function that
operates on a stream of events will always produce the same state and output
set of new events.

Practical No: 9
Date: 19/04/2023
Aim: Building an ASP.NET Core Web Application & Invoking REST APIs
from JavaScript

Description:
Explain Invoking REST APIs from JavaScript
To invoke a REST API from JavaScript, you typically use the built-in fetch() method
or a third-party library like Axios or jQuery.

The basic steps for invoking a REST API from JavaScript are:
1. Determine the endpoint URL of the REST API you want to call.
2. Choose the appropriate HTTP method (GET, POST, PUT, DELETE, etc.) to
use for the request.
3. Add any necessary request headers, such as Authorization or Content-Type.
4. If the API requires it, add a request body with any data that needs to be sent to
the server.
5. Use the fetch() method or a library function to send the HTTP request to the
API endpoint.
6. Handle the response returned from the API, which may include data or an error
message.

When invoking a REST API from JavaScript, it's important to handle errors and
handle the response data appropriately. This may involve parsing the data into a
specific format, such as JSON, or displaying it in the user interface of the application.

Practical No: 10
Date: 20/04/2023
Aim: Working with Docker Volumes and Networks

Description:
Explain the concept of Docker Volumes and Networks

Docker Volumes:
A volume in Docker is a way to persist data outside of a container's file system.
Volumes allow you to share data between containers, and between containers and the
host machine. By using volumes, you can store application data in a separate location
from the container, making it easier to manage and backup. Volumes are created using
the "docker volume" command and can be mounted to a container using the "docker
run" command.

Docker Networks:
A network in Docker is a way to connect containers together and allow them to
communicate with each other. By default, Docker creates a bridge network for each
host, which allows containers to communicate with each other using their IP
addresses. You can also create custom networks using the "docker network" command
and assign containers to those networks using the "docker run" command. By using
custom networks, you can isolate containers from each other, and control the flow of
traffic between them.

You might also like