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 Microsoft.AspNetCore.Http; | |
| using Microsoft.AspNetCore.Mvc; | |
| public class FailedPreconditionObjectResult : ObjectResult | |
| { | |
| public FailedPreconditionObjectResult(string detail) | |
| : base(detail) | |
| => StatusCode = StatusCodes.Status412PreconditionFailed; | |
| } |
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 Microsoft.AspNetCore.JsonPatch; | |
| using Microsoft.AspNetCore.JsonPatch.Operations; | |
| using Newtonsoft.Json.Linq; | |
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| //Based on this: https://blog.abodit.com/posts/2014-05-json-patch-c-implementation/ | |
| public static class JsonPatchDocumentDiff | |
| { |
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.Expressions; | |
| using System.Reflection; | |
| using System.Collections.Concurrent; | |
| public class ReflectionUtilities | |
| { | |
| private static readonly LockingConcurrentDictionary<PropertyInfo, Func<object, object>> getterCache; | |
| private static readonly LockingConcurrentDictionary<PropertyInfo, Action<object, object>> setterCache; |
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.Linq.Expressions; | |
| using System.Reflection; | |
| public static class TypeActivator | |
| { | |
| /// <summary> | |
| /// Returns an instance of type <typeparamref name="TInstance"/> on which the method is invoked. | |
| /// </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
| #!/bin/bash | |
| # | |
| # check commit messages for semantic versioning tags | |
| REGEX="\\+semver:\\s?(breaking|major|feature|minor|fix|patch|none|skip)" | |
| DEFAULT_BRANCH=$(git symbolic-ref HEAD) | |
| ERROR_MSG="[POLICY] The commit message doesn't contains a semantic versioning tag" | |
| while read OLDREV NEWREV REFNAME ; do | |
| if [[ "${REFNAME}" != "${DEFAULT_BRANCH:=refs/heads/master}" ]]; then |
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
| param | |
| ( | |
| [String]$Path, | |
| [String]$Server, | |
| [String]$Database | |
| ) | |
| $sqlCmdUtil = "C:\Program Files\Microsoft SQL Server\110\Tools\Binn\SQLCMD.EXE" | |
| Get-ChildItem $Path\*.sql | Sort-Object -Property Name | % { & $sqlCmdUtil -S $Server -d $Database -i $_.FullName -t 750 -l 600 } |
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
| function Register-Watcher-ToCopy { | |
| param ( | |
| [string]$sourceFolder, | |
| [string]$destFolder, | |
| [string]$id | |
| ) | |
| $filter = "*.*" | |
| $watcher = New-Object System.IO.FileSystemWatcher $sourceFolder, $filter -Property @{ | |
| IncludeSubdirectories = $true |
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.Net; | |
| using System.Net.Http; | |
| using System.Threading; | |
| using System.Threading.Tasks; | |
| using System.Web.Http; | |
| public class NotAcceptableResult : IHttpActionResult | |
| { | |
| private readonly HttpRequestMessage 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
| using System.Collections.Specialized; | |
| using System.Web; | |
| using System.Web.Mvc; | |
| using Microsoft.VisualStudio.TestTools.UnitTesting; | |
| using Moq; | |
| //http://mdavies.net/2013/06/07/unit-testing-mvc3mvc4-model-binders/ | |
| public abstract class ModelBinderTestsBase<TBinder, TModel> | |
| where TBinder : IModelBinder, new() | |
| { |
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.Net.Http; | |
| internal class EmptyContent : ByteArrayContent | |
| { | |
| public EmptyContent() | |
| : base(new byte[0]) | |
| { | |
| } | |
| } |