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 ValidationBehavior<T> : BasicBehavior where T : class | |
{ | |
IFubuRequest request; | |
IChainResolver chain; | |
ContinuationHandler continuation; | |
public ValidationBehavior(IFubuRequest request, IChainResolver chain, ContinuationHandler continuation) : base(PartialBehavior.Executes) | |
{ | |
this.request = request; | |
this.chain = chain; |
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 ValidationBehavior<T> : BasicBehavior where T : class | |
{ | |
IFubuRequest request; | |
IChainResolver chain; | |
IPartialFactory _factory; | |
public ValidationBehavior(IFubuRequest request, IChainResolver chain, IPartialFactory factory) : base(PartialBehavior.Executes) | |
{ | |
this.request = request; | |
this.chain = chain; |
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 SqlBuilder | |
{ | |
Dictionary<string, Clauses> data = new Dictionary<string, Clauses>(); | |
int seq; | |
class Clause | |
{ | |
public string Sql { get; set; } | |
public List<object> Parameters { get; set; } | |
} |
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 IActivity | |
{ | |
void Run(); | |
bool Matches(int i); | |
} | |
public class PluginRunner | |
{ | |
private readonly IContainer _container; | |
private readonly ILogger _logger; |
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 IActivity | |
{ | |
void Run(); | |
bool Matches(int i); | |
} | |
public class PluginCoordinator | |
{ | |
private readonly IPluginActivator _activator; | |
private readonly PluginRunner _pluginRunner; |
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 GuidComb | |
{ | |
public static Guid NewGuid() | |
{ | |
byte[] b = Guid.NewGuid().ToByteArray(); | |
DateTime dateTime = new DateTime(1900, 1, 1); | |
DateTime now = DateTime.Now; | |
TimeSpan timeSpan = new TimeSpan(now.Ticks - dateTime.Ticks); | |
TimeSpan timeOfDay = now.TimeOfDay; | |
byte[] bytes1 = BitConverter.GetBytes(timeSpan.Days); |
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 HomeController : DelegatingControllers.DelegatingController | |
{ | |
public ActionResult Edit(UserEditQueryModel model) | |
{ | |
var vm = Invoker.Execute<UserEditQueryModel, UserEditViewModel>(model); | |
return View(vm); | |
} | |
public ActionResult Edit(UserEditInputModel model) |
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 FluentValidationKeys : StringToken | |
{ | |
public static StringToken CREDITCARD_ERROR = new FluentValidationKeys("'{PropertyName}' is not a valid credit card number."); | |
public static StringToken EMAIL_ERROR = new FluentValidationKeys("'{PropertyName}' is not a valid email address."); | |
public static StringToken EQUAL_ERROR = new FluentValidationKeys("'{PropertyName}' should be equal to '{PropertyValue}'."); | |
public static StringToken EXACT_LENGTH_ERROR = new FluentValidationKeys("'{PropertyName}' must be {MaxLength} characters in length. You entered {TotalLength} characters."); | |
public static StringToken EXCLUSIVEBETWEEN_ERROR = new FluentValidationKeys("'{PropertyName}' must be between {From} and {To} (exclusive). You entered {Value}."); | |
public static StringToken GREATERTHAN_ERROR = new FluentValidationKeys("'{PropertyName}' must be greater than '{ComparisonValue}'."); | |
public static StringToken GREATERTHANOREQUAL_ERROR = new FluentValidationK |
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 BindingExtensions | |
{ | |
public static HtmlTag Data(this HtmlTag html, Dictionary<string, object> dataattrs) | |
{ | |
foreach (var item in dataattrs) | |
{ | |
html.Data(item.Key, item.Value); | |
} | |
return html; | |
} |
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
create database deadlocktest | |
go | |
SELECT snapshot_isolation_state_desc from sys.databases where name='deadlocktest' | |
go | |
--ensure this is off: If Not do the following alters | |
ALTER DATABASE deadlocktest | |
SET ALLOW_SNAPSHOT_ISOLATION OFF | |
go |