.NET Framework 4.5.2 released

Posted on Updated on

The  Microsoft .NET Framework 4.5.2 is a highly compatible, in-place update to the Microsoft .NET Framework 4, Microsoft .NET Framework 4.5 and Microsoft .NET Framework 4.5.1. The offline package can be used in situations where the web installer cannot be used due to lack of internet connectivity

You can download the web installer from here instead of this package if you intend to redistribute .NET Framework 4.5.2.

This package installs the following components:

.NET Framework 4.5.2
.NET Framework 4.5.2 Multi-Targeting Pack:Contains the reference assemblies needed to build apps that target the .NET Framework 4.5.2
.NET Framework 4.5.2 Language Packs
.NET Framework 4.5.2 Multi-Targeting Pack Language Packs: Contains the IntelliSense files to display help while building apps that target the .NET Framework 4.5.2 through Visual Studio and third party IDEs.
. In this release few windows controls has been updated.
ComboBox
ToolStripComboBox
ToolStripMenuItem
Cursor
DataGridView
DataGridViewComboBoxColumn

References:-
http://blogs.msdn.com/b/dotnet/archive/2014/05/05/announcing-the-net-framework-4-5-2-release.aspx

Advertisements

How to configure PageListGrid in MVC

Posted on

This article explains how to implement paging and sorting in MVC using PagedList with Ajax:

PagedList is a library that enables you to easily take an IEnumerable/IQueryable, chop it up into “pages”, and grab a specific “page” by an index. PagedList.Mvc allows you to take that “page” and display a pager control that has links like “Previous”, “Next”, etc.

PagedList grid

Configuration for loading Grid with Ajax :-

Install “PagedList.Mvc” via NuGet – that will automatically install “PagedList” as well.

  • Make sure you are adding the unobtrusive in the scripts section of the view as below code.
    View
  • Create a partial view for Grid which is (UnobtrusiveAjax_Partial) in the below example
    Partial View
  • Call PagedListPager method in the view by passing the list of parameters below:-
    data(“Names”),

    Action Name(“Index”),

    PageNumber ,

    PagedListRenderOptions – EnableUnobtrusiveAjaxReplacing is the option type in ajax based call.

    UpdateTargetId (“unobtrusive”)- the ID of the which need to be updated on paging.

    OnComplete (“PagedOnComplete”) – The javascript function PagedOnComplete() will be triggered OnComplete of Grid loading.

  • In Controller the action method must have ‘page’ as the first parameter to identify the page number

  • Return the partial view if it is AjaxRequest from client. So that the partial view will get return and the partial view will be reloaded.

List of ORM’s available for .NET

Posted on Updated on

What is ORM ?

ORM is a tool for storing data from domain objects to relational database like MS SQL Server in an automated way without much programming. O/RM includes three main parts: Domain class objects, Relational database objects and Mapping information on how domain objects maps to relational database objects (tables, views & storedprocedures). ORM helps us to keep our database design separate from our domain class design. This makes application maintainable and extendable. It also automates standard CRUD operation (Create, Read, Update & Delete) so developer doesn’t need to write it manually.

ORM Flow

Open Source:

  1. ADO.NET Entity Framework
  2. Business Logic Toolkit
  3. Castle ActiveRecord
  4. Database Objects
  5. Dapper
  6. My Batis.NET
  7. Linq TO SQL
  8. NHibernate
  9. nHydrate
  10. Subsonic

Commercial:

  1. The Base One Foundation Component Library (BFC)
  2. DataObjects.NET
  3. ECO (Domain Driven Design)
  4. Light Speed

