zHaytam / SmartBreadcrumbs

A utility library for ASP.NET Core (both MVC and Razor Pages) websites to easily add and customize breadcrumbs.
https://blog.zhaytam.com/2018/06/24/asp-net-core-using-smartbreadcrumbs/
MIT License
161 stars 77 forks source link

[Request] Make attributes property virtual #88

Open LightAndrek opened 3 years ago

LightAndrek commented 3 years ago

I am developing a localized website and I need the breadcrumbs to be localizable too. Usually when I write a localizable attribute I create a constructor with the type of Resources and a string that would be the key to search for. This is the same concept used, for example, by the DisplayAttribute in the COmponentModel namespace.

public class BreadcrumbAttribute(string titleKey, Type resourceType)

I tried to replicate the same operation by deriving a class from the BreadcrumbAttribute attribute but since the proprties are not virtual it is not possible for me to change the behavior in the correct way.

Suggestion

Make all properties in the BreadcrumbAttribute as virtual OR Implements the localization pattern directly inside the library