Giter Club home page Giter Club logo

Comments (11)

KevinDockx avatar KevinDockx commented on August 31, 2024

Needs design

from httpcacheheaders.

maartenba avatar maartenba commented on August 31, 2024

Should this be as a function returning an IValidationValueStore or as an instance? Or will users just register the service themselves and be done with it (skipping service collection .AddHttpCacheHeaders)

from httpcacheheaders.

KevinDockx avatar KevinDockx commented on August 31, 2024

I was thinking of something along the lines of how JsonOptions can be used to set a custom contract resolver, eg:
services.AddMvc(...)
.AddJsonOptions(options => options.SerializerSettings.ContractResolver =
new CamelCasePropertyNamesContractResolver());

But I'm open to suggestions, what do you think? :)

from httpcacheheaders.

maartenba avatar maartenba commented on August 31, 2024

That's what the service collection is for imo :-) Although that sucks for discoverability. I'd go with either a function that instantiates things, or just take an instance much like the above example.

from httpcacheheaders.

CumpsD avatar CumpsD commented on August 31, 2024

Just wondering, today, wouldn't registering your own after you added HttpCacheHeaders simply overwrite the existing one and use yours?
services.Add(ServiceDescriptor.Singleton<IValidationValueStore, InMemoryValidationValueStore>());

from httpcacheheaders.

CumpsD avatar CumpsD commented on August 31, 2024

Proposal to implement this by passing in an instance of a custom store: #57

from httpcacheheaders.

KevinDockx avatar KevinDockx commented on August 31, 2024

@CumpsD : I pushed a few commits to the modular branch - let me know what you think :) If those are ok for you I think we can merge this into master.

from httpcacheheaders.

KevinDockx avatar KevinDockx commented on August 31, 2024

Been thinking about this some more (it's amazing what an awful night of sleep in terrible temperatures can do). I think it's best to add a StoreKeyContext (or something along those lines) object and accept that as parameter for GenerateStoreKey. That allows us to add additional info to the context in case it's needed in a later version without breaking changes. I'll add another commit for that today :)

from httpcacheheaders.

CumpsD avatar CumpsD commented on August 31, 2024

Commits look good to me, StoreKeyContext sounds good too, can't wait for the next release :D

from httpcacheheaders.

KevinDockx avatar KevinDockx commented on August 31, 2024

Added the context, merged branch into master and just pushed a prerelease version to NuGet :)

from httpcacheheaders.

CumpsD avatar CumpsD commented on August 31, 2024

Using prerelease, seems to all work :)

from httpcacheheaders.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.