Getting Started with Oak: a different approach

Source: Internet
Author: User
Tags ruby on rails visual studio

As I mentioned last time, the Oak project is a WEB framework that incorporates dynamic features and methods that are common to frameworks based on more dynamic languages (such as Ruby on Rails, or to various MVC Web frameworks in Node.js, such as Express or Tower). Because of the dynamic Language runtime (DLR) portion of C # based on the Microsoft. NET Framework, Oak uses a much different approach to WEB application development than traditional asp.net MVC developers. So, as mentioned in the last article, to get the package you need for Oak development, you need to do more than just download it through NuGet, and do a little bit more complicated work.

If you've read the previous column (msdn.microsoft.com/magazine/dn451446), downloaded and installed the package, started the continuous build sidekick, and ran the initial build on your computer (you may recall that the IIS Express in Port 3000), you can now start developing in Oak.

Start

If you are not running on your computer, run rake and Rake server from the command prompt to make sure everything is OK. Then, start "sidekick" (if it is not already running), and then open the browser and access localhost:3000, as shown in Figure 1 .

Figure 1 Oak Project Help window

As shown in the tutorials shown here, you can learn Oak by using a breadcrumbs step-by-step walkthrough. Before you dive into your study, take a quick look at the structure of the project, as shown in Figure 2 .

Figure 2 Oak Project structure in Visual Studio Solution Explorer

The seed project is comprised of two projects: the ASP.net MVC project and the project that contains the test for the solution. The MVC project is a traditional asp.net MVC application that adds a "Oak" folder that contains the source files that make up the Oak part of the project. This makes the Oak part of the code step-by-step in the debugging process irrelevant and, in line with the purpose of all open source projects, it also supports your local modifications as needed. Currently, there are no models for this project, only three controllers and two views. More importantly, because the code here does not implement too many functions, the first request to the endpoint will produce an error stating that there is no "index.cshtml" (or similar) view. The Oak Bootstrapper recommends that you perform a two-step procedure. First you need to create two new types: blogs and Blogs, which is a collection of blog instances. Naming this class "Blogs" allows you to easily access the Blogs tables in your database based on Conventions:

          public class Blogs:dynamicrepository   
{   
}   
//are a dynamic entity that represents the blogger public   
CLA SS Blog:dynamicmodel   
{public   
  blog () {} Public   
  Blog (object dto): Base (DTO) {}   
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.