adopilot
adopilot

Reputation: 4510

Create Pocos for Petapco with data (results) from stored procuders

I realy like PetaPoco, and I am at early beginning of using it.
My database server is MSSQL2008R2, and I there is havy use of stored procedures.
I learned how to create Pocos from (for) tables .
Is there an easy way to create Pocos from already written stored procedures which returning data back from SQL serve.

Upvotes: 1

Views: 155

Answers (1)

Eduardo Molteni
Eduardo Molteni

Reputation: 39413

The hard thing about getting POCOs from SPs is that you need to execute them with the correct parameters to get the results in order to build a POCO.

Are you aware that you can use a dynamic type instead of creating a POCO for every SP?

If a POCO is required, there are some tool that maybe can help you, although they aren't PetaPoco specific.

  • Code Smith Generate code from SQL databases
  • SqlMetal is a Linq to SQL generator, but generates POCO from SPs (use /sprocs)

Upvotes: 2

Related Questions