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.

20 lines
526 B

2 years ago
  1. using Newtonsoft.Json;
  2. using SqlSugar.Entities;
  3. namespace SqlSugar
  4. {
  5. public class ModelContext : BaseEntity
  6. {
  7. [SugarColumn(IsIgnore = true)]
  8. [JsonIgnore]
  9. public SqlSugarClient Context { get; set; }
  10. public ISugarQueryable<T> CreateMapping<T>() where T : class, new()
  11. {
  12. Check.ArgumentNullException(Context, "Please use Sqlugar.ModelContext");
  13. using (Context)
  14. {
  15. return Context.Queryable<T>();
  16. }
  17. }
  18. }
  19. }