This file contains 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; | |
using AutoMapper; | |
using AutoMapper.QueryableExtensions; | |
using FluentAssertions; | |
using NUnit.Framework; | |
namespace Automapper.PolymorphicList.Tests | |
{ | |
[TestFixture] |
This file contains 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 @tableName VARCHAR(50) = 'Foo' | |
SELECT | |
'public ' | |
+ CASE | |
WHEN DATA_TYPE = 'int' THEN 'int' | |
WHEN DATA_TYPE = 'uniqueidentifier' THEN 'Guid' | |
WHEN DATA_TYPE = 'nvarchar' THEN 'string' | |
WHEN DATA_TYPE = 'datetime' THEN 'DateTime' | |
WHEN DATA_TYPE = 'bit' THEN 'bool' |
This file contains 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.ComponentModel; | |
using System.Linq; | |
using System.Reflection; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace Inventory.Data { |
This file contains 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 override bool Equals(object obj) | |
{ | |
return this.Equals(obj as IAggregate); | |
} | |
public virtual bool Equals(IAggregate other) | |
{ | |
return null != other && other.Id == this.Id; | |
} |
This file contains 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.Web; | |
using System.Web.Mvc; | |
namespace Inventory.Web.Code.Extensions | |
{ | |
public enum SelectListItemEnumValueOption | |
{ |
This file contains 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 @InsertDate DATETIME2 | |
SET @InsertDate = GETDATE() | |
DECLARE @InsertDateString NVARCHAR(24) | |
SET @InsertDateString = | |
CAST(YEAR(@InsertDate) AS NVARCHAR(4)) | |
+ '-' | |
+ CASE | |
WHEN MONTH(@InsertDate) < 10 THEN '0' | |
ELSE '' |
This file contains 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
open System.IO | |
let lines path = | |
System.IO.File.ReadAllLines(path) | |
let writeFile lines path = | |
System.IO.File.Delete(path) | |
System.IO.File.AppendAllLines(path, lines) | |
let replaceNulls path = | |
let origFileNameAndExtension = System.IO.Path.GetFileName(path) |
This file contains 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
--USE <REPLACE WITH DATABASE NAME> | |
CREATE TABLE #tablesOfInterest (TableName VARCHAR(2000)) | |
INSERT INTO #tablesOfInterest | |
SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES | |
WHERE TABLE_NAME | |
IN ('table1' | |
,'table2' | |
) |
This file contains 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
USE <REPLACE WITH DATABASE NAME> | |
SELECT | |
foreignKeyConstraintObject.Name as ForeignKeyConstraint | |
,foreignKeySchema.Name as ForeignKeySchema | |
,foreignKeyTable.Name as ForeignKeyTable | |
,foreignKeyColumn.Name as FoeignKeyName | |
,referencedSchema.Name as ReferencedSchema | |
,referencedTable.Name as ReferencedTable | |
,referencedColumn.Name as ReferencedColumn |
This file contains 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 SERVERPROPERTY('productversion'), SERVERPROPERTY ('productlevel'), SERVERPROPERTY ('edition') |
NewerOlder