mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-11-08 10:24:55 +08:00
Update README.md
This commit is contained in:
24
README.md
24
README.md
@@ -22,18 +22,18 @@ Install-Package sqlSugarCore
|
||||
All operations are based on SqlSugarClient
|
||||
```cs
|
||||
public List<Student> GetStudentList()
|
||||
{
|
||||
{
|
||||
var db= GetInstance();
|
||||
var list= db.Queryable<Student>().ToList();//Search
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create SqlSugarClient
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private SqlSugarClient GetInstance()
|
||||
{
|
||||
/// <summary>
|
||||
/// Create SqlSugarClient
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private SqlSugarClient GetInstance()
|
||||
{
|
||||
SqlSugarClient db = new SqlSugarClient(new ConnectionConfig()
|
||||
{
|
||||
ConnectionString = "Server=.xxxxx",
|
||||
@@ -48,15 +48,15 @@ All operations are based on SqlSugarClient
|
||||
Console.WriteLine();
|
||||
};
|
||||
return db;
|
||||
}
|
||||
}
|
||||
|
||||
public class Student
|
||||
{
|
||||
public class Student
|
||||
{
|
||||
[SugarColumn(IsPrimaryKey = true, IsIdentity = true]
|
||||
public int Id { get; set; }
|
||||
public int? SchoolId { get; set; }
|
||||
public string Name { get; set; }
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## SqlSugar's 16 Functions
|
||||
|
||||
Reference in New Issue
Block a user