You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
50 lines
1.2 KiB
50 lines
1.2 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace OrmTest
|
|
{
|
|
public class UCustom013
|
|
{
|
|
public static void Init()
|
|
{
|
|
var db = NewUnitTest.Db;
|
|
try
|
|
{
|
|
db.Ado.ExecuteCommand("create type week as enum('Sun','Mon','Tues','Wed','Thur','Fri','Sat');");
|
|
db.Ado.ExecuteCommand(@"create table unitduty(
|
|
person text,
|
|
weekday week
|
|
); ");
|
|
}
|
|
catch
|
|
{
|
|
|
|
}
|
|
db.CurrentConnectionConfig.MoreSettings = new SqlSugar.ConnMoreSettings()
|
|
{
|
|
TableEnumIsString = true,
|
|
};
|
|
//db.Insertable(new unitduty()
|
|
//{
|
|
// weekday = weekday.Fri,
|
|
// person="a"
|
|
//}).ExecuteCommand();
|
|
var list=db.Queryable<unitduty>().ToList();
|
|
}
|
|
public class unitduty
|
|
{
|
|
public string person { get; set; }
|
|
public weekday weekday { get;set; }
|
|
}
|
|
public enum weekday
|
|
{
|
|
Fri,
|
|
Thur,
|
|
Sun
|
|
}
|
|
|
|
}
|
|
}
|
|
|