Skip to content
This repository has been archived by the owner on Oct 30, 2019. It is now read-only.

Commit

Permalink
Skeleton site added
Browse files Browse the repository at this point in the history
  • Loading branch information
DamianEdwards committed Jul 23, 2015
1 parent cb2e389 commit 5ab483e
Show file tree
Hide file tree
Showing 32 changed files with 891 additions and 0 deletions.
50 changes: 50 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain

*.jpg binary
*.png binary
*.gif binary

*.cs text=auto diff=csharp
*.vb text=auto
*.resx text=auto
*.c text=auto
*.cpp text=auto
*.cxx text=auto
*.h text=auto
*.hxx text=auto
*.py text=auto
*.rb text=auto
*.java text=auto
*.html text=auto
*.htm text=auto
*.css text=auto
*.scss text=auto
*.sass text=auto
*.less text=auto
*.js text=auto
*.lisp text=auto
*.clj text=auto
*.sql text=auto
*.php text=auto
*.lua text=auto
*.m text=auto
*.asm text=auto
*.erl text=auto
*.fs text=auto
*.fsx text=auto
*.hs text=auto

*.csproj text=auto
*.vbproj text=auto
*.fsproj text=auto
*.dbproj text=auto
*.sln text=auto eol=crlf
39 changes: 39 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
[Oo]bj/
[Bb]in/
Debug/
TestResults/
.nuget/
_ReSharper.*/
/packages
artifacts/
PublishProfiles/
*.user
*.suo
*.cache
*.docstates
_ReSharper.*
nuget.exe
*net45.csproj
*k10.csproj
*.psess
*.vsp
*.pidb
*.userprefs
*DS_Store
*.ncrunchsolution
*.*sdf
*.ipch
*.aps
/KRuntime.sln.ide
/*.vspx
*.metaproj*
debugSettings.json
project.lock.json
version.h

# Profiler result files, just in case they are left lying around :)
/.vs/


node_modules/
src/*/wwwroot/lib/
6 changes: 6 additions & 0 deletions global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"projects": [ "src", "test" ],
"sdk": {
"version": "1.0.0-beta5"
}
}
32 changes: 32 additions & 0 deletions live.asp.net.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.23107.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{1C0CE3D7-47F2-419F-8550-BAFFD63502B8}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{608A1E11-6EF7-4D54-8F5B-DEDED21CECE3}"
ProjectSection(SolutionItems) = preProject
global.json = global.json
EndProjectSection
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "live.asp.net", "src\live.asp.net\live.asp.net.xproj", "{36B98821-099A-4C64-A117-151354333639}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{36B98821-099A-4C64-A117-151354333639}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{36B98821-099A-4C64-A117-151354333639}.Debug|Any CPU.Build.0 = Debug|Any CPU
{36B98821-099A-4C64-A117-151354333639}.Release|Any CPU.ActiveCfg = Release|Any CPU
{36B98821-099A-4C64-A117-151354333639}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{36B98821-099A-4C64-A117-151354333639} = {1C0CE3D7-47F2-419F-8550-BAFFD63502B8}
EndGlobalSection
EndGlobal
3 changes: 3 additions & 0 deletions src/live.asp.net/.bowerrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"directory": "wwwroot/lib"
}
51 changes: 51 additions & 0 deletions src/live.asp.net/Controllers/AccountController.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Principal;
using System.Threading.Tasks;
using Microsoft.AspNet.Http;
using Microsoft.AspNet.Http.Authentication;
using Microsoft.AspNet.Mvc;
using Microsoft.AspNet.Authentication;
using Microsoft.AspNet.Authentication.Cookies;
using Microsoft.AspNet.Authentication.OpenIdConnect;

namespace live.asp.net.Controllers
{
public class AccountController : Controller
{
[HttpGet("signin")]
public IActionResult SignIn()
{
return new ChallengeResult(
OpenIdConnectAuthenticationDefaults.AuthenticationScheme,
new AuthenticationProperties { RedirectUri = "/" }
);
}

[HttpGet("signout")]
public IActionResult SignOut()
{
var callbackUrl = Url.Action("SignOutCallback", "Account", values: null, protocol: Request.Scheme);
Context.Authentication.SignOut(CookieAuthenticationDefaults.AuthenticationScheme);
Context.Authentication.SignOut(
OpenIdConnectAuthenticationDefaults.AuthenticationScheme,
new AuthenticationProperties { RedirectUri = callbackUrl }
);

return new EmptyResult();
}

[HttpGet("signoutcallback")]
public IActionResult SignOutCallback()
{
if (Context.User.Identity.IsAuthenticated)
{
// Redirect to home page if the user is authenticated.
return RedirectToAction(nameof(HomeController.Index), "Home");
}

return View();
}
}
}
18 changes: 18 additions & 0 deletions src/live.asp.net/Controllers/HomeController.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNet.Authorization;
using Microsoft.AspNet.Mvc;

namespace live.asp.net.Controllers
{
public class HomeController : Controller
{
[HttpGet("/")]
public IActionResult Index()
{
return View();
}
}
}
24 changes: 24 additions & 0 deletions src/live.asp.net/Models/Show.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace live.asp.net.Models
{
public class Show
{
public int Id { get; set; }

public string Title { get; set; }

public string Description { get; set; }

public DateTimeOffset ShowDate { get; set; }

public bool IsInFuture => ShowDate > DateTimeOffset.Now;

public string Url { get; set; }

public string ThumbnailUrl { get; set; }
}
}
Loading

0 comments on commit 5ab483e

Please sign in to comment.