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
namespace Middleware | |
{ | |
public class WebApiTrace | |
{ | |
public Guid Id { get; set; } | |
public WebApiTrace() | |
{ | |
Id = Guid.NewGuid(); |
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 static class SortUtils | |
{ | |
private static readonly Type QueryableType = typeof(Queryable); | |
public static IOrderedQueryable<T> OrderDescending<T>(this IQueryable<T> query, string propertyName) | |
{ | |
return ApplyOrdering(query, propertyName, false, true); | |
} | |
public static IOrderedQueryable<T> OrderAscending<T>(this IQueryable<T> query, string propertyName) |
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 RunHelper | |
{ | |
readonly bool _logError; | |
readonly ILog _log; | |
public RunHelper( ILog log ) | |
{ | |
_log = log; | |
_logError = 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
DECLARE @Sql NVARCHAR(500) DECLARE @Cursor CURSOR | |
SET @Cursor = CURSOR FAST_FORWARD FOR | |
SELECT DISTINCT sql = 'ALTER TABLE [' + tc2.TABLE_NAME + '] DROP [' + rc1.CONSTRAINT_NAME + ']' | |
FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS rc1 | |
LEFT JOIN INFORMATION_SCHEMA.TABLE_CONSTRAINTS tc2 ON tc2.CONSTRAINT_NAME =rc1.CONSTRAINT_NAME | |
OPEN @Cursor FETCH NEXT FROM @Cursor INTO @Sql | |
WHILE (@@FETCH_STATUS = 0) |
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
SELECT CAST(SERVERPROPERTY('ServerName') AS [nvarchar](256)) AS [SQLServer] | |
,db.[database_id] AS [DatabaseID] | |
,db.[name] AS [DatabaseName] | |
,id.[object_id] AS [ObjectID] | |
,id.[statement] AS [FullyQualifiedObjectName] | |
,id.[equality_columns] AS [EqualityColumns] | |
,id.[inequality_columns] AS [InEqualityColumns] | |
,id.[included_columns] AS [IncludedColumns] | |
,gs.[unique_compiles] AS [UniqueCompiles] | |
,gs.[user_seeks] AS [UserSeeks] |
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
SELECT db_name(d.database_id) dbname | |
, object_name(d.object_id) tablename | |
, d.equality_columns | |
, d.inequality_columns | |
, d.included_columns | |
,'CREATE INDEX [missing_index_' + CONVERT (varchar, g.index_group_handle) + '_' + CONVERT (varchar, d.index_handle) | |
+ '_' + LEFT (PARSENAME(d.statement, 1), 32) + ']' | |
+ ' ON ' + d.statement | |
+ ' (' + ISNULL (d.equality_columns,'') | |
+ CASE WHEN d.equality_columns IS NOT NULL AND d.inequality_columns IS NOT NULL THEN ',' ELSE '' END |
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
begin try | |
SELECT | |
d.[object_id], | |
s = OBJECT_SCHEMA_NAME(d.[object_id]), | |
o = OBJECT_NAME(d.[object_id]), | |
d.equality_columns, | |
d.inequality_columns, | |
d.included_columns, | |
s.unique_compiles, | |
s.user_seeks, s.last_user_seek, |
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
/// <summary> | |
/// Provides methods for converting <see cref="DateTime"/> structures to and from the equivalent RFC 3339 string representation. | |
/// </summary> | |
public static class Rfc3339DateTime | |
{ | |
static Rfc3339DateTime() | |
{ | |
Formats = new List<string> | |
{ |
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
<# | |
#> | |
<#@ template debug="true" hostspecific="true" language="C#" #> | |
<#@ include file="EF6.Utility.CS.ttinclude"#> | |
<#@ assembly name="System.Configuration" #> | |
<#@ assembly name="System.Windows.Forms" #> | |
<#@ import namespace="System.Data" #> | |
<#@ import namespace="System.Data.SqlClient" #> | |
<#@ import namespace="System.Data.Common" #> | |
<#@ import namespace="System.Data.Entity.Infrastructure.Pluralization" #> |
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
// Forked from: http://blog.ashmind.com/2007/09/05/evaluating-javascript-in-watin/ | |
// This helper class adds Eval so that you can obtain the result of a JavaScript | |
// function. This functionality is not native to WatiN. | |
/* | |
* Usage: | |
* var browser = new IE(); | |
* var foo = browser.NativeDocument.Eval<bool>("isFoo()"); | |
*/ |
OlderNewer