BaseDAL.cs 700 B

12345678910111213141516171819202122232425262728293031
  1. using Microsoft.Extensions.Caching.Memory;
  2. using Microsoft.Extensions.Primitives;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Text;
  6. using ZcPeng.PublicLibrary;
  7. namespace CoreEntity.DAL
  8. {
  9. public class BaseDAL
  10. {
  11. private static IMemoryCache _cache;
  12. public BaseDAL(IMemoryCache cache)
  13. {
  14. _cache = cache;
  15. }
  16. public static int GetId(string tablename)
  17. {
  18. Object id ;
  19. string result = "";
  20. DataAccess.GetOneValue("SELECT IDENT_CURRENT('"+ tablename + "') as newid",out id,out result);
  21. Decimal id1 = (Decimal)id;
  22. return Decimal.ToInt32(id1);
  23. }
  24. }
  25. }