Store a range of values in web.config - what data structure to use

后端 未结 2 1732
渐次进展
渐次进展 2021-01-07 01:33

What is the best data structure to use for the following scenario?

I want to have a fee percentage based on the price of certain items. For example if (simplest scen

2条回答
  •  误落风尘
    2021-01-07 01:59

    I would put it on table on SQL Server; the table would have 4 columns:

    • Id
    • StartValue
    • EndValue
    • Percentage

    I would catch this data on the application side if necessary. You can use a SqlCacheDependency object to ensure that any update on the database gets quickly reflected on the application side. I would not put on Web.config since Web.config is mostly suitable for Key-Value pairs and I don't see this being the case here.

提交回复
热议问题