View ConsoleColorExtensions.cs
using System;
namespace Utilities.Extensions
{
public static class ConsoleColorExtensions
{
/// <summary>
/// Writes the specified string value, followed by the current line terminator, to the standard output stream.
/// </summary>
/// <example>
View EntityFrameworkMigrationTests.cs
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Data.Entity.Migrations;
using System.Data.Entity.Migrations.Design;
using System.Diagnostics;
using System.Linq;
namespace YabbaDabbaDoo
{
[TestClass]
public class EntityFrameworkMigrationTests
View TFS_Compare_Filter_Criteria.txt
!*.csproj.user;!UpgradeLog.htm;!*.vspscc;!packages\;!bin\;!bld\;!ClientBin\;!Debug\;!obj\;!AppPackages\;!Release\;!TestResults\;!*.*~!*.appx!*.appxrecipe;!*.cache!*.cer!*.dbmdl!*.dll!*.docstates!*.docstates.suo;!*.err!*.exe!*.ilk!*.ipch!*.lastbuildstate!*.lce!*.ldf!*.lib!*.log!*.mdf!*.msscci!*.ncb!*.obj!*.opensdf!*.pch!*.pdb!*.pri!*.res!*.resources!*.sdf!*.suo!*.swp!*.temp!*.tfOrig*!*.tlog!*.tmp!*.trx!*.user!*.unsuccessfulbuild!*.v11.suo!*.vcxproj.user!*.vsix!*.vsmdi!*.vspscc!*.vssettings!*.vssscc!*.wrn!*.xap;!.metadata\
View SqlServerAuditColumns.sql
CREATE TABLE TableName
(
TableNameId INT NOT NULL IDENTITY(1,1),
/* Other columns */
CreatedDate DATETIME2 NOT NULL CONSTRAINT [DF_TableName_CreatedDate] DEFAULT (GETDATE()),
CreatedBy VARCHAR(100) NOT NULL CONSTRAINT [DF_TableName_CreatedBy] DEFAULT (SUSER_SNAME()),
CreatedByHostName VARCHAR(100) NOT NULL CONSTRAINT [DF_TableName_CreatedByHostName] DEFAULT (HOST_NAME()),
ModifiedDate DATETIME2 NOT NULL CONSTRAINT [DF_TableName_ModifiedDate] DEFAULT (GETDATE()),
ModifiedBy VARCHAR(100) NOT NULL CONSTRAINT [DF_TableName_ModifiedBy] DEFAULT (SUSER_SNAME()),
ModifiedByHostName VARCHAR(100) NOT NULL CONSTRAINT [DF_TableName_ModifiedByHostName] DEFAULT (HOST_NAME())
View InsertWithOracleArrayBinding.cs
/// <summary>
/// Insert list into a database table using Oracle array binding (a type of bulk insert).
/// </summary>
/// <typeparam name="T">Type of data in list.</typeparam>
/// <param name="listOfData">List to insert.</param>
/// <param name="tableName">Table name.</param>
/// <returns>Rows affected.</returns>
public int Insert<T>(List<T> listOfData, string tableName) where T : class, new()
{
try
View VbaProject.OTM
Public Sub ShowCategoriesDialog()
Dim Mail As Object
Set Mail = Application.ActiveInspector.CurrentItem
Mail.ShowCategoriesDialog
End Sub
Public Sub AddAwaitingFeedbackCategory()
Dim Mail As Object
Set Mail = Application.ActiveInspector.CurrentItem
Mail.Categories = "Awaiting Feedback"
View SocialSecurityNumberGenerator.cs
using System;
namespace Helpers
{
/// <summary>
/// Social Security Number Generator.
/// </summary>
public static class SocialSecurityNumberGenerator
{
/// <summary>
View NameGenerator.cs
using System;
namespace Helpers
{
/// <summary>
/// Name Generator.
/// </summary>
public static class NameGenerator
{
// List of the top 40 boy and girl baby names of 2016
View InjectAppNameIntoConnectionString.cs
public string GetConnectionString( string connectionStringName, string applicationName )
{
var connectionString = ConfigurationManager.ConnectionStrings[ connectionStringName ];
var builder = new System.Data.SqlClient.SqlConnectionStringBuilder( connectionString );
// Inject application name into connection string
if ( String.IsNullOrWhiteSpace( builder.ApplicationName ) )
{
if ( String.IsNullOrWhiteSpace( applicationName ) == false )
View NanoWindowsServiceExample.cs
using System;
using System.Diagnostics;
using System.Threading;
using Nano.Web.Core;
using Nano.Web.Core.Host.HttpListener;
namespace NanoWindowsServiceExample
{
public class Program
{