upgraded to NHibernate 3.0.0
This commit is contained in:
parent
1dea16708b
commit
b811c0ce52
@ -1,9 +1,13 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Net;
|
||||||
using System.Web.Mvc;
|
using System.Web.Mvc;
|
||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
|
using Portoa.Persistence;
|
||||||
using Portoa.Web.Controllers;
|
using Portoa.Web.Controllers;
|
||||||
|
using Portoa.Web.ErrorHandling;
|
||||||
|
using Portoa.Web.Results;
|
||||||
using VideoGameQuotes.Api;
|
using VideoGameQuotes.Api;
|
||||||
using VideoGameQuotes.Web.Models;
|
using VideoGameQuotes.Web.Models;
|
||||||
using VideoGameQuotes.Web.Security;
|
using VideoGameQuotes.Web.Security;
|
||||||
@ -135,7 +139,11 @@ namespace VideoGameQuotes.Web.Controllers {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public ActionResult Quote(int id) {
|
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]
|
[HttpPost]
|
||||||
|
@ -40,6 +40,7 @@ namespace VideoGameQuotes.Web {
|
|||||||
routes.MapRoute("about", "about", new { controller = "Home", action = "About" });
|
routes.MapRoute("about", "about", new { controller = "Home", action = "About" });
|
||||||
routes.MapRoute("contact", "contact", new { controller = "Home", action = "Contact" });
|
routes.MapRoute("contact", "contact", new { controller = "Home", action = "Contact" });
|
||||||
routes.MapRoute("submit", "submit", new { controller = "Quote", action = "Submit" });
|
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("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("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 });
|
routes.MapRoute("Default", "{controller}/{action}/{id}", new { controller = "Home", action = "Index", id = UrlParameter.Optional });
|
||||||
|
@ -115,6 +115,7 @@
|
|||||||
<Content Include="Views\Home\Contact.aspx" />
|
<Content Include="Views\Home\Contact.aspx" />
|
||||||
<Content Include="Views\Home\ContactSuccess.aspx" />
|
<Content Include="Views\Home\ContactSuccess.aspx" />
|
||||||
<Content Include="Views\Quote\Quote.aspx" />
|
<Content Include="Views\Quote\Quote.aspx" />
|
||||||
|
<Content Include="Views\Quote\QuoteNotFound.aspx" />
|
||||||
<Content Include="Views\Quote\Submit.aspx" />
|
<Content Include="Views\Quote\Submit.aspx" />
|
||||||
<Content Include="Views\Shared\ExceptionView.ascx" />
|
<Content Include="Views\Shared\ExceptionView.ascx" />
|
||||||
<Content Include="Views\Shared\Forbidden.aspx" />
|
<Content Include="Views\Shared\Forbidden.aspx" />
|
||||||
|
22
Src/VideoGameQuotes.Web/Views/Quote/QuoteNotFound.aspx
Normal file
22
Src/VideoGameQuotes.Web/Views/Quote/QuoteNotFound.aspx
Normal 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’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’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>
|
@ -43,7 +43,6 @@ ul.menu {
|
|||||||
list-style: none;
|
list-style: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.validation-summary-errors {
|
.validation-summary-errors {
|
||||||
color: #000000;
|
color: #000000;
|
||||||
border: 1px solid #000000;
|
border: 1px solid #000000;
|
||||||
|
@ -40,7 +40,10 @@
|
|||||||
<Reference Include="MySql.Data">
|
<Reference Include="MySql.Data">
|
||||||
<HintPath>..\..\Lib\MySql.Data.dll</HintPath>
|
<HintPath>..\..\Lib\MySql.Data.dll</HintPath>
|
||||||
</Reference>
|
</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">
|
<Reference Include="NHibernate.ByteCode.LinFu">
|
||||||
<HintPath>..\..\Lib\NHibernate.ByteCode.LinFu.dll</HintPath>
|
<HintPath>..\..\Lib\NHibernate.ByteCode.LinFu.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
Loading…
Reference in New Issue
Block a user