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
| <!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
| 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
| [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
| [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
| 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
| var foo = new ObjectDef(typeof(Foo)); // you can also target a value instead of a type (new Foo()) | |
| foo.DependencyByType(typeof(IBar), typeof(Bar)); // by type | |
| foo.DependencyByValue(typeof(IBaz), new Baz()); // by value | |
| Services(x => | |
| { | |
| x.AddService(typeof(IFoo), foo); | |
| }); |
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.Collections.Generic; | |
| using Bottles; | |
| using Bottles.Diagnostics; | |
| using FubuCore; | |
| using Spark; | |
| namespace WebApplication7 | |
| { | |
| public class SparkSettingsActivator : IActivator | |
| { |
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 MyOwnPolicy : IAssetPolicy | |
| { | |
| private readonly IAssetTagPlanCache _planCache; | |
| private readonly IAssetDependencyFinder _finder; | |
| public MyOwnPolicy(IAssetTagPlanCache planCache, IAssetDependencyFinder finder) | |
| { | |
| _planCache = planCache; | |
| _finder = finder; | |
| } |
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 AssetsWarmUpPolicy : IAssetPolicy | |
| { | |
| private readonly IAssetRequirements _requirements; | |
| private readonly IAssetTagPlanCache _planCache; | |
| public AssetsWarmUpPolicy(IAssetRequirements requirements, IAssetTagPlanCache planCache) | |
| { | |
| _requirements = requirements; | |
| _planCache = planCache; | |
| } |