SqlSugar/Src/Asp.NetCore2/SqliteTest/UserTestCases/Unitafadsa.cs
2024-02-05 15:22:29 +08:00

57 lines
1.4 KiB
C#

using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace OrmTest
{
internal class Unitafadsa
{
public static void Init()
{
var db = NewUnitTest.Db;
db.CodeFirst.InitTables<School>();
db.CodeFirst.InitTables<School2>();
db.Queryable<School2>().ToList();
var list2 = db.Reportable(new List<Unitguidsda>() {
new Unitguidsda()
}).ToQueryable().ToList();
}
public class Unitguidsda
{
public Guid Id { get; set; } = Guid.NewGuid();
}
/// <summary>
/// 多主键表
/// </summary>
[SugarTable("dbschool")]
public class School
{
[SugarColumn(IsPrimaryKey = true)]
public string Id { get; set; }
[SugarColumn(IsPrimaryKey = true)]
public int SchoolId { get; set; }
}
/// <summary>
/// 多主键表
/// </summary>
[SugarTable("dbschool")]
public class School2
{
[SugarColumn(IsPrimaryKey = true)]
public string Id { get; set; }
[SugarColumn(IsPrimaryKey = true)]
public int SchoolId { get; set; }
public string Remark { get; set; }
}
}
}