Awesome talks about software

How to disable globally applied StyleCop rules

If you have a set of StyleCop rules that you want to disable for a specific solution in Visual Studio, follow the steps:

1. Create a file with the name Settings.StyleCop in the solution root folder (same place where the .sln file is)

2. Insert the following xml snippet in the file:

<StyleCopSettings Version="105">
    <BooleanProperty Name="RulesEnabledByDefault">False</BooleanProperty>

Productivity boost with ASP.NET MVC, Code First and SQLCe

It’s easy to start from a working example.

I’ve created on GitHub a starter project that make use of ASP.NET MVC, Entity Framework 5 and SQL Compact Framework which gives you all the wirings needed to start build a data oriented application.

Business project contains a Model namespace in which you can put your application domain objects along with the BusinessContext object which describes your data context, exposing the entities and explicitly invoking the connection string which in mentioned in class constructor.

BusinessContextInitializer is make use of DropCreateDatabaseIfModelChanges strategy, so any change on the Model will trigger a database recreation (useful for development).

In the Web project the web.config file contains an connection string called BusinessContext that wires up a SQL Compact database but it can be changed to a SQL Server connection.


<add name=”BusinessContext”
connectionString=”Data Source=|DataDirectory|\Data\data.sdf”/>

GitHub repo link: