This file contains 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 Microsoft.AspNetCore.Mvc.ModelBinding.Validation; | |
namespace Foo { | |
// Implementation makes use of the IPropertyValidationFilter interface that allows | |
// control over whether the attribute (and its children, if relevant) need to be | |
// validated. | |
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property, AllowMultiple = false, Inherited = true)] | |
public class ConditionalValidationAttribute : Attribute, IPropertyValidationFilter { | |
public string OtherProperty { get; set; } |
This file contains 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 System.Text.Encodings.Web; | |
using Microsoft.AspNetCore.Antiforgery; | |
using Microsoft.AspNetCore.Mvc; | |
using Microsoft.AspNetCore.Mvc.ModelBinding; | |
using Microsoft.AspNetCore.Mvc.Rendering; | |
using Microsoft.AspNetCore.Mvc.Routing; | |
using Microsoft.AspNetCore.Mvc.ViewFeatures; | |
using Microsoft.Extensions.Options; |
This file contains 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
### Keybase proof | |
I hereby claim: | |
* I am FWest98 on github. | |
* I am fwest98 (https://keybase.io/fwest98) on keybase. | |
* I have a public key whose fingerprint is EB40 A06C 490B B16D C28F 7540 6394 EA2F 6F8F 92A1 | |
To claim this, I am signing this object: |
This file contains 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.Globalization; | |
using System.Linq; | |
using System.Windows.Forms; | |
namespace System.Windows.Forms { | |
public static class DynamicInvokers { | |
// This would replace a Control.Property = value | |
private delegate void SetPropertyCallBack(Control c, string property, dynamic value); |