This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Result | |
{ | |
protected internal Result(bool isSuccess, Error error) | |
{ | |
if (isSuccess && error != Error.None) | |
{ | |
throw new InvalidOperationException(); | |
} | |
if (!isSuccess && error == Error.None) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Data; | |
using System.Data.SqlClient; | |
namespace Core.Data | |
{ | |
/// <summary> | |
/// | |
/// </summary> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--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 = "' + |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Umbraco Clear Old Document Versions To Decrease Database Size And Improve Performance | |
-- http://borism.net/2008/12/16/fixing-a-large-cmspropertydata-table-in-umbraco/ | |
DECLARE @createdDate Datetime = DATEADD(m, -1, getdate()) | |
-- dump logs | |
-- TRUNCATE TABLE umbracolog -- faster if log table is very big and you don't need anything | |
DELETE FROM umbracolog WHERE Datestamp < @createdDate | |
-- clean up old versions | |
DELETE FROM cmsPropertyData WHERE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Document</title> | |
</head> | |
<body> | |
<header> | |
<nav> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections.Generic; | |
using System.Linq; | |
usingusing System.Collections.Generic; | |
using System.Linq; | |
using System.Web.Mvc; | |
namespace Gists.Mvc.Helpers | |
{ | |
public static class ModelExtensions | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Linq; | |
using Umbraco.Core; | |
using Umbraco.Core.Logging; | |
using Umbraco.Web; | |
namespace Sniper.Umbraco | |
{ | |
public static class MultiNodeTreePickerIdToUdiMigrator | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*bootstrap 3 resets for SharePoint*/ | |
/*border-box causes many issues with SP*/ | |
*, *:before, *:after { | |
-webkit-box-sizing: content-box; | |
-moz-box-sizing: content-box; | |
box-sizing: content-box; | |
} | |
/*reset elements that B3 is expecting to be border-box*/ | |
* [class^="col-"], * [class^="col-"]:before, * [class^="col-"]:after, | |
.container, .container:before, .container:after, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Reflection; | |
using System.Runtime.Remoting.Messaging; | |
using System.Runtime.Remoting.Proxies; | |
using System.Threading.Tasks; | |
namespace Demo | |
{ |
NewerOlder