FreeSql supports CodeFirst migration of structures to databases, which should be a standard (O/RM) feature.

Different from other (O/RM), FreeSql supports more database features than just basic data types, which is both advantage and disadvantage. The advantage is to make full use of database features to aid development, while the disadvantage is that switching databases becomes difficult. The concept of different programmers may not be quite consistent, as a function library FreeSql support to the extreme, as to whether to use is another problem measured by the project team technology.

Despite various database adapter logic is very complex, under the principle of optimization program development habit FreeSql always as far as possible to achieve, met some nontechnical cannot conquer problems among them, such as a database of custom types, and entity class itself is a kind of conflict, in order to reduce the cost, such as the database function not supported.

static IFreeSql fsql = new FreeSql.FreeSqlBuilder()
    .UseConnectionString(FreeSql.DataType.MySql, "Data Source = 127.0.0.1; Port=3306; User ID=root; Password=root; Initial Catalog=cccddd; Charset=utf8; SslMode=none; Max pool size=10")
    .UseAutoSyncStructure(true) // Automatically synchronize entity structure
    .Build(); // Be sure to define the Singleton Singleton pattern
Copy the code

Series article navigation

  • (1) Introduction

  • (2) Automatic migration of entities

  • (3) Entity characteristics

  • (4) Solid features of Fluent Api

  • (5) Insert data

  • (6) Batch insert data

  • (7) Ignore columns when inserting data

  • (8) Specify columns when inserting data

  • (9) Delete data

  • (x) Update data

  • (11) Update data Where

  • (12) Specify columns when updating data

  • (13) Ignore columns when updating data

  • (14) Batch update data

  • (15) Query data

  • (16) paging query

  • (17) joint table query

  • (18) Navigation attributes

  • (19) multi-table query

  • (20) query where ecascade

  • (21) Query returned data

  • (22) Dto mapping query

  • (23) Grouping and aggregation

  • (24) Introduction To Linq To Sql syntax

  • (25) delayed loading

  • Include, IncludeMany, Dto, ToList

  • (27) the SQL statement has been written, and entity class mapping for the second query

  • (28) Business

  • Lambda expression

  • (30) Reading and writing separation

  • (31) Zoning table

  • (32) Aop

  • CodeFirst type mapping

  • (34) CodeFirst migration instructions

  • CodeFirst custom features

The resources

Beginner’s Guide | “Select” | “Update” | “Insert” | “Delete”
Expression function | “CodeFirst” | “DbFirst” | “The BaseEntity”
“Repository” | “The UnitOfWork” | The Filter | Optimism Lock | “The DbContext”
Unread | Partition table | “The tenants” | The AOP | Black Tech | Update log