It's the about net core orm
This is a framework for generating SQL statements for .net core.
Support database: Mysql, Sqlite, SqlService
Features: The query is written very elegantly
More detailed Chinese introduction address: https://blog.csdn.net/weixin_45394846/article/details/127154931
Example: Simple configuration only requires configuring the connection string
'''var simpleClient = new SimpleClient(
new DataBaseConfiguration(false,
new ConnectionEntity("链接字符串!")
{
IsAutoClose = true,
DBType=eDBType.Mysql,
Name="test1",
ReadWeight=5,
WriteReadType=eWriteOrReadType.ReadOrWrite
}));
Configure the database you need to use (it is just a tool to generate SQL statements) DataBaseConfiguration.DBDrives.Add(eDBType.Mysql,Tuple.Create(typeof(MySqlConnection),typeof(MySqlParameter)));
var command=simpleClient.Insert(
new UserEntity() {
CompanyId=1,
gIdColumn=Guid.NewGuid(),
Description="Test",
Name="Name",Role=10});
simpleClient.Update(
new UserEntity()
{
CompanyId = 1,
gIdColumn = Guid.NewGuid(),
Description = "Test",
Name = "Name",
Role = 10
});
var query = simpleClient.Queryable<UserEntity, RoleEntity, CompanyEntity>(
(u, r, c) =>
new JoinInfoEntity(
new JoinMapEntity(eJoinType.Inner, u.Role == r.Id && u.Role.Equals((int)eConditionType.Sign)),
new JoinMapEntity(eJoinType.Inner, u.CompanyId == c.Id)
)
)
.Where((u,r,c)=>u.Id>10&&(r.Id==10||c.Id.Equals((int)eDBType.Mysql)))
.Select((u,r,c)=>new ViewView
{
UserId=r.Id,
DisplayName=u.Name,
CompanyName=c.Name,
RoleName=r.Name,
}).Select(v=>new
{
UID=v.UserId,
RName=v.RoleName
});
If you are interested, you can learn about a simple implementation provided here, although the code is relatively rough.
Basic use is no problem.
Now there is no problem with basically using it.
What is more important about writing this thing may be a learning process, slowly improving some functions and modifying the problems in it.