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 ICriterion | |
| { | |
| } | |
| public interface IQuery | |
| { | |
| } |
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 ConventionsTests | |
| { | |
| private const string PropertyName = "Name"; | |
| private readonly ModelMetadataRegistry registry; | |
| private readonly Type modelType; | |
| public ConventionsTests() | |
| { | |
| registry = new ModelMetadataRegistry(); | |
| modelType = typeof(DummyMetaconvTestModel); |
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; | |
| using System.Collections; | |
| using System.Linq.Expressions; | |
| using System.Reflection; | |
| using System.Web.Mvc; | |
| /// <summary> | |
| /// RegisterModelMetadata | |
| /// </summary> | |
| public class RegisterModelMetadata : BootstrapperTask |
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
| #region Copyright | |
| // Copyright (c) 2009 - 2011, Kazi Manzur Rashid <kazimanzurrashid@gmail.com>, hazzik <hazzik@gmail.com>. | |
| // This source is subject to the Microsoft Public License. | |
| // See http://www.microsoft.com/opensource/licenses.mspx#Ms-PL. | |
| // All other rights reserved. | |
| #endregion | |
| namespace MvcExtensions | |
| { | |
| using System; |
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 BoolRequired : CustomModelValidator | |
| { | |
| private readonly Func<string> _getErrorMsg; | |
| public BoolRequired(ModelMetadata metadata, ControllerContext controllerContext, Func<string> getErrorMsg) | |
| : base(metadata, controllerContext) | |
| { | |
| _getErrorMsg = getErrorMsg; | |
| } |
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
| class Program | |
| { | |
| static void Main() | |
| { | |
| List<Input> session = new List<Input>(); | |
| session.Add(new Input() | |
| { | |
| Id = 1, | |
| Custom = "custom111", | |
| Simple = "simple111" |
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
| internal class DelegateModelValidator<TModel> : ModelValidator | |
| { | |
| public DelegateModelValidator(ModelMetadata metadata, ControllerContext controllerContext) | |
| : base(metadata, controllerContext) | |
| { | |
| } | |
| public Func<TModel, bool> CheckValidity { get; set; } | |
| public Func<string> ErrorMessage { 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
| using System; | |
| using System.Collections.Generic; | |
| using System.Web.Mvc; | |
| namespace MvcExtensions | |
| { | |
| public class CustomValidationMetadata<TValidator> : ModelValidationMetadata where TValidator : CustomValidator, new() | |
| { |