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.

ValuesManager.cs 1.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using System.Collections.Generic;
  2. using System.Data.Entity;
  3. using System.Security;
  4. using iiie.Logs.DBO;
  5. using iiie.WebApiUtils.BusinessManager;
  6. using WebAPiUtils_test.DBO;
  7. namespace WebAPiUtils_test.DataAccess
  8. {
  9. public class ValuesManager : SqlServerManager<T_SqlManager, ValuesDbo, SqlServerManagerEntities, ValuesManager>
  10. {
  11. public override DbSet<T_SqlManager> GetTable(SqlServerManagerEntities db)
  12. {
  13. return db.T_SqlManager;
  14. }
  15. public override ValuesDbo DbToDbo(T_SqlManager o)
  16. {
  17. return new ValuesDbo
  18. {
  19. Id = o.id,
  20. MyInt = o.my_int,
  21. MyString = o.my_string
  22. };
  23. }
  24. public override T_SqlManager DboToDb(ValuesDbo o)
  25. {
  26. return new T_SqlManager
  27. {
  28. id = o.Id,
  29. my_int = o.MyInt,
  30. my_string = o.MyString
  31. };
  32. }
  33. public static OpResult<IEnumerable<ValuesDbo>> Contains(string text)
  34. {
  35. return GetMultipleDbo(x => x.my_string.Contains(text));
  36. }
  37. }
  38. }