init
This commit is contained in:
245
.gitignore
vendored
Normal file
245
.gitignore
vendored
Normal file
@@ -0,0 +1,245 @@
|
||||
gnore Visual Studio temporary files, build results, and
|
||||
## files generated by popular Visual Studio add-ons.
|
||||
|
||||
# User-specific files
|
||||
*.suo
|
||||
*.user
|
||||
*.userosscache
|
||||
*.sln.docstates
|
||||
|
||||
# User-specific files (MonoDevelop/Xamarin Studio)
|
||||
*.userprefs
|
||||
|
||||
# Build results
|
||||
[Dd]ebug/
|
||||
[Dd]ebugPublic/
|
||||
[Rr]elease/
|
||||
[Rr]eleases/
|
||||
x64/
|
||||
x86/
|
||||
bld/
|
||||
[Bb]in/
|
||||
[Oo]bj/
|
||||
[Ll]og/
|
||||
|
||||
# Visual Studio 2015 cache/options directory
|
||||
.vs/
|
||||
# Uncomment if you have tasks that create the project's static files in wwwroot
|
||||
src/**/wwwroot/lib
|
||||
|
||||
# MSTest test Results
|
||||
[Tt]est[Rr]esult*/
|
||||
[Bb]uild[Ll]og.*
|
||||
|
||||
# NUNIT
|
||||
*.VisualState.xml
|
||||
TestResult.xml
|
||||
|
||||
# Build Results of an ATL Project
|
||||
[Dd]ebugPS/
|
||||
[Rr]eleasePS/
|
||||
dlldata.c
|
||||
|
||||
# DNX
|
||||
project.lock.json
|
||||
artifacts/
|
||||
|
||||
*_i.c
|
||||
*_p.c
|
||||
*_i.h
|
||||
*.ilk
|
||||
*.meta
|
||||
*.obj
|
||||
*.pch
|
||||
*.pdb
|
||||
*.pgc
|
||||
*.pgd
|
||||
*.rsp
|
||||
*.sbr
|
||||
*.tlb
|
||||
*.tli
|
||||
*.tlh
|
||||
*.tmp
|
||||
*.tmp_proj
|
||||
*.log
|
||||
*.vspscc
|
||||
*.vssscc
|
||||
.builds
|
||||
*.pidb
|
||||
*.svclog
|
||||
*.scc
|
||||
|
||||
# Chutzpah Test files
|
||||
_Chutzpah*
|
||||
|
||||
# Visual C++ cache files
|
||||
ipch/
|
||||
*.aps
|
||||
*.ncb
|
||||
*.opendb
|
||||
*.opensdf
|
||||
*.sdf
|
||||
*.cachefile
|
||||
|
||||
# Visual Studio profiler
|
||||
*.psess
|
||||
*.vsp
|
||||
*.vspx
|
||||
*.sap
|
||||
|
||||
# TFS 2012 Local Workspace
|
||||
$tf/
|
||||
|
||||
# Guidance Automation Toolkit
|
||||
*.gpState
|
||||
|
||||
# ReSharper is a .NET coding add-in
|
||||
_ReSharper*/
|
||||
*.[Rr]e[Ss]harper
|
||||
*.DotSettings.user
|
||||
|
||||
# JustCode is a .NET coding add-in
|
||||
.JustCode
|
||||
|
||||
# TeamCity is a build add-in
|
||||
_TeamCity*
|
||||
|
||||
# DotCover is a Code Coverage Tool
|
||||
*.dotCover
|
||||
|
||||
# NCrunch
|
||||
_NCrunch_*
|
||||
.*crunch*.local.xml
|
||||
nCrunchTemp_*
|
||||
|
||||
# MightyMoose
|
||||
*.mm.*
|
||||
AutoTest.Net/
|
||||
|
||||
# Web workbench (sass)
|
||||
.sass-cache/
|
||||
|
||||
# Installshield output folder
|
||||
[Ee]xpress/
|
||||
|
||||
# DocProject is a documentation generator add-in
|
||||
DocProject/buildhelp/
|
||||
DocProject/Help/*.HxT
|
||||
DocProject/Help/*.HxC
|
||||
DocProject/Help/*.hhc
|
||||
DocProject/Help/*.hhk
|
||||
DocProject/Help/*.hhp
|
||||
DocProject/Help/Html2
|
||||
DocProject/Help/html
|
||||
|
||||
# Click-Once directory
|
||||
publish/
|
||||
|
||||
# Publish Web Output
|
||||
*.[Pp]ublish.xml
|
||||
*.azurePubxml
|
||||
# TODO: Comment the next line if you want to checkin your web deploy settings
|
||||
# but database connection strings (with potential passwords) will be unencrypted
|
||||
*.pubxml
|
||||
*.publishproj
|
||||
|
||||
# NuGet Packages
|
||||
*.nupkg
|
||||
# The packages folder can be ignored because of Package Restore
|
||||
**/packages/*
|
||||
# except build/, which is used as an MSBuild target.
|
||||
!**/packages/build/
|
||||
# Uncomment if necessary however generally it will be regenerated when needed
|
||||
#!**/packages/repositories.config
|
||||
# NuGet v3's project.json files produces more ignoreable files
|
||||
*.nuget.props
|
||||
*.nuget.targets
|
||||
|
||||
# Microsoft Azure Build Output
|
||||
csx/
|
||||
*.build.csdef
|
||||
|
||||
# Microsoft Azure Emulator
|
||||
ecf/
|
||||
rcf/
|
||||
|
||||
# Windows Store app package directories and files
|
||||
AppPackages/
|
||||
BundleArtifacts/
|
||||
Package.StoreAssociation.xml
|
||||
_pkginfo.txt
|
||||
|
||||
# Visual Studio cache files
|
||||
# files ending in .cache can be ignored
|
||||
*.[Cc]ache
|
||||
# but keep track of directories ending in .cache
|
||||
!*.[Cc]ache/
|
||||
|
||||
# Others
|
||||
ClientBin/
|
||||
~$*
|
||||
*~
|
||||
*.dbmdl
|
||||
*.dbproj.schemaview
|
||||
*.pfx
|
||||
*.publishsettings
|
||||
node_modules/
|
||||
orleans.codegen.cs
|
||||
|
||||
# Since there are multiple workflows, uncomment next line to ignore bower_components
|
||||
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
|
||||
#bower_components/
|
||||
|
||||
# RIA/Silverlight projects
|
||||
Generated_Code/
|
||||
|
||||
# Backup & report files from converting an old project file
|
||||
# to a newer Visual Studio version. Backup files are not needed,
|
||||
# because we have git ;-)
|
||||
_UpgradeReport_Files/
|
||||
Backup*/
|
||||
UpgradeLog*.XML
|
||||
UpgradeLog*.htm
|
||||
|
||||
# SQL Server files
|
||||
*.mdf
|
||||
*.ldf
|
||||
|
||||
# Business Intelligence projects
|
||||
*.rdl.data
|
||||
*.bim.layout
|
||||
*.bim_*.settings
|
||||
|
||||
# Microsoft Fakes
|
||||
FakesAssemblies/
|
||||
|
||||
# GhostDoc plugin setting file
|
||||
*.GhostDoc.xml
|
||||
|
||||
# Node.js Tools for Visual Studio
|
||||
.ntvs_analysis.dat
|
||||
|
||||
# Visual Studio 6 build log
|
||||
*.plg
|
||||
|
||||
# Visual Studio 6 workspace options file
|
||||
*.opt
|
||||
|
||||
# Visual Studio LightSwitch build output
|
||||
**/*.HTMLClient/GeneratedArtifacts
|
||||
**/*.DesktopClient/GeneratedArtifacts
|
||||
**/*.DesktopClient/ModelManifest.xml
|
||||
**/*.Server/GeneratedArtifacts
|
||||
**/*.Server/ModelManifest.xml
|
||||
_Pvt_Extensions
|
||||
|
||||
# Paket dependency manager
|
||||
.paket/paket.exe
|
||||
paket-files/
|
||||
|
||||
# FAKE - F# Make
|
||||
.fake/
|
||||
|
||||
# JetBrains Rider
|
||||
.idea/
|
||||
*.sln.iml
|
||||
46
Alive.Net.sln
Normal file
46
Alive.Net.sln
Normal file
@@ -0,0 +1,46 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 14
|
||||
VisualStudioVersion = 14.0.24720.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{87BBACD9-21A7-4169-94B9-DD6989B700B7}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{826840ED-1A86-4502-BB2D-04EECAAE49F0}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
global.json = global.json
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Alive.Net", "src\Alive.Net\Alive.Net.xproj", "{1628A48E-DD1D-45C7-A316-6CFD8498845C}"
|
||||
EndProject
|
||||
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Alive.Net.UnitTests", "src\Alive.Net.UnitTests\Alive.Net.UnitTests.xproj", "{4CA8001B-27C7-4671-B451-2C2DA00A3827}"
|
||||
EndProject
|
||||
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Alive.Net.Example", "src\Alive.Net.Example\Alive.Net.Example.xproj", "{43D7C97A-6041-492F-95C6-FD88C7FA7A7B}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{1628A48E-DD1D-45C7-A316-6CFD8498845C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{1628A48E-DD1D-45C7-A316-6CFD8498845C}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{1628A48E-DD1D-45C7-A316-6CFD8498845C}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{1628A48E-DD1D-45C7-A316-6CFD8498845C}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{4CA8001B-27C7-4671-B451-2C2DA00A3827}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{4CA8001B-27C7-4671-B451-2C2DA00A3827}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{4CA8001B-27C7-4671-B451-2C2DA00A3827}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{4CA8001B-27C7-4671-B451-2C2DA00A3827}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{43D7C97A-6041-492F-95C6-FD88C7FA7A7B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{43D7C97A-6041-492F-95C6-FD88C7FA7A7B}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{43D7C97A-6041-492F-95C6-FD88C7FA7A7B}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{43D7C97A-6041-492F-95C6-FD88C7FA7A7B}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(NestedProjects) = preSolution
|
||||
{1628A48E-DD1D-45C7-A316-6CFD8498845C} = {87BBACD9-21A7-4169-94B9-DD6989B700B7}
|
||||
{4CA8001B-27C7-4671-B451-2C2DA00A3827} = {87BBACD9-21A7-4169-94B9-DD6989B700B7}
|
||||
{43D7C97A-6041-492F-95C6-FD88C7FA7A7B} = {87BBACD9-21A7-4169-94B9-DD6989B700B7}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
6
global.json
Normal file
6
global.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"projects": [ "src", "test" ],
|
||||
"sdk": {
|
||||
"version": "1.0.0-rc1-update1"
|
||||
}
|
||||
}
|
||||
3
src/Alive.Net.Example/.bowerrc
Normal file
3
src/Alive.Net.Example/.bowerrc
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"directory": "wwwroot/lib"
|
||||
}
|
||||
23
src/Alive.Net.Example/Alive.Net.Example.xproj
Normal file
23
src/Alive.Net.Example/Alive.Net.Example.xproj
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
|
||||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.Props" Condition="'$(VSToolsPath)' != ''" />
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>43d7c97a-6041-492f-95c6-fd88c7fa7a7b</ProjectGuid>
|
||||
<RootNamespace>Alive.Net.Example</RootNamespace>
|
||||
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
|
||||
<OutputPath Condition="'$(OutputPath)'=='' ">..\..\artifacts\bin\$(MSBuildProjectName)\</OutputPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<DnxInvisibleContent Include="bower.json" />
|
||||
<DnxInvisibleContent Include=".bowerrc" />
|
||||
<DnxInvisibleContent Include="package.json" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" />
|
||||
</Project>
|
||||
35
src/Alive.Net.Example/Controllers/HomeController.cs
Normal file
35
src/Alive.Net.Example/Controllers/HomeController.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNet.Mvc;
|
||||
|
||||
namespace Alive.Net.Example.Controllers
|
||||
{
|
||||
public class HomeController : Controller
|
||||
{
|
||||
public IActionResult Index()
|
||||
{
|
||||
return View();
|
||||
}
|
||||
|
||||
public IActionResult About()
|
||||
{
|
||||
ViewData["Message"] = "Your application description page.";
|
||||
|
||||
return View();
|
||||
}
|
||||
|
||||
public IActionResult Contact()
|
||||
{
|
||||
ViewData["Message"] = "Your contact page.";
|
||||
|
||||
return View();
|
||||
}
|
||||
|
||||
public IActionResult Error()
|
||||
{
|
||||
return View();
|
||||
}
|
||||
}
|
||||
}
|
||||
25
src/Alive.Net.Example/Properties/launchSettings.json
Normal file
25
src/Alive.Net.Example/Properties/launchSettings.json
Normal file
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"iisSettings": {
|
||||
"windowsAuthentication": false,
|
||||
"anonymousAuthentication": true,
|
||||
"iisExpress": {
|
||||
"applicationUrl": "http://localhost:6445/",
|
||||
"sslPort": 0
|
||||
}
|
||||
},
|
||||
"profiles": {
|
||||
"IIS Express": {
|
||||
"commandName": "IISExpress",
|
||||
"launchBrowser": true,
|
||||
"environmentVariables": {
|
||||
"Hosting:Environment": "Development"
|
||||
}
|
||||
},
|
||||
"web": {
|
||||
"commandName": "web",
|
||||
"environmentVariables": {
|
||||
"Hosting:Environment": "Development"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
67
src/Alive.Net.Example/Startup.cs
Normal file
67
src/Alive.Net.Example/Startup.cs
Normal file
@@ -0,0 +1,67 @@
|
||||
using Microsoft.AspNet.Builder;
|
||||
using Microsoft.AspNet.Hosting;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Alive.Net.Example
|
||||
{
|
||||
public class Startup
|
||||
{
|
||||
public Startup(IHostingEnvironment env)
|
||||
{
|
||||
// Set up configuration sources.
|
||||
var builder = new ConfigurationBuilder()
|
||||
.AddJsonFile("appsettings.json")
|
||||
.AddEnvironmentVariables();
|
||||
Configuration = builder.Build();
|
||||
}
|
||||
|
||||
public IConfigurationRoot Configuration { get; set; }
|
||||
|
||||
// This method gets called by the runtime. Use this method to add services to the container.
|
||||
public void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
// Add framework services.
|
||||
services.AddMvc();
|
||||
}
|
||||
|
||||
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
|
||||
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
|
||||
{
|
||||
loggerFactory.AddConsole(Configuration.GetSection("Logging"));
|
||||
loggerFactory.AddDebug();
|
||||
|
||||
if (env.IsDevelopment())
|
||||
{
|
||||
app.UseBrowserLink();
|
||||
app.UseDeveloperExceptionPage();
|
||||
}
|
||||
else
|
||||
{
|
||||
app.UseExceptionHandler("/Home/Error");
|
||||
}
|
||||
app.UseAlive(a =>
|
||||
{
|
||||
a.BodyText = "Im awesome";
|
||||
});
|
||||
app.UseIISPlatformHandler();
|
||||
|
||||
app.UseStaticFiles();
|
||||
|
||||
app.UseMvc(routes =>
|
||||
{
|
||||
routes.MapRoute(
|
||||
name: "default",
|
||||
template: "{controller=Home}/{action=Index}/{id?}");
|
||||
});
|
||||
}
|
||||
|
||||
// Entry point for the application.
|
||||
public static void Main(string[] args) => WebApplication.Run<Startup>(args);
|
||||
}
|
||||
}
|
||||
7
src/Alive.Net.Example/Views/Home/About.cshtml
Normal file
7
src/Alive.Net.Example/Views/Home/About.cshtml
Normal file
@@ -0,0 +1,7 @@
|
||||
@{
|
||||
ViewData["Title"] = "About";
|
||||
}
|
||||
<h2>@ViewData["Title"].</h2>
|
||||
<h3>@ViewData["Message"]</h3>
|
||||
|
||||
<p>Use this area to provide additional information.</p>
|
||||
17
src/Alive.Net.Example/Views/Home/Contact.cshtml
Normal file
17
src/Alive.Net.Example/Views/Home/Contact.cshtml
Normal file
@@ -0,0 +1,17 @@
|
||||
@{
|
||||
ViewData["Title"] = "Contact";
|
||||
}
|
||||
<h2>@ViewData["Title"].</h2>
|
||||
<h3>@ViewData["Message"]</h3>
|
||||
|
||||
<address>
|
||||
One Microsoft Way<br />
|
||||
Redmond, WA 98052-6399<br />
|
||||
<abbr title="Phone">P:</abbr>
|
||||
425.555.0100
|
||||
</address>
|
||||
|
||||
<address>
|
||||
<strong>Support:</strong> <a href="mailto:Support@example.com">Support@example.com</a><br />
|
||||
<strong>Marketing:</strong> <a href="mailto:Marketing@example.com">Marketing@example.com</a>
|
||||
</address>
|
||||
110
src/Alive.Net.Example/Views/Home/Index.cshtml
Normal file
110
src/Alive.Net.Example/Views/Home/Index.cshtml
Normal file
@@ -0,0 +1,110 @@
|
||||
@{
|
||||
ViewData["Title"] = "Home Page";
|
||||
}
|
||||
|
||||
<div id="myCarousel" class="carousel slide" data-ride="carousel" data-interval="6000">
|
||||
<ol class="carousel-indicators">
|
||||
<li data-target="#myCarousel" data-slide-to="0" class="active"></li>
|
||||
<li data-target="#myCarousel" data-slide-to="1"></li>
|
||||
<li data-target="#myCarousel" data-slide-to="2"></li>
|
||||
<li data-target="#myCarousel" data-slide-to="3"></li>
|
||||
</ol>
|
||||
<div class="carousel-inner" role="listbox">
|
||||
<div class="item active">
|
||||
<img src="~/images/ASP-NET-Banners-01.png" alt="ASP.NET" class="img-responsive" />
|
||||
<div class="carousel-caption">
|
||||
<p>
|
||||
Learn how to build ASP.NET apps that can run anywhere.
|
||||
<a class="btn btn-default btn-default" href="http://go.microsoft.com/fwlink/?LinkID=525028&clcid=0x409">
|
||||
Learn More
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<img src="~/images/Banner-02-VS.png" alt="Visual Studio" class="img-responsive" />
|
||||
<div class="carousel-caption">
|
||||
<p>
|
||||
There are powerful new features in Visual Studio for building modern web apps.
|
||||
<a class="btn btn-default btn-default" href="http://go.microsoft.com/fwlink/?LinkID=525030&clcid=0x409">
|
||||
Learn More
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<img src="~/images/ASP-NET-Banners-02.png" alt="Package Management" class="img-responsive" />
|
||||
<div class="carousel-caption">
|
||||
<p>
|
||||
Bring in libraries from NuGet, Bower, and npm, and automate tasks using Grunt or Gulp.
|
||||
<a class="btn btn-default btn-default" href="http://go.microsoft.com/fwlink/?LinkID=525029&clcid=0x409">
|
||||
Learn More
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<img src="~/images/Banner-01-Azure.png" alt="Microsoft Azure" class="img-responsive" />
|
||||
<div class="carousel-caption">
|
||||
<p>
|
||||
Learn how Microsoft's Azure cloud platform allows you to build, deploy, and scale web apps.
|
||||
<a class="btn btn-default btn-default" href="http://go.microsoft.com/fwlink/?LinkID=525027&clcid=0x409">
|
||||
Learn More
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<a class="left carousel-control" href="#myCarousel" role="button" data-slide="prev">
|
||||
<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
|
||||
<span class="sr-only">Previous</span>
|
||||
</a>
|
||||
<a class="right carousel-control" href="#myCarousel" role="button" data-slide="next">
|
||||
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
|
||||
<span class="sr-only">Next</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<h2>Application uses</h2>
|
||||
<ul>
|
||||
<li>Sample pages using ASP.NET MVC 6</li>
|
||||
<li><a href="http://go.microsoft.com/fwlink/?LinkId=518007">Gulp</a> and <a href="http://go.microsoft.com/fwlink/?LinkId=518004">Bower</a> for managing client-side libraries</li>
|
||||
<li>Theming using <a href="http://go.microsoft.com/fwlink/?LinkID=398939">Bootstrap</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<h2>How to</h2>
|
||||
<ul>
|
||||
<li><a href="http://go.microsoft.com/fwlink/?LinkID=398600">Add a Controller and View</a></li>
|
||||
<li><a href="http://go.microsoft.com/fwlink/?LinkID=699314">Add an appsetting in config and access it in app.</a></li>
|
||||
<li><a href="http://go.microsoft.com/fwlink/?LinkId=699315">Manage User Secrets using Secret Manager.</a></li>
|
||||
<li><a href="http://go.microsoft.com/fwlink/?LinkId=699316">Use logging to log a message.</a></li>
|
||||
<li><a href="http://go.microsoft.com/fwlink/?LinkId=699317">Add packages using NuGet.</a></li>
|
||||
<li><a href="http://go.microsoft.com/fwlink/?LinkId=699318">Add client packages using Bower.</a></li>
|
||||
<li><a href="http://go.microsoft.com/fwlink/?LinkId=699319">Target development, staging or production environment.</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<h2>Overview</h2>
|
||||
<ul>
|
||||
<li><a href="http://go.microsoft.com/fwlink/?LinkId=518008">Conceptual overview of what is ASP.NET 5</a></li>
|
||||
<li><a href="http://go.microsoft.com/fwlink/?LinkId=699320">Fundamentals of ASP.NET 5 such as Startup and middleware.</a></li>
|
||||
<li><a href="http://go.microsoft.com/fwlink/?LinkId=398602">Working with Data</a></li>
|
||||
<li><a href="http://go.microsoft.com/fwlink/?LinkId=398603">Security</a></li>
|
||||
<li><a href="http://go.microsoft.com/fwlink/?LinkID=699321">Client side development</a></li>
|
||||
<li><a href="http://go.microsoft.com/fwlink/?LinkID=699322">Develop on different platforms</a></li>
|
||||
<li><a href="http://go.microsoft.com/fwlink/?LinkID=699323">Read more on the documentation site</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<h2>Run & Deploy</h2>
|
||||
<ul>
|
||||
<li><a href="http://go.microsoft.com/fwlink/?LinkID=517851">Run your app</a></li>
|
||||
<li><a href="http://go.microsoft.com/fwlink/?LinkID=517852">Run your app on .NET Core</a></li>
|
||||
<li><a href="http://go.microsoft.com/fwlink/?LinkID=517853">Run commands in your project.json</a></li>
|
||||
<li><a href="http://go.microsoft.com/fwlink/?LinkID=398609">Publish to Microsoft Azure Web Apps</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
6
src/Alive.Net.Example/Views/Shared/Error.cshtml
Normal file
6
src/Alive.Net.Example/Views/Shared/Error.cshtml
Normal file
@@ -0,0 +1,6 @@
|
||||
@{
|
||||
ViewData["Title"] = "Error";
|
||||
}
|
||||
|
||||
<h1 class="text-danger">Error.</h1>
|
||||
<h2 class="text-danger">An error occurred while processing your request.</h2>
|
||||
67
src/Alive.Net.Example/Views/Shared/_Layout.cshtml
Normal file
67
src/Alive.Net.Example/Views/Shared/_Layout.cshtml
Normal file
@@ -0,0 +1,67 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>@ViewData["Title"] - Alive.Net.Example</title>
|
||||
|
||||
<environment names="Development">
|
||||
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.css" />
|
||||
<link rel="stylesheet" href="~/css/site.css" />
|
||||
</environment>
|
||||
<environment names="Staging,Production">
|
||||
<link rel="stylesheet" href="https://ajax.aspnetcdn.com/ajax/bootstrap/3.3.5/css/bootstrap.min.css"
|
||||
asp-fallback-href="~/lib/bootstrap/dist/css/bootstrap.min.css"
|
||||
asp-fallback-test-class="sr-only" asp-fallback-test-property="position" asp-fallback-test-value="absolute" />
|
||||
<link rel="stylesheet" href="~/css/site.min.css" asp-append-version="true" />
|
||||
</environment>
|
||||
</head>
|
||||
<body>
|
||||
<div class="navbar navbar-inverse navbar-fixed-top">
|
||||
<div class="container">
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a asp-controller="Home" asp-action="Index" class="navbar-brand">Alive.Net.Example</a>
|
||||
</div>
|
||||
<div class="navbar-collapse collapse">
|
||||
<ul class="nav navbar-nav">
|
||||
<li><a asp-controller="Home" asp-action="Index">Home</a></li>
|
||||
<li><a asp-controller="Home" asp-action="About">About</a></li>
|
||||
<li><a asp-controller="Home" asp-action="Contact">Contact</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container body-content">
|
||||
@RenderBody()
|
||||
<hr />
|
||||
<footer>
|
||||
<p>© 2016 - Alive.Net.Example</p>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
<environment names="Development">
|
||||
<script src="~/lib/jquery/dist/jquery.js"></script>
|
||||
<script src="~/lib/bootstrap/dist/js/bootstrap.js"></script>
|
||||
<script src="~/js/site.js" asp-append-version="true"></script>
|
||||
</environment>
|
||||
<environment names="Staging,Production">
|
||||
<script src="https://ajax.aspnetcdn.com/ajax/jquery/jquery-2.1.4.min.js"
|
||||
asp-fallback-src="~/lib/jquery/dist/jquery.min.js"
|
||||
asp-fallback-test="window.jQuery">
|
||||
</script>
|
||||
<script src="https://ajax.aspnetcdn.com/ajax/bootstrap/3.3.5/bootstrap.min.js"
|
||||
asp-fallback-src="~/lib/bootstrap/dist/js/bootstrap.min.js"
|
||||
asp-fallback-test="window.jQuery && window.jQuery.fn && window.jQuery.fn.modal">
|
||||
</script>
|
||||
<script src="~/js/site.min.js" asp-append-version="true"></script>
|
||||
</environment>
|
||||
|
||||
@RenderSection("scripts", required: false)
|
||||
</body>
|
||||
</html>
|
||||
2
src/Alive.Net.Example/Views/_ViewImports.cshtml
Normal file
2
src/Alive.Net.Example/Views/_ViewImports.cshtml
Normal file
@@ -0,0 +1,2 @@
|
||||
@using Alive.Net.Example
|
||||
@addTagHelper "*, Microsoft.AspNet.Mvc.TagHelpers"
|
||||
3
src/Alive.Net.Example/Views/_ViewStart.cshtml
Normal file
3
src/Alive.Net.Example/Views/_ViewStart.cshtml
Normal file
@@ -0,0 +1,3 @@
|
||||
@{
|
||||
Layout = "_Layout";
|
||||
}
|
||||
10
src/Alive.Net.Example/appsettings.json
Normal file
10
src/Alive.Net.Example/appsettings.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"Logging": {
|
||||
"IncludeScopes": false,
|
||||
"LogLevel": {
|
||||
"Default": "Verbose",
|
||||
"System": "Information",
|
||||
"Microsoft": "Information"
|
||||
}
|
||||
}
|
||||
}
|
||||
10
src/Alive.Net.Example/bower.json
Normal file
10
src/Alive.Net.Example/bower.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"name": "ASP.NET",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"bootstrap": "3.3.5",
|
||||
"jquery": "2.1.4",
|
||||
"jquery-validation": "1.14.0",
|
||||
"jquery-validation-unobtrusive": "3.2.4"
|
||||
}
|
||||
}
|
||||
45
src/Alive.Net.Example/gulpfile.js
Normal file
45
src/Alive.Net.Example/gulpfile.js
Normal file
@@ -0,0 +1,45 @@
|
||||
/// <binding Clean='clean' />
|
||||
"use strict";
|
||||
|
||||
var gulp = require("gulp"),
|
||||
rimraf = require("rimraf"),
|
||||
concat = require("gulp-concat"),
|
||||
cssmin = require("gulp-cssmin"),
|
||||
uglify = require("gulp-uglify");
|
||||
|
||||
var paths = {
|
||||
webroot: "./wwwroot/"
|
||||
};
|
||||
|
||||
paths.js = paths.webroot + "js/**/*.js";
|
||||
paths.minJs = paths.webroot + "js/**/*.min.js";
|
||||
paths.css = paths.webroot + "css/**/*.css";
|
||||
paths.minCss = paths.webroot + "css/**/*.min.css";
|
||||
paths.concatJsDest = paths.webroot + "js/site.min.js";
|
||||
paths.concatCssDest = paths.webroot + "css/site.min.css";
|
||||
|
||||
gulp.task("clean:js", function (cb) {
|
||||
rimraf(paths.concatJsDest, cb);
|
||||
});
|
||||
|
||||
gulp.task("clean:css", function (cb) {
|
||||
rimraf(paths.concatCssDest, cb);
|
||||
});
|
||||
|
||||
gulp.task("clean", ["clean:js", "clean:css"]);
|
||||
|
||||
gulp.task("min:js", function () {
|
||||
return gulp.src([paths.js, "!" + paths.minJs], { base: "." })
|
||||
.pipe(concat(paths.concatJsDest))
|
||||
.pipe(uglify())
|
||||
.pipe(gulp.dest("."));
|
||||
});
|
||||
|
||||
gulp.task("min:css", function () {
|
||||
return gulp.src([paths.css, "!" + paths.minCss])
|
||||
.pipe(concat(paths.concatCssDest))
|
||||
.pipe(cssmin())
|
||||
.pipe(gulp.dest("."));
|
||||
});
|
||||
|
||||
gulp.task("min", ["min:js", "min:css"]);
|
||||
11
src/Alive.Net.Example/package.json
Normal file
11
src/Alive.Net.Example/package.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"name": "ASP.NET",
|
||||
"version": "0.0.0",
|
||||
"devDependencies": {
|
||||
"gulp": "3.8.11",
|
||||
"gulp-concat": "2.5.2",
|
||||
"gulp-cssmin": "0.1.7",
|
||||
"gulp-uglify": "1.2.0",
|
||||
"rimraf": "2.2.8"
|
||||
}
|
||||
}
|
||||
44
src/Alive.Net.Example/project.json
Normal file
44
src/Alive.Net.Example/project.json
Normal file
@@ -0,0 +1,44 @@
|
||||
{
|
||||
"version": "1.0.0-*",
|
||||
"compilationOptions": {
|
||||
"emitEntryPoint": true
|
||||
},
|
||||
|
||||
"dependencies": {
|
||||
"Microsoft.AspNet.Diagnostics": "1.0.0-rc1-final",
|
||||
"Microsoft.AspNet.IISPlatformHandler": "1.0.0-rc1-final",
|
||||
"Microsoft.AspNet.Mvc": "6.0.0-rc1-final",
|
||||
"Microsoft.AspNet.Mvc.TagHelpers": "6.0.0-rc1-final",
|
||||
"Microsoft.AspNet.Server.Kestrel": "1.0.0-rc1-final",
|
||||
"Microsoft.AspNet.StaticFiles": "1.0.0-rc1-final",
|
||||
"Microsoft.AspNet.Tooling.Razor": "1.0.0-rc1-final",
|
||||
"Microsoft.Extensions.Configuration.FileProviderExtensions": "1.0.0-rc1-final",
|
||||
"Microsoft.Extensions.Configuration.Json": "1.0.0-rc1-final",
|
||||
"Microsoft.Extensions.Logging": "1.0.0-rc1-final",
|
||||
"Microsoft.Extensions.Logging.Console": "1.0.0-rc1-final",
|
||||
"Microsoft.Extensions.Logging.Debug": "1.0.0-rc1-final",
|
||||
"Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0-rc1-final",
|
||||
"Alive.Net": ""
|
||||
},
|
||||
|
||||
"commands": {
|
||||
"web": "Microsoft.AspNet.Server.Kestrel"
|
||||
},
|
||||
|
||||
"frameworks": {
|
||||
"dnx451": { },
|
||||
"dnxcore50": { }
|
||||
},
|
||||
|
||||
"exclude": [
|
||||
"wwwroot",
|
||||
"node_modules"
|
||||
],
|
||||
"publishExclude": [
|
||||
"**.user",
|
||||
"**.vspscc"
|
||||
],
|
||||
"scripts": {
|
||||
"prepublish": [ "npm install", "bower install", "gulp clean", "gulp min" ]
|
||||
}
|
||||
}
|
||||
7
src/Alive.Net.Example/wwwroot/_references.js
Normal file
7
src/Alive.Net.Example/wwwroot/_references.js
Normal file
@@ -0,0 +1,7 @@
|
||||
/// <autosync enabled="true" />
|
||||
/// <reference path="../gulpfile.js" />
|
||||
/// <reference path="lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.js" />
|
||||
/// <reference path="lib/jquery-validation/jquery.validate.js" />
|
||||
/// <reference path="lib/jquery/dist/jquery.js" />
|
||||
/// <reference path="lib/bootstrap/dist/js/bootstrap.js" />
|
||||
/// <reference path="js/site.js" />
|
||||
34
src/Alive.Net.Example/wwwroot/css/site.css
Normal file
34
src/Alive.Net.Example/wwwroot/css/site.css
Normal file
@@ -0,0 +1,34 @@
|
||||
body {
|
||||
padding-top: 50px;
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
|
||||
/* Wrapping element */
|
||||
/* Set some basic padding to keep content from hitting the edges */
|
||||
.body-content {
|
||||
padding-left: 15px;
|
||||
padding-right: 15px;
|
||||
}
|
||||
|
||||
/* Set widths on the form inputs since otherwise they're 100% wide */
|
||||
input,
|
||||
select,
|
||||
textarea {
|
||||
max-width: 280px;
|
||||
}
|
||||
|
||||
/* Carousel */
|
||||
.carousel-caption {
|
||||
z-index: 10 !important;
|
||||
}
|
||||
|
||||
.carousel-caption p {
|
||||
font-size: 20px;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
.carousel-caption {
|
||||
z-index: 10 !important;
|
||||
}
|
||||
}
|
||||
1
src/Alive.Net.Example/wwwroot/css/site.min.css
vendored
Normal file
1
src/Alive.Net.Example/wwwroot/css/site.min.css
vendored
Normal file
@@ -0,0 +1 @@
|
||||
body{padding-top:50px;padding-bottom:20px}.body-content{padding-left:15px;padding-right:15px}input,select,textarea{max-width:280px}.carousel-caption{z-index:10!important}.carousel-caption p{font-size:20px;line-height:1.4}@media (min-width:768px){.carousel-caption{z-index:10!important}}
|
||||
BIN
src/Alive.Net.Example/wwwroot/favicon.ico
Normal file
BIN
src/Alive.Net.Example/wwwroot/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 31 KiB |
BIN
src/Alive.Net.Example/wwwroot/images/ASP-NET-Banners-01.png
Normal file
BIN
src/Alive.Net.Example/wwwroot/images/ASP-NET-Banners-01.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 8.1 KiB |
BIN
src/Alive.Net.Example/wwwroot/images/ASP-NET-Banners-02.png
Normal file
BIN
src/Alive.Net.Example/wwwroot/images/ASP-NET-Banners-02.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 8.4 KiB |
BIN
src/Alive.Net.Example/wwwroot/images/Banner-01-Azure.png
Normal file
BIN
src/Alive.Net.Example/wwwroot/images/Banner-01-Azure.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 14 KiB |
BIN
src/Alive.Net.Example/wwwroot/images/Banner-02-VS.png
Normal file
BIN
src/Alive.Net.Example/wwwroot/images/Banner-02-VS.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
1
src/Alive.Net.Example/wwwroot/js/site.js
Normal file
1
src/Alive.Net.Example/wwwroot/js/site.js
Normal file
@@ -0,0 +1 @@
|
||||
// Write your Javascript code.
|
||||
0
src/Alive.Net.Example/wwwroot/js/site.min.js
vendored
Normal file
0
src/Alive.Net.Example/wwwroot/js/site.min.js
vendored
Normal file
9
src/Alive.Net.Example/wwwroot/web.config
Normal file
9
src/Alive.Net.Example/wwwroot/web.config
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<system.webServer>
|
||||
<handlers>
|
||||
<add name="httpPlatformHandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified"/>
|
||||
</handlers>
|
||||
<httpPlatform processPath="%DNX_PATH%" arguments="%DNX_ARGS%" stdoutLogEnabled="false" startupTimeLimit="3600"/>
|
||||
</system.webServer>
|
||||
</configuration>
|
||||
20
src/Alive.Net.UnitTests/Alive.Net.UnitTests.xproj
Normal file
20
src/Alive.Net.UnitTests/Alive.Net.UnitTests.xproj
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
|
||||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.Props" Condition="'$(VSToolsPath)' != ''" />
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>4ca8001b-27c7-4671-b451-2c2da00a3827</ProjectGuid>
|
||||
<RootNamespace>Alive.Net.UnitTests</RootNamespace>
|
||||
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
|
||||
<OutputPath Condition="'$(OutputPath)'=='' ">..\..\artifacts\bin\$(MSBuildProjectName)\</OutputPath>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" />
|
||||
</Project>
|
||||
16
src/Alive.Net.UnitTests/Class1.cs
Normal file
16
src/Alive.Net.UnitTests/Class1.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Alive.Net.UnitTests
|
||||
{
|
||||
// This project can output the Class library as a NuGet Package.
|
||||
// To enable this option, right-click on the project and select the Properties menu item. In the Build tab select "Produce outputs on build".
|
||||
public class Class1
|
||||
{
|
||||
public Class1()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
23
src/Alive.Net.UnitTests/Properties/AssemblyInfo.cs
Normal file
23
src/Alive.Net.UnitTests/Properties/AssemblyInfo.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("Alive.Net.UnitTests")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("Alive.Net.UnitTests")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2016")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("4ca8001b-27c7-4671-b451-2c2da00a3827")]
|
||||
23
src/Alive.Net.UnitTests/project.json
Normal file
23
src/Alive.Net.UnitTests/project.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"version": "1.0.0-*",
|
||||
"description": "Alive.Net.UnitTests Class Library",
|
||||
"authors": [ "Tommy Parnell" ],
|
||||
"tags": [ "" ],
|
||||
"projectUrl": "",
|
||||
"licenseUrl": "",
|
||||
"dependencies": {
|
||||
"Alive.Net": ""
|
||||
},
|
||||
"frameworks": {
|
||||
"net451": { },
|
||||
"dotnet5.4": {
|
||||
"dependencies": {
|
||||
"Microsoft.CSharp": "4.0.1-beta-23516",
|
||||
"System.Collections": "4.0.11-beta-23516",
|
||||
"System.Linq": "4.0.1-beta-23516",
|
||||
"System.Runtime": "4.0.21-beta-23516",
|
||||
"System.Threading": "4.0.11-beta-23516"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
20
src/Alive.Net/Alive.Net.xproj
Normal file
20
src/Alive.Net/Alive.Net.xproj
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
|
||||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.Props" Condition="'$(VSToolsPath)' != ''" />
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>1628a48e-dd1d-45c7-a316-6cfd8498845c</ProjectGuid>
|
||||
<RootNamespace>Alive.Net</RootNamespace>
|
||||
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
|
||||
<OutputPath Condition="'$(OutputPath)'=='' ">..\..\artifacts\bin\$(MSBuildProjectName)\</OutputPath>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" />
|
||||
</Project>
|
||||
69
src/Alive.Net/Alive.cs
Normal file
69
src/Alive.Net/Alive.cs
Normal file
@@ -0,0 +1,69 @@
|
||||
using Microsoft.AspNet.Builder;
|
||||
using Microsoft.AspNet.Http;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Alive.Net
|
||||
{
|
||||
public class Alive
|
||||
{
|
||||
private RequestDelegate _next;
|
||||
|
||||
private AliveOptions Options { get; set; }
|
||||
|
||||
public Alive(RequestDelegate next, AliveOptions options)
|
||||
{
|
||||
Options = options ?? new AliveOptions();
|
||||
if (next == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(next), "RequestDelegate not passed in");
|
||||
}
|
||||
_next = next;
|
||||
}
|
||||
|
||||
public async Task Invoke(HttpContext context)
|
||||
{
|
||||
if (context.Request.Path.Equals(this.Options.LivecheckPath, StringComparison.CurrentCultureIgnoreCase))
|
||||
{
|
||||
context.Response.StatusCode = (int)this.Options.ReturnStatusCode;
|
||||
if (!string.IsNullOrWhiteSpace(Options.BodyText))
|
||||
{
|
||||
await context.Response.WriteAsync(Options.BodyText);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
await _next?.Invoke(context);
|
||||
}
|
||||
//context.Request.Path.
|
||||
}
|
||||
}
|
||||
|
||||
public static class BuilderExtension
|
||||
{
|
||||
/// <summary>
|
||||
/// Automatic livecheck
|
||||
/// </summary>
|
||||
/// <param name="app"></param>
|
||||
/// <param name="options">Setup your options</param>
|
||||
public static void UseAlive(this IApplicationBuilder app, Action<AliveOptions> options)
|
||||
{
|
||||
var userOptions = new AliveOptions();
|
||||
options?.Invoke(userOptions);
|
||||
app.UseMiddleware<Alive>(userOptions);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Automatic livecheck
|
||||
/// </summary>
|
||||
/// <param name="app"></param>
|
||||
/// <param name="options">Setup your options</param>
|
||||
public static void UseHeartBeat(this IApplicationBuilder app, Action<AliveOptions> options)
|
||||
{
|
||||
var userOptions = new AliveOptions();
|
||||
options?.Invoke(userOptions);
|
||||
app.UseMiddleware<Alive>(userOptions);
|
||||
}
|
||||
}
|
||||
}
|
||||
16
src/Alive.Net/AliveOptions.cs
Normal file
16
src/Alive.Net/AliveOptions.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using Microsoft.AspNet.Http;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Alive.Net
|
||||
{
|
||||
public class AliveOptions
|
||||
{
|
||||
public PathString LivecheckPath { get; set; } = new PathString("/livecheck");
|
||||
public HttpStatusCode ReturnStatusCode { get; set; } = HttpStatusCode.OK;
|
||||
public string BodyText { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
23
src/Alive.Net/Properties/AssemblyInfo.cs
Normal file
23
src/Alive.Net/Properties/AssemblyInfo.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("Alive.Net")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("Alive.Net")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2016")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("1628a48e-dd1d-45c7-a316-6cfd8498845c")]
|
||||
23
src/Alive.Net/project.json
Normal file
23
src/Alive.Net/project.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"version": "1.0.0-*",
|
||||
"description": "Alive.Net Class Library",
|
||||
"authors": [ "Tommy Parnell" ],
|
||||
"tags": [ "" ],
|
||||
"projectUrl": "",
|
||||
"licenseUrl": "",
|
||||
"dependencies": {
|
||||
"Microsoft.AspNet.Http.Abstractions": "1.0.0-rc1-final"
|
||||
},
|
||||
"frameworks": {
|
||||
"net451": { },
|
||||
"dotnet5.4": {
|
||||
"dependencies": {
|
||||
"Microsoft.CSharp": "4.0.1-beta-23516",
|
||||
"System.Collections": "4.0.11-beta-23516",
|
||||
"System.Linq": "4.0.1-beta-23516",
|
||||
"System.Runtime": "4.0.21-beta-23516",
|
||||
"System.Threading": "4.0.11-beta-23516"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user