KickStart - Application Initialization Framework

Application start-up helper to initialize things like an IoC container, register mapping information or run a task.

Features

  • Run tasks on application start-up
  • Extension model to add library specific start up tasks
  • Common IoC container adaptor
  • Singleton instance of an application level IoC container

Download

The KickStart library is available on nuget.org via package name KickStart.

To install KickStart, run the following command in the Package Manager Console

Install-Package KickStart

Example

This example will scan the assembly containing UserModule. Then it will find all Autofac modules and register them with Autofac. Then, all AutoMapper profiles will be registered with Automapper. Finally, it will find all classes that implement IStartupTask and run it.


NLog Fluent Library

Fluent API for NLog

Download

The NLog.Fluent library is available on nuget.org via package name NLog.Fluent.

To install NLog.Fluent, run the following command in the Package Manager Console

Install-Package NLog.Fluent

Examples

Writing info message via fluent API.

_logger.Info()
    .Message("This is a test fluent message '{0}'.", DateTime.Now.Ticks)
    .Property("Test", "InfoWrite")
    .Write();

Writing error message.

try
{
    string text = File.ReadAllText(path);
}
catch (Exception ex)
{
    _logger.Error()
        .Message("Error reading file '{0}'.", path)
        .Exception(ex)
        .Property("Test", "ErrorWrite")
        .Write();
}

Caller Info

Use the static Log class so you don’t have to include loggers in all of classes. The static Log class using .net 4.5 caller info to get the logger from the file name.


NLog MongoDB Library

Writes NLog messages to MongoDB.

Download

The NLog.Mongo library is available on nuget.org via package name NLog.Mongo.

To install NLog.Mongo, run the following command in the Package Manager Console

Install-Package NLog.Mongo

Configuration Syntax

<extensions>
    <add assembly="NLog.Mongo"/>
</extensions>

<targets>
    <target xsi:type="Mongo"
            name="String"
            connectionName="String"
            connectionString="String"
            collectionName="String"
            cappedCollectionSize="Long"
            cappedCollectionMaxItems="Long"
            includeDefaults="Boolean">
    
    <!-- repeated --> 
    <field name="String" Layout="Layout" />
    
    <!-- repeated --> 
    <property name="String" Layout="Layout" />
    </target>
</targets>

Parameters

General Options

name - Name of the target.


Entity Framework Batch Update and Future Queries

Entity Framework Extended Library

A library the extends the functionality of Entity Framework.

Features

  • Batch Update and Delete
  • Future Queries
  • Audit Log

Project Package and Source

NuGet Package:

Install-Package EntityFramework.Extended

Batch Update and Delete

A current limitations of the Entity Framework is that in order to update or delete an entity you have to first retrieve it into memory. Now in most scenarios this is just fine. There are however some scenarios where performance would suffer. Also, for single deletes, the object must be retrieved before it can be deleted requiring two calls to the database. Batch update and delete eliminates the need to retrieve and load an entity before modifying it.


Optimize LINQ to SQL with PLINQO Futures

PLINQO future queries are a way to defer query execution until it is needed. The difference between standard IQueryable deferred queries and future queries is that the future queries are batched up and executed in a single round trip to the database.

Read more at PLINQO.com