Ha  door  do   test tube  selected from  of  not  which  home  Hospital Medical    can operate to   for 

Micro Signal █ 188★2320★3776 Donor eggs tube means Choose the gender of a boy  tube package born donor eggs boy donor egg package born three generations of selected sex test-tube baby boy donor egg in vitro Hospital

FreeSql is a powerful .NETStandard library for object-relational mapper (O / RM), support .NETCore 2.1+ or .NETFramework 4.6.1+ (QQ group: 4336577).

It is understood that the user rarely ask questions, the encoding process, due to traffic congestion, excusable; blocked due to the use of the framework, not worth the candle. Our slogan: The most convenient do .net ORM! Every developer is willing mouth up 91!

The overall function

  • IFreeSql is the core, to provide the original usage;

  • FreeSql.DbContext expansion pack is to provide the use of object-oriented (as EF);

  • FreeSql.Repository expansion pack is also provided the use of storage + working unit (actually an extension package and DbContext);

  • FreeSql.Connection.Extensions also the expansion pack, like Dapper to provide the same usage;

Source Address: https://github.com/2881099/FreeSql , warehouse in each chain to introduce here above.

fsql= new FreeSql.FreeSqlBuilder() .UseConnectionString(FreeSql.DataType.Sqlite, @"Data Source=|DataDirectory|\document.db;Attachs=xxxtb.db;Pooling=true;Max Pool Size=10") .UseAutoSyncStructure(true) //自动迁移(CodeFirst) .Build();

AOP functionality

Today is play AOP existing functionality, the future will continue to enhance the user needs.

Audit CRUD

Ma said, 996 is Salford reported. For most programmers, overtime is a good thing. . . At least not idlers, not laid off.

As if time-consuming operation because of a sql show high, there is no relevant audit function, it can be said that the investigation can not start, reward and you walk away (ha ha).

FreeSql similar functionality to support simple:

fsql.Aop.CurdAfter = (s, e) => {
    if (e.ElapsedMilliseconds > 200) { //记录日志 //发送短信给负责人 } };

Yes, only one event, can play a role in the overall situation.

In addition to CurdAfter, there is a CurdBefore (fire before sql).

Audit migration scripts

FreeSql comes migration, then the migration of long-sawed SQL statements, you might wonder.

  • For example, when the table is created;

  • When such a field is added;

  • Such as modifying the table name, the field name, if modified;

  • Another example is when the field type after the change;

These operations do not require basic care at FreeSql.CodeFirst achieve, but we only recommend the development environment using automated migration capabilities, formal environment can use other tools to replace this.

But we may still need to complete the project to do logging.

fsql.Aop.SyncStructureBefore, fsql.Aop.SyncStructureAfter these two events will Dollars At Work.

Custom entity properties

For example within the project has been to use other orm, such efcore, this means that entities may be present [Key], but it FreeSql [Column (IsPrimary = true] different.

Q: FreeSql physical properties of why so awkward?

A: In order to consider the use of consistency, all packaged under ColumnAttribute, so that users use, or without using full memory characteristics which name should be used, such as increment [Column (IsIdentity = true)] to.

FreeSql provide AOP custom attribute functions, and achieve more orm a jointly owned entity properties, avoid duplication defined characteristics.

fsql.Aop.ConfigEntity = (s, e) => {
    var attr = e.EntityType.GetCustomAttributes( typeof(System.ComponentModel.DataAnnotations.Schema.TableAttribute), false).FirstOrDefault() as System.ComponentModel.DataAnnotations.Schema.TableAttribute; if (attr != null) e.ModifyResult.Name = attr.Name; //表名 }; fsql.Aop.ConfigEntityProperty = (s, e) => { if (e.Property.GetCustomAttributes( typeof(System.ComponentModel.DataAnnotations.KeyAttribute), false).Any()) e.ModifyResult.IsPrimary = true; //主键 };

In this way, the physical characteristics of the FreeSql EFCore as you can and set. Other increment, such as optimistic locking, Yihuhuhuapiao is.

Custom expression

Internal FreeSql expression support is very rich, on the degree of compatibility of the major database is also doing very well.

Related to the expression level of support, you can click here to Wiki: https://github.com/2881099/FreeSql/wiki/%E8%A1%A8%E8%BE%BE%E5%BC%8F%E5%87 % BD% E6% 95% B0

Even so rich, it still can not meet the needs of users, FreeSql opening a custom expression parsing interfaces:

fsql.Aop.ParseExpression = (s, e) => {
    if (e.Expression.NodeType == Call && e.Expression.Name == "get_Item") e.Result = "1111"; };

The parsing a bit complicated, when e.Expression very complex, we also provide e.FreeParse method, which is equivalent to calling FreeSql built expression parsing engine to assist you parse.

Aop.Where

ISelect, IDelete, IUpdate three objects FreeSql provided, can be used .Where (lambda) operation, it can be .Where (sql) operation.

Aop.Where is positioned to intercept Where conditions.

fsql.Aop.Where = (s, e) => {
    if (e.Parameter[0]?.ToString() == "1") e.IsCancel = true;

Guess you like

Origin www.cnblogs.com/rerr/p/10943418.html