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
Rules | |
.IfProperty(p => p.Name.ToLower().Contains("email"), validate => validate.AsEmail()) | |
.IfProperty(p => p.Name.ToLower().Contains("phone"), validate => validate.AsPhoneNumber()); |
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 HelloWorldValidationRegistry : ValidationRegistry | |
{ | |
public HelloWorldValidationRegistry() | |
{ | |
AppliesTo | |
.ToThisAssembly(); | |
Models | |
.IncludeTypes(t => t.Namespace.StartsWith(typeof(ModelMarker).Namespace)) | |
.Exclude<ModelMarker>(); |
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 void AddAsset(Action<IAddAssetExpression> configure) | |
{ | |
var assetBuilder = new AssetBuilder(this); | |
configure(expression); | |
_assets.add(assetBuilder.Build()); | |
} |
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 ApplicationSetting | |
{ | |
public string Key { get; set; } | |
public string Value { 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
// metadata for finding models | |
[AttributeUsage(AttributeTargets.Class, Inherited = false)] | |
public abstract class DecoratorAttribute : Attribute | |
{ | |
private readonly Type _entityType; | |
protected DecoratorAttribute(Type entityType) | |
{ | |
_entityType = entityType; | |
} |
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 DomElement : DynamicObject | |
{ | |
private readonly object _inner; | |
public DomElement(object inner) | |
{ | |
_inner = inner; | |
} | |
public override bool TryInvokeMember(InvokeMemberBinder binder, object[] args, out object result) |
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 Test | |
{ | |
public Test() | |
{ | |
Scan(x => | |
{ | |
x.IncludeDirectory("content/scripts"); | |
x.IncludeDirectory("packages"); | |
x.IncludeSubdirectories(); | |
}); |
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 PartialActionExtensionsConvention : IRegistrationConvention | |
{ | |
public void Process(Type type, Registry registry) | |
{ | |
var extensionType = type.FindInterfaceThatCloses(typeof(IPartialActionExtension<>)); | |
if(extensionType == null) | |
{ | |
return; | |
} |
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 OrderProcessingModule | |
{ | |
public void Process(OrderStatusMessage orderStatusMessage) | |
{ | |
string connectionString = ConfigurationManager.ConnectionStrings["Main"].ConnectionString; | |
Order order = null; | |
using(var connection = new SqlConnection(connectionString)) | |
{ | |
order = FetchData(orderStatusMessage, connection); |
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 should_return_single_view_token_matched_on_policy_criteria() | |
{ | |
_descriptor.Templates.Add("Projects\\Dashboard.spark"); | |
_descriptor.Templates.Add("Shared\\Application.spark"); | |
var descriptor2 = newDescriptor(); | |
descriptor2.Templates.Add("Projects\\StoryMap.spark"); | |
descriptor2.Templates.Add("Shared\\Application.spark"); | |
_token.Descriptors.Add(descriptor2); |