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 @TableName varchar(255) | |
DECLARE TableCursor CURSOR FOR | |
SELECT table_name FROM information_schema.tables | |
WHERE table_type = 'base table' | |
OPEN TableCursor | |
FETCH NEXT FROM TableCursor INTO @TableName | |
WHILE @@FETCH_STATUS = 0 | |
BEGIN | |
exec('ALTER INDEX ALL ON ' + @TableName + ' REBUILD') |
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
logparser -i:W3C -o:csv "SELECT * INTO c:\temp\results.csv FROM c:\temp\myLogFile.log" |
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
<?xml version="1.0" encoding="utf-8"?> | |
<packages> | |
<package id="notepadplusplus" /> | |
<package id="fiddler" /> | |
<package id="cmder" /> | |
<package id="sourcetree" /> | |
<package id="TortoiseGit" /> | |
<package id="winrar" /> | |
<package id="rdcman" /> | |
<package id="greenshot" /> |
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
//Taken from http://codebetter.com/glennblock/2012/05/24/two-ways-to-work-with-http-responses-in-apicontroller-httpresponsemessage-and-httpresponseexception/ | |
public class CustomerController : ApiController | |
{ | |
private ICustomerContext repo; | |
public CustomerController(ICustomerContext repo) | |
{ | |
this.repo = repo; | |
} | |
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
[Test] | |
public void AllApiControllersInProjectInheritFromBaseApiController() | |
{ | |
var apiBaseType = typeof(BaseApiController); | |
var controllerTypes = (from type in apiBaseType.Assembly.GetTypes() | |
where type.Name.EndsWith("Controller") && type.IsSubclassOf(typeof(ApiController)) | |
&& !type.IsSubclassOf(typeof (BaseApiController)) | |
&& type != typeof(BaseApiController) | |
select type.Name).ToArray(); |
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.Data.Entity; | |
using System.Diagnostics; | |
using NUnit.Framework; | |
namespace EntityFrameworkTests | |
{ | |
//TODO replace this stub with your own | |
public class MyDataContext : DbContext | |
{} |
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
kernel.Bind(x => x.FromAssembliesMatching("Company.Product.Namespace.*") | |
.SelectAllClasses() | |
.BindDefaultInterface() | |
.Configure(b => b.InRequestScope())); |
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
ICACLS C:\inetpub\wwwroot\MyWebsite /grant "IIS APPPOOL\MyAppPool":(OI)(CI)(RX) |
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
//the 'domain/service' layer... | |
public class ContactService | |
{ | |
public ContactService(IContactRepository contactRepository) | |
{ | |
_contactRepository = contactRepository; | |
} | |
public Contact GetContact(int id) | |
{ |
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 bool IsNull<T>(this T instanceToCheck) where T : class | |
{ | |
return instanceToCheck == default(T); | |
} |