Why create Taurus.MVC:

I remember being fooled by the last company into taking charge of the company's e-commerce platform , Here's the thing :

The original project was outsourced to a third party , Use :WebForm+NHibernate, The code is ugly ,Bug Infinite , It's always on fire .

At the beginning, I recruited several interns to play there , I don't know , I finally cheated , ha-ha ...

The first feeling when I went in was to redo , But hehe , You can't guess the boss's mind .

Then the first stage is to transform and maintain stability in the old project , As long as it's not a problem that requires hundreds of servers , What can be dealt with weakly, don't want , After all, there are no three or three , It's not good to go to the beam pit .

In the second stage , Nature is thinking and doing it again :

E-commerce background has ASP.NET Aries frame , Don't worry too much about brushing ;

What framework does the e-commerce front desk choose ?

1:WebForm Taibaoshou ;

2:.NET Core Too radical ;

3:QBlog( Autumn garden ) High threshold ;

4: Write a new set , Busy business , No time to think , And time is limited , Already directed BOSS Submitted a plan .

In the end, I have no choice but to choose :ASP.NET MVC 了 .

Think carefully .NET Environmental Science , The popular development framework on the market , It's all Microsoft's own ( It's said that a hundred flowers blossom ?)

I know that too. , Some of them are older , Also build the frame , But they are all made for themselves or their own companies ( It's different from the perspective and breadth of thinking that users are given ).

There are also some made for free to the people , But after three or two rounds of propaganda, there was no sound ;

The garden has never taken the initiative to help the third-party open source framework to promote , Just by the blogger's own passion and feelings , How long it will last is an unknown number , After all, there is no income from framing .

The wind of writing turns :

later , The boss is down .....( Tear rush ~~~).

then , I'll have time to calm down and make a good frame with my feelings !

finally ,Taurus.MVC It's coming out. , And it's open source as soon as it comes out !!! Open source !! open ! Three times .

About frame name :Taurus

Ten years ago CYQ.Data When , Bad name ( My fault? ), It leads to great resistance to promotion .

So now build a new framework , You have to think about a name , After all, it has to be like : Qi Delong , Qi Dongqiang , Qi de long, Dong Qiang This is loud and thorough enough .

It was released a little while ago :ASP.NET Aries Business development framework : The name :Aries( Aries , Gentle with pride ).

So think , It's time to continue the Aries series called :Aries.MVC Well ?

still ... Building the golden twelve palaces ?

Then put the thirteen constellations , Look up the English words of the eight planets , I'm not very satisfied with it , Jumping names are a hindrance , Let's name it in order .

Taurus( Taurus ), In fact, the reason for the final decision is the pronunciation of the word : Off ( It's like watching a big movie , And imaginative , There's a little bit of color in the explosive force ).

About the applicable scenarios of the framework :

Choose the framework , For a master , It's a discipline ; For beginners , It's just a choice .

When I was young , Forced to choose the framework made by Microsoft , Now? , I became the Creator :

CYQ.Data+Aries+Taurus, It can adapt to almost all business scenarios .

No need ASP.NET WebForm、ASP.NET MVC 了 .

but , Still can't do without ASP.NET platform .

As mentioned above :

1:ASP.NET Aries Suitable for business system and background rapid development .

2:Taurus.MVC It is suitable for e-commerce and other front-end systems with high performance requirements WebAPI.

About the advantages of the framework :

Generally speaking, the advantages of framework , It's just the beginning of bullshit B When , As long as the market slogan is loud , As long as the product is not a weak one B It's not a problem .

What's the advantage of a framework ? Most people ask this first , You're going to blow my heart , Blowing my heart open , I just told you , Then silently download the source code to the hard disk .

Because the market is basically the same, Microsoft has unified the world , So the comparison is to find Microsoft home MVC 了 .

In fact! , and .NET MVC Compare to , It can only be said : A sky , An underground .

MVC4 installed :800M( I don't know what's so big );

Taurus.MVC installed :400K(Taurus.Core.dll+CYQ.Data).

Obviously : Microsoft has been doing addition all these years , I didn't want to subtract , Keep innovating , I don't want to be compatible , Many products have big leaves , It's very disturbing .

Far away , Talk about the advantages , Let me see , Let me think about it with you ...

Let's start with a few overused words : Lightweight ? High performance ? high efficiency ?

no way , You have to be different , It's an advantage to have something that others haven't done :

Oh , Yes , It has to be illustrated , Only in this way can you show your specialty , Yes , This is it , That way, that way , good , finished repairing or putting to rights , Upper figure :

Taurus.MVC Source code :

1: Source code SVN:https://github.com/cyq1162/Taurus.MVC

2:Demo Demonstration station :http://taurus.cyqdata.com

Demo The screenshot is like this :

Taurus.MVC The introduction of framework :

1: stay Nuget Search on Taurus.MVC, Just quote ( Will introduce :Taurus.Core and CYQ.Data)

And then out comes a Readme.txt, Follow the prompts to configure URL Intercept and specify Controller Local dll that will do .

2: Direct source project ( There will be in the source project Demo).

Taurus.MVC The framework is introduced :

1: After downloading the source code : Solution map :

2: Solution description :

1:CYQ.Data: The main XHtmlAction When the template engine , In addition, when the data layer can provide Model Or provide automatic binding Syntax .

2:Taurus.Core: It mainly implements route rewriting 、Controller call 、ViewEngine And so on .

3:Taurus.Controllers Method entrance , Where the code is written .

4:Taurus.View Keep only html and css and js

3: Additional explanation :

1: Usually MVC Of Controller,Modle,View The files are all in one project , Here are two projects .

2: For project hierarchy clarity , You can build Model project ( Put entity ) and Logic project ( Write business logic code ) also Utility( Tools ).

3: Framework provided Demo, Just let it all go Controllers It's in the project .

Press next MVC Let's talk about the principle and usage of the foundation :

1:Taurus.MVC The routing :

1: Hidden routes :

stay .NET MVC in , Routing is a very important part , But the troubling function .

To simplify MVC, First step , It's about thinking about how to eliminate routes implicitly .

Finally, there are two internal default routes :



Default to the first .

2: Extended Routing :

When deployed as a subapplication , Or when the first one is a user name , There will be one more prefix Directory .

At this time, we can pass AppSetting To configure RouteMode The value is 2, Over relaxed .

Context provides three parameters for you to get information :ControllerType,Action,Para.

Okay , That's it , Want to customize routing ?No Way! Oh , You can change the source code ~~~~


1: seek Controller:

The rules are set , The rest is to follow the rules Controller 了 .

1: Collect all the Controller.

2: Specify where to collect : The default is to Taurus.Controllers Find a class that inherits from the base class :Taurus.Core.Controller.

3: Custom storage Controllers:AppSetting To configure Taurus.Controllers Value , Assuming that :Taurus.View

4: Can't find Controller when , Look for everything DefaultController, If there's any (Demo There is ), It's abnormal .

2: call Controller Of Action:

1: The names of methods are public void, And there are no parameters ( Overload multiple parameters , Only the first one is collected by default ).

2: If it is Ajax request , Assign the processed value to the context AjaxResult that will do .

3: Can't find Action when , Will be looking for Default Method ( This base class has , So there must be , Rewrite it if you need to ).


1: Templates :html( Strictly speaking, it should be xhtml)

2: Template loading mode : and URL The corresponding addressing path : Namely Views/{Controller}/{Action}.html

3: How the master page is referenced :itemref=" page . The name of the node ".(itemref yes div Properties of , Nobody uses , Use it to refer to node replacement .)

4: Load replacement Syntax :

A: about input label , have access to CYQ.Data.MDataRow.SetToAll Batch assignment .

B: about ${name}, have access to View.LoadData( data ," Prefix "), It will automatically format .

C: For list loop tags : have access to CYQ.Data.MDataTable.Bind Method binding .

summary :

1: This article does not explain how to use it in detail , For usage , I'll introduce it in the next article :

Um. , An introduction is enough , Because there's really nothing to say , There's no need to write a Book .

2:Demo Add, delete, modify and query the paging function of the list , Better ability or have MVC The basis of , Scanning the source code will use .

3: Today's focus is on open source ... Open source ... Open source ... Say the important things 123.

Taurus.MVC More articles about

  1. Open source :Taurus.MVC frame

    Why create Taurus.MVC: I remember being fooled by the last company into taking charge of the company's e-commerce platform , Here's the thing : The original project was outsourced to a third party , Use :WebForm+NHibernate, The code is ugly ,Bug Infinite , More often ...

  2. Taurus.MVC 2.2 Open source release :WebAPI Functional enhancement ( Request cross domain and Json transformation )

    background : 1: Some users have given feedback about cross domain requests . 2: Some users have given feedback on parameter acquisition . 3:JsonHelper The enhancement of . Under the above conditions , With 2.2 Version update , So I wrote this article . Open source address : https:/ ...

  3. Taurus.MVC 2.0 Open source release :WebAPI Development tutorial

    background : User response ,Tausus.MVC Able to write WebAPI Well ? can ! What about the tutorial ? Um. , Wood has ! ok , just 2.0 come out , Take it WEBAPI It's a tutorial ! Open source address : https://github.com/cyq1 ...

  4. use Taurus.MVC Be an enterprise station ( Next )

    Preface : The last one finished the front page , Let's do the remaining functions in this article . Include a list of articles . Article details and product presentation . 1: The article lists : The original ArticleList.aspx 1: current articlelist.html except ...

  5. use Taurus.MVC Be an enterprise station ( On )

    Preface : I was going to write an article called :Taurus.MVC From entry to mastery , One is the end of the story ! Later, I turned to read , Let's set the tutorial on this enterprise station project !!! Enterprise station style : Before I sent an enterprise station to help my younger martial sister write : I've spent several nights helping my teacher recently ...

  6. GJM : Taurus.MVC 2.0 Open source release :WebAPI Development tutorial [ Reprint ]

    Taurus.MVC 2.0 Open source release :WebAPI Development tutorial Reprinted from http://www.cnblogs.com/cyq1162/p/6069020.html Because I'm new   There is a copyright issue when pasting This article is originally ...

  7. Taurus.MVC :WebAPI Realize authority control authentication ( And function enhancement instructions )

    Preface : Two days before , When I was still packing up my trip back home , Ready to go back to Guangzhou , by IT Company's start-up fight again 365 days , Some netizens asked :Taurus.MVC How to realize authentication and authority control in , It's better to make a small example . I accidentally replied : I'll write another article when I get back to Guangzhou ...

  8. Taurus.MVC Support Asp.Net Core The process of

    Preface : These days , Seems to be .NET Core Related news and articles are often in front of me ~~~ yesterday , Microsoft has released .Core 2.1, Again , Almost blinded my eyes . ok , Maybe it's a hint from God , After all  CYQ.Data  ...

  9. Existing Asp.net MVC Introduced in the project Taurus.MVC

    Taurus.MVC It's an excellent framework , If you want to apply to the existing Asp.net MVC In the project , It needs to be revised . 1. Prerequisite agreement : go Taurus.MVC Suffix... Must be specified . Such as .api 2. The original project is amended as follows : web.co ...

Random recommendation

  1. Java Of Debug debugging

    One . Right click on the project ,Debug As>Debug on Server Two . On the test class ,Run As>Run On Server

  2. strange UnexpectedRollbackException abnormal

    Today, when using a common function , Suddenly found in some scenarios will report abnormal , The contents are as follows : Through breakpoint debugging, we found that everything was smooth , Is from controller This exception will be reported when the layer returns to the previous segment , Can't , You can only locate the problem by exclusion , later ...

  3. c# winform Multithreading in programming ui Summary of interface resource modification

    Single threaded winfom In the program , It's easy to set the value of a control easy Things about , direct this.TextBox1.value = "Hello World!"; Just like the , But if you do this in a new thread ...

  4. HTTP A long connection (Comet) Implementation example

    I saw it yesterday. comet After the introduction of , Although I probably know comet Principle , But I'm not sure if I've ever used it , So today, I went to other netizens to share comet Realization http An example of a long connection , stay  Comet Server Push ...

  5. QT Of radioButton Group usage

    In the use of Qt Of radioButton When the control , There will be a question , How to make the one you choose radio Get a data , Judge , Some information on the Internet is incomplete , It's easy to make mistakes . So you have to do something , For each radioButton Give initial value ...

  6. angular Press enter to trigger the event

    angularJs   Press enter to trigger an event. This function is very simple , But today's has made me fall for a long time .... Because there are two different methods on my page $event event , Such as search($event) and create($event) ...

  7. Tsinghua source and China University of science and technology both stopped talking about Anaconda After the support of , Change the method of Tencent cloud image

    Download the following file directly, unzip it and put it in the user's folder ,windows by "C:\ user \ Your username \",Linux by "/home/ Your username /" That is, under the user's home directory . Click me to download ...

  8. Chapter5_ Initialization and cleanup _this keyword

    this Keywords are Java A very special kind of keyword in , First, it can only be used within methods , Used to represent the object calling this method , At this point this The operation is the same as other references to objects . We can access it inside the method because the compiler is inside the method ...

  9. Javascript introduction ( 3、 ... and ) function

    Javascript function One . Function definition and execution <script type="text/javascript"> //define function fun1(){ ale ...

  10. activity window view Relationship

    1.Activity , Window and View What is the relationship of ? track Activity Source code will find out :Activity.attch() -> PolicyManager -> Policy ...