Update README.md

This commit is contained in:
sunkaixuan
2019-04-29 15:17:36 +08:00
committed by GitHub
parent 35ab5c84d6
commit f936c8903a

View File

@@ -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