How do you create a proxy using svcutil?

  1. Open visual studio developer command prompt.
  2. Start your service and make sure it is up and running.
  3. Copy the URL of service .
  4. In visual studio command prompt type ” svcutil [URL] /out:filename.cs /config:filename.config
This will generate two files in the local as mentioned above in the command prompt.

What is the difference between Compile time Exception and Runtime Exception?

Compile time is where your compiler transforms your source code to a machine understandable language.
During the compile time, it processes through various stages:
Creation of Symbol table, Syntax analysis, Semantic analysis, Code optimization, Code Generation & Error Handling.
Runtime is during the execution process(Eg: Page request is made. or looping through a variable instances, etc). Runtime errors are handles after the successful compilation.

Best C# Practices to follow

  1. Always name things well.
  2. Make sure there is only one class per file.
  3. Always try to use properties instead of public variables.
  4. Write methods to make only one thing.
  5. Use public modifier only when necessary.
  6. Try to keep everything simple.
  7. Always be consistent.
  8. Use curly braces for if statement.
  9. Concatenate strings using “$”.
  10. Avoid global variables.(Make use of app.config file to declare global variables if needed).

What is a “Table”, “Record”, “Field” ?

A table is a collection of records of specific type.
Ex:Employee Table, Salary Table.

A record is a collection of values/specific entity.
Ex:Employee, Salary.

A field is an area within a record for a specific piece of data.
Ex:Employee Name, Employee Id.

What is a foreign key?

When a ‘one’ table’s primary key field is added to a related “many” table in order to create a common field which relates the two tables , it is called foreign key in the “many”  table.

How to reset column identity in SQL server?

Sometimes we delete rows from a table and the identity will not start as expected from one, it would assign a random value. In order to reset the value we have to use the following command.

DBCC CHECKIDENT ('[TableName]', RESEED, 0);
GO

What is Lazy Loading?

Lazy loading loads data into cache only when necessary. Write through adds data or updates data in the cache whenever data is written to the database.Lazy loading allows for stale data ,but wont fail with empty nodes and may populate the cache with superfluous data, a problem referred to as “cache churn” .

Adding a time to live (TTL) value to each write allows us to enjoy the advantages of each strategy and avoid cluttering up the cache with superfluous data. Unrelated to these issues is consistent hashing, which is technique used to partition data keys between nodes in cluster.