Using ServiceStack to transform our project, servicestack Transformation

Source: Internet
Author: User

Using ServiceStack to transform our project, servicestack Transformation
ServiceStack is an open-source framework set in the NET environment.

Including a lightweight Orm framework, database access, Json processing, Redis driver, and other modules, we can choose to use as needed

ServiceStack. Ormlite

ServiceStack. Ormlite is A. NET platform that quickly implements the ORM Data access framework and supports multiple mainstream databases. The framework exposes some programming interfaces for database access in this province. Developers do not even need to write complete SQL statements. You can use SQL expressions to construct SQL statements.

You can map database fields to object classes. The following operations are based on database access objects:

IDbConnection dbcon

Insert data:
using (IDbConnection db = dbFactory.OpenDbConnection()) {    db.CreateTable<Employee>();    db.Insert(new Employee { Id = 1, Name = "Employee 1" });}
Query operation:

1. Custom SQL

String plain text = "SELECT * FROM City WHERE" + field name + "=" + parameterized field;
Return dbcon. Select <City> (plain text, new {ProvinceCode = parameter value}

2. Return objects directly.

   return dbcon.Select<City>()
SQL Expression
Dbcon. Select (dbCmd. SqlExpression <Province> (). Where (q => q. Code = "100010 "));
More APIs
Update operation
dbcon.Update(new Person { Id = 1, FirstName = "Jimi", LastName = "Hendrix", Age = 27});
dbcon.UpdateOnly(new Person { FirstName = "JJ" }, p => p.FirstName);

Version Management

We use the command line to handle version dependency installation and uninstallation issues.

Uninstall version
Uninstall-Package ServiceStack -Force

 

References

ServiceStack. Ormlite github address

Http://mono.servicestack.net/docs/ormlite/ormlite-overview

Http://www.curlette.com /? Cat = 26

Http://www.strathweb.com/2013/03/signalr-filters-and-servicestack/

ServiceStack V3 Wikipedia

Https://github.com/ServiceStackV3/ServiceStackV3/wiki

Https://github.com/ServiceStackV3/ServiceStackV3/wiki/Create-your-first-webservice

Https://github.com/ServiceStackV3/ServiceStackV3

 

Freelance freelancer

Major differences between MySql and Sqlserver

Mysql end ";"

1. Function for obtaining the current date: curdate (), current_date ()

2. Obtain the current time function: curtime ();

3. Get the current date + time: now ();

LinuxMysql database table names are case sensitive and can be adjusted through Configuration

 

MySQL does not have the top keyword. Instead, use limit and

In ServiceStack, you can use[Alias ("tablename")]To retain the class naming rules of C # without affecting database access.

Http://www.cnblogs.com/chu888chu888/archive/2012/01/12/2320207.html

Separate hot and cold data:
When creating a table, data is separated based on the update frequency. Fields that are frequently updated must be separated from those that are not frequently updated. This helps separate control when traffic is high. Cache can be used to the maximum extent for infrequently updated fields.

Avoid using Null fields,

Auto-increment column or global primary key as the InnoDb primary key

Count (*) high resource consumption

MYsql database and table are case sensitive.

The field name is case insensitive.

Marketing begins with the research on consumer needs, and also includes how to meet the needs. Selecting and determining certain requirements means giving up other requirements.

Positioning refers to what kind of impression we give customers. We are telling customers that I am different, because we have these characteristics. If you think these characteristics are important and your favorite, then my products are your best choice.

Traditional Marketing includes market segmentation and positioning

 

NuGet Package discovery and management tools NuGet Package Explorer http://nuget.codeplex.com/releases/view/59864

 

Related Article

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.