enkelmedia / TheDashboard

Magic dashboard for Umbraco
MIT License
39 stars 42 forks source link

Add extension method to remove counter #73

Closed erikjanwestendorp closed 2 years ago

erikjanwestendorp commented 2 years ago

@enkelmedia I'm sure if this is an desired addition. But I really like to remove a counter from the startup.cs class.

enkelmedia commented 2 years ago

Thanks @erikjanwestendorp! I think this looks useful, just need to check it a little closer and update the docs.

Just wondering, is there anything that prevents you from doing this in your startup?

builder.TheDashboardCounters().Remove<T>();

Given that the above works, the only difference would be some syntactic sugar?

builder.RemoveCounterDashboard<T>();

Or I'm I missing something?

erikjanwestendorp commented 2 years ago

@enkelmedia Thanks for your quick reply.

builder.TheDashboardCounters().Remove<T>();

Returns the DashboardCountersCollectionBuilder and not the IUmbracoBuilder and therefore it cannot be used in the startup.cs class.

enkelmedia commented 2 years ago

Ahh! You mean that you want to be able to chain them in startup? That makes sense!

erikjanwestendorp commented 2 years ago

Yes, indeed! That would be great 😄

enkelmedia commented 2 years ago

Sorry for the late merge, I'll make sure to include this in the next release!