Skip to content

Instantly share code, notes, and snippets.

@emiaj
Created February 5, 2013 05:08
Show Gist options
  • Select an option

  • Save emiaj/4712305 to your computer and use it in GitHub Desktop.

Select an option

Save emiaj/4712305 to your computer and use it in GitHub Desktop.
public class InputQueryModel
{
public string Name { get; set; }
}
public class InputCommandModel : InputQueryModel
{
}
public class Endpoint
{
public InputQueryModel Query(InputQueryModel input)
{
return new InputQueryModel();
}
public AjaxContinuation Command(InputCommandModel input)
{
Debug.Assert(input.Name.IsEmpty()); // FAILS!
return AjaxContinuation.Successful();
}
}
public class InputCommandModelRules : OverridesFor<InputCommandModel>
{
public InputCommandModelRules()
{
// This wont be picked up
Property(x => x.Name).Required();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment