Advertisement
Guest User

Untitled

a guest
Jun 15th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. public class MyViewModel
  2. {
  3. [Required(ErrorMessageResourceType = typeof(Global), ErrorMessageResourceName = "Required")]
  4. public string Code { get; set; }
  5. }
  6.  
  7. public ActionResult Create()
  8. {
  9. var model = new MyViewModel();
  10. if(something){
  11. model.SomeThingToRemoveTheRequiredFromCode();
  12. }
  13.  
  14. return View(model);
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement