Tuesday, August 24, 2010

Log Reporting Dashboard for ASP.NET MVC

Integrates Log4Net, NLog, Elmah, and ASP.NET Health Monitoring into an ASP.NET MVC 2.0 Website and provide a log reporting dashboard.

Looks a very good article on the code project

Posted via email from solution revolution

Caliburn: A Client Framework for WPF and Silverlight

Smart Client - Building Distributed Apps with NHibernate and Rhino Service Bus

Smart Client - Building Distributed Apps with NHibernate and Rhino Service Bus, Part 2

Git, TortoiseGit, Github and the rest

A good article on getting started with Git, TortoiseGit and Github

Posted via email from solution revolution

Hungover Owls

Normally this blog is just about code but hungover owls. Quality

Posted via email from solution revolution

My .NET ICache

.NET caching code used to help improve testability, swap out different implementations, and enhance the API.

http://openmymind.net/2010/8/24/My-DOTNET-ICache#

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 
using System;
using System.Web.Caching;

public interface ICache
{
    T Get<T>(string key, params object[] keyArgs);

    T Fetch<T>(string key, Func<T> callIfGetReturnsNull, params object[] keyArgs);
    T Fetch<T>(string key, Func<T> callIfGetReturnsNull, DateTime absoluteExpiration, params object[] keyArgs);
    T Fetch<T>(string key, Func<T> callIfGetReturnsNull, TimeSpan slidingExpiration, params object[] keyArgs);
    T Fetch<T>(string key, Func<T> callIfGetReturnsNull, CacheDependency dependencies, params object[] keyArgs);
    T Fetch<T>(string key, Func<T> callIfGetReturnsNull, CacheDependency dependencies, DateTime absoluteExpiration, TimeSpan slidingExpiration, params object[] keyArgs);
    T Fetch<T>(string key, Func<T> callIfGetReturnsNull, CacheDependency dependencies, DateTime absoluteExpiration, TimeSpan slidingExpiration, CacheItemPriority priority, CacheItemRemovedCallback onRemoveCallback, params object[] keyArgs);

    T Fetch<T>(string key, Action<T> callIfGetReturnsValue, Func<T> callIfGetReturnsNull, params object[] keyArgs);
    T Fetch<T>(string key, Action<T> callIfGetReturnsValue, Func<T> callIfGetReturnsNull, DateTime absoluteExpiration, params object[] keyArgs);
    T Fetch<T>(string key, Action<T> callIfGetReturnsValue, Func<T> callIfGetReturnsNull, TimeSpan slidingExpiration, params object[] keyArgs);
    T Fetch<T>(string key, Action<T> callIfGetReturnsValue, Func<T> callIfGetReturnsNull, CacheDependency dependencies, params object[] keyArgs);
    T Fetch<T>(string key, Action<T> callIfGetReturnsValue, Func<T> callIfGetReturnsNull, CacheDependency dependencies, DateTime absoluteExpiration, TimeSpan slidingExpiration, params object[] keyArgs);
    T Fetch<T>(string key, Action<T> callIfGetReturnsValue, Func<T> callIfGetReturnsNull, CacheDependency dependencies, DateTime absoluteExpiration, TimeSpan slidingExpiration, CacheItemPriority priority, CacheItemRemovedCallback onRemoveCallback, params object[] keyArgs);


    void Insert(string key, object data, params object[] keyArgs);
    void Insert(string key, object data, DateTime absoluteExpiration, params object[] keyArgs);
    void Insert(string key, object data, TimeSpan slidingExpiration, params object[] keyArgs);
    void Insert(string key, object data, CacheDependency dependencies, params object[] keyArgs);
    void Insert(string key, object data, CacheDependency dependencies, DateTime absoluteExpiration, TimeSpan slidingExpiration, params object[] keyArgs);
    void Insert(string key, object data, CacheDependency dependencies, DateTime absoluteExpiration, TimeSpan slidingExpiration, CacheItemPriority priority, CacheItemRemovedCallback onRemoveCallback, params object[] keyArgs);

    void Remove(string key, params object[] keyArgs);

    void RemoveAll();

    int Count();
}

Posted via email from solution revolution

Thursday, August 19, 2010

New Visual Studio 2010 Feature: Pin To Source

Downloading Youtube Videos C# WinForm - CodeProject

SQL SERVER – Fastest Way to Restore the Database

Lucene.net is powering Subtext 2.5 search

Check out this website I found at codeclimber.net.nz

Posted via email from solution revolution

jQuery AJAX calls to a WCF REST Service - Rick Strahl's Web Log

Check out this website I found at west-wind.com

Posted via email from solution revolution

Building JSON,XML REST API using WCF services

[ServiceContract]
public interface IFetchChildItems
{
[OperationContract]
[WebInvoke(
Method = "GET",
ResponseFormat = WebMessageFormat,
BodyStyle = WebMessageBodyStyle.Wrapped,
UriTemplate = "{ID}/{Filter}")
]
void DoWork(int ID, string Filter);
}

Posted via email from solution revolution

How to do API Key Verification for REST Services in .NET 4 - Ron Jacobs - Site Home - MSDN Blogs

Town Crier – An open-source e-mail templating engine for .NET « The Code Decanter

Integrated StructureMap container for the MvcServiceLocator in ASP.NET MVC 3 - Context is King

