-
Notifications
You must be signed in to change notification settings - Fork 39
dealing with Web API and MVC in the same service #196
Copy link
Copy link
Closed
Description
Solution 1:
Wildcard of controller exclusion.
Solution 2:
Check ApiController when enumerating controllers.
Solution 1 is likely enough, unless there are a lot real world cases demanding solution 2.
- MyBusiness.Domain.Mvc* will be excluded
string[] excludedControllerNames;
/// <summary>
/// Filters to exclude some controllers. For example, [My.Namespace.Home, My.Namespace.FileUpload] for My.Namespace.HomeController and My.Namespace.FileUploadController.
/// Wildcard "My.Mvc*" will filter out "My.Mvc.Home" and "My.MvcSomething".
/// </summary>
public string[] ExcludedControllerNames
{
get { return excludedControllerNames; }
set
{
excludedControllerNames = value;
var candidates = excludedControllerNames.Where(d=> d.EndsWith('*')).ToArray();
if (candidates.Length > 0)
{
excludedWildCard = candidates.Select(d => d.TrimEnd('*')).ToArray();
}
}
}
string[] excludedWildCard;implemented. Until next release.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels