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 UniqueUsernameRule : IFieldValidationRule | |
| { | |
| public void Validate(Accessor accessor, ValidationContext context) | |
| { | |
| var email = accessor.GetValue(context.Target) as EmailAddress; | |
| var repository = context.Services.Get<IEntityRepository>(); | |
| if (email == null) return; | |
| var isUnique = !repository.All<User>().Any(x => x.Username.Equals(email.Address, StringComparison.OrdinalIgnoreCase)); |
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
| [TestFixture] | |
| public class NumberBindingFixture | |
| { | |
| private CultureInfo _currentCulture; | |
| private CultureInfo _currentUICulture; | |
| private Model _model; | |
| private string _rawValue; | |
| private double _expectedNumber; | |
| [SetUp] |
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
| [AttributeUsage(AttributeTargets.Method)] | |
| public class UrlAliasAttribute : Attribute | |
| { | |
| private readonly string _url; | |
| public UrlAliasAttribute(string url) | |
| { | |
| _url = url; | |
| } | |
| public string Url |
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
| console.log("test"); |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title><use:title /></title> | |
| ${this.WriteScriptTags()} | |
| </head> | |
| <body> | |
| <div class="page"> | |
| <div id="main"> | |
| <use:view /> |
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 ALS.Validation.Ajax; | |
| using FubuMVC.Core.Ajax; | |
| using FubuMVC.Core.Security; | |
| using HelloWorld.Handlers.Home; | |
| using HelloWorld.Services; | |
| namespace HelloWorld.Handlers.Account | |
| { | |
| // ... |
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 SomeRule : IValidationRule | |
| { | |
| private readonly ISomeService _service; | |
| public SomeRule(ISomeService service) | |
| { | |
| _service = service; | |
| } |
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 AppRegistry : FubuRegistry | |
| { | |
| public AppRegistry() | |
| { | |
| //.. | |
| HtmlConvention(x => | |
| { | |
| x.Editors | |
| .If(def => // Condition) |
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 AppHtmlConventions : HtmlConventionRegistry | |
| { | |
| public AppHtmlConventions() | |
| { | |
| //... | |
| Editors | |
| .If(def => // Condition) | |
| .Modify((e, tag) => tag.Attr("value", e.RawValue.ToString())); | |
| //... | |
| } |