public void Validate(FubuCore.Reflection.Accessor accessor, ValidationContext context) { var username = context.GetFieldValue<string>(accessor); var users = context.Service<IUserService>(); if (users.UsernameExists(username)) { context.Notification.RegisterMessage(accessor, StringToken.FromKeyString("Validation:Username", "Username '{username}' already exists"), TemplateValue.For("username", username)); } }
public override FubuMVC.Core.Behaviors.IActionBehavior BuildBehavior(FubuCore.Binding.ServiceArguments arguments, Guid behaviorId) { return new TransactionalContainerBehavior(_container, arguments, behaviorId); }
protected virtual IActionBehavior GetBuilder(IContainer container, FubuCore.Binding.ServiceArguments args, Guid beehaviorId) { return null; }
public string GetName(Type modelType, FubuCore.Reflection.Accessor accessor) { var t = string.Join(".", accessor.PropertyNames).Replace(".[", "["); return t; }