Stored procedure,Dbcontext and Dbset in Entity framework

Stored procedure use in EF Stored procedures and user-defined functions (UDFs) in the database are represented as functions in entity framework. So EDM won’t have any entity or other stuff for stored procedures in the EDM designer. USE [MyDB] GO /****** Object:  StoredProcedure [dbo].[InsertRole]    Script Date: 08/27/2014 11:10:29 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE PROCEDURE [dbo].[InsertRole]… Read more →

Json and Xml

Java Script Object Notation is a text based format for exchanging data. JSON is human readable format. JSON is language independent. It is light weight component. It doesn’t need any compilation process to execute it. It supports many languages. Ex: JAVA, C, C#, .net….. It has a standard database structure. It supports two type of structure in database. 1. Store… Read more →

Partial class,partial method and Anonymous Type

Partial class– It is possible to split the definition of a class or a struct, an interface or a method over two or more source files. Each source file contains a section of the type or method definition, and all parts are combined when the application is compiled. There are several situations when splitting a class definition is desirable: When… Read more →

Pattern using in MVC

–Repository Pattern The repository and unit of work patterns are intended to create an abstraction layer between the data access layer and the business logic layer of an application. It is a data access pattern that prompts a more loosely coupled approach to data access. We create the data access logic in a separate class, or set of classes, called… Read more →

updated topic discussion in Mvc

—Route table,Action filter ,validation  and Budling(how to use or call) protected void Application_Start() { AreaRegistration.RegisterAllAreas();//Registers all the areas in ASP.NET MVC. //GlobalFilters.Filters.Add(new HandleErrorAttribute()); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters) ; RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); //RegisterGlobalFilters(GlobalFilters.Filters); } ///Route class defined in app_start folder .it is config file. public class RouteConfig { public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute(“{resource}.axd/{*pathInfo}”);   // routes.MapRoute( //   name: “Default”, //   url: “{controller}/{action}/{id}”, //                   … Read more →

Web portal,web site,web application (project) difference

A web portal is most often one specially-designed Web page which brings information together from diverse sources in a uniform way. Usually, each information source gets its dedicated area on the page for displaying information (a portlet); Portals are becoming a very prevalent and efficient method of communicating information to individuals. There are primarily two types of portals: public and… Read more →

Array and Arraylist

–Array The Array class is not part of the System.Collections namespaces. However, it is still a collection because it is based on the IList interface. The rank of an Array object is the number of dimensions in the Array. An Array can have one or more ranks. The lower bound of an Array is the index of its first element.… Read more →

Pivot table and Find DateDifference in fomat of Number of year,Month and Days in sql server

—-Use of datedifference Declare @PreviousDate datetime=‘2001-11-08’; Declare @CurrentDate date=CONVERT(date,GETDATE(),110); Declare @CurrentDate1 date=CONVERT(varchar(10),GETDATE(),110); declare @datediff int=DATEDIFF(DAY,@PreviousDate,@CurrentDate); Declare @NumLeapYear INT=DATEDIFF(YEAR,@PreviousDate,@CurrentDate)/4 –for Count of Leap Year but may be some extend to be need.; with FindDate as(Select @datediff as TotalDays, (   @datediff % 365)as NumMonth,–for calculate of MonthCount @CurrentDate as TodayDate,@CurrentDate1 as TodayDate1 ) Select   TotalDays/365 asYear, NumMonth /31 asMonth, (((NumMonth/31)%31)+@NumLeapYear)asdays,TotalDays… Read more →

Dictionary ,Hashtable and HashSet

HashTable Represents a collection of key/value pairs that are organized based on the hash code of the key. Hashtable optimizes lookups. It computes an adding hash of each key. It then uses this hash code to look up the element very quickly. It is an older .NET Framework type. It is slower than the generic Dictionary type. Dictionary A dictionary… Read more →

Typeof operator,GetType method,as operator & Is operator

—Typeof operator and GetType Method Used to obtain the System.Type object for a type. A typeof expression takes the following form: System.Type type = typeof(int); To obtain the run-time type of an expression, we can use the .NET Framework method GetType, as in the following example: int i = 0; System.Type type = i.GetType(); The typeof operator cannot be overloaded.… Read more →