We are C # enthusiasts, sharing technology with each other, learning to grow together to do a project together.
We are open source enthusiasts, the code from our hands will be hosted on the source Control platform (Oschina), so far no charge, and there will be no charges in the future.
We are "Daniel", in the work, the study encountered all kinds of problems in the group discussion of the vivid, perhaps just a beginner programmer, but perhaps you will not he just know, and at this time he is your "Daniel."
A project called "Papapa", similar to the B/s architecture of escorts.
ASP. MVC5, Bootstrap 3, Metronic, Redis, EF, SIGNALR, etc. used in the project.
| Introduction to System Architecture |
This is a PPT, here is almost all the content, after all, we have only done these, in the future, of course, definitely more than this.
If you want to see the full version of PPT, you can poke me: http://files.cnblogs.com/files/doddgu/PaPaPa.pptx
Here is to find the ppt template on the Internet casually changed the next, hierarchical relationship don't too tangled oh
The Approximate class library division is like this.
We're trying to create something ourselves.
Fix a solution.
The prototype of the system architecture has been completed, the above PPT mentioned in the things are finished (of course, there is part of the embryonic stage, which requires a continuous improvement process).
And the project is at the beginning of the initial stage, only completed the registration, login, User Center (modify user information).
The infrastructure layer has been completely detached from the business, with the aim of creating a reusable base class library that is characterized by: stable, extensible, and easy to use.
The core layer is a compromise package for the business, which may not be applicable in different businesses, but it is not completely non-referential. Caching decisions, for example, are a useful feature in most projects.
| Not too much water, this article Dragonfly water cache decision |
In fact, technology can not be too serious, it sounds very tall on the actual word behind is a particularly simple method call collection.
After all, this is just a preface, I will not write too much, if you are interested to continue to follow my next article, here is a short comparison of the core points of the code bar.
1 Public Override Asynctask<int>Saveasync ()2 {3 varresult =await Base. Saveasync ();4 5 Setredis ();6 7 returnresult;8 }9 Ten Private voidSetredis () One { A Try - { - varType =typeof(T); the varMonitor = equalsmonitormanager<string, Rediscachemonitor>. Get (monitorconstant.redis_key, x = X.tablename = =type. Name); - if(Monitor! =NULL) - { - foreach(varEntityinch Base. dbset.local) + { - foreach(varFieldinchMonitor. Fields) + { A varPI =type. GetProperty (field); atRedisSingleton.GetInstance.Client.HSet (type. Name,string. Format ("{0}:{1}"Pi. Name, Pi. GetValue (Entity,NULL). ToString ()), entity); - } - } - } - } - Catch(Exception ex) in { - Logger.error (ex. ToString ()); to } +}
This code is actually a paragraph in the upper part of the cache decision, need to fill the cache before the cache data, and here is to insert, modify, delete (actually did not delete, because I design only allow to change to the invalid state, do not allow the deletion of data) 3 will trigger the database modification of the action after the synchronization action into Redis.
There is a very tall noun, you can call him "mirror", can also be called "XXX", anyway this is just some of the names of Daniel for the unified name.
Savechangesasync is the EF's asynchronous Save method, the thing we want to do is very simple, is to intercept the preservation method, the code is Saveasync, this is our own for the EF package after the method.
Probably the idea is this:
To get Saveasync to listen to us, override comes in handy, rewriting Saveasync.
After you call the Saveasync of the base class, add the code that you saved to Redis.
Such a saveasync becomes a 2-thing, save to the database and then save to Redis, thus eliminating the code to write the duplicate code saved to Redis.
Careful friends will find that we don't save all the data to Redis, so we have to have a rule that tells us what data needs to be saved to Redis.
and Equalmonitormanager in the code is the thing to do with this save rule, because it needs to be paired with a lot of things, so if you're interested in it, please look back at the blog.
Of course if you are a short-tempered can also download our code directly, tracking debugging under the instant clear.
Finally, I would like to thank so many people for their contributions during the launch of this project.
Tiger: A very bull x pm-level character, the requirements of the document written is very funny and very practical. Actually call him "color Tiger", I feel better.
Baylor: Never abandon any work, learn while doing, very good lad. You can also call him "100,000 why".
Four elder brother: No matter jumps out to pick the fault, the suggestion, in this process we indeed also reaped a lot.
0 Points: There are always a variety of problems, the atmosphere in the active group.
Here the ellipsis should appear, "..."
| Now I have to say I'm bad. |
Yes, I found that my previous open source project was a lot of people to see, download, even add a group, but few people point to recommend, comment.
And then one day I found a blog to adopt a method effect is very good I will follow.
Want to get the code address you have to click on the recommendation, and then comments to leave your QQ mailbox, or see the top right corner of my profile, join our group is also a shortcut.
Add a group of no need to leave QQ mailbox Oh, group announcements have git address.
Finally, I wish you all a pleasant work and everything ^_^
"Papapa" Integration of B/s mainstream technology MVC5 project-hard-working faction: Say do it, we have set sail