Dependency Injection – ASP.NET  

Dependency Injection –  ASP.NET  

Introduction:

By taking a closer look on a Dependency Injection (DI) , we can understand it is a software design pattern which allows us to develop a loosely coupled code and it also decreases the code dependency of components of the tightly coupled software. It is also known as Inversion-of-Control, which helps us to do the unit testing more convenient.

Advantages of using Dependency Injection are:

1. Increases code re usability

.2. Reduces class coupling

3. Improves code maintainability

4. Improves application testing

Basic CRUD Operations & Scaffold Templates

  1. File -> New Project-> Visual C# -> ASP.NET      Web Application-> OK
  2. Select MVC,      Change Authentication = No Authentication->OK
  3. Create a two table in the new database in Sql Server as Department and Employee
  4. Right Click on Project ->Add New Item-> Under Visual C#, Data Select ADO.NET Entity Data Model, Name = DeccansoftEntity -> Add
  5.  Select EFDesigner from database -> Next
  6.  New Connection -> Select Server Name = ADMIN-PC\SQLEXPRESS2017, database name = Deccansoft -> OK -> Next -> Select Entity Framework 6.x -> Next
  7. Expand tables and Select all the tables (Department and Employee)which we have created on the step 3 -> Finish
  8. Solution Explorer -> Right click on Controller -> New -> Controller -> MVC 5 Controller with Views using Entity Framework ASP.NET MVC 5.X CRUD Operations
  9. Model Class=Employee, DataContextClass=EFDemoDbEntities,ControllerName=EmployeesController ->Add 10. Build and run the application

Writing Generic Class/Repository

1. To project add the following Generic class in the Repository folder

2. Create a new folder, Name=BO.

3. Under BO folder, add the Employee BO class to the project.

4. Under BO Folder, add the Department BO class to the project.

4.1 Under BO Folder, add Context Helper class to the project

Dependency Injection and Custom Controller Factory

4.2 Add-> Global.asax in below code

4.3 To separate the creation of the dependencies from the main class we use Dependency injection technique, so we typically inject an object which is needed by a class through a constructor.

5.  Edit the code of Employees Controller as below-

5.1 Create Index Action Result in a Controller as below

5.2 Create Index Action Result method view(Index-> Add View-> View name=Index, Template=List, Model class = Employee, Data Context class=DeccansoftEntities -> Add)

5.3 Display Index View in Browser

6. Edit the code of Employees Controller, write a Create Action method as below.

6.1 Create Action Result method View (Create->Add View->View name=Create, Template=Create,Model class=Employee,Data Context= DeccansoftEntities -> Add)

6.2 Create Index Action Result in a Controller as below

6.3 Display Create View in Browser

7. Edit the code of Employees Controller, Write a Edit Action method as below.

7.1 Edit Action Result method View (Edit->Add View->View name=Edit, Template=Create,Model class=Employee,Data Context=DeccansoftEntities->Add)

7.2 Create Edit Action Result method in a Controller as below

7.3 Display Edit View in Browser

8. Edit the code of Employees Controller, write a Details Action method as below.

8.1 Details Action Result method View (Create->Add View->View name=Details, Template=Details,Model class=Employee,Data Context=DeccansoftEntities->Add)

8.3 Display Details View in Browser

9. Edit the code of Employees Controller, Write a Delete Action method as below.

9.1 Delete Action Result method View (Create->Add View->View name=Delete, Template=Delete,Model class=Employee, Data Context=DeccansoftEntities->Add)

9.2 Create Delete Action Result in a Controller as below

9.3 Display Details View in Browser

Please follow and like us:
0

Working With Static In C sharp

Article by Mr Sandeep Soni on ”
Description

Working With Static In C sharp: The static keyword can be applied on data members, constructors, classes, methods, properties, and events. The static modifier makes an item non-instantiable.

 

 

C# program using static class
C# program using static class

 

: https://www.c-sharpcorner.com/article/working-with-static-in-c-sharp/
Please feel free to like and post comments on the article. Also Like the profile of “Sandeep Soni” to get future updates.

You can search the profile –
1. Search
2. under “People” tab
3. Type First Name “Sandeep”, Last Name “Soni”
4. click on the profile – Hit Like.

Introduction

This article is all about static in C#. It explains about,
Static members
Static constructor
Static methods and properties
Static class
Example using all these.
Description

The static keyword can be applied to data members, constructors, classes, methods, properties, and events. The static modifier makes an item non-instantiable.

Static members in C#

When are they loaded and how is the memory allocation,
A class is loaded when either

The static members of the class are accessed for the first time, or
When the first instance of the class is created.
A class once loaded will remain in memory permanently and also are all static members of that class.

For every new instance of a class, all the instance members are allocated memory as one unit, but static field members of a class are allocated memory only once, irrespective of the number of objects created, and they are allocated memory when the class is loaded. These members are also called class members and are accessed outside the class using the class name.

A public static member of a class can be used as a Global member of the application because it can be assessed using a class name from any part of the application.

Static Constructor in C#

It is a constructor with the static keyword.
It is used to initialize static members dynamically and is executed when the class is loaded.
It is invoked by the CLR when the class is loaded by it and hence cannot be overloaded nor can be declared with any accesses specifier like public or private.
Series of events that occur when the first object is created,

The class is loaded.
Static members are loaded and allocated memory.
The static constructor is executed.
An object is created and Instance members are loaded and allocated memory.
Instance constructor is executed.
4 and 5 repeats for a subsequent object.

Please follow and like us:
0

SSIS Introductory Course | SSIS Online Videos.- Best Dot Net Training

SSIS Introductory Course | SSIS Online Videos.
SQL Server Integration service is a platform for data integration and workflow application. It has a fast and flexible data warehousing tool used for data extraction, transformation and loading. (ETL)

