SqlSugar源码
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.

35 lines
1.1 KiB

7 years ago
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using OrmTest.Demo;
using OrmTest.Models;
namespace OrmTest.UnitTest
{
public class EnumTest : UnitTestBase
{
private EnumTest() { }
public EnumTest(int eachCount)
{
this.Count = eachCount;
}
public void Init()
{
var db = GetInstance();
var shoolValue = SchoolEnum.HarvardUniversity;
var list = db.Queryable<StudentEnum>().AS("student").Where(it => it.SchoolId == shoolValue).ToList();
7 years ago
var x = new StudentEnum()
{
Name = shoolValue.ToString(),
SchoolId = shoolValue
};
var id= db.Insertable(x).AS("student").ExecuteReutrnIdentity();
var data = db.Queryable<StudentEnum>().AS("student").InSingle(id);
shoolValue = SchoolEnum.UniversityOfOxford;
var sql= db.Updateable<StudentEnum>().AS("student").UpdateColumns(it=>new StudentEnum() { Name="a" , SchoolId= shoolValue }).Where(it=>it.Id==id).ToSql();
7 years ago
}
}
}