NO
|
ITEM
|
DESCRIPTION / REMARKS / E.G
|
1
|
Class Names
|
Use PascalCasing for declaring Class Names
E.g.
public
class Apple
{
Coding………..
}
|
2
|
Method Names
|
Use PascalCasing for declaring Class Names
E.g.
public
class Apple
{
public void Create()
{
Coding………..
}
}
|
3
|
Variable Names
|
Use camelCasing for local variables and method
arguments
E.g.
int counter;
string name;
int itemCount;
|
4
|
Try
Catch
|
Use Try catch block in all methods
E.g.
Try{
Coding…….
}
Catch(exception e)
{
Handle
Exception
}
|
5
|
#region
#endregion
|
Use separate region and declare all member variables at the top of a
class within the region.
Use separate region for properties member.
Use separate region for properties member.
Use separate region for Views.
Use separate region for common methods.
|
6
|
Variable Naming
|
Meaningful names to the context for class / methods
/ variables.
E.g.
UserGroup userGroup.
Assignment employeeAssignment.
|
7
|
Comments
|
Always give comments for
every method and every five lines of code.
|
8
|
If / Else
|
Use Else always with the IF/ Else statement
|
Monday, 18 January 2016
Naming Conventions Standards to be followed while coding
Wednesday, 13 January 2016
Lambda Expression - Part 2
In this post we will see some more Lambda Expression Queries:
6. Order By Descending
var result = dbcontext.table_name.OrderByDescending(x => x.columnName).Take(1);
7. Order By Multiple Columns
var result = dbcontext.table_name.OrderBy(X => X.columnName).OrderBy(X => X.ColumnName);
8. Lesser than and equal to query
var result =dbcontext.table_namet.Where(x => x.columnname <= 4);
9. Joins
var result = bcontext.table_name.Join(dbcontext.table_name1,x=>x.column(table_name),y=>y.column(table_name1),(x,y)=> new{y.columnName,y.columnName,x.columnName}).ToList();
9. Joins
var result = bcontext.table_name.Join(dbcontext.table_name1,x=>x.column(table_name),y=>y.column(table_name1),(x,y)=> new{y.columnName,y.columnName,x.columnName}).ToList();
Tuesday, 12 January 2016
Lambda Expression
In this post we will see Lambda Expression Queries
1. Normal Select Query
var result = dbcontext.table_name.ToList();
2. Select particular columns
var result = dbcontext.table_name.select(x => new { AsColumnName = x.ColumnName, AsColumnName = x.ColumnName });
3. Select Top 10 Records from the table
var result = dbcontext.table_name.Take(10).ToList();
4. Order By Query using Lambda Expression
var result = dbcontext.table_name.OrderBy(x => x.columnName).ToList();
5. Order By Descending
var result = dbcontext.table_name.OrderByDescending(x => x.columnName).ToList();
1. Normal Select Query
var result = dbcontext.table_name.ToList();
2. Select particular columns
var result = dbcontext.table_name.select(x => new { AsColumnName = x.ColumnName, AsColumnName = x.ColumnName });
3. Select Top 10 Records from the table
var result = dbcontext.table_name.Take(10).ToList();
4. Order By Query using Lambda Expression
var result = dbcontext.table_name.OrderBy(x => x.columnName).ToList();
5. Order By Descending
var result = dbcontext.table_name.OrderByDescending(x => x.columnName).ToList();
Subscribe to:
Posts (Atom)