Description: SSIS Introductory Course | SSIS Online Videos.

COURSE OVERVIEW

SQL Server Integration Services (SSIS) is a component of Microsoft SQL Server database software which can be used to perform a broad range of data migration, Data integration and Data Consolidation tasks. It features fast and flexible data warehousing tool used for data extraction, transformation and loading (ETL). The tool may also be used to automate maintenance of SQL Server databases and updates multidimensional cube data. SSIS is the new data transformation standard for SQL Server 2005 onwards and has replaced the old SQL Server Data Transformation Services.

This extensive SSIS Introductory Course is provided for the participant to have in-depth knowledge of Developing packages using different tasks and providing ETL solutions based on different requirements.

WHY BESTDOTNETTRAINING.COM? OUR USP…
Get an idea of the quality and quantity of the subjects by watching demo videos provided.
For any technical issues/queries relating to the online training videos, we provide technical support by Subject Matter Experts (SMEs)
The course material is simple and organized and can be used for learning and as a reference material.
Includes job interview related training to help participants face an interview confidently.
Microsoft Certification Guidance and any subject related questions will be answered by Mr Sandeep Soni (MCT).
Every course is accompanied by a Real-time project along with a step-by-step guide and complete source code.

SSIS Introductory Course | SSIS Online Videos.

WHAT YOU’LL LEARN / COURSE OBJECTIVE
Understand MSBI application development Life Cycle.
Understand basic Data Warehousing Concepts.
Understand the Concept of OLTP and OLAP.
Use SSDT (SQL Server Data Tools) in detail for development of SSIS packages.
Learn SSIS Architecture, Components of SSIS.
Gain a complete understanding of different control flow tasks, containers and precedence constraints.
Gain a complete understanding of a wide variety of data flow Sources, Transformations and Destinations.
Learn to work with variables, data types, functions, expressions and parameters and providing Dynamism in SSIS.
Develop packages using different tasks and different Transformations based on real-time requirements.
Learn to work with an event handler, Logging, Configuration Files.
Learn Error Handling and Debugging in SSIS.
Learn package deployment and project deployment.
Gain understanding of Security and Package management.

PRE-REQUISITES
Participants need to be familiar with basic RDBMS concepts with skills to write queries. Working experience on any RDBMS would be an added advantage.

INSTRUCTOR
A well-known trainer at Deccansoft for more than 6 years, she is a specialist in SQL Server 2008 and has taught well over many students. Her uniqueness lies in conducting her classes with ease and clarity, making her students understand even the most complex queries with no difficulty at all. Her class sessions are also now available as videos, targeting students who want to learn the course at their own pace and convenience. An avid learner, she has now trained herself in Microsoft Business Intelligence suite of products (SSIS, SSAS and SSRS), a must for everyone specializing in Business Intelligence and will soon be launching the classes which will definitely enhance one’s knowledge in SQL Server.

SSIS Introductory Course | SSIS Online Videos.
SSIS Introductory Course | SSIS Online Videos.
Please follow and like us:
0

Microsoft Azure Online Course.Best Dot Net Training

70-533: Implementing Microsoft Azure Online Course.Best Dot Net Training. Infrastructure Solutions Introductory Course

                                    Description:  Microsoft Azure Online Course.

Tired of doing the same routine and mundane job…on Microsoft Azure Online Course.

Break the barrier open yourself to a world of completely new opportunities. Expand your Horizon and Vision about Cloud Computing. Be an actor and not a spectator in how cloud computing is encompassing the IT industry. Microsoft Azure Online Course.

Whether it is a Startup, Midscale or Large Organization, all are now moving away from On-Premise infrastructure to Cloud Infrastructure. Virtual Network and Virtual Machines are taking over providing the advantage of Pay-As-Go model and ability to scale infrastructure if need be. Whether it is a Simple Website or E-commerce Portal or CRM or Office Automation tools or DevOps tools or anything which needs Server Infrastructure – all are now finding their space in Cloud.
Today knowledge of cloud computing is as essential as knowledge of OS for effectively using the system.
In Microsoft Build conference, Microsoft shared with the world how large its cloud platform is and who is using these services. They boasted that they have more data centres than Amazon Web Services (AWS) and Google’s Cloud Service combined and that 85% of Fortune 500 companies are currently using Azure in some or the other capacity. Microsoft Azure Online Course.

TIME TO NOW LEAVE YOUR COMFORT ZONE AND GROW IN YOUR CAREER – ACCEPT CLOUD IS THE FUTURE.

COURSE OVERVIEW

This, Microsoft Azure training is targeted for ANYONE who wants to move their current skillset to Microsoft Azure cloud taking the benefit of unlimited computing, storing and networking power.

The Microsoft Azure course will enable you to design, build, maintain and monitor robust and scalable cloud solutions and most important you will start thinking BIG. This course also focuses on the architectural considerations and decisions necessary when building a highly available solution in the cloud.

Teaching methodology of Mr Sandeep Soni is pretty simple, for every topic it all begins with an in-depth understanding of concepts followed by practical demos of how the feature can be incorporated in real-time situations. You can experience this by looking at some of his demo videos of Microsoft Azure as listed below.

visit: https://www.bestdotnettraining.com/FreeDotNetVideos/AZURE-70-533

For Paid Azure Prerecorded Videos Visit
https://www.bestdotnettraining.com/azure-70-533-online-training

For Any Online Courses With Best Offers Kindly Visit

Microsoft Azure Online Course.Best Dot Net Training
Microsoft Azure Online Course.Best Dot Net Training

https://www.bestdotnettraining.com/

Please follow and like us:
0