Information of the list:

  1. ADO.NET Entity Framework enables developers to work with relational data as domain-specific objects, eliminating the need for most of the data access plumbing code that developers usually need to write. Using the Entity Framework, developers issue queries using LINQ, then retrieve and manipulate data as strongly typed objects. The Entity Framework’s ORM implementation provides services like change tracking, identity resolution, lazy loading, and query translation so that developers can focus on their application-specific business logic rather than the data access fundamentals.
    It is included in .NET Framework 3.5 SP1 and above…. more
  2. Business Logic Toolkit is a set of components to simplify .NET application development. BLToolkit is provided as source code that you can use “as is” or customize for your applications. It is written in C# and compatible with .NET Frameworks 3.5 and 4.0, Silverlight 4, and Mono . . more
  3. The Castle ActiveRecord project is an implementation of the ActiveRecord pattern for .NET. The ActiveRecord pattern consists on instance properties representing a record in the database, instance methods acting on that specific record and static methods acting on all records.Castle ActiveRecord is built on top of NHibernate, but its attribute-based mapping frees the developer of writing XML for database-to-object mapping, which is needed when using NHibernate directly.
  4. The Data Objects library is simple, powerful and easy to learn. There are no external files to setup – everything is setup using standard object-oriented techniques. It is light-weight, flexible and provides facilities for ensuring maximum performance. It is also under active development and requests for changes are always welcome. The source code is hosted on GitHub
  5. . Dapper is free as open source software that is distributed under dual license, either the Apache License 2.0 or the MIT License
    Dapper’s primary feature is mapping from .NET classes to database tables (and from CLR data types to SQL data types). Dapper also provides data query and retrieval facilities.
    Dapper is a micro-ORM: it does not offer the full range of features of a full ORM such as nHibernate or Entity Framework. This is by design. It focuses on simplicity and performance rather than full automation. Dapper does not generate the SQL queries, but only maps the result to Plain Old CLR Objects (POCOs). Third party extensions are available for mapping objects to INSERT and UPDATE queries. It is optimized for usage with .NET 4.0 or higher.http://www.tritac.com/bp-24-dapper-net-by-example
    https://code.google.com/p/dapper-dot-net/
  6. The MyBatis.NET data mapper framework makes it easier to use a relational database with object-oriented applications. MyBatis.NET couples objects with stored procedures or SQL statements using a XML descriptor or annotations. Simplicity is the biggest advantage of the MyBatis.NET data mapper over object relational mapping tools.
    To use the MyBatis.NET data mapper, you rely on your own objects, XML, and SQL. There is little to learn that you don’t already know. With the MyBatis.NET data mapper, you have the full power of both SQL and stored procedures at your fingertips.
    The MyBatis.NET project is developed and maintained by a team that includes the maintainers of the “iBATIS.net” data mapper.
  7. Language Integrated Query (LINQ, pronounced “link”) is a Microsoft .NET Framework component that adds native data querying capabilities to .NET languages, although ports exist for Java,[1] PHP, JavaScript and ActionScript.
    LINQ extends the language by the addition of query expressions, which are akin to SQL statements, and can be used to conveniently extract and process data from arrays, enumerable classes, XML documents, relational databases, and third-party data sourcesIt is included in .NET Framework 3.5 and above.
  8. NHibernate’s primary feature is mapping from .NET classes to database tables (and from CLR data types to SQL data types). NHibernate also provides data query and retrieval facilities. NHibernate generates the SQL commands and relieves the developer from manual data set handling and object conversion, keeping the application portable to most SQL databases, with database portability delivered at very little performance overhead
  9. nHydrate allows you to model and generate your application framework without having to worry about database updates. This is a major issue for developers who have production systems. Product managers constantly want to add features and enhance functionality. More often than not, this requires database changes. By modeling your application with nHydrate, you get database migration for free. Each time you generate a model, the database change scripts are automatically created
  10. Signum Framework
    Main Features:
    • Entities-first approach
    • ORM with a full LINQ Provider
    • Unified validation
    • Schema generation (and sync)
    • WPF smart-client interface
    • ASP.Net MVC web interface (working on it…)
    Signum Framework currently works fine with Sql Server 2005/2008 (express editions or greater).
  11. The Subsonic pattern is that each instance you work with is, literally, a row of data in your database. This means that each object type can be thought of as a table in your database.
  12. The Subsonic pattern is that each instance you work with is, literally, a row of data in your database. This means that each object type can be thought of as a table in your database.
  13. Here Irwsoft Data Framework come as help because by designed like Sql Syntax make us to use easier.
    Simplicity. It is less codes
    Many database application projects work with databases using stored procedures and functions.
    Here you can look How Irwsoft Data Framework doing with Stored Procedures.
    All Classes
    With Irwsoft Data, we no longer type a string name to access a data. All tables, functions and procedures are represented as data classes.
    This mean that you no longer type any query string to select table, execute function and procedure.
  14. The Base One Foundation Component Library (BFC) is a comprehensive RAD framework for creating networked database applications with Visual Studio and DBMS software from Microsoft, Oracle, IBM, Sybase, and MySQL. Building on a patented “database-centric” architecture, BFC employs a unique, cross-platform data dictionary to provide enhanced security, optimization, and maintainability, making it easier and quicker to develop robust, scalable applications.. more
  15. Features for DataObjects.NET
    • Visual Studio 2008, Visual Studio 2010, SharpDevelop 3 and others (MSBuild process support is required)
    • ASP.NET
    • WPF (built-in INotifyPropertyChanged, INotifyCollectionChanged, IDataErrorInfo implementation)
    • Open, extendable architecture (built-in IoC container, custom IoC containers support)
    • Built-in logging framework, custom loggers are supported through IoC
    Code-First approach with attribute-based mappings
    • Automatic maintenance of database schema: tables, foreign keys, constraints, indexes, sequences/generators, full-text indexes
    • Wide range of supported primary key types: int, long, string, guid, etc
  16. ECO (Domain Driven Design) is a true model-driven environment model is a central part of an ECO application. The developer alters the model and the changes are applied automatically to the underlying implementation. This allows developers to concentrate on the problem domain model instead of drowning in the implementation specifics. In particular there is no need to take care of database design which makes ECO applications more object-oriented and less database-oriented. Model construction in ECO is done in visual UML editor. The corresponding code is generated on the fly in either C# or Delphi.NET languages.
  17. LightSpeed’s design philosophy is centered on the following guiding principles:
    • Convention over configuration.
    • Support idiomatic .NET domain models: validation, data binding, change notification etc.
    • Highly usable API and low barrier to entry.
    • Encapsulate and encourage best practice patterns: session per request, Unit of Work etc.
    • Small, lightweight and fast.
    key features are:
    • Domain modelling. LightSpeed supports domain-driven design concepts such as entities and value objects, the Unit of Work pattern and aggregates.
    • Visual model design. You can create models in a visual designer, making it easy to see the relationships between entities and reducing the need for hand coding. Models can be created from an existing database or from scratch using a toolbox.

