C# and Angular.

DLithe_BC_NFS_T_Task30_C#

21-Feb-2022

1. Collections
2. Pass by value, reference, out
3.Constructors and Destructors
4. Abstract Classes
5. Interfaces

C# collection types are designed to store, manage and manipulate similar data more efficiently. Data manipulation includes adding, removing, finding, and inserting data in the collection. Collection types implement the following common functionality:

The System.Collections.Generic namespace has following classes:

  • List
  • Stack
  • Queue
  • LinkedList
  • HashSet
  • SortedSet
  • Dictionary
  • SortedDictionary
  • SortedList

Pass by Value

In C#, Pass a copy of the original value to the function rather than reference. It does not modify the original value. The changes made to the parameter inside of the called method will not have an effect on the original value. The Variable value is directly stored in the memory.

Pass by Reference

In C#, it passes a reference of arguments to the function. The changes in passed values are permanent and modify the original variable values. The Reference types won’t store variable values directly in the memory. Rather, it will store the memory address of the variable value to indicate where the value is being stored.

Constructor

Constructors are special methods called when a class is instantiated.

  • Constructor will not return anything.
  • Constructor name is same as class name.
  • By default C# will create default constructor internally.
  • Constructor with no arguments and no body is called default constructor.
  • Constructor with arguments is called parameterized constructor.
  • Constructor by default public.
  • We can create private constructors.
  • A method with same name as class name is called constructor there is no separate keyword.

Destructors

.Net will clean up the un-used objects by using garbage collection process. It internally uses the destruction method to clean up the un-used objects. Some times the programmer needs to do manual cleanup.

Abstract Classes

Data abstraction is the process of hiding certain details and showing only essential information to the user.
Abstraction can be achieved with either abstract classes or interfaces (which you will learn more about in the next chapter).

C# Interface

Interface in C# is a blueprint of a class. It is like abstract class because all the methods which are declared inside the interface are abstract methods. It cannot have method body and cannot be instantiated.

array list
Dictionary
Pass by ref
pass by value
Constructor
Destructor
Interference

DLithe_BC_NFS_T_Task31_C#Debugging

Program debugged

DLithe_BC_NFS_T_Task32_C#

23-Feb-2022

1.Virtual Functions
2. Generics
3. Files

1.Virtual Functions

What are virtual functions in C#?

The virtual keyword is useful in modifying a method, property, indexer, or event. When you have a function defined in a class that you want to be implemented in an inherited class(es), you use virtual functions. The virtual functions could be implemented differently in different inherited class and the call to these functions will be decided at runtime.

2. Generics

Generic means the general form, not specific. In C#, generic means not specific to a particular data type.

C# allows you to define generic classes, interfaces, abstract classes, fields, methods, static methods, properties, events, delegates, and operators using the type parameter and without the specific data type. A type parameter is a placeholder for a particular type specified when creating an instance of the generic type.

3. Files

A file is a collection of data stored in a disk with a specific name and a directory path. When a file is opened for reading or writing, it becomes a stream.

The stream is basically the sequence of bytes passing through the communication path. There are two main streams: the input stream and the output stream. The input stream is used for reading data from file (read operation) and the output stream is used for writing into the file (write operation).

C# I/O Classes

The System.IO namespace has various classes that are used for performing numerous operations with files, such as creating and deleting files, reading from or writing to a file, closing a file etc.

The following table shows some commonly used non-abstract classes in the System.IO namespace.

The FileStream Class

The FileStream class in the System.IO namespace helps in reading from, writing to and closing files. This class derives from the abstract class Stream.

1.Vertual function
2.Generics
3.Write file
4.File

— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —

Date: 25–02–2022

SQL Commands

  • SQL commands are instructions. It is used to communicate with the database. It is also used to perform specific tasks, functions, and queries of data.
  • SQL can perform various tasks like create a table, add data to tables, drop the table, modify the table, set permission for users.

DLithe_BC_NFS_T_Task33_SQLSERVER

The given task is to implement SQL Queries as per the requirement

  1. .DDL
  2. DML
  3. CONSTRAINTS
  4. HOW TO GIVE USER-DEFINED CONSTRAINT NAMES
  5. MULTIPLE ROWS IN ONE INSERT QUERY

1. Data Definition Language (DDL)

  • DDL changes the structure of the table like creating a table, deleting a table, altering a table, etc.
  • All the command of DDL are auto-committed that means it permanently save all the changes in the database.

Here are some commands that come under DDL:

  • CREATE
  • ALTER
  • DROP
  • TRUNCATE

a. CREATE It is used to create a new table in the database

2. Data Manipulation Language

  • DML commands are used to modify the database. It is responsible for all form of changes in the database.
  • The command of DML is not auto-committed that means it can’t permanently save all the changes in the database. They can be rollback.

Here are some commands that come under DML:

  • INSERT
  • UPDATE
  • DELETE
DDL
DML
Constraints
Multiple

--

--