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 interface IFormHandler<in TForm, out TResult> where TForm : IForm | |
{ | |
TResult Handle(TForm form); | |
} |
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 Localization | |
{ | |
private readonly Func<string> message; | |
private Localization(string message) | |
: this(() => message) | |
{ | |
} | |
private Localization(Func<string> message) |
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
@for /d %%f in (*) do @call :update %%f | |
:update | |
pushd %1 | |
git fetch --all | |
popd | |
@goto :eof |
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 IoCAwareScanner : DefaultModelMetadataScanner | |
{ | |
private readonly Action<Type, Type> registerAsTransient; | |
internal static readonly Type ModelMetadataConfigurationType = typeof(IModelMetadataConfiguration); | |
protected IoCAwareScanner(Action<Type, Type> registerAsTransient) | |
{ | |
this.registerAsTransient = registerAsTransient; | |
} |
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 DelegatedFileStreamResult : FileResult | |
{ | |
readonly Action<Stream> _writer; | |
public DelegatedFileStreamResult(Action<Stream> writer, string contentType) | |
: base(contentType) | |
{ | |
_writer = writer; | |
} |
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
(1 row(s) affected) | |
1 | |
Msg 8117, Level 16, State 1, Procedure proc1, Line 6 | |
Operand data type nvarchar(max) is invalid for avg operator. |
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
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Table_1]') AND type in (N'U')) | |
DROP TABLE [dbo].[Table_1] | |
GO | |
CREATE TABLE [dbo].[Table_1] ([Name] [nvarchar](max) NULL) | |
GO | |
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[proc1]') AND type in (N'P', N'PC')) | |
DROP PROCEDURE [dbo].[proc1] | |
GO |
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
FOR /R . %%G IN (*.cs) DO ( | |
"C:\Program Files\GnuWin32\bin\expand" --tabs=4 --initial "%%G">"%%G.1" | |
del "%%G" | |
move "%%G.1" "%%G" ) |
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 ExpressionExtensions | |
{ | |
public static TResult Invoke<TResult>(this Expression<Func<TResult>> expression) | |
{ | |
return expression.Compile().Invoke(); | |
} | |
public static TResult Invoke<T1, TResult>(this Expression<Func<T1, TResult>> expression, T1 arg1) | |
{ | |
return expression.Compile().Invoke(arg1); |
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.Diagnostics; | |
using Castle.Facilities.TypedFactory; | |
using Castle.MicroKernel.Registration; | |
using Castle.Windsor; | |
using Xunit; | |
public class LifestileTests | |
{ | |
[Fact] | |
public void TestForTypedFactories() |