/// <summary>
        /// Initializes a new instance of the <see cref="StructureMapControllerFactory"/> class.
        /// </summary>
        /// <param name="container">The container.</param>
        public StructureMapControllerFactory(IContainer container)
            : this(container, new DefaultControllerFactory())
        {
        }

Posted via email from solution revolution

41 Remarkable and useful jQuery Plugins

OData: The Open Data Protocol

Check out this website I found at mtaulty.com

Posted via email from solution revolution

New Social API Web Application Toolkit for .NET web developers

Full-Text Search in ASP.NET using Lucene.NET

public void Application_OnStart(Object sender, EventArgs e)
{
    if (btnet.Util.get_setting("EnableLucene", "1") == "1")
    {
        build_lucene_index(this.Application);
    }
}

Posted via email from solution revolution

WhiteBoard Chat - an ASP.NET MVC Chat program

SubSonic3 Works on Mono! - Nathan Bridgewater

SubSonic  Project

So a couple weeks ago I decided to test a few changes made to SubSonic3 that fixed a LINQ evaluation bug related to medium trust. Using a simple console app on linux/mono, I tested basic data access to a SQLite database using repository mode, and to my surprise it worked! 

Mono-gorilla-aqua.100px

I've always been a big fan of SubSonic since its 2.0 version, which I used for a mid-sized e-commerce site. With a totally rewritten core, 3.0 uses LINQ (language integrated query) for all of its data access providing a great alternative to Dblinq for the Mono platform.

 

 

SubSonic3 supports ActiveRecord, Repository, and Custom Linq modes, which give you the flexibility to build code-first or database-first.  SubSonic3 is not an ORM (object relational mapping) like NHibernate, but it can behave like one when you use Repository Mode using POCO (plain old CLR object) representations of your tables. SubSonic handles the mapping and database query generation itself based on the database provider configured. Its intention is to allow you to build code-first and let the persistence of the object be non-critical to your application. It can even migrate your class definition changes (table schema) to the database automatically during runtime; however, it still has the flexibility to let you design your database with keys, indexes, and constraints yourself without using the automatic migration. The SubSonic website has a great demo showing this capability.

Database Independence

To make SubSonc3 truly database agnostic, you have to use Repository mode. Active Record and Custom Linq modes DO support multiple database engines, but they all require custom class generation which is hard-wired to those engines. So when you change database types like from MySql to MSSQL or vice-versa, you have to regenerate your classes.

With Repository mode, you simply change your connection string in the app.config. It will use the 2.0 Data Provider model provided by the database engine client and the definition of your POCO classes to determine the SQL syntax and schema to use.  SubSonic is pre-wired with MSSql, SQLite, MySql, and a generic ANSI Sql syntax support. There's been lots of talk about implementing Oracle and PostgreSql, which may already work in ActiveRecord or LinqTemplates, but are not yet in the Core assembly for use with Repository.

Decoupled – Mocking for Unit Tests and Framework Independence

Another big advantage of Repository is the ability to decouple your data framework from your application completely. Since the POCO objects are not directly tied to SubSonic, they can be re-used with other frameworks like NHibernate or the latest Entity Framework 4 without touching a single line of application code. It also opens the door to mocking and testability. Dependency Injection frameworks like Unity or StructureMap work perfect for this.

So how about a sample?

This is a silly little test application that is neither pretty nor elegant, but it proves that this code will run on Mono 2.6.3 and 2.7 (trunk) with a SQLite database. It also uses Unity for dependency injection much like you would in Asp.NET MVC. Within the project, you'll find an AppService interface used to provide the definition for simple 'business' functionality. This is meant to be generic for the sample; but in a real application, I would breakdown the services by functional purpose. They all can share the same LinqRepository data interface, which provides basic rules for LINQ-based CRUD. SubSonic3 hooks right into that and is nearly transparent to the application with the exception of a few attributes on the domain objects. There are some placeholder Mock classes there and sample mappings in the code just for show.

Download the sample project

You can also get the latest version from IWS Snippets project subversion.

Posted via email from solution revolution

Multi-tenant ASP.NET – Foundation - Zack Owens

public interface IApplicationTenant
{
string ApplicationName { get; }
IFeatureRegistry EnabledFeatures { get; }
IEnumerable<string> UrlPaths { get; }
IContainer DependencyContainer { get; }
IViewEngine ViewEngine { get; }
}

Posted via email from solution revolution

Sunday, August 15, 2010

NUnit isn't running VS10 code

I've downloaded the NUnit 2.5 source and opened the VS2008 solution in the VS2010 beta. Once the conversion finished I opened all the projects and changed the target framework setting for all the projects to ".NET Framework 4.0". I then built the solution without any errors. I can now use the NUnit GUI app to run tests built for .NET 4.0. I've not done exhaustive testing of this build so there may be problems, but for my purposes it works fine.

Update: It is not necessary to rebuild NUnit. I discovered that if you add the following to the relevant NUnit config file you can run a test dll built for .NET 4.0.

Under <configuration> add:

<startup>  <requiredRuntime version="v4.0.20506" /></startup>

and under <runtime> add:

<loadFromRemoteSources enabled="true" />

Posted via email from solution revolution

Saturday, August 14, 2010

Schedule a daily backup with SQL Server Express

At the moment I am finishing up an application that uses MS SQL Server Express 2008 as a data store for user data and MS SQL Server Express does not have an agent service you can use to automatically back up the database.

This article uses a similar technique to one I have been using to back up my development database.

Posted via email from solution revolution