Skip to content

Commit 07af183

Browse files
Add sample web project to test / demo usage
1 parent afb637a commit 07af183

19 files changed

+671
-2
lines changed

src/Elmah-MongoDB.sln

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

2-
Microsoft Visual Studio Solution File, Format Version 11.00
3-
# Visual Studio 2010
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 2012
44
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elmah.MongoDB", "Elmah.MongoDB\Elmah.MongoDB.csproj", "{41AFEE84-1EE9-4457-917A-52632B55A1BA}"
55
EndProject
66
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "package", "package", "{8341DC55-5656-478A-B15F-CD3CC0C087C0}"
@@ -16,6 +16,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{F970C7
1616
.nuget\NuGet.targets = .nuget\NuGet.targets
1717
EndProjectSection
1818
EndProject
19+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elmah.MongoDB.Sample", "Elmah.MongoDB.Sample\Elmah.MongoDB.Sample.csproj", "{B0812E20-6414-4648-A4F6-F7376FA7939C}"
20+
EndProject
1921
Global
2022
GlobalSection(SolutionConfigurationPlatforms) = preSolution
2123
Debug|Any CPU = Debug|Any CPU
@@ -26,6 +28,10 @@ Global
2628
{41AFEE84-1EE9-4457-917A-52632B55A1BA}.Debug|Any CPU.Build.0 = Debug|Any CPU
2729
{41AFEE84-1EE9-4457-917A-52632B55A1BA}.Release|Any CPU.ActiveCfg = Release|Any CPU
2830
{41AFEE84-1EE9-4457-917A-52632B55A1BA}.Release|Any CPU.Build.0 = Release|Any CPU
31+
{B0812E20-6414-4648-A4F6-F7376FA7939C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
32+
{B0812E20-6414-4648-A4F6-F7376FA7939C}.Debug|Any CPU.Build.0 = Debug|Any CPU
33+
{B0812E20-6414-4648-A4F6-F7376FA7939C}.Release|Any CPU.ActiveCfg = Release|Any CPU
34+
{B0812E20-6414-4648-A4F6-F7376FA7939C}.Release|Any CPU.Build.0 = Release|Any CPU
2935
EndGlobalSection
3036
GlobalSection(SolutionProperties) = preSolution
3137
HideSolutionNode = FALSE
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
using System.Web.Optimization;
2+
3+
namespace Elmah.MongoDB.Sample
4+
{
5+
public class BundleConfig
6+
{
7+
// For more information on Bundling, visit http://go.microsoft.com/fwlink/?LinkId=254725
8+
public static void RegisterBundles(BundleCollection bundles)
9+
{
10+
bundles.Add(new StyleBundle("~/Content/css").Include("~/Content/site.css"));
11+
}
12+
}
13+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
using System.Web;
2+
using System.Web.Mvc;
3+
4+
namespace Elmah.MongoDB.Sample
5+
{
6+
public class FilterConfig
7+
{
8+
public static void RegisterGlobalFilters(GlobalFilterCollection filters)
9+
{
10+
filters.Add(new HandleErrorAttribute());
11+
}
12+
}
13+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Web;
5+
using System.Web.Mvc;
6+
using System.Web.Routing;
7+
8+
namespace Elmah.MongoDB.Sample
9+
{
10+
public class RouteConfig
11+
{
12+
public static void RegisterRoutes(RouteCollection routes)
13+
{
14+
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
15+
16+
routes.MapRoute(
17+
name: "Default",
18+
url: "{controller}/{action}/{id}",
19+
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
20+
);
21+
}
22+
}
23+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Web.Http;
5+
6+
namespace Elmah.MongoDB.Sample
7+
{
8+
public static class WebApiConfig
9+
{
10+
public static void Register(HttpConfiguration config)
11+
{
12+
config.Routes.MapHttpRoute(
13+
name: "DefaultApi",
14+
routeTemplate: "api/{controller}/{id}",
15+
defaults: new { id = RouteParameter.Optional }
16+
);
17+
}
18+
}
19+
}
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
body {
2+
font-size: .85em;
3+
font-family: "Segoe UI", Verdana, Helvetica, Sans-Serif;
4+
color: #232323;
5+
background-color: #fff;
6+
}
7+
8+
header, footer, nav, section {
9+
display: block;
10+
}
11+
12+
13+
/* Styles for basic forms
14+
-----------------------------------------------------------*/
15+
fieldset {
16+
border: 1px solid #ddd;
17+
padding: 0 1.4em 1.4em 1.4em;
18+
margin: 0 0 1.5em 0;
19+
}
20+
21+
legend {
22+
font-size: 1.2em;
23+
font-weight: bold;
24+
}
25+
26+
textarea {
27+
min-height: 75px;
28+
}
29+
30+
.editor-label {
31+
margin: 1em 0 0 0;
32+
}
33+
34+
.editor-field {
35+
margin: 0.5em 0 0 0;
36+
}
37+
38+
39+
/* Styles for validation helpers
40+
-----------------------------------------------------------*/
41+
.field-validation-error {
42+
color: #f00;
43+
}
44+
45+
.field-validation-valid {
46+
display: none;
47+
}
48+
49+
.input-validation-error {
50+
border: 1px solid #f00;
51+
background-color: #fee;
52+
}
53+
54+
.validation-summary-errors {
55+
font-weight: bold;
56+
color: #f00;
57+
}
58+
59+
.validation-summary-valid {
60+
display: none;
61+
}
Lines changed: 198 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,198 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProductVersion>
8+
</ProductVersion>
9+
<SchemaVersion>2.0</SchemaVersion>
10+
<ProjectGuid>{B0812E20-6414-4648-A4F6-F7376FA7939C}</ProjectGuid>
11+
<ProjectTypeGuids>{E3E379DF-F4C6-4180-9B81-6769533ABE47};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
12+
<OutputType>Library</OutputType>
13+
<AppDesignerFolder>Properties</AppDesignerFolder>
14+
<RootNamespace>Elmah.MongoDB.Sample</RootNamespace>
15+
<AssemblyName>Elmah.MongoDB.Sample</AssemblyName>
16+
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
17+
<MvcBuildViews>false</MvcBuildViews>
18+
<UseIISExpress>true</UseIISExpress>
19+
<IISExpressSSLPort />
20+
<IISExpressAnonymousAuthentication />
21+
<IISExpressWindowsAuthentication />
22+
<IISExpressUseClassicPipelineMode />
23+
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
24+
<RestorePackages>true</RestorePackages>
25+
</PropertyGroup>
26+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
27+
<DebugSymbols>true</DebugSymbols>
28+
<DebugType>full</DebugType>
29+
<Optimize>false</Optimize>
30+
<OutputPath>bin\</OutputPath>
31+
<DefineConstants>DEBUG;TRACE</DefineConstants>
32+
<ErrorReport>prompt</ErrorReport>
33+
<WarningLevel>4</WarningLevel>
34+
</PropertyGroup>
35+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
36+
<DebugType>pdbonly</DebugType>
37+
<Optimize>true</Optimize>
38+
<OutputPath>bin\</OutputPath>
39+
<DefineConstants>TRACE</DefineConstants>
40+
<ErrorReport>prompt</ErrorReport>
41+
<WarningLevel>4</WarningLevel>
42+
</PropertyGroup>
43+
<ItemGroup>
44+
<Reference Include="Antlr3.Runtime, Version=3.3.1.7705, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
45+
<SpecificVersion>False</SpecificVersion>
46+
<HintPath>..\packages\WebGrease.1.3.0\lib\Antlr3.Runtime.dll</HintPath>
47+
</Reference>
48+
<Reference Include="Elmah">
49+
<HintPath>..\packages\elmah.corelibrary.1.2.2\lib\Elmah.dll</HintPath>
50+
</Reference>
51+
<Reference Include="Elmah.Mvc">
52+
<HintPath>..\packages\Elmah.MVC.2.0.2\lib\net40\Elmah.Mvc.dll</HintPath>
53+
</Reference>
54+
<Reference Include="Microsoft.CSharp" />
55+
<Reference Include="Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
56+
<SpecificVersion>False</SpecificVersion>
57+
<HintPath>..\packages\Newtonsoft.Json.4.5.11\lib\net40\Newtonsoft.Json.dll</HintPath>
58+
</Reference>
59+
<Reference Include="System" />
60+
<Reference Include="System.Data" />
61+
<Reference Include="System.Data.Entity" />
62+
<Reference Include="System.Drawing" />
63+
<Reference Include="System.Web.DynamicData" />
64+
<Reference Include="System.Web.Entity" />
65+
<Reference Include="System.Web.ApplicationServices" />
66+
<Reference Include="System.ComponentModel.DataAnnotations" />
67+
<Reference Include="System.Core" />
68+
<Reference Include="System.Data.DataSetExtensions" />
69+
<Reference Include="System.Web.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
70+
<Private>True</Private>
71+
<HintPath>..\packages\Microsoft.AspNet.Razor.2.0.20715.0\lib\net40\System.Web.Razor.dll</HintPath>
72+
</Reference>
73+
<Reference Include="System.Xml.Linq" />
74+
<Reference Include="System.Web" />
75+
<Reference Include="System.Web.Extensions" />
76+
<Reference Include="System.Web.Abstractions" />
77+
<Reference Include="System.Web.Routing" />
78+
<Reference Include="System.Xml" />
79+
<Reference Include="System.Configuration" />
80+
<Reference Include="System.Web.Services" />
81+
<Reference Include="System.EnterpriseServices" />
82+
<Reference Include="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
83+
<Private>True</Private>
84+
<HintPath>..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
85+
</Reference>
86+
<Reference Include="System.Net.Http">
87+
</Reference>
88+
<Reference Include="System.Net.Http.Formatting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
89+
<HintPath>..\packages\Microsoft.AspNet.WebApi.Client.4.0.20710.0\lib\net40\System.Net.Http.Formatting.dll</HintPath>
90+
</Reference>
91+
<Reference Include="System.Net.Http.WebRequest">
92+
</Reference>
93+
<Reference Include="System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
94+
<HintPath>..\packages\Microsoft.AspNet.WebApi.Core.4.0.20710.0\lib\net40\System.Web.Http.dll</HintPath>
95+
</Reference>
96+
<Reference Include="System.Web.Http.WebHost, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
97+
<HintPath>..\packages\Microsoft.AspNet.WebApi.WebHost.4.0.20710.0\lib\net40\System.Web.Http.WebHost.dll</HintPath>
98+
</Reference>
99+
<Reference Include="System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
100+
<Private>True</Private>
101+
<HintPath>..\packages\Microsoft.AspNet.Mvc.4.0.20710.0\lib\net40\System.Web.Mvc.dll</HintPath>
102+
</Reference>
103+
<Reference Include="System.Web.Optimization">
104+
<HintPath>..\packages\Microsoft.AspNet.Web.Optimization.1.0.0\lib\net40\System.Web.Optimization.dll</HintPath>
105+
</Reference>
106+
<Reference Include="System.Web.WebPages, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
107+
<Private>True</Private>
108+
<HintPath>..\packages\Microsoft.AspNet.WebPages.2.0.20710.0\lib\net40\System.Web.WebPages.dll</HintPath>
109+
</Reference>
110+
<Reference Include="System.Web.WebPages.Deployment, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
111+
<Private>True</Private>
112+
<HintPath>..\packages\Microsoft.AspNet.WebPages.2.0.20710.0\lib\net40\System.Web.WebPages.Deployment.dll</HintPath>
113+
</Reference>
114+
<Reference Include="System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
115+
<Private>True</Private>
116+
<HintPath>..\packages\Microsoft.AspNet.WebPages.2.0.20710.0\lib\net40\System.Web.WebPages.Razor.dll</HintPath>
117+
</Reference>
118+
<Reference Include="WebGrease, Version=1.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
119+
<SpecificVersion>False</SpecificVersion>
120+
<HintPath>..\packages\WebGrease.1.3.0\lib\WebGrease.dll</HintPath>
121+
</Reference>
122+
</ItemGroup>
123+
<ItemGroup>
124+
<Compile Include="App_Start\BundleConfig.cs" />
125+
<Compile Include="App_Start\FilterConfig.cs" />
126+
<Compile Include="App_Start\RouteConfig.cs" />
127+
<Compile Include="App_Start\WebApiConfig.cs" />
128+
<Compile Include="Global.asax.cs">
129+
<DependentUpon>Global.asax</DependentUpon>
130+
</Compile>
131+
<Compile Include="Properties\AssemblyInfo.cs" />
132+
</ItemGroup>
133+
<ItemGroup>
134+
<Content Include="Global.asax" />
135+
<Content Include="Content\Site.css" />
136+
<Content Include="Scripts\_references.js" />
137+
<Content Include="Web.config" />
138+
<Content Include="Web.Debug.config">
139+
<DependentUpon>Web.config</DependentUpon>
140+
</Content>
141+
<Content Include="Web.Release.config">
142+
<DependentUpon>Web.config</DependentUpon>
143+
</Content>
144+
<Content Include="Views\Web.config" />
145+
<Content Include="Views\_ViewStart.cshtml" />
146+
<Content Include="Views\Shared\Error.cshtml" />
147+
<Content Include="Views\Shared\_Layout.cshtml" />
148+
</ItemGroup>
149+
<ItemGroup>
150+
<Folder Include="App_Data\" />
151+
<Folder Include="Controllers\" />
152+
<Folder Include="Models\" />
153+
</ItemGroup>
154+
<ItemGroup>
155+
<Content Include="packages.config" />
156+
</ItemGroup>
157+
<ItemGroup>
158+
<ProjectReference Include="..\Elmah.MongoDB\Elmah.MongoDB.csproj">
159+
<Project>{41afee84-1ee9-4457-917a-52632b55a1ba}</Project>
160+
<Name>Elmah.MongoDB</Name>
161+
</ProjectReference>
162+
</ItemGroup>
163+
<PropertyGroup>
164+
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
165+
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
166+
</PropertyGroup>
167+
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
168+
<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
169+
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />
170+
<Target Name="MvcBuildViews" AfterTargets="AfterBuild" Condition="'$(MvcBuildViews)'=='true'">
171+
<AspNetCompiler VirtualPath="temp" PhysicalPath="$(WebProjectOutputDir)" />
172+
</Target>
173+
<ProjectExtensions>
174+
<VisualStudio>
175+
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
176+
<WebProjectProperties>
177+
<UseIIS>True</UseIIS>
178+
<AutoAssignPort>True</AutoAssignPort>
179+
<DevelopmentServerPort>0</DevelopmentServerPort>
180+
<DevelopmentServerVPath>/</DevelopmentServerVPath>
181+
<IISUrl>http://localhost:53476/</IISUrl>
182+
<NTLMAuthentication>False</NTLMAuthentication>
183+
<UseCustomServer>False</UseCustomServer>
184+
<CustomServerUrl>
185+
</CustomServerUrl>
186+
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
187+
</WebProjectProperties>
188+
</FlavorProperties>
189+
</VisualStudio>
190+
</ProjectExtensions>
191+
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
192+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
193+
Other similar extension points exist, see Microsoft.Common.targets.
194+
<Target Name="BeforeBuild">
195+
</Target>
196+
<Target Name="AfterBuild">
197+
</Target> -->
198+
</Project>

src/Elmah.MongoDB.Sample/Global.asax

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<%@ Application Codebehind="Global.asax.cs" Inherits="Elmah.MongoDB.Sample.MvcApplication" Language="C#" %>
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Web;
5+
using System.Web.Http;
6+
using System.Web.Mvc;
7+
using System.Web.Optimization;
8+
using System.Web.Routing;
9+
10+
namespace Elmah.MongoDB.Sample
11+
{
12+
// Note: For instructions on enabling IIS6 or IIS7 classic mode,
13+
// visit http://go.microsoft.com/?LinkId=9394801
14+
15+
public class MvcApplication : System.Web.HttpApplication
16+
{
17+
protected void Application_Start()
18+
{
19+
AreaRegistration.RegisterAllAreas();
20+
21+
WebApiConfig.Register(GlobalConfiguration.Configuration);
22+
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
23+
RouteConfig.RegisterRoutes(RouteTable.Routes);
24+
BundleConfig.RegisterBundles(BundleTable.Bundles);
25+
}
26+
}
27+
}

0 commit comments

Comments
 (0)