PacktLib: .Net Framework 4.5 Expert Programming Cookbook

.NET Framework 4.5 Expert Programming Cookbook


About the Author

About the Reviewers


Core .NET Recipes


Implementing the validation logic using the Repository pattern

Creating a custom validation attribute by extending the validation data annotation

Using XML to generate a localized validation message

Extending the validation attribute for localization

Creating custom attributes

Processing custom attributes via reflection

Using asynchronous file I/O for directory-to-directory copy

Accessing JSON using dynamic programming

Application Events and Windows Forms


Creating an event that can have generic values as payload

Creating a table layout that can dynamicallyadd or remove rows based on the size of the collection

Creating DataGridView dynamically

Creating a video player using DirectX and Windows Forms

Threading and Parallel Programming


Creating a shared resource

Handling Producer-Consumer race conditions

Handling background threads in Windows Forms

Handling threads in WPF

Using parallel programming to make bulk image processing faster

Chaining two parallelized bulk image processing operations

ASP.NET Recipes – I


Creating a user registration page using HTML5 controls

Saving a draft of a user registration page using HTML5 client storage

Binding objects to controls using strongly-typed data controls

Implementing communication between an ASPX page and a Silverlight application

ADO.NET Recipes


Saving large files (BLOB) in MS SQL Server using ADO.NET

Retrieving large files (BLOB) from SQL Server using ADO.NET

Using transactions to maintain database consistency when saving multiple files

Using DataSet to modify custom XML configuration files

WCF Recipes


Implementing custom binding in WCF

Creating a WCF REST service

Handling exceptions using FaultContract and FaultException

Uploading files using Stream

Securing a service using role-based security

WPF Recipes


Implementing the Model and Repository patterns

Implementing View Model

Implementing View commands and binding data to View

Using the live data shaper for live sorting

Playing videos using MediaElement

Using Ribbon control to display the video player controls

ASP.NET Recipes – II


Preventing cross-site injection using the anti-XSS library

Adding Google Map functionality using Map Helper

Third-party authentication of users using Google

Implementing unobtrusive validation

Silverlight Recipes


Using Pivot control to present asset data

Accessing webcams

Using client-side storage for saving a draft of the user registration data

Entity Framework Recipes


Joining two entities using LINQ

Uploading files using Entity Framework and stored procedures

Managing connections manually for long-running tasks

Using functions that return tables as return values