Skip to content

Instantly share code, notes, and snippets.

@danmusk
danmusk / ElmahMigration.cs
Last active April 4, 2016 14:40
EF Migrations for Elmah. Include sql for Elmah in Azure (by Roberto Bonini).
public partial class Elmah : DbMigration
{
public override void Up()
{
Sql(CreateTable_ELMAH_Error);
Sql(CreatreProcedure_ELMAH_GetErrorXml);
Sql(CreateProcedure_ELMAH_GetErrorsXml);
Sql(CreateProcedure_ELMAH_LogError);
}
internal static IEnumerable<string> ReadLines(this string s)
{
string line;
using (var sr = new StringReader(s))
while ((line = sr.ReadLine()) != null)
yield return line;
}