Release Candidates for ASP.NET MVC 5.1

Posted on Updated on

Attribute Routing

The Attribute Routing will now support the constraints, versioning enabled and header based route section. Many aspects of attribute routes are now customizable via the IDirectRouteProvider interface and RouteProviderAttribute class.

There’s a Web API-based sample here:
(https://aspnet.codeplex.com/SourceControl/latest#Samples/WebApi/RoutingConstraintsSample/ReadMe.txt)
the concepts are the same as MVC.

Bootstrap support in HTML Helpers

Now, you can pass HTML attributes in Html.EditorFor as an anonymous object. This means you can pass in Bootstrap styles in HtmlHelpers and style the various input elements such as textboxes, dropdownlist etc. with the correct Bootstrap styles.

Support for Enums

Now in ASP.NET MVC 5.1, the Enum type will be supported in Views. The new HTML Helper Html.EnumDropDownListFor() added will generate a dropdown when binding to Enum types. For this you need to declare an Enum as follows:

When you use the EnumDropDownListFor Helper, it will generate the following view when you are creating an Enum. You can see a full sample at:
https://aspnet.codeplex.com/SourceControl/latest#Samples/MVC/EnumSample/

References:-

http://www.asp.net/visual-studio/overview/2013/aspnet-and-web-tools-20132-preview-for-visual-studio-2013-release-notes
http://blogs.msdn.com/b/webdev/archive/2013/12/09/asp-net-and-web-tools-2013-2-preview-for-visual-studio-2013.aspx

ASP.NET MVC Pipeline Overview

Posted on Updated on

Asp.NET MVC Pipeline

Routing
is the first step in ASP.NET MVC pipeline. typically, it is a pattern matching system that matches the incoming request to the registered URL patterns in the Route Table.
The UrlRoutingModule(System.Web.Routing.UrlRoutingModule) is a class which matches an incoming HTTP request to a registered route pattern in the RouteTable(System.Web.Routing.RouteTable).
When ASP.NET MVC application starts at first time, it registers one or more patterns to the RouteTable to tell the routing system what to do with any requests that match these patterns. An application has only one RouteTable and this is setup in the Application_Start event of Global.asax of the application….. more

References:-
Dot net tricks.

What is Dependency Injection and available Containers(IOC)

Posted on Updated on

What is Dependency Injection (DI) Design Pattern ?
Dependency injection (DI) design pattern is based on separating component behavior from dependency resolution without object intervention.

This pattern is a particular implementation of Inversion of Control, where the consumer object receives his dependencies inside constructor properties or arguments.

DI requires a framework component behind to deal with class constructor.

Dependensy Injection pattern flow diagram

List of Dependency Injection Containers:-

Castle Windsor based on the Castle MicroKernel.

StructureMap is released under the permissive Apache 2 OSS license. You are free to download, modify, or redistribute StructureMap in any way you see fit without restriction.

Written by Jeremy D. Miller

Spring.NET Social supports the following runtime environments:
.NET 2.0
.NET Client Profile 3.5 and 4.0
Silverlight 4.0 and 5.0
Windows Phone 7.0 and 7.1

Written by Mark Pollack

Autofac intends to be IoC with a C# 3.0 flavor, but also supports 2.0.

Licensed under MIT, Written by Nicholas Blumhardt and Rinat Abdullin

The basic pattern for integrating Autofac into your application is:

•Structure your app with inversion of control (IoC) in mind.
•Add Autofac references.
•At application startup…
•Create a ContainerBuilder.
•Register components.
•Build the container and store it for later use.
•During application execution…
•Create a lifetime scope from the container.
•Use the lifetime scope to resolve instances of the components.

The Unity Application Block (Unity) is a lightweight extensible dependency injection container with support for constructor, property, and method call injection.

Unity addresses the issues faced by developers engaged in component-based software engineering. Modern business applications consist of custom business objects and components that perform specific or generic tasks within the application, in addition to components that individually address cross cutting concerns such as logging, authentication, authorization, caching, and exception handling.
Licensed as MS-PL, Written by Chris Tavares.

Puzzle.NFactory

Licensed under the Lesseor GPL , part of the larger Puzzle Framework

Written by Roger Alsing and Mats Helander

Ninject formerly “Titan”

Licensed under Apache 2

Was quiet, but has recently sprung back to life.

Written by Nate Kohari.

S2Container.NET is a lightweight DI container supporting AOP.
It is a port of Java version Seasar2 to .NET framework.

PicoContainer.NET has originally been implemented in Java but is also available for other platforms and
languages. These are detailed in Ports.
Written by Aslak Hellesøy

References:-
Castle Windsor based on the Castle MicroKernel.
StructureMap
Spring.NET
Autofac intends to be IoC with a C# 3.0 flavor
The Unity Pattern

Access modifiers in C#

Posted on Updated on

List of Access Modifiers in C#:

Public: When Members of a class are declared as public, then they can be accessed

1. Within the class in which they are declared.
2. Within the derived classes of that class available within the same assembly.
3. Outside the class within the same assembly.
4. Within the derived classes of that class available outside the assembly.
5. Outside the class outside the assembly.

Internal: When Members of a class are declared as internal, then they can be accessed

1. Within the class in which they are declared.
2. Within the derived classes of that class available within the same assembly.
3. Outside the class within the same assembly.

Protected: When Members of a class are declared as protected, then they can be accessed

1. Within the class in which they are declared.
2. Within the derived classes of that class available within the same assembly.
3. Within the derived classes of that class available outside the assembly.

Protected internal: When Members of a class are declared as protected internal, then they can be accessed

1. Within the class in which they are declared.
2. Within the derived classes of that class available within the same assembly.
3. Outside the class within the same assembly.
4. Within the derived classes of that class available outside the assembly.

Private: Private members of a class are completely restricted and are accessible only within the class in which they are declared.

References:-
http://msdn.microsoft.com/en-us/library/wxh6fsc7.aspx
http://msdn.microsoft.com/en-us/library/ms173121.aspx