Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ItemTemplates for Razor Pages #566

Merged
merged 4 commits into from
Apr 15, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions template_feed/Microsoft.DotNet.Web.ItemTemplates/Templates.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>Microsoft.DotNet.Web.ItemTemplates</id>
<version>$version$</version>
<authors>Microsoft</authors>
<description>Web File Templates for Microsoft Template Engine</description>
<language>en-US</language>
<projectUrl>https://github.com/dotnet/templating</projectUrl>
<licenseUrl>https://www.microsoft.com/web/webpi/eula/net_library_eula_enu.htm</licenseUrl>
<packageTypes>
<packageType name="Template" />
</packageTypes>
</metadata>
<files>
<file src="content/**" target="" />
</files>
</package>
21 changes: 21 additions & 0 deletions template_feed/Microsoft.DotNet.Web.ItemTemplates/build.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\Version.props" />
<PropertyGroup>
<TargetFramework>netstandard1.0</TargetFramework>
<NuspecFile>$(MSBuildThisFileDirectory)\Templates.nuspec</NuspecFile>
<NuspecProperties>version=$(PackageVersion)</NuspecProperties>
<IncludeBuildOutput>False</IncludeBuildOutput>
<IncludeBuildOutput>False</IncludeBuildOutput>
<IncludeSource>False</IncludeSource>
<GenerateAssemblyInfo>False</GenerateAssemblyInfo>
<OutputPath>$(TemplatesFolder)</OutputPath>
<EnableDefaultItems>False</EnableDefaultItems>
<BaseIntermediateOutputPath>$(MSBuildThisFileDirectory)..\..\artifacts\scratch</BaseIntermediateOutputPath>
</PropertyGroup>
<ItemGroup>
<PackageReference Remove="Microsoft.NETCore.App" />
<Compile Remove="$(GitInfoFile)" />
<Compile Remove="$(MSBuildThisFileDirectory)../../src/GitInfo.cs" />
<None Remove="**/*.csproj" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"author": "Microsoft",
"classifications": ["Web", "ASP.NET"],
"name": "Razor Page",
"generatorVersions": "[1.0.0.0-*)",
"groupIdentity": "Microsoft.AspNetCore.Mvc.RazorPage",
"precedence": "100",
"identity": "Microsoft.AspNetCore.Mvc.RazorPage",
"shortName": "page",
"sourceName": "Index",
"primaryOutputs": [
{ "path": "Index.cshtml"},
{
"path": "Index.cshtml.cs",
"condition": "(!no-pagemodel)"
}
],
"defaultName": "Index",
"sources": [
{
"modifiers": [
{
"condition": "(no-pagemodel)",
"exclude": [
"Index.cshtml.cs"
]
}
]
}
],
"symbols": {
"namespace": {
"description": "namespace for the generated code",
"replaces": "MyApp.Namespace",
"type": "parameter"
},
"no-pagemodel": {
"description": "create page without a PageModel",
"type": "parameter",
"datatype": "bool",
"defaultValue": "false"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
@page
@*#if (!no-pagemodel)*@
@model IndexModel
@*#endif*@
@{
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;

namespace MyApp.Namespace
{
public class IndexModel : PageModel
{
public void OnGet()
{
}
}
}
1 change: 1 addition & 0 deletions template_feed/Template.proj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

<ItemGroup>
<TemplatePack Include="Microsoft.DotNet.Common.ItemTemplates" />
<TemplatePack Include="Microsoft.DotNet.Web.ItemTemplates" />

<TemplatePack Include="Microsoft.DotNet.Common.ProjectTemplates.1.x" />
<TemplatePack Include="Microsoft.DotNet.Web.ProjectTemplates.1.x" />
Expand Down