Skip to content

Instantly share code, notes, and snippets.

@DanElliott
DanElliott / ActivePageTagHelper.cs
Last active July 13, 2023 21:10 — forked from bjcull/ActiveRouteTagHelper.cs
Adds an "active" class to the given element when the route parameters match. An Active Page Tag Helper for use with Razor Pages.
[HtmlTargetElement(Attributes = "is-active-page")]
public class ActivePageTagHelper : TagHelper
{
/// <summary>The name of the action method.</summary>
/// <remarks>Must be <c>null</c> if <see cref="P:Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper.Route" /> is non-<c>null</c>.</remarks>
[HtmlAttributeName("asp-page")]
public string Page { get; set; }
/// <summary>
/// Gets or sets the <see cref="T:Microsoft.AspNetCore.Mvc.Rendering.ViewContext" /> for the current request.
@DanElliott
DanElliott / README-Template.md
Created October 31, 2018 12:28 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@DanElliott
DanElliott / ClassGenerator.sql
Created July 24, 2019 12:03 — forked from gionnani/ClassGenerator.sql
Generate C# class from database table
--modified from SO: http://stackoverflow.com/questions/5873170/generate-class-from-database-table
--added table and column
declare @TableName sysname = 'TableName'
declare @Result varchar(max) = '[Table(Name = "' + @TableName + '")]
public class ' + @TableName + '
{'
select @Result = @Result + '
[Column(DbType = "' +