The previous article briefly introduced the download, installation, testing, now directly used, see the results
The Redis service that is used is the simple service that was built on a temporary basis, note that it is easy to say, because it is just a single point of "Toys";
Temporarily at the time of the project login simulation, the cache object used here is a custom Redis several methods, wherein the parameters, Func<>, this all understand, so sweet grammar sugar, the use of the use of, their own benefit,
Only look at the red box is enough, other neglect; Here is a simulation query for a data, first query from the cache, if the query is not available, use await () = = expression from the database, and then insert into the cache again
Implementation method:
Other methods, such as updating, adding, deleting, and similar implementations, result in the result of an image being persisted into the redis environment.
Actually write these things do not make sense, but for some enterprises, they always feel very good appearance, always feel, others this can not, in fact, do not want to talk to you, do not want to show you
The use of these things is not difficult to say, simple is not so simple, the only difference is, 1, whether dare to do, 2, whether in the face of problems can be flexible, timely resolution, 3, whether there is a careful look at the official API,
Does not mean that learning does not, everyone's learning ability, absorptive capacity is not the same. Moreover, a lot of things are more rigid, check data, test several times can come out of things.
2.redis.3.2 Download, install, configure, use-2