Can’t find ADO.Net DbContext Code Generator for Entity Framework

I was following this Entity Framework Database First tutorial and couldn’t find the DbContext code generator shown in the video.

Can’t-find-ADO.Net-DbContext-Code-Generator-for-Entity-Framework

Here’s how to install ADO.Net DbContext Code Generator to Visual Studio:

1. Click on the “Online Templates” section.

2. Search for “ADO.Net DbContext Generator”.

Install-ADO.Net-DBContext-Code-Generator

3. Click “Add” and proceed with installation.

 

Embed below is the video tutorial that I'm referring to.

Read More

GetType() vs typeof() in C#

question-type-one-correct-icon‘typeof()’ is actually an operator for ‘GetType()’, so both function are same. Both returns an object ‘Type’ which can be used to find out further information like properties, methods and etc.

  1: Type typeObj = obj.GetType();  // Return the same result like typeof()
  2: Type typeObk = typeof(obj);    // Return the same result like .GetType()
Read More

Difference between ‘string’ and ‘System.String’ in C#

Programming-icon‘string’ is an alias (or shorthand) of System.String. That means, by typing ‘string’ we meant System.String. As pointed out by Jeffrey Richter (in his book CLR via C#, page 119), it’s as if every C# program (in Visual Studio) contained ‘using’ directives like the following:

1 using string = System.String;
2 using char = System.Char;
3 using int = System.Int32;
4 using double = System.Double;
Read More

Why I keep getting the wrong floating point result in C#

Something that took me while to figure out.

1 double result = 1 / 3; //will return 0.
2 double resutt = 1 / 3.0; // will return 0.33333
3

source-cs-iconEver wonder why I'm getting 0 (in Line 1) while i have already assign it to double type? Here’s the explanation: Line 1 return 0 as a result because C# interprets numeric value as integer, and integer division is performed with truncation; hence, 0. Line 2 is interpreted as floating point calculation because of 3.0 (putting a decimal point for the calculation to be done in floating point).

Read More

Some stuff for myself when i feel less motivated in life

These are some of the stuff I should spend time going through when i feel less motivated in life.




If ever, i feel like giving up on entrepreneurship; take a look at this and learn what mistake I made.
http://www.forbes.com/sites/brianclark/2012/06/06/characteristics-entrepreneurs/
Read More