Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Adding support for running in a shared environment

  • Loading branch information...
commit 1587e193aff5ad3b6151d86025802b64c42d17ba 1 parent bdb1330
@ayende authored
Showing with 1,003 additions and 1,045 deletions.
  1. +71 −72 Code/RavenOverflow.Core/RavenOverflow.Core.csproj
  2. +0 −10 Code/RavenOverflow.Core/Services/IQuestionService.cs
  3. +1 −1  Code/RavenOverflow.FakeData/FakeQuestions.cs
  4. +0 −30 Code/RavenOverflow.Services/QuestionService.cs
  5. +74 −75 Code/RavenOverflow.Services/RavenOverflow.Services.csproj
  6. +54 −58 Code/RavenOverflow.Web/Areas/Question/Controllers/QuestionsController.cs
  7. +4 −4 Code/RavenOverflow.Web/Areas/User/Controllers/UsersController.cs
  8. +270 −261 Code/RavenOverflow.Web/Controllers/HomeController.cs
  9. +57 −22 Code/RavenOverflow.Web/Controllers/RavenDbController.cs
  10. +1 −2  Code/RavenOverflow.Web/DependencyResolution/IoC.cs
  11. +65 −33 Code/RavenOverflow.Web/DependencyResolution/RavenDbRegistry.cs
  12. +1 −6 Code/RavenOverflow.Web/DependencyResolution/ServiceRegistry.cs
  13. +0 −101 Code/RavenOverflow.Web/RavenDb/DocumentStoreExtensions.cs
  14. +63 −49 Code/RavenOverflow.Web/RavenDb/HelperUtilities.cs
  15. +268 −248 Code/RavenOverflow.Web/RavenOverflow.Web.csproj
  16. +14 −3 Code/RavenOverflow.Web/Views/Shared/_Layout.cshtml
  17. +0 −4 Code/RavenOverflow.Web/Web.config
  18. +16 −16 Code/RavenOverflow.Web/packages.config
  19. +44 −50 RavenOverflow.sln
View
143 Code/RavenOverflow.Core/RavenOverflow.Core.csproj
@@ -1,79 +1,78 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>8.0.30703</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{58D8E77E-68D3-4623-A558-84B731E7725F}</ProjectGuid>
- <OutputType>Library</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>RavenOverflow.Core</RootNamespace>
- <AssemblyName>RavenOverflow.Core</AssemblyName>
- <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
- <FileAlignment>512</FileAlignment>
- <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\..\RavenOverflow\</SolutionDir>
- <RestorePackages>true</RestorePackages>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>bin\Debug\</OutputPath>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
- <OutputPath>bin\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="Newtonsoft.Json">
- <HintPath>..\..\packages\Newtonsoft.Json.4.0.8\lib\net40\Newtonsoft.Json.dll</HintPath>
- </Reference>
- <Reference Include="Raven.Client.Lightweight">
- <HintPath>..\..\packages\RavenDB.Client.1.0.888\lib\net40\Raven.Client.Lightweight.dll</HintPath>
- </Reference>
- <Reference Include="System" />
- <Reference Include="System.ComponentModel.DataAnnotations" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="Entities\OAuthData.cs" />
- <Compile Include="Entities\Comment.cs" />
- <Compile Include="Entities\Extensions.cs" />
- <Compile Include="Entities\OAuthProvider.cs" />
- <Compile Include="Entities\Post.cs" />
- <Compile Include="Entities\Tag.cs" />
- <Compile Include="Entities\User.cs" />
- <Compile Include="Entities\Answer.cs" />
- <Compile Include="Entities\Question.cs" />
- <Compile Include="Entities\RootAggregate.cs" />
- <Compile Include="Entities\Vote.cs" />
- <Compile Include="Extensions\Common.cs" />
- <Compile Include="Extensions\User.cs" />
- <Compile Include="Extensions\Questions.cs" />
- <Compile Include="Properties\AssemblyInfo.cs" />
- <Compile Include="Services\IQuestionService.cs" />
- <Compile Include="Services\IUserService.cs" />
- </ItemGroup>
- <ItemGroup>
- <Folder Include="Filters\" />
- </ItemGroup>
- <ItemGroup>
- <None Include="packages.config" />
- </ItemGroup>
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
- <Import Project="$(SolutionDir)\.nuget\nuget.targets" />
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.30703</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{58D8E77E-68D3-4623-A558-84B731E7725F}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>RavenOverflow.Core</RootNamespace>
+ <AssemblyName>RavenOverflow.Core</AssemblyName>
+ <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+ <FileAlignment>512</FileAlignment>
+ <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\..\RavenOverflow\</SolutionDir>
+ <RestorePackages>true</RestorePackages>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="Newtonsoft.Json">
+ <HintPath>..\..\packages\Newtonsoft.Json.4.0.8\lib\net40\Newtonsoft.Json.dll</HintPath>
+ </Reference>
+ <Reference Include="Raven.Client.Lightweight">
+ <HintPath>..\..\packages\RavenDB.Client.1.0.888\lib\net40\Raven.Client.Lightweight.dll</HintPath>
+ </Reference>
+ <Reference Include="System" />
+ <Reference Include="System.ComponentModel.DataAnnotations" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="Entities\OAuthData.cs" />
+ <Compile Include="Entities\Comment.cs" />
+ <Compile Include="Entities\Extensions.cs" />
+ <Compile Include="Entities\OAuthProvider.cs" />
+ <Compile Include="Entities\Post.cs" />
+ <Compile Include="Entities\Tag.cs" />
+ <Compile Include="Entities\User.cs" />
+ <Compile Include="Entities\Answer.cs" />
+ <Compile Include="Entities\Question.cs" />
+ <Compile Include="Entities\RootAggregate.cs" />
+ <Compile Include="Entities\Vote.cs" />
+ <Compile Include="Extensions\Common.cs" />
+ <Compile Include="Extensions\User.cs" />
+ <Compile Include="Extensions\Questions.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="Services\IUserService.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <Folder Include="Filters\" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="packages.config" />
+ </ItemGroup>
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <Import Project="$(SolutionDir)\.nuget\nuget.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
- -->
+ -->
</Project>
View
10 Code/RavenOverflow.Core/Services/IQuestionService.cs
@@ -1,10 +0,0 @@
-using Raven.Client;
-using RavenOverflow.Core.Entities;
-
-namespace RavenOverflow.Core.Services
-{
- public interface IQuestionService
- {
- Question Create(Question question, IDocumentSession documentSession);
- }
-}
View
2  Code/RavenOverflow.FakeData/FakeQuestions.cs
@@ -32,7 +32,7 @@ public static class FakeQuestions
public static ICollection<Question> CreateFakeQuestions(IList<string> userIds)
{
- return CreateFakeQuestions(userIds, GetRandom.Int(20, 100));
+ return CreateFakeQuestions(userIds, 100);
}
public static ICollection<Question> CreateFakeQuestions(IList<string> userIds, int numberOfFakeQuestions)
View
30 Code/RavenOverflow.Services/QuestionService.cs
@@ -1,30 +0,0 @@
-using System.ComponentModel.DataAnnotations;
-using CuttingEdge.Conditions;
-using Raven.Client;
-using RavenOverflow.Core.Entities;
-using RavenOverflow.Core.Services;
-
-namespace RavenOverflow.Services
-{
- public class QuestionService : IQuestionService
- {
- #region IQuestionService Members
-
- public Question Create(Question question, IDocumentSession documentSession)
- {
- Condition.Requires(question).IsNotNull();
- Condition.Requires(documentSession).IsNotNull();
-
- // First, validate the question.
- Validator.ValidateObject(question, new ValidationContext(question, null, null), true);
- Condition.Requires(question.Tags).IsNotNull().IsLongerThan(0);
-
- // Save.
- documentSession.Store(question);
-
- return question;
- }
-
- #endregion
- }
-}
View
149 Code/RavenOverflow.Services/RavenOverflow.Services.csproj
@@ -1,82 +1,81 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>8.0.30703</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{A1F07927-5943-44D6-9FD4-FF36AE6C25DC}</ProjectGuid>
- <OutputType>Library</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>RavenOverflow.Services</RootNamespace>
- <AssemblyName>RavenOverflow.Services</AssemblyName>
- <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
- <FileAlignment>512</FileAlignment>
- <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\..\RavenOverflow\</SolutionDir>
- <RestorePackages>true</RestorePackages>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>bin\Debug\</OutputPath>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
- <OutputPath>bin\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="CuttingEdge.Conditions">
- <HintPath>..\..\packages\CuttingEdge.Conditions.1.2.0.0\lib\NET35\CuttingEdge.Conditions.dll</HintPath>
- </Reference>
- <Reference Include="Newtonsoft.Json, Version=4.0.8.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
- <HintPath>..\..\packages\Newtonsoft.Json.4.0.8\lib\net40\Newtonsoft.Json.dll</HintPath>
- </Reference>
- <Reference Include="NLog, Version=2.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
- <HintPath>..\..\packages\NLog.2.0.0.2000\lib\net40\NLog.dll</HintPath>
- </Reference>
- <Reference Include="Raven.Abstractions, Version=1.0.0.0, Culture=neutral, PublicKeyToken=37f41c7f99471593, processorArchitecture=MSIL">
- <HintPath>..\..\packages\RavenDB.Client.1.0.888\lib\net40\Raven.Abstractions.dll</HintPath>
- </Reference>
- <Reference Include="Raven.Client.Lightweight, Version=1.0.0.0, Culture=neutral, PublicKeyToken=37f41c7f99471593, processorArchitecture=MSIL">
- <HintPath>..\..\packages\RavenDB.Client.1.0.888\lib\net40\Raven.Client.Lightweight.dll</HintPath>
- </Reference>
- <Reference Include="System" />
- <Reference Include="System.ComponentModel.Composition" />
- <Reference Include="System.ComponentModel.DataAnnotations" />
- <Reference Include="System.Core" />
- <Reference Include="Microsoft.CSharp" />
- <Reference Include="System.Web" />
- <Reference Include="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="QuestionService.cs" />
- <Compile Include="Properties\AssemblyInfo.cs" />
- <Compile Include="UserService.cs" />
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\RavenOverflow.Core\RavenOverflow.Core.csproj">
- <Project>{58D8E77E-68D3-4623-A558-84B731E7725F}</Project>
- <Name>RavenOverflow.Core</Name>
- </ProjectReference>
- </ItemGroup>
- <ItemGroup>
- <None Include="packages.config" />
- </ItemGroup>
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
- <Import Project="$(SolutionDir)\.nuget\nuget.targets" />
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.30703</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{A1F07927-5943-44D6-9FD4-FF36AE6C25DC}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>RavenOverflow.Services</RootNamespace>
+ <AssemblyName>RavenOverflow.Services</AssemblyName>
+ <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+ <FileAlignment>512</FileAlignment>
+ <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\..\RavenOverflow\</SolutionDir>
+ <RestorePackages>true</RestorePackages>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="CuttingEdge.Conditions">
+ <HintPath>..\..\packages\CuttingEdge.Conditions.1.2.0.0\lib\NET35\CuttingEdge.Conditions.dll</HintPath>
+ </Reference>
+ <Reference Include="Newtonsoft.Json, Version=4.0.8.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
+ <HintPath>..\..\packages\Newtonsoft.Json.4.0.8\lib\net40\Newtonsoft.Json.dll</HintPath>
+ </Reference>
+ <Reference Include="NLog, Version=2.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
+ <HintPath>..\..\packages\NLog.2.0.0.2000\lib\net40\NLog.dll</HintPath>
+ </Reference>
+ <Reference Include="Raven.Abstractions, Version=1.0.0.0, Culture=neutral, PublicKeyToken=37f41c7f99471593, processorArchitecture=MSIL">
+ <HintPath>..\..\packages\RavenDB.Client.1.0.888\lib\net40\Raven.Abstractions.dll</HintPath>
+ </Reference>
+ <Reference Include="Raven.Client.Lightweight, Version=1.0.0.0, Culture=neutral, PublicKeyToken=37f41c7f99471593, processorArchitecture=MSIL">
+ <HintPath>..\..\packages\RavenDB.Client.1.0.888\lib\net40\Raven.Client.Lightweight.dll</HintPath>
+ </Reference>
+ <Reference Include="System" />
+ <Reference Include="System.ComponentModel.Composition" />
+ <Reference Include="System.ComponentModel.DataAnnotations" />
+ <Reference Include="System.Core" />
+ <Reference Include="Microsoft.CSharp" />
+ <Reference Include="System.Web" />
+ <Reference Include="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="UserService.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\RavenOverflow.Core\RavenOverflow.Core.csproj">
+ <Project>{58D8E77E-68D3-4623-A558-84B731E7725F}</Project>
+ <Name>RavenOverflow.Core</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="packages.config" />
+ </ItemGroup>
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <Import Project="$(SolutionDir)\.nuget\nuget.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
- -->
+ -->
</Project>
View
112 Code/RavenOverflow.Web/Areas/Question/Controllers/QuestionsController.cs
@@ -1,59 +1,55 @@
-using System;
-using System.Web.Mvc;
-using AutoMapper;
-using CuttingEdge.Conditions;
-using Raven.Client;
-using RavenOverflow.Core.Services;
-using RavenOverflow.Web.Areas.Question.Models.ViewModels;
-using RavenOverflow.Web.Controllers;
-
-namespace RavenOverflow.Web.Areas.Question.Controllers
-{
- public class QuestionsController : RavenDbController
- {
- private readonly IQuestionService _questionService;
-
- public QuestionsController(IDocumentStore documentStore, IQuestionService questionService)
- : base(documentStore)
- {
- Condition.Requires(questionService).IsNotNull();
-
- _questionService = questionService;
- }
-
- [HttpGet]
- public ActionResult Create()
- {
- var viewModel = new CreateViewModel(User.Identity)
- {
- Header = "Ask a Question"
- };
- return View("Create", viewModel);
- }
-
- [HttpPost, Authorize]
- public ActionResult Create(CreateInputModel inputModel)
- {
- try
- {
- if (ModelState.IsValid)
- {
- Core.Entities.Question question = Mapper.Map<CreateInputModel, Core.Entities.Question>(inputModel);
- question.CreatedByUserId = User.Identity.UserId;
-
- _questionService.Create(question, DocumentSession);
-
- return RedirectToAction("Index", "Home", new { area = "" });
- }
- }
- catch (Exception exception)
- {
- ModelState.AddModelError("RuRoh", exception.Message);
- }
-
- CreateViewModel viewModel = Mapper.Map(inputModel,
- new CreateViewModel(User.Identity) { Header = "Ask a Question" });
- return View("Create", viewModel);
- }
- }
+using System;
+using System.Web.Mvc;
+using AutoMapper;
+using CuttingEdge.Conditions;
+using Raven.Client;
+using RavenOverflow.Core.Services;
+using RavenOverflow.Web.Areas.Question.Models.ViewModels;
+using RavenOverflow.Web.Controllers;
+using RavenOverflow.Web.DependencyResolution;
+
+namespace RavenOverflow.Web.Areas.Question.Controllers
+{
+ public class QuestionsController : RavenDbController
+ {
+ public QuestionsController(DocumentStores documentStores)
+ : base(documentStores)
+ {
+ }
+
+ [HttpGet]
+ public ActionResult Create()
+ {
+ var viewModel = new CreateViewModel(User.Identity)
+ {
+ Header = "Ask a Question"
+ };
+ return View("Create", viewModel);
+ }
+
+ [HttpPost, Authorize]
+ public ActionResult Create(CreateInputModel inputModel)
+ {
+ try
+ {
+ if (ModelState.IsValid)
+ {
+ Core.Entities.Question question = Mapper.Map<CreateInputModel, Core.Entities.Question>(inputModel);
+ question.CreatedByUserId = User.Identity.UserId;
+
+ QuestionsSession.Store(question);
+
+ return RedirectToAction("Index", "Home", new { area = "" });
+ }
+ }
+ catch (Exception exception)
+ {
+ ModelState.AddModelError("RuRoh", exception.Message);
+ }
+
+ CreateViewModel viewModel = Mapper.Map(inputModel,
+ new CreateViewModel(User.Identity) { Header = "Ask a Question" });
+ return View("Create", viewModel);
+ }
+ }
}
View
8 Code/RavenOverflow.Web/Areas/User/Controllers/UsersController.cs
@@ -8,7 +8,8 @@
using RavenOverflow.Core.Entities;
using RavenOverflow.Core.Services;
using RavenOverflow.Services;
-using RavenOverflow.Web.Controllers;
+using RavenOverflow.Web.Controllers;
+using RavenOverflow.Web.DependencyResolution;
using RavenOverflow.Web.Models;
using RavenOverflow.Web.Models.Authentication;
@@ -20,8 +21,7 @@ public class UsersController : RavenDbController
private readonly string _facebookSecret;
private readonly ICustomFormsAuthentication _customFormsAuthentication;
- public UsersController(IDocumentStore documentStore,
- ICustomFormsAuthentication customCustomFormsAuthentication,
+ public UsersController(DocumentStores documentStore, ICustomFormsAuthentication customCustomFormsAuthentication,
IOAuthAuthentication oAuthAuthentication)
: base(documentStore)
{
@@ -137,7 +137,7 @@ private Core.Entities.User AcceptFacebookOAuthToken(FacebookOAuthResult facebook
// Not sure how to Inject an IUserService because it requires a Session .. which I don't have.
- var userService = new UserService(DocumentSession);
+ var userService = new UserService(UsersSession);
// Now associate this facebook user to an existing user OR create a new one.
return userService.CreateOrUpdate(oauthData, facebookUser.username, facebookUser.name, facebookUser.email);
View
531 Code/RavenOverflow.Web/Controllers/HomeController.cs
@@ -1,262 +1,271 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Web.Mvc;
-using Raven.Abstractions.Data;
-using Raven.Client;
-using Raven.Client.Linq;
-using RavenOverflow.Core.Entities;
-using RavenOverflow.Core.Extensions;
-using RavenOverflow.Web.Models.ViewModels;
-using RavenOverflow.Web.RavenDb.Indexes;
-
-namespace RavenOverflow.Web.Controllers
-{
- public class HomeController : RavenDbController
- {
- public HomeController(IDocumentStore documentStore) : base(documentStore)
- {
- }
-
- [HttpGet]
- public ActionResult Index(string displayName, string tag)
- {
- string header;
-
- // 1. All the questions, ordered by most recent.
- IQueryable<QuestionWithDisplayName> questionsQuery = QuestionQuery(tag, out header);
-
- // 2. Popular Tags for a time period.
- // StackOverflow calls it 'recent tags'.
- IQueryable<RecentPopularTags.ReduceResult> recentPopularTags = RecentPopularTagsQuery();
-
- // 3. Log in user information.
- IQueryable<User> userQuery = UserQuery(displayName);
-
- var viewModel = new IndexViewModel(User.Identity)
- {
- Header = header,
- QuestionListViewModel = new QuestionListViewModel
- {
- Questions = questionsQuery.ToList()
- },
- RecentPopularTags = recentPopularTags.ToDictionary(x => x.Tag, x => x.Count),
- UserFavoriteTagListViewModel = new UserTagListViewModel
- {
- Header = "Favorite Tags",
- DivId1 = "interesting-tags",
- DivId2 = "interestingtags",
- Tags = userQuery == null
- ? null
- : (userQuery.SingleOrDefault() ??
- new User()).FavoriteTags
- },
- UserIgnoredTagList = new UserTagListViewModel
- {
- Header = "Ignored Tags",
- DivId1 = "ignored-tags",
- DivId2 = "ignoredtags",
- Tags = null
- }
- };
-
- return View(viewModel);
- }
-
- [HttpGet]
- public ActionResult BatchedIndex(string displayName, string tag)
- {
- string header;
-
- // 1. All the questions, ordered by most recent.
- Lazy<IEnumerable<QuestionWithDisplayName>> questionsQuery = QuestionQuery(tag, out header).Lazily();
-
- // 2. Popular Tags for a time period.
- // StackOverflow calls it 'recent tags'.
- Lazy<IEnumerable<RecentPopularTags.ReduceResult>> recentPopularTags = RecentPopularTagsQuery().Lazily();
-
- // 3. Log in user information.
- IQueryable<User> userQuery = UserQuery(displayName);
- Lazy<IEnumerable<User>> lazyUserQuery = (userQuery != null ? userQuery.Lazily() : null);
-
- var viewModel = new IndexViewModel(User.Identity)
- {
- Header = header,
- QuestionListViewModel = new QuestionListViewModel
- {
- Questions = questionsQuery.Value.ToList()
- },
- RecentPopularTags = recentPopularTags.Value.ToDictionary(x => x.Tag, x => x.Count),
- UserFavoriteTagListViewModel = new UserTagListViewModel
- {
- Header = "Favorite Tags",
- DivId1 = "interesting-tags",
- DivId2 = "interestingtags",
- Tags = lazyUserQuery == null
- ? null
- : (lazyUserQuery.Value.
- SingleOrDefault() ??
- new User()).FavoriteTags
- },
- UserIgnoredTagList = new UserTagListViewModel
- {
- Header = "Ignored Tags",
- DivId1 = "ignored-tags",
- DivId2 = "ignoredtags",
- Tags = null
- }
- };
-
- return View("Index", viewModel);
- }
-
- [HttpGet]
- public ActionResult AggressiveIndex(string displayName, string tag)
- {
- using (DocumentSession.Advanced.DocumentStore.AggressivelyCacheFor(TimeSpan.FromMinutes(1)))
- {
- string header;
-
- // 1. All the questions, ordered by most recent.
- Lazy<IEnumerable<QuestionWithDisplayName>> questionsQuery = QuestionQuery(tag, out header).Lazily();
-
- // 2. Popular Tags for a time period.
- // StackOverflow calls it 'recent tags'.
- Lazy<IEnumerable<RecentPopularTags.ReduceResult>> recentPopularTags = RecentPopularTagsQuery().Lazily();
-
- // 3. Log in user information.
- IQueryable<User> userQuery = UserQuery(displayName);
- Lazy<IEnumerable<User>> lazyUserQuery = (userQuery != null ? userQuery.Lazily() : null);
-
- var viewModel = new IndexViewModel(User.Identity)
- {
- Header = header,
- QuestionListViewModel = new QuestionListViewModel
- {
- Questions = questionsQuery.Value.ToList()
- },
- RecentPopularTags =
- recentPopularTags.Value.ToDictionary(x => x.Tag, x => x.Count),
- UserFavoriteTagListViewModel = new UserTagListViewModel
- {
- Header = "Favorite Tags",
- DivId1 = "interesting-tags",
- DivId2 = "interestingtags",
- Tags = lazyUserQuery == null
- ? null
- : (lazyUserQuery.Value.
- SingleOrDefault() ??
- new User()).FavoriteTags
- },
- UserIgnoredTagList = new UserTagListViewModel
- {
- Header = "Ignored Tags",
- DivId1 = "ignored-tags",
- DivId2 = "ignoredtags",
- Tags = null
- }
- };
-
- return View("Index", viewModel);
- }
- }
-
- public ActionResult Tag(string id)
- {
- RavenQueryStatistics stats;
- List<Question> questions = DocumentSession.Query<Question>()
- .Statistics(out stats)
- .OrderByCreatedByDescending()
- .Take(20)
- .Where(x => x.Tags.Any(tag => tag == id))
- .ToList();
-
- return Json(new
- {
- Questions = questions,
- stats.TotalResults
- }, JsonRequestBehavior.AllowGet);
- }
-
- public ActionResult Facets(string id)
- {
- IDictionary<string, IEnumerable<FacetValue>> facets = DocumentSession.Query
- <RecentPopularTagsMapOnly.ReduceResult, RecentPopularTagsMapOnly>()
- .Where(x => x.LastSeen > DateTime.UtcNow.AddMonths(-1).ToUtcToday())
- .ToFacets("Raven/Facets/Tags");
-
- return Json(facets, JsonRequestBehavior.AllowGet);
- }
-
- public ActionResult Search(string term)
- {
- IRavenQueryable<RecentPopularTags.ReduceResult> query = DocumentSession
- .Query<RecentPopularTags.ReduceResult, RecentPopularTags>()
- .Where(x => x.Tag == term);
-
- // Does this tag exist?
- RecentPopularTags.ReduceResult tag = query.FirstOrDefault();
-
- var results = new List<string>();
-
- if (tag != null)
- {
- results.Add(tag.Tag);
- }
- else
- {
- // No exact match .. so lets use Suggest.
- SuggestionQueryResult suggestedTags = query.Suggest();
- if (suggestedTags.Suggestions.Length > 0)
- {
- results.AddRange(suggestedTags.Suggestions);
- }
- }
-
- return Json(results, JsonRequestBehavior.AllowGet);
- }
-
- public JsonResult IndexJson(string displayName, string tag)
- {
- string header;
- var questions = QuestionQuery(tag, out header).ToList();
- return Json(questions.Count <= 0 ? null : questions);
- }
-
- private IQueryable<QuestionWithDisplayName> QuestionQuery(string tag, out string header)
- {
- header = "Top Questions";
-
- IQueryable<Question> questionsQuery = DocumentSession.Query<Question, Questions_Search>()
- .OrderByCreatedByDescending()
- .Take(20);
-
- // Filter Questions by Tags?
- if (!string.IsNullOrEmpty(tag))
- {
- header = "Tagged Questions";
- questionsQuery = questionsQuery
- .WithAnyTag(tag);
- }
-
- return questionsQuery.As<QuestionWithDisplayName>();
- }
-
- private IQueryable<RecentPopularTags.ReduceResult> RecentPopularTagsQuery()
- {
- IQueryable<RecentPopularTags.ReduceResult> recentPopularTags =
- DocumentSession.Query<RecentPopularTags.ReduceResult, RecentPopularTags>()
- .WithinTheLastMonth(1)
- .OrderByCountDescending()
- .Take(20);
-
- return recentPopularTags;
- }
-
- private IQueryable<User> UserQuery(string displayName)
- {
- string name = displayName ?? User.Identity.Name;
- return !string.IsNullOrEmpty(name) ? DocumentSession.Query<User>().WithDisplayName(name) : null;
- }
- }
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web.Mvc;
+using Raven.Abstractions.Data;
+using Raven.Client;
+using Raven.Client.Linq;
+using RavenOverflow.Core.Entities;
+using RavenOverflow.Core.Extensions;
+using RavenOverflow.Web.DependencyResolution;
+using RavenOverflow.Web.Models.ViewModels;
+using RavenOverflow.Web.RavenDb.Indexes;
+using RavenOverflow.Web.RavenDb;
+
+namespace RavenOverflow.Web.Controllers
+{
+ public class HomeController : RavenDbController
+ {
+ public HomeController(DocumentStores documentStore) : base(documentStore)
+ {
+ }
+
+ [HttpGet]
+ public ActionResult Create()
+ {
+ _documentStores.CreateSeedData();
+ return Content("Created data");
+ }
+
+ [HttpGet]
+ public ActionResult Index(string displayName, string tag)
+ {
+ string header;
+
+ // 1. All the questions, ordered by most recent.
+ IQueryable<QuestionWithDisplayName> questionsQuery = QuestionQuery(tag, out header);
+
+ // 2. Popular Tags for a time period.
+ // StackOverflow calls it 'recent tags'.
+ IQueryable<RecentPopularTags.ReduceResult> recentPopularTags = RecentPopularTagsQuery();
+
+ // 3. Log in user information.
+ IQueryable<User> userQuery = UserQuery(displayName);
+
+ var viewModel = new IndexViewModel(User.Identity)
+ {
+ Header = header,
+ QuestionListViewModel = new QuestionListViewModel
+ {
+ Questions = questionsQuery.ToList()
+ },
+ RecentPopularTags = recentPopularTags.ToDictionary(x => x.Tag, x => x.Count),
+ UserFavoriteTagListViewModel = new UserTagListViewModel
+ {
+ Header = "Favorite Tags",
+ DivId1 = "interesting-tags",
+ DivId2 = "interestingtags",
+ Tags = userQuery == null
+ ? null
+ : (userQuery.SingleOrDefault() ??
+ new User()).FavoriteTags
+ },
+ UserIgnoredTagList = new UserTagListViewModel
+ {
+ Header = "Ignored Tags",
+ DivId1 = "ignored-tags",
+ DivId2 = "ignoredtags",
+ Tags = null
+ }
+ };
+
+ return View(viewModel);
+ }
+
+ [HttpGet]
+ public ActionResult BatchedIndex(string displayName, string tag)
+ {
+ string header;
+
+ // 1. All the questions, ordered by most recent.
+ Lazy<IEnumerable<QuestionWithDisplayName>> questionsQuery = QuestionQuery(tag, out header).Lazily();
+
+ // 2. Popular Tags for a time period.
+ // StackOverflow calls it 'recent tags'.
+ Lazy<IEnumerable<RecentPopularTags.ReduceResult>> recentPopularTags = RecentPopularTagsQuery().Lazily();
+
+ // 3. Log in user information.
+ IQueryable<User> userQuery = UserQuery(displayName);
+ Lazy<IEnumerable<User>> lazyUserQuery = (userQuery != null ? userQuery.Lazily() : null);
+
+ var viewModel = new IndexViewModel(User.Identity)
+ {
+ Header = header,
+ QuestionListViewModel = new QuestionListViewModel
+ {
+ Questions = questionsQuery.Value.ToList()
+ },
+ RecentPopularTags = recentPopularTags.Value.ToDictionary(x => x.Tag, x => x.Count),
+ UserFavoriteTagListViewModel = new UserTagListViewModel
+ {
+ Header = "Favorite Tags",
+ DivId1 = "interesting-tags",
+ DivId2 = "interestingtags",
+ Tags = lazyUserQuery == null
+ ? null
+ : (lazyUserQuery.Value.
+ SingleOrDefault() ??
+ new User()).FavoriteTags
+ },
+ UserIgnoredTagList = new UserTagListViewModel
+ {
+ Header = "Ignored Tags",
+ DivId1 = "ignored-tags",
+ DivId2 = "ignoredtags",
+ Tags = null
+ }
+ };
+
+ return View("Index", viewModel);
+ }
+
+ [HttpGet]
+ public ActionResult AggressiveIndex(string displayName, string tag)
+ {
+ using (AggressivelyCacheFor(TimeSpan.FromMinutes(1)))
+ {
+ string header;
+
+ // 1. All the questions, ordered by most recent.
+ Lazy<IEnumerable<QuestionWithDisplayName>> questionsQuery = QuestionQuery(tag, out header).Lazily();
+
+ // 2. Popular Tags for a time period.
+ // StackOverflow calls it 'recent tags'.
+ Lazy<IEnumerable<RecentPopularTags.ReduceResult>> recentPopularTags = RecentPopularTagsQuery().Lazily();
+
+ // 3. Log in user information.
+ IQueryable<User> userQuery = UserQuery(displayName);
+ Lazy<IEnumerable<User>> lazyUserQuery = (userQuery != null ? userQuery.Lazily() : null);
+
+ var viewModel = new IndexViewModel(User.Identity)
+ {
+ Header = header,
+ QuestionListViewModel = new QuestionListViewModel
+ {
+ Questions = questionsQuery.Value.ToList()
+ },
+ RecentPopularTags =
+ recentPopularTags.Value.ToDictionary(x => x.Tag, x => x.Count),
+ UserFavoriteTagListViewModel = new UserTagListViewModel
+ {
+ Header = "Favorite Tags",
+ DivId1 = "interesting-tags",
+ DivId2 = "interestingtags",
+ Tags = lazyUserQuery == null
+ ? null
+ : (lazyUserQuery.Value.
+ SingleOrDefault() ??
+ new User()).FavoriteTags
+ },
+ UserIgnoredTagList = new UserTagListViewModel
+ {
+ Header = "Ignored Tags",
+ DivId1 = "ignored-tags",
+ DivId2 = "ignoredtags",
+ Tags = null
+ }
+ };
+
+ return View("Index", viewModel);
+ }
+ }
+
+ public ActionResult Tag(string id)
+ {
+ RavenQueryStatistics stats;
+ List<Question> questions = QuestionsSession.Query<Question>()
+ .Statistics(out stats)
+ .OrderByCreatedByDescending()
+ .Take(20)
+ .Where(x => x.Tags.Any(tag => tag == id))
+ .ToList();
+
+ return Json(new
+ {
+ Questions = questions,
+ stats.TotalResults
+ }, JsonRequestBehavior.AllowGet);
+ }
+
+ public ActionResult Facets(string id)
+ {
+ IDictionary<string, IEnumerable<FacetValue>> facets = QuestionsSession.Query
+ <RecentPopularTagsMapOnly.ReduceResult, RecentPopularTagsMapOnly>()
+ .Where(x => x.LastSeen > DateTime.UtcNow.AddMonths(-1).ToUtcToday())
+ .ToFacets("Raven/Facets/Tags");
+
+ return Json(facets, JsonRequestBehavior.AllowGet);
+ }
+
+ public ActionResult Search(string term)
+ {
+ IRavenQueryable<RecentPopularTags.ReduceResult> query = QuestionsSession
+ .Query<RecentPopularTags.ReduceResult, RecentPopularTags>()
+ .Where(x => x.Tag == term);
+
+ // Does this tag exist?
+ RecentPopularTags.ReduceResult tag = query.FirstOrDefault();
+
+ var results = new List<string>();
+
+ if (tag != null)
+ {
+ results.Add(tag.Tag);
+ }
+ else
+ {
+ // No exact match .. so lets use Suggest.
+ SuggestionQueryResult suggestedTags = query.Suggest();
+ if (suggestedTags.Suggestions.Length > 0)
+ {
+ results.AddRange(suggestedTags.Suggestions);
+ }
+ }
+
+ return Json(results, JsonRequestBehavior.AllowGet);
+ }
+
+ public JsonResult IndexJson(string displayName, string tag)
+ {
+ string header;
+ var questions = QuestionQuery(tag, out header).ToList();
+ return Json(questions.Count <= 0 ? null : questions);
+ }
+
+ private IQueryable<QuestionWithDisplayName> QuestionQuery(string tag, out string header)
+ {
+ header = "Top Questions";
+
+ IQueryable<Question> questionsQuery = QuestionsSession.Query<Question, Questions_Search>()
+ .OrderByCreatedByDescending()
+ .Take(20);
+
+ // Filter Questions by Tags?
+ if (!string.IsNullOrEmpty(tag))
+ {
+ header = "Tagged Questions";
+ questionsQuery = questionsQuery
+ .WithAnyTag(tag);
+ }
+
+ return questionsQuery.As<QuestionWithDisplayName>();
+ }
+
+ private IQueryable<RecentPopularTags.ReduceResult> RecentPopularTagsQuery()
+ {
+ IQueryable<RecentPopularTags.ReduceResult> recentPopularTags =
+ QuestionsSession.Query<RecentPopularTags.ReduceResult, RecentPopularTags>()
+ .WithinTheLastMonth(1)
+ .OrderByCountDescending()
+ .Take(20);
+
+ return recentPopularTags;
+ }
+
+ private IQueryable<User> UserQuery(string displayName)
+ {
+ string name = displayName ?? User.Identity.Name;
+ return !string.IsNullOrEmpty(name) ? UsersSession.Query<User>().WithDisplayName(name) : null;
+ }
+ }
}
View
79 Code/RavenOverflow.Web/Controllers/RavenDbController.cs
@@ -1,23 +1,58 @@
-using CuttingEdge.Conditions;
-using Raven.Client;
-
-namespace RavenOverflow.Web.Controllers
-{
- public abstract class RavenDbController : BaseController
- {
- private readonly IDocumentStore _documentStore;
- private IDocumentSession _documentSession;
-
- protected RavenDbController(IDocumentStore documentStore)
- {
- Condition.Requires(documentStore).IsNotNull();
-
- _documentStore = documentStore;
- }
-
- public IDocumentSession DocumentSession
- {
- get { return _documentSession ?? (_documentSession = _documentStore.OpenSession()); }
- }
- }
+using System;
+using CuttingEdge.Conditions;
+using Raven.Abstractions.Extensions;
+using Raven.Client;
+using RavenOverflow.Web.DependencyResolution;
+
+namespace RavenOverflow.Web.Controllers
+{
+ public abstract class RavenDbController : BaseController
+ {
+ protected readonly DocumentStores _documentStores;
+ private IDocumentSession _usersSession, _questionsSession;
+
+ protected RavenDbController(DocumentStores documentStore)
+ {
+ Condition.Requires(documentStore).IsNotNull();
+
+ _documentStores = documentStore;
+ }
+
+ public IDocumentSession UsersSession
+ {
+ get { return _usersSession ?? (_usersSession = _documentStores.Users.OpenSession()); }
+ }
+
+ public IDocumentSession QuestionsSession
+ {
+ get { return _questionsSession ?? (_questionsSession = _documentStores.Questions.OpenSession()); }
+ }
+
+ public IDisposable AggressivelyCacheFor(TimeSpan cacheDuration)
+ {
+ var q = _documentStores.Questions.AggressivelyCacheFor(cacheDuration);
+ var u = _documentStores.Users.AggressivelyCacheFor(cacheDuration);
+
+ return new DisposableAction(() =>
+ {
+ q.Dispose();
+ u.Dispose();
+ });
+ }
+
+ protected override void OnActionExecuted(System.Web.Mvc.ActionExecutedContext filterContext)
+ {
+ using(_usersSession)
+ {
+ if(_usersSession!= null && filterContext.Exception == null)
+ _usersSession.SaveChanges();
+ }
+
+ using (_questionsSession)
+ {
+ if (_questionsSession != null && filterContext.Exception == null)
+ _questionsSession.SaveChanges();
+ }
+ }
+ }
}
View
3  Code/RavenOverflow.Web/DependencyResolution/IoC.cs
@@ -9,8 +9,7 @@ public static IContainer Initialize()
{
ObjectFactory.Initialize(x =>
{
- x.AddRegistry(
- new RavenDbRegistry(ConfigurationManager.ConnectionStrings[0].Name));
+ x.AddRegistry(new RavenDbRegistry());
x.AddRegistry(
new AuthenticationRegistry(
ConfigurationManager.AppSettings["FacebookAppId"],
View
98 Code/RavenOverflow.Web/DependencyResolution/RavenDbRegistry.cs
@@ -1,34 +1,66 @@
-using Raven.Client;
-using Raven.Client.Document;
-using Raven.Client.MvcIntegration;
-using RavenOverflow.Web.RavenDb;
-using RavenOverflow.Web.RavenDb.Indexes;
-using StructureMap.Configuration.DSL;
-
-namespace RavenOverflow.Web.DependencyResolution
-{
- public class RavenDbRegistry : Registry
- {
- public RavenDbRegistry(string connectionStringName)
- {
- For<IDocumentStore>()
- .Singleton()
- .Use(x =>
- {
- var documentStore = new DocumentStore {ConnectionStringName = connectionStringName};
- documentStore.InitializeWithDefaults();
-
- // Create any Facets.
- RavenFacetTags.CreateFacets(documentStore);
-
- // Wire up the RavenDb profiler.
- // This is -very- MVC specific, of course. You wouldn't find this in the Tests.
- RavenProfiler.InitializeFor(documentStore);
-
- return documentStore;
- }
- )
- .Named("RavenDB Document Store.");
- }
- }
+using System.Collections.Generic;
+using System.Text;
+using System.Web;
+using Raven.Client;
+using Raven.Client.Connection;
+using Raven.Client.Document;
+using Raven.Client.MvcIntegration;
+using Raven.Client.Shard;
+using RavenOverflow.Web.RavenDb;
+using RavenOverflow.Web.RavenDb.Indexes;
+using StructureMap.Configuration.DSL;
+
+namespace RavenOverflow.Web.DependencyResolution
+{
+ public class RavenDbRegistry : Registry
+ {
+ public RavenDbRegistry()
+ {
+ For<DocumentStores>()
+ .Singleton()
+ .Use(x =>
+ {
+ var shards = new Dictionary<string, IDocumentStore>
+ {
+ {"01", new DocumentStore{Url = "http://localhost:8079", DefaultDatabase = "Questions"}},
+ {"02", new DocumentStore{Url = "http://localhost:8078", DefaultDatabase = "Questions"}},
+ {"03", new DocumentStore{Url = "http://localhost:8077", DefaultDatabase = "Questions"}},
+ {"04", new DocumentStore{Url = "http://localhost:8076", DefaultDatabase = "Questions"}},
+ };
+
+ var shardStrategy = new ShardStrategy(shards);
+ shardStrategy.ShardAccessStrategy.OnError += (commands, request, exception) =>
+ {
+ if(HttpContext.Current.Items["raven-query-error"] == null)
+ HttpContext.Current.Items["raven-query-error"] = new HashSet<string>();
+
+
+ var msgs = ((HashSet<string>)HttpContext.Current.Items["raven-query-error"]);
+ msgs.Add(exception.Message + " " + ((ServerClient) commands).Url);
+
+ return request.Query != null;
+ };
+
+ var documentStores = new DocumentStores
+ {
+ Users = new DocumentStore
+ {
+ Url = "http://localhost:8079", DefaultDatabase = "Users"
+ }.Initialize(),
+ Questions = new ShardedDocumentStore(shardStrategy).Initialize()
+ };
+
+
+ return documentStores;
+ }
+ )
+ .Named("RavenDB Document Store.");
+ }
+ }
+
+ public class DocumentStores
+ {
+ public IDocumentStore Questions { get; set; }
+ public IDocumentStore Users { get; set; }
+ }
}
View
7 Code/RavenOverflow.Web/DependencyResolution/ServiceRegistry.cs
@@ -5,11 +5,6 @@
namespace RavenOverflow.Web.DependencyResolution
{
public class ServiceRegistry : Registry
- {
- public ServiceRegistry()
- {
- For<IQuestionService>().Use<QuestionService>()
- .Named("Custom Forms Authentication instance.");
- }
+ {
}
}
View
101 Code/RavenOverflow.Web/RavenDb/DocumentStoreExtensions.cs
@@ -1,101 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel.Composition.Hosting;
-using System.Diagnostics;
-using System.Linq;
-using System.Text;
-using System.Threading;
-using CuttingEdge.Conditions;
-using Raven.Abstractions.Data;
-using Raven.Client;
-using Raven.Client.Indexes;
-using RavenOverflow.Web.RavenDb.Indexes;
-
-namespace RavenOverflow.Web.RavenDb
-{
- public static class DocumentStoreExtensions
- {
- public static void InitializeWithDefaults(this IDocumentStore documentStore)
- {
- documentStore.InitializeWithDefaults(true, null);
- }
-
- public static void InitializeWithDefaults(this IDocumentStore documentStore, bool isDataToBeSeeded,
- IList<Type> indexesToExecute)
- {
- Condition.Requires(documentStore).IsNotNull();
-
- // Default initializtion;
- documentStore.Initialize();
-
- // Index initialisation.
- if (indexesToExecute != null)
- {
- Type[] indexes = (from type in indexesToExecute
- where type.IsSubclassOf(typeof (AbstractIndexCreationTask))
- select type).ToArray();
-
- IndexCreation.CreateIndexes(new CompositionContainer(new TypeCatalog(indexes)), documentStore);
- }
- else
- {
- IndexCreation.CreateIndexes(typeof (RecentPopularTags).Assembly, documentStore);
- }
-
- // Create our Seed Data (if required).
- // NOTE: This would be handled differently if it was a -real- production system.
- // Like, wrapping this called in a #if RELEASE #endif, for example.
- if (isDataToBeSeeded)
- {
- HelperUtilities.CreateSeedData(documentStore);
- }
-
- // Now lets check to make sure there are now errors.
- documentStore.AssertDocumentStoreErrors();
- }
-
- public static void AssertDocumentStoreErrors(this IDocumentStore documentStore)
- {
- if (documentStore == null)
- {
- throw new ArgumentNullException("documentStore");
- }
-
- ServerError[] errors = documentStore.DatabaseCommands.GetStatistics().Errors;
- if (errors == null || errors.Length <= 0)
- {
- return;
- }
-
- // We have some Errors. NOT. GOOD. :(
- var errorMessages = new StringBuilder();
- foreach (ServerError serverError in errors)
- {
- string errorMessage = string.Format("Document: {0}; Index: {1}; Error: {2}",
- string.IsNullOrEmpty(serverError.Document)
- ? "No Document Id"
- : serverError.Document,
- string.IsNullOrEmpty(serverError.Index)
- ? "No Index"
- : serverError.Index,
- string.IsNullOrEmpty(serverError.Error)
- ? "No Error message .. err??"
- : serverError.Error);
-
-
- Debug.WriteLine(errorMessage);
- errorMessages.AppendLine(errorMessage);
- }
-
- throw new InvalidOperationException("DocumentStore has some errors. Dast is nict gut.");
- }
-
- public static void WaitForStaleIndexesToComplete(this IDocumentStore documentStore)
- {
- while (documentStore.DatabaseCommands.GetStatistics().StaleIndexes.Length != 0)
- {
- Thread.Sleep(50);
- }
- }
- }
-}
View
112 Code/RavenOverflow.Web/RavenDb/HelperUtilities.cs
@@ -1,50 +1,64 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using CuttingEdge.Conditions;
-using Raven.Client;
-using RavenOverflow.Core.Entities;
-using RavenOverflow.FakeData;
-
-namespace RavenOverflow.Web.RavenDb
-{
- public static class HelperUtilities
- {
- public static void CreateSeedData(IDocumentStore documentStore)
- {
- Condition.Requires(documentStore).IsNotNull();
-
- using (IDocumentSession documentSession = documentStore.OpenSession())
- {
- // Users.
- ICollection<User> users = FakeUsers.CreateFakeUsers(50);
- StoreFakeEntities(users, documentSession);
-
- // Questions.
- ICollection<Question> questions = FakeQuestions.CreateFakeQuestions(users.Select(x => x.Id).ToList());
- StoreFakeEntities(questions, documentSession);
-
- documentSession.SaveChanges();
-
- // Make sure all our indexes are not stale.
- documentStore.WaitForStaleIndexesToComplete();
- }
- }
-
- public static void StoreFakeEntities(IEnumerable<RootAggregate> entities, IDocumentSession session)
- {
- // Dont' use Condition.Requires for entities becuase it might enumerate through it.
- if (entities == null)
- {
- throw new ArgumentNullException("entities");
- }
-
- Condition.Requires(session).IsNotNull();
-
- foreach (RootAggregate entity in entities)
- {
- session.Store(entity);
- }
- }
- }
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using CuttingEdge.Conditions;
+using Raven.Client;
+using RavenOverflow.Core.Entities;
+using RavenOverflow.FakeData;
+using RavenOverflow.Web.DependencyResolution;
+using RavenOverflow.Web.RavenDb.Indexes;
+
+namespace RavenOverflow.Web.RavenDb
+{
+ public static class HelperUtilities
+ {
+ public static void CreateSeedData(this DocumentStores documentStores)
+ {
+ Condition.Requires(documentStores).IsNotNull();
+
+ RavenFacetTags.CreateFacets(documentStores.Questions);
+
+ new RecentPopularTags().Execute(documentStores.Questions);
+ new RecentPopularTagsMapOnly().Execute(documentStores.Questions);
+ new Questions_Search().Execute(documentStores.Questions);
+
+ ICollection<User> users = FakeUsers.CreateFakeUsers(50);
+
+ using (IDocumentSession documentSession = documentStores.Users.OpenSession())
+ {
+ // Users.
+ StoreFakeEntities(users, documentSession);
+
+
+ documentSession.SaveChanges();
+ }
+
+ using (IDocumentSession documentSession = documentStores.Questions.OpenSession())
+ {
+ // Questions.
+ ICollection<Question> questions = FakeQuestions.CreateFakeQuestions(users.Select(x => x.Id).ToList());
+ StoreFakeEntities(questions, documentSession);
+
+ documentSession.SaveChanges();
+ }
+
+
+ }
+
+ public static void StoreFakeEntities(IEnumerable<RootAggregate> entities, IDocumentSession session)
+ {
+ // Dont' use Condition.Requires for entities becuase it might enumerate through it.
+ if (entities == null)
+ {
+ throw new ArgumentNullException("entities");
+ }
+
+ Condition.Requires(session).IsNotNull();
+
+ foreach (RootAggregate entity in entities)
+ {
+ session.Store(entity);
+ }
+ }
+ }
}
View
516 Code/RavenOverflow.Web/RavenOverflow.Web.csproj
@@ -1,254 +1,274 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>
- </ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{44F86C85-B711-4CF5-A161-862EE6E5D160}</ProjectGuid>
- <ProjectTypeGuids>{E53F8FEA-EAE0-44A6-8774-FFD645390401};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
- <OutputType>Library</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>RavenOverflow.Web</RootNamespace>
- <AssemblyName>RavenOverflow.Web</AssemblyName>
- <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
- <MvcBuildViews>false</MvcBuildViews>
- <UseIISExpress>true</UseIISExpress>
- <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\..\RavenOverflow\</SolutionDir>
- <RestorePackages>true</RestorePackages>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>bin\</OutputPath>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
- <OutputPath>bin\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="AutoMapper, Version=2.1.266.0, Culture=neutral, PublicKeyToken=be96cd2c38ef1005, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\packages\AutoMapper.2.1.266\lib\net40\AutoMapper.dll</HintPath>
- </Reference>
- <Reference Include="CuttingEdge.Conditions, Version=1.2.0.11174, Culture=neutral, PublicKeyToken=984cb50dea722e99, processorArchitecture=MSIL">
- <HintPath>..\..\packages\CuttingEdge.Conditions.1.2.0.0\lib\NET35\CuttingEdge.Conditions.dll</HintPath>
- </Reference>
- <Reference Include="Facebook, Version=5.4.1.0, Culture=neutral, PublicKeyToken=58cb4f2111d1e6de, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\packages\Facebook.5.4.1.0\lib\net40-client\Facebook.dll</HintPath>
- </Reference>
- <Reference Include="Facebook.Web, Version=5.4.1.0, Culture=neutral, PublicKeyToken=58cb4f2111d1e6de, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\packages\FacebookWeb.5.4.1.0\lib\net40\Facebook.Web.dll</HintPath>
- </Reference>
- <Reference Include="Raven.Abstractions, Version=1.0.0.0, Culture=neutral, PublicKeyToken=37f41c7f99471593, processorArchitecture=MSIL">
- <HintPath>..\..\packages\RavenDB.Client.1.0.888\lib\net40\Raven.Abstractions.dll</HintPath>
- </Reference>
- <Reference Include="Raven.Client.Lightweight, Version=1.0.0.0, Culture=neutral, PublicKeyToken=37f41c7f99471593, processorArchitecture=MSIL">
- <HintPath>..\..\packages\RavenDB.Client.1.0.888\lib\net40\Raven.Client.Lightweight.dll</HintPath>
- </Reference>
- <Reference Include="Raven.Client.MvcIntegration, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
- <HintPath>..\..\packages\RavenDB.Client.MvcIntegration.1.0.888\lib\net40\Raven.Client.MvcIntegration.dll</HintPath>
- </Reference>
- <Reference Include="RouteDebugger">
- <HintPath>..\..\packages\routedebugger.2.1.2\lib\net40\RouteDebugger.dll</HintPath>
- </Reference>
- <Reference Include="StructureMap">
- <HintPath>..\..\packages\structuremap.2.6.3\lib\StructureMap.dll</HintPath>
- </Reference>
- <Reference Include="System.ComponentModel.Composition" />
- <Reference Include="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
- <Reference Include="System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
- <Reference Include="Microsoft.CSharp" />
- <Reference Include="System" />
- <Reference Include="System.ComponentModel.DataAnnotations" />
- <Reference Include="System.Core" />
- <Reference Include="System.Web" />
- <Reference Include="System.Web.Abstractions" />
- <Reference Include="System.Web.Routing" />
- <Reference Include="System.Configuration" />
- <Reference Include="WebActivator, Version=1.5.0.0, Culture=neutral, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\packages\WebActivator.1.5\lib\net40\WebActivator.dll</HintPath>
- </Reference>
- </ItemGroup>
- <ItemGroup>
- <Compile Include="App_Start\MagicalUnicornCustomErrorHandling.cs" />
- <Compile Include="App_Start\StructuremapMvc.cs" />
- <Compile Include="Areas\Question\Controllers\QuestionsController.cs" />
- <Compile Include="Areas\Question\Models\ViewModels\CreateInputModel.cs" />
- <Compile Include="Areas\Question\Models\ViewModels\CreateViewModel.cs" />
- <Compile Include="Areas\Question\QuestionAreaRegistration.cs" />
- <Compile Include="Areas\User\Controllers\UsersController.cs" />
- <Compile Include="Areas\User\UserAreaRegistration.cs" />
- <Compile Include="Controllers\BaseController.cs" />
- <Compile Include="Controllers\ErrorController.cs" />
- <Compile Include="DependencyResolution\IoC.cs" />
- <Compile Include="RavenDb\HelperUtilities.cs" />
- <Compile Include="RavenDb\Indexes\Questions_Search.cs" />
- <Compile Include="AutoMapper\TagsResolver.cs" />
- <Compile Include="DependencyResolution\AuthenticationRegistry.cs" />
- <Compile Include="RavenDb\Indexes\RavenFacetTags.cs" />
- <Compile Include="Models\Authentication\IOAuthAuthentication.cs" />
- <Compile Include="Models\Authentication\OAuthAuthentication.cs" />
- <Compile Include="AutoMapper\AutoMapperBootstrapper.cs" />
- <Compile Include="DependencyResolution\ServiceRegistry.cs" />
- <Compile Include="RavenDb\DocumentStoreExtensions.cs" />
- <Compile Include="Models\ViewModels\QuestionListViewModel.cs" />
- <Compile Include="Models\ViewModels\QuestionWithDisplayName.cs" />
- <Compile Include="Models\ViewModels\TagListViewModel.cs" />
- <Compile Include="Models\ViewModels\UserTagListViewModel.cs" />
- <Compile Include="Models\_LayoutViewModel.cs" />
- <Compile Include="Controllers\RavenDbController.cs" />
- <Compile Include="Controllers\HomeController.cs" />
- <Compile Include="DependencyResolution\RavenDbRegistry.cs" />
- <Compile Include="DependencyResolution\SmDependencyResolver.cs" />
- <Compile Include="Global.asax.cs">
- <DependentUpon>Global.asax</DependentUpon>
- </Compile>
- <Compile Include="RavenDb\Indexes\RecentPopularTagsMapOnly.cs" />
- <Compile Include="RavenDb\Indexes\RecentPopularTags.cs" />
- <Compile Include="Models\Authentication\CustomFormsAuthentication.cs" />
- <Compile Include="Models\Authentication\CustomIdentity.cs" />
- <Compile Include="Models\Authentication\CustomPrincipal.cs" />
- <Compile Include="Models\Authentication\ICustomFormsAuthentication.cs" />
- <Compile Include="Models\Authentication\ICustomIdentity.cs" />
- <Compile Include="Models\Authentication\UserData.cs" />
- <Compile Include="Models\HtmlExtensions.cs" />
- <Compile Include="Models\_MainNavigationViewModel.cs" />
- <Compile Include="Properties\AssemblyInfo.cs" />
- <Compile Include="Models\ViewModels\AuthenticationViewModel.cs" />
- </ItemGroup>
- <ItemGroup>
- <Content Include="Content\Images\Error\NotFound.jpg" />
- <Content Include="Content\Images\Error\ServerError.jpg" />
- <Content Include="Content\logo-ravendb.png" />
- <Content Include="Global.asax" />
- <Content Include="Content\Site.css" />
- <Content Include="Web.config" />
- <Content Include="Web.Debug.config">
- <DependentUpon>Web.config</DependentUpon>
- </Content>
- <Content Include="Web.Release.config">
- <DependentUpon>Web.config</DependentUpon>
- </Content>
- <Content Include="Views\Web.config" />
- <Content Include="Views\_ViewStart.cshtml" />
- <Content Include="Views\Shared\Error.cshtml" />
- <Content Include="Views\Shared\_Layout.cshtml" />
- </ItemGroup>
- <ItemGroup>
- <Folder Include="Areas\Question\Views\Shared\" />
- <Folder Include="Areas\User\Models\" />
- <Folder Include="Areas\User\Views\Shared\" />
- <Folder Include="Scripts\" />
- </ItemGroup>
- <ItemGroup>
- <Content Include="packages.config" />
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\RavenOverflow.Core\RavenOverflow.Core.csproj">
- <Project>{58D8E77E-68D3-4623-A558-84B731E7725F}</Project>
- <Name>RavenOverflow.Core</Name>
- </ProjectReference>
- <ProjectReference Include="..\RavenOverflow.FakeData\RavenOverflow.FakeData.csproj">
- <Project>{71DACF07-CC2C-4AD3-BF61-FF953DE917FF}</Project>
- <Name>RavenOverflow.FakeData</Name>
- </ProjectReference>
- <ProjectReference Include="..\RavenOverflow.Services\RavenOverflow.Services.csproj">
- <Project>{A1F07927-5943-44D6-9FD4-FF36AE6C25DC}</Project>
- <Name>RavenOverflow.Services</Name>
- </ProjectReference>
- </ItemGroup>
- <ItemGroup>
- <Content Include="Views\Shared\_Authentication.cshtml" />
- </ItemGroup>
- <ItemGroup>
- <Content Include="Views\Home\Index.cshtml" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="Models\ViewModels\IndexViewModel.cs" />
- </ItemGroup>
- <ItemGroup>
- <Content Include="Views\Shared\_QuestionList.cshtml" />
- </ItemGroup>
- <ItemGroup>
- <Content Include="Views\Shared\_TagList.cshtml" />
- </ItemGroup>
- <ItemGroup>
- <Content Include="Views\Shared\_MainNavigation.cshtml" />
- </ItemGroup>
- <ItemGroup>
- <Content Include="Views\Shared\_TagSearch.cshtml" />
- </ItemGroup>
- <ItemGroup>
- <Content Include="Areas\User\Views\Web.config" />
- </ItemGroup>
- <ItemGroup>
- <Content Include="Areas\User\Views\Users\Authenticate.cshtml" />
- </ItemGroup>
- <ItemGroup>
- <Content Include="Views\Shared\_TagListVertical.cshtml" />
- </ItemGroup>
- <ItemGroup>
- <Content Include="Views\Shared\_UserTagList.cshtml" />
- </ItemGroup>
- <ItemGroup>
- <Content Include="Views\Shared\_QuestionTagList.cshtml" />
- </ItemGroup>
- <ItemGroup>
- <Content Include="Areas\Question\Views\Web.config" />
- </ItemGroup>
- <ItemGroup>
- <Content Include="Areas\Question\Views\Questions\Create.cshtml" />
- </ItemGroup>
- <ItemGroup>
- <Content Include="Views\Error\ServerError.cshtml" />
- </ItemGroup>
- <ItemGroup>
- <Content Include="Views\Error\NotFound.cshtml" />
- </ItemGroup>
- <ItemGroup>
- <Content Include="Views\Shared\_ErrorLayout.cshtml" />
- </ItemGroup>
- <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
- <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>
+ </ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{44F86C85-B711-4CF5-A161-862EE6E5D160}</ProjectGuid>
+ <ProjectTypeGuids>{E53F8FEA-EAE0-44A6-8774-FFD645390401};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>RavenOverflow.Web</RootNamespace>
+ <AssemblyName>RavenOverflow.Web</AssemblyName>
+ <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+ <MvcBuildViews>false</MvcBuildViews>
+ <UseIISExpress>true</UseIISExpress>
+ <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\..\RavenOverflow\</SolutionDir>
+ <RestorePackages>true</RestorePackages>
+ <FileUpgradeFlags>
+ </FileUpgradeFlags>
+ <UpgradeBackupLocation>
+ </UpgradeBackupLocation>
+ <OldToolsVersion>4.0</OldToolsVersion>
+ <IISExpressSSLPort />
+ <IISExpressAnonymousAuthentication />
+ <IISExpressWindowsAuthentication />
+ <IISExpressUseClassicPipelineMode />
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="AutoMapper, Version=2.1.266.0, Culture=neutral, PublicKeyToken=be96cd2c38ef1005, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\..\packages\AutoMapper.2.1.266\lib\net40\AutoMapper.dll</HintPath>
+ </Reference>
+ <Reference Include="CuttingEdge.Conditions, Version=1.2.0.11174, Culture=neutral, PublicKeyToken=984cb50dea722e99, processorArchitecture=MSIL">
+ <HintPath>..\..\packages\CuttingEdge.Conditions.1.2.0.0\lib\NET35\CuttingEdge.Conditions.dll</HintPath>
+ </Reference>
+ <Reference Include="Facebook, Version=5.4.1.0, Culture=neutral, PublicKeyToken=58cb4f2111d1e6de, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\..\packages\Facebook.5.4.1.0\lib\net40-client\Facebook.dll</HintPath>
+ </Reference>
+ <Reference Include="Facebook.Web, Version=5.4.1.0, Culture=neutral, PublicKeyToken=58cb4f2111d1e6de, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\..\packages\FacebookWeb.5.4.1.0\lib\net40\Facebook.Web.dll</HintPath>
+ </Reference>
+ <Reference Include="NLog">
+ <HintPath>..\..\packages\NLog.2.0.0.2000\lib\net40\NLog.dll</HintPath>
+ </Reference>
+ <Reference Include="Raven.Abstractions, Version=1.0.0.0, Culture=neutral, PublicKeyToken=37f41c7f99471593, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\..\packages\RavenDB.Client.1.0.931-Unstable\lib\net40\Raven.Abstractions.dll</HintPath>
+ </Reference>
+ <Reference Include="Raven.Client.Lightweight, Version=1.0.0.0, Culture=neutral, PublicKeyToken=37f41c7f99471593, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\..\packages\RavenDB.Client.1.0.931-Unstable\lib\net40\Raven.Client.Lightweight.dll</HintPath>
+ </Reference>
+ <Reference Include="Raven.Client.MvcIntegration, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\..\packages\RavenDB.Client.MvcIntegration.1.0.931-Unstable\lib\net40\Raven.Client.MvcIntegration.dll</HintPath>
+ </Reference>
+ <Reference Include="RouteDebugger">
+ <HintPath>..\..\packages\routedebugger.2.1.2\lib\net40\RouteDebugger.dll</HintPath>
+ </Reference>
+ <Reference Include="StructureMap">
+ <HintPath>..\..\packages\structuremap.2.6.3\lib\StructureMap.dll</HintPath>
+ </Reference>
+ <Reference Include="System.ComponentModel.Composition" />
+ <Reference Include="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
+ <Reference Include="System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
+ <Reference Include="Microsoft.CSharp" />
+ <Reference Include="System" />
+ <Reference Include="System.ComponentModel.DataAnnotations" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Web" />
+ <Reference Include="System.Web.Abstractions" />
+ <Reference Include="System.Web.Routing" />
+ <Reference Include="System.Configuration" />
+ <Reference Include="WebActivator, Version=1.5.0.0, Culture=neutral, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\..\packages\WebActivator.1.5\lib\net40\WebActivator.dll</HintPath>
+ </Reference>
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="App_Start\MagicalUnicornCustomErrorHandling.cs" />
+ <Compile Include="App_Start\StructuremapMvc.cs" />
+ <Compile Include="Areas\Question\Controllers\QuestionsController.cs" />
+ <Compile Include="Areas\Question\Models\ViewModels\CreateInputModel.cs" />
+ <Compile Include="Areas\Question\Models\ViewModels\CreateViewModel.cs" />
+ <Compile Include="Areas\Question\QuestionAreaRegistration.cs" />
+ <Compile Include="Areas\User\Controllers\UsersController.cs" />
+ <Compile Include="Areas\User\UserAreaRegistration.cs" />
+ <Compile Include="Controllers\BaseController.cs" />
+ <Compile Include="Controllers\ErrorController.cs" />
+ <Compile Include="DependencyResolution\IoC.cs" />
+ <Compile Include="RavenDb\HelperUtilities.cs" />
+ <Compile Include="RavenDb\Indexes\Questions_Search.cs" />
+ <Compile Include="AutoMapper\TagsResolver.cs" />
+ <Compile Include="DependencyResolution\AuthenticationRegistry.cs" />
+ <Compile Include="RavenDb\Indexes\RavenFacetTags.cs" />
+ <Compile Include="Models\Authentication\IOAuthAuthentication.cs" />
+ <Compile Include="Models\Authentication\OAuthAuthentication.cs" />
+ <Compile Include="AutoMapper\AutoMapperBootstrapper.cs" />
+ <Compile Include="DependencyResolution\ServiceRegistry.cs" />
+ <Compile Include="Models\ViewModels\QuestionListViewModel.cs" />
+ <Compile Include="Models\ViewModels\QuestionWithDisplayName.cs" />
+ <Compile Include="Models\ViewModels\TagListViewModel.cs" />
+ <Compile Include="Models\ViewModels\UserTagListViewModel.cs" />
+ <Compile Include="Models\_LayoutViewModel.cs" />
+ <Compile Include="Controllers\RavenDbController.cs" />
+ <Compile Include="Controllers\HomeController.cs" />
+ <Compile Include="DependencyResolution\RavenDbRegistry.cs" />
+ <Compile Include="DependencyResolution\SmDependencyResolver.cs" />
+ <Compile Include="Global.asax.cs">
+ <DependentUpon>Global.asax</DependentUpon>
+ </Compile>
+ <Compile Include="RavenDb\Indexes\RecentPopularTagsMapOnly.cs" />
+ <Compile Include="RavenDb\Indexes\RecentPopularTags.cs" />
+ <Compile Include="Models\Authentication\CustomFormsAuthentication.cs" />
+ <Compile Include="Models\Authentication\CustomIdentity.cs" />
+ <Compile Include="Models\Authentication\CustomPrincipal.cs" />
+ <Compile Include="Models\Authentication\ICustomFormsAuthentication.cs" />
+ <Compile Include="Models\Authentication\ICustomIdentity.cs" />
+ <Compile Include="Models\Authentication\UserData.cs" />
+ <Compile Include="Models\HtmlExtensions.cs" />
+ <Compile Include="Models\_MainNavigationViewModel.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="Models\ViewModels\AuthenticationViewModel.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <Content Include="Content\Images\Error\NotFound.jpg" />
+ <Content Include="Content\Images\Error\ServerError.jpg" />
+ <Content Include="Content\logo-ravendb.png" />
+ <Content Include="Global.asax" />
+ <Content Include="Content\Site.css" />
+ <Content Include="Web.config" />
+ <Content Include="Web.Debug.config">
+ <DependentUpon>Web.config</DependentUpon>
+ </Content>
+ <Content Include="Web.Release.config">
+ <DependentUpon>Web.config</DependentUpon>
+ </Content>
+ <Content Include="Views\Web.config" />
+ <Content Include="Views\_ViewStart.cshtml" />
+ <Content Include="Views\Shared\Error.cshtml" />
+ <Content Include="Views\Shared\_Layout.cshtml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Folder Include="Areas\Question\Views\Shared\" />
+ <Folder Include="Areas\User\Models\" />
+ <Folder Include="Areas\User\Views\Shared\" />
+ <Folder Include="Scripts\" />
+ </ItemGroup>
+ <ItemGroup>
+ <Content Include="packages.config" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\RavenOverflow.Core\RavenOverflow.Core.csproj">
+ <Project>{58D8E77E-68D3-4623-A558-84B731E7725F}</Project>
+ <Name>RavenOverflow.Core</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\RavenOverflow.FakeData\RavenOverflow.FakeData.csproj">
+ <Project>{71DACF07-CC2C-4AD3-BF61-FF953DE917FF}</Project>
+ <Name>RavenOverflow.FakeData</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\RavenOverflow.Services\RavenOverflow.Services.csproj">
+ <Project>{A1F07927-5943-44D6-9FD4-FF36AE6C25DC}</Project>
+ <Name>RavenOverflow.Services</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <Content Include="Views\Shared\_Authentication.cshtml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Content Include="Views\Home\Index.cshtml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="Models\ViewModels\IndexViewModel.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <Content Include="Views\Shared\_QuestionList.cshtml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Content Include="Views\Shared\_TagList.cshtml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Content Include="Views\Shared\_MainNavigation.cshtml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Content Include="Views\Shared\_TagSearch.cshtml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Content Include="Areas\User\Views\Web.config" />
+ </ItemGroup>
+ <ItemGroup>
+ <Content Include="Areas\User\Views\Users\Authenticate.cshtml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Content Include="Views\Shared\_TagListVertical.cshtml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Content Include="Views\Shared\_UserTagList.cshtml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Content Include="Views\Shared\_QuestionTagList.cshtml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Content Include="Areas\Question\Views\Web.config" />
+ </ItemGroup>
+ <ItemGroup>
+ <Content Include="Areas\Question\Views\Questions\Create.cshtml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Content Include="Views\Error\ServerError.cshtml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Content Include="Views\Error\NotFound.cshtml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Content Include="Views\Shared\_ErrorLayout.cshtml" />
+ </ItemGroup>
+ <PropertyGroup>
+ <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
+ <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
+ </PropertyGroup>
+ <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+ <Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
+ <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
- </Target> -->
- <Target Name="MvcBuildViews" AfterTargets="AfterBuild" Condition="'$(MvcBuildViews)'=='true'">
- <AspNetCompiler VirtualPath="temp" PhysicalPath="$(WebProjectOutputDir)" />
- </Target>
- <ProjectExtensions>
- <VisualStudio>
- <FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
- <WebProjectProperties>
- <UseIIS>True</UseIIS>
- <AutoAssignPort>True</AutoAssignPort>
- <DevelopmentServerPort>52263</DevelopmentServerPort>
- <DevelopmentServerVPath>/</DevelopmentServerVPath>
- <IISUrl>http://localhost:52263/</IISUrl>
- <NTLMAuthentication>False</NTLMAuthentication>
- <UseCustomServer>False</UseCustomServer>
- <CustomServerUrl>
- </CustomServerUrl>
- <SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
- </WebProjectProperties>
- </FlavorProperties>
- </VisualStudio>
- </ProjectExtensions>
- <Import Project="$(SolutionDir)\.nuget\nuget.targets" />
+ </Target> -->
+ <Target Name="MvcBuildViews" AfterTargets="AfterBuild" Condition="'$(MvcBuildViews)'=='true'">
+ <AspNetCompiler VirtualPath="temp" PhysicalPath="$(WebProjectOutputDir)" />
+ </Target>
+ <ProjectExtensions>
+ <VisualStudio>
+ <FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
+ <WebProjectProperties>
+ <UseIIS>True</UseIIS>
+ <AutoAssignPort>True</AutoAssignPort>
+ <DevelopmentServerPort>52263</DevelopmentServerPort>
+ <DevelopmentServerVPath>/</DevelopmentServerVPath>
+ <IISUrl>http://localhost:52263/</IISUrl>
+ <NTLMAuthentication>False</NTLMAuthentication>
+ <UseCustomServer>False</UseCustomServer>
+ <CustomServerUrl>
+ </CustomServerUrl>
+ <SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
+ </WebProjectProperties>
+ </FlavorProperties>
+ </VisualStudio>
+ </ProjectExtensions>
+ <Import Project="$(SolutionDir)\.nuget\nuget.targets" />
</Project>
View
17 Code/RavenOverflow.Web/Views/Shared/_Layout.cshtml
@@ -17,11 +17,22 @@
<body class="home-page">
@Raven.Client.MvcIntegration.RavenProfiler.CurrentRequestSessions();
-
- <noscript><div id="noscript-padding"></div></noscript>
+
+ <noscript><div id="noscript-padding"></div></noscript>
@Html.Partial("_MainNavigation", new _MainNavigationViewModel { CustomIdentity = Model.CustomIdentity })
-
+
+ <div>
+ @if (HttpContext.Current.Items["raven-query-error"] != null)
+ {
+ <ul>
+ @foreach(var msg in (HashSet<string>) HttpContext.Current.Items["raven-query-error"])
+ {
+ <li>@msg</li>
+ }
+ </ul>
+ }
+ </div>
<div id="notify-container"></div>
<div id="overlay-header"></div>
<div id="custom-header"></div>
View
4 Code/RavenOverflow.Web/Web.config
@@ -7,10 +7,6 @@
<configSections>
<section name="facebookSettings" type="Facebook.FacebookConfigurationSection" />
</configSections>
- <connectionStrings>
- <clear />
- <add name="RavenDB" connectionString="Url=http://localhost:8080" />
- </connectionStrings>
<appSettings>
<add key="FacebookAppId" value="190987390979843" />
<add key="FacebookSecret" value="4727898cbaaba07eed0a1ca60f1e74b3" />
View
32 Code/RavenOverflow.Web/packages.config
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="utf-8"?>
-<packages>
- <package id="AutoMapper" version="2.1.266" />
- <package id="CuttingEdge.Conditions" version="1.2.0.0" />
- <package id="Facebook" version="5.4.1.0" />
- <package id="FacebookWeb" version="5.4.1.0" />
- <package id="MagicalUnicornMvcErrorToolkit" version="1.0" />
- <package id="Microsoft.Web.Infrastructure" version="1.0.0.0" />
- <package id="Newtonsoft.Json" version="4.0.8" />
- <package id="NLog" version="2.0.0.2000" />
- <package id="RavenDB.Client" version="1.0.888" />
- <package id="RavenDB.Client.MvcIntegration" version="1.0.888" />
- <package id="routedebugger" version="2.1.2" />
- <package id="structuremap" version="2.6.3" />
- <package id="StructureMap.MVC3" version="1.0.8" />
- <package id="WebActivator" version="1.5" />
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+ <package id="AutoMapper" version="2.1.266" />
+ <package id="CuttingEdge.Conditions" version="1.2.0.0" />
+ <package id="Facebook" version="5.4.1.0" />
+ <package id="FacebookWeb" version="5.4.1.0" />
+ <package id="MagicalUnicornMvcErrorToolkit" version="1.0" />
+ <package id="Microsoft.Web.Infrastructure" version="1.0.0.0" />
+ <package id="Newtonsoft.Json" version="4.0.8" />
+ <package id="NLog" version="2.0.0.2000" />
+ <package id="RavenDB.Client" version="1.0.931-Unstable" />
+ <package id="RavenDB.Client.MvcIntegration" version="1.0.931-Unstable" />
+ <package id="routedebugger" version="2.1.2" />
+ <package id="structuremap" version="2.6.3" />
+ <package id="StructureMap.MVC3" version="1.0.8" />
+ <package id="WebActivator" version="1.5" />
</packages>
View
94 RavenOverflow.sln
@@ -1,50 +1,44 @@
-
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RavenOverflow.Core", "Code\RavenOverflow.Core\RavenOverflow.Core.csproj", "{58D8E77E-68D3-4623-A558-84B731E7725F}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RavenOverflow.Web", "Code\RavenOverflow.Web\RavenOverflow.Web.csproj", "{44F86C85-B711-4CF5-A161-862EE6E5D160}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RavenOverflow.FakeData", "Code\RavenOverflow.FakeData\RavenOverflow.FakeData.csproj", "{71DACF07-CC2C-4AD3-BF61-FF953DE917FF}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RavenOverflow.Services", "Code\RavenOverflow.Services\RavenOverflow.Services.csproj", "{A1F07927-5943-44D6-9FD4-FF36AE6C25DC}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RavenOverflow.Tests", "Code\RavenOverflow.Tests\RavenOverflow.Tests.csproj", "{9F1968B0-8FF6-4890-AE9E-B391447E9EA4}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{56965C84-8C59-41E3-975E-7875E2BE77BA}"
- ProjectSection(SolutionItems) = preProject
- .nuget\NuGet.exe = .nuget\NuGet.exe
- .nuget\NuGet.targets = .nuget\NuGet.targets
- EndProjectSection
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Release|Any CPU = Release|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {58D8E77E-68D3-4623-A558-84B731E7725F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {58D8E77E-68D3-4623-A558-84B731E7725F}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {58D8E77E-68D3-4623-A558-84B731E7725F}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {58D8E77E-68D3-4623-A558-84B731E7725F}.Release|Any CPU.Build.0 = Release|Any CPU
- {44F86C85-B711-4CF5-A161-862EE6E5D160}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {44F86C85-B711-4CF5-A161-862EE6E5D160}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {44F86C85-B711-4CF5-A161-862EE6E5D160}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {44F86C85-B711-4CF5-A161-862EE6E5D160}.Release|Any CPU.Build.0 = Release|Any CPU
- {71DACF07-CC2C-4AD3-BF61-FF953DE917FF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {71DACF07-CC2C-4AD3-BF61-FF953DE917FF}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {71DACF07-CC2C-4AD3-BF61-FF953DE917FF}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {71DACF07-CC2C-4AD3-BF61-FF953DE917FF}.Release|Any CPU.Build.0 = Release|Any CPU
- {A1F07927-5943-44D6-9FD4-FF36AE6C25DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {A1F07927-5943-44D6-9FD4-FF36AE6C25DC}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {A1F07927-5943-44D6-9FD4-FF36AE6C25DC}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {A1F07927-5943-44D6-9FD4-FF36AE6C25DC}.Release|Any CPU.Build.0 = Release|Any CPU
- {9F1968B0-8FF6-4890-AE9E-B391447E9EA4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {9F1968B0-8FF6-4890-AE9E-B391447E9EA4}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {9F1968B0-8FF6-4890-AE9E-B391447E9EA4}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {9F1968B0-8FF6-4890-AE9E-B391447E9EA4}.Release|Any CPU.Build.0 = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 11
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{56965C84-8C59-41E3-975E-7875E2BE77BA}"
+ ProjectSection(SolutionItems) = preProject
+ .nuget\NuGet.exe = .nuget\NuGet.exe
+ .nuget\NuGet.targets = .nuget\NuGet.targets
+ EndProjectSection
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RavenOverflow.Core", "Code\RavenOverflow.Core\RavenOverflow.Core.csproj", "{58D8E77E-68D3-4623-A558-84B731E7725F}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RavenOverflow.Web", "Code\RavenOverflow.Web\RavenOverflow.Web.csproj", "{44F86C85-B711-4CF5-A161-862EE6E5D160}"