Monday, November 26, 2018

error in MVC entity framework

Hi all if you are using code first approach in entity framework and you are facing below error.

the solution are as below :-
update-database.


this is solution .

.........................Thank you .................

Wednesday, November 14, 2018

Difference between WriteLine() and Write() method


The main difference between WriteLine() and Write() is that the Write() method only prints the string provided to it, while the WriteLine() method prints the string and moves to the start of next line as well.
Let's take at a look at the example below to understand the difference between these methods.

Example 1: How to use WriteLine() and Write() method?

When we run the program, the output will be


Thank you

Creating DLL and consuming it using C#


Description
DLL  Stand for  (Dynamic Link Library).
How to create a DLL and consuming it  because most of the reusable components are written in the form of a DLL.


Create DLL.

Step 1
First, create a project of type “Class Library” as shown here.


Then we are implementing a Fullname class library that is responsible for show fullname of user.


Step 3
Build this code and you will see that a DLL file has been created rather than an exe in the root directory of the application (path = C:\Users\Admin\Documents\visual studio 2017\Projects\LibraryForDLL\LibraryForTest\bin\Debug\netstandard1.4\ LibraryForTest.dll).

Consume the DLL
Step 1
 
Now create another console based application(Any project) where we will utilize the class library functionality.In my case i am created new project in same Solution Explorer.

 


Step 2
 
Then you need to add the reference of the Fullname Class Library DLL file reference to access the declared class in the library DLL. (Right-click on the Reference then select Add reference then select the path of the DLL file.)

Step 3
 
When you add the class library reference then you will see in the Solution Explorer that a new LibraryForTest is added as in the following,


Step 4
 
Now add the namespace of the class library file in the console application and create the instance of the class declared in the library as follows,


Step 5
Finally, run the application and you must see the result as shown in the image below.


;;;;;;;;;;;;;;;;;;;;;;;;;Thank you ;;;;;;;;;;;;;;;;;