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
[Test] | |
public void TestChunks() | |
{ | |
const string connectionString = @"YOUR_DB"; | |
const string insertEvent = "INSERT INTO Events (id, payload) VALUES(@id, @payload)"; | |
const int testSize = 10; | |
using (var con = new SqlConnection(connectionString)) | |
{ |
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 class TestX | |
{ | |
[Test] | |
public void T() | |
{ | |
Inspect(typeof(int)); | |
Inspect(typeof(long)); | |
Inspect(typeof(bool)); | |
Inspect(typeof(Guid)); | |
} |
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
/// <summary> | |
/// The model binder aware of entities types. | |
/// </summary> | |
/// <remarks> | |
/// If an action parameter is an entity, it uses custom binding, | |
/// searching for already existing (if id provided) and applying changes onto it. | |
/// | |
/// The binder does not cascade onto entities' properties which are references to the other entities. | |
/// All it does is one level (for entity->entity relationships) mapping. | |
/// </remarks> |
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.Web.Mvc; | |
namespace ActionProviders | |
{ | |
/// <summary> | |
/// The extended controller actions invoker, using other than controllers action providers. | |
/// </summary> | |
public class ActionInvoker : ControllerActionInvoker | |
{ | |
private readonly IActionProvider[] _actionProviders; |
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
/// <summary> | |
/// The class representing an action info, with its <see cref="ActionMethodSelectorAttribute"/> retrieved. | |
/// </summary> | |
/// <remarks> | |
/// For performance optimization, cache this class instances. | |
/// </remarks> | |
public sealed class ActionInfo | |
{ | |
private readonly ActionMethodSelectorAttribute[] _attributes; |
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
remote="$1" | |
url="$2" | |
z40=0000000000000000000000000000000000000000 | |
IFS=' ' | |
while read local_ref local_sha remote_ref remote_sha | |
do | |
if [ "$local_sha" = $z40 ] | |
then |
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 log4net.Core; | |
using log4net.Filter; | |
using log4net.Util; | |
namespace Log4NetEnhancing | |
{ | |
public class ExceptionBasedLogEnhancer : FilterSkeleton | |
{ | |
private const string EventLogKeyEventId = "EventID"; |
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
(function (factory) { | |
if (typeof define === 'function' && define.amd) { | |
// AMD is found. Use it to register as anonymous module. | |
define(['jquery'], factory); | |
} else { | |
// AMD is not found, use a standard module patter | |
factory(jQuery); | |
} | |
}(function ($) { | |
// use $ safetly, it's provided either by AMD or a simple module patter |
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
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)] | |
public class MeasureTimeAttribute : Attribute, ITestAction | |
{ | |
private const string Key = "stopWatch"; | |
public void BeforeTest(TestDetails testDetails) | |
{ | |
TestContext.CurrentContext.Test.Properties[Key] = Stopwatch.StartNew(); | |
} |
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 CodeCop.Core; | |
using CodeCop.Core.Fluent; | |
using NUnit.Framework; | |
namespace CodeCop.Tests | |
{ | |
public class CodeCopStructBugTests | |
{ | |
public unsafe struct WithPtr |
OlderNewer