The “ var ” is a keyword that implicitly types a variable and it is strongly typed also. The “ var ” keyword derives type from the right hand side and its scope is in the method. The “ var ” is an implicitly typed local variable. We just let the compiler determine the type i.e. var x = 1; //Implicitly typed. int y = 1; //Explicitly typed. For example, var customer = ent.Customers.Where(x => x.CustId>0).ToList(); IEnumerable < Customers > customer = ent.Customers..Where(x => x.CustId>0).ToList(); In the above example, the “ var ” keyword is only syntax for a programmer. It doesn't change the semantics at all. If we declared as “ var ” the type of customer is still IEnumerable< Customers > and both the above query will generate the same output. Actually, ...
Angular, React, JavaScript, Java, PHP, SQL, C#, Vue, NodeJs, TypeScript and Interview Questions Answers