---
title: "What the two ways by which we add constraints to a route?"  
description: "What the two ways by which we add constraints to a route?"  
author: "Nishi Tiwari"  
published: 2020-02-15  
updated: 2020-09-23  
canonical: https://www.mindstick.com/interview/33702/what-the-two-ways-by-which-we-add-constraints-to-a-route  
category: "asp.net mvc"  
tags: ["asp.net mvc"]  
reading_time: 1 minute  

---

# What the two ways by which we add constraints to a route?

The two methods which are used to add constraints to a route is

- By using regular expressions.
- And by using an object that implements IRouteConstraint Interface.

## Answers

### Answer by Nishi Tiwari

The two methods which are used to add constraints to a route is

- By using regular expressions.
- And by using an object that implements IRouteConstraint Interface.


---

Original Source: https://www.mindstick.com/interview/33702/what-the-two-ways-by-which-we-add-constraints-to-a-route

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
