upgraded to NHibernate 3.0.0

This commit is contained in:
tmont 2011-02-14 08:55:54 +00:00
parent 1dea16708b
commit b811c0ce52
6 changed files with 37 additions and 3 deletions

View File

@ -1,9 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Web.Mvc;
using JetBrains.Annotations;
using Portoa.Persistence;
using Portoa.Web.Controllers;
using Portoa.Web.ErrorHandling;
using Portoa.Web.Results;
using VideoGameQuotes.Api;
using VideoGameQuotes.Web.Models;
using VideoGameQuotes.Web.Security;
@ -135,7 +139,11 @@ namespace VideoGameQuotes.Web.Controllers {
}
public ActionResult Quote(int id) {
return View(quoteService.GetQuote(id));
try {
return View(quoteService.GetQuote(id));
} catch (EntityNotFoundException) {
return new StatusOverrideResult(View("QuoteNotFound")) { StatusCode = HttpStatusCode.NotFound };
}
}
[HttpPost]

View File

@ -40,6 +40,7 @@ namespace VideoGameQuotes.Web {
routes.MapRoute("about", "about", new { controller = "Home", action = "About" });
routes.MapRoute("contact", "contact", new { controller = "Home", action = "Contact" });
routes.MapRoute("submit", "submit", new { controller = "Quote", action = "Submit" });
routes.MapRoute("search", "search", new { controller = "Quote", action = "Search" });
routes.MapRoute("create-category", "category/create", new { controller = "Quote", action = "CreateCategory" });
routes.MapRoute("individual-quote", "quote/{id}/{*text}", new { controller = "Quote", action = "Quote" }, new { id = @"\d+" });
routes.MapRoute("Default", "{controller}/{action}/{id}", new { controller = "Home", action = "Index", id = UrlParameter.Optional });

View File

@ -115,6 +115,7 @@
<Content Include="Views\Home\Contact.aspx" />
<Content Include="Views\Home\ContactSuccess.aspx" />
<Content Include="Views\Quote\Quote.aspx" />
<Content Include="Views\Quote\QuoteNotFound.aspx" />
<Content Include="Views\Quote\Submit.aspx" />
<Content Include="Views\Shared\ExceptionView.ascx" />
<Content Include="Views\Shared\Forbidden.aspx" />

View File

@ -0,0 +1,22 @@
<%@ Page Title="" Language="C#" Inherits="System.Web.Mvc.ViewPage" MasterPageFile="~/Views/Shared/Site.Master" %>
<asp:Content runat="server" ID="Title" ContentPlaceHolderID="TitleContent">Quote Not Found</asp:Content>
<asp:Content runat="server" ID="Main" ContentPlaceHolderID="MainContent">
<p>
These are not the quotes you&rsquo;re looking for. Perhaps you found a dead link,
or somebody was playing a prank on you. Either way, you are one pathetic loser,
always clicking on links that are broken. I pity you. In fact, stop reading
these words that I&rsquo;ve written: your repugnant retinas are not worthy of my
prolific prose and alluring alliterations. You make me ashamed to share the same
species.
</p>
<p>
Anyway, try <%= Html.ActionLink("searching", "Search", "Quote") %> for the quote
you were hoping to find. Maybe that will make you less of a stain on humanity.
</p>
<p>
Go lose some weight, fatty.
</p>
</asp:Content>
<asp:Content runat="server" ID="DeferrableScripts" ContentPlaceHolderID="DeferrableScripts"></asp:Content>

View File

@ -43,7 +43,6 @@ ul.menu {
list-style: none;
}
.validation-summary-errors {
color: #000000;
border: 1px solid #000000;

View File

@ -40,7 +40,10 @@
<Reference Include="MySql.Data">
<HintPath>..\..\Lib\MySql.Data.dll</HintPath>
</Reference>
<Reference Include="NHibernate, Version=2.1.2.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4, processorArchitecture=MSIL" />
<Reference Include="NHibernate, Version=3.0.0.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Lib\NHibernate.dll</HintPath>
</Reference>
<Reference Include="NHibernate.ByteCode.LinFu">
<HintPath>..\..\Lib\NHibernate.ByteCode.LinFu.dll</HintPath>
</Reference>