SqlSugar/Src/Asp.Net/SqlServerTest/Demos/G_Mapper.cs

30 lines
508 B
C#
Raw Normal View History

2018-10-14 09:26:53 +08:00
using OrmTest.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace OrmTest.Demo
{
2018-10-14 13:10:08 +08:00
public class Mapper : DemoBase
2018-10-14 09:26:53 +08:00
{
public static void Init()
{
var db = GetInstance();
2019-01-10 13:50:19 +08:00
var x = db.Queryable<Student>()
2018-10-14 13:10:08 +08:00
.Mapper((it, cache) =>
{
2019-01-10 13:50:19 +08:00
it.Name = "xx";
}).ToListAsync();
x .Wait();
2018-10-14 13:10:08 +08:00
2018-10-14 09:26:53 +08:00
}
}
}