Advertisement
Guest User

Untitled

a guest
Oct 21st, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. using PayCoreCustomReport.Configurations;
  2. using PetaPoco.NetCore;
  3. using System.Data.SqlClient;
  4.  
  5. namespace PayCoreCustomReport.Service
  6. {
  7. public interface IService
  8. {
  9. }
  10.  
  11. public class Service : IService
  12. {
  13. protected readonly Database _db;
  14.  
  15. public Service() => _db = GetDatabase();
  16.  
  17. protected Database DB => _db;
  18.  
  19. protected virtual Database GetDatabase()
  20. {
  21. string connectionString
  22. = new StartUpConfigurations().GetConnectionStringConfiguration().Conn;
  23.  
  24. return new Database(new SqlConnection(connectionString));
  25. }
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement