DB.cs 601 B

1234567891011121314151617181920212223242526
  1. using EasyTemplate.Tool.Entity;
  2. using EasyTemplate.Tool;
  3. using Microsoft.AspNetCore.Components;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. namespace EasyTemplate.Service
  10. {
  11. public class DB
  12. {
  13. [Inject] public static SqlSugarRepository<TRecord> _RepoRecord { get; set; }
  14. [Inject] public static SqlSugarRepository<TProduct> _Repository { get; set; }
  15. public static int insertRecord(TRecord record)
  16. {
  17. return _RepoRecord.InsertAsync(record).Result ? 1 : 0;
  18. }
  19. }
  20. }