23
This commit is contained in:
23
FrameWork/SqlSugar/Entities/ModelContext.cs
Normal file
23
FrameWork/SqlSugar/Entities/ModelContext.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace SqlSugar
|
||||
{
|
||||
public class ModelContext
|
||||
{
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
[JsonIgnore]
|
||||
public SqlSugarClient Context { get; set; }
|
||||
public ISugarQueryable<T> CreateMapping<T>() where T : class, new()
|
||||
{
|
||||
Check.ArgumentNullException(Context, "Please use Sqlugar.ModelContext");
|
||||
using (Context)
|
||||
{
|
||||
return Context.Queryable<T>();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user