-1

I'm trying to move my Dapper project to repository pattern. What I want to do is

public SomeMethod(NpgsqlConnection con) { .../ }

And I want to know will it eat too much memory? Is it bad pattern. I don't need much explanations if you wish. Can you just answer me yes or no?

Code works but I'm not sure about correct cpu using

  • 4
    Connection parameters cost nothing. Passing a reference type to a method only copies a reference to that object, not the object itself. Connections still have to be short lived, repository or not. Connection pooling ensures that closing and reopening a connection will use an existing connection from Npgsql's connection pool – Panagiotis Kanavos Aug 28 '23 at 12:32
  • Not directly related to your question; but you may find this helpful: https://stackoverflow.com/q/31298235/5779732 – Amit Joshi Aug 29 '23 at 06:09

0 Answers0