Questions tagged [petapoco]

PetaPoco is a tiny and fast micro-ORM for .NET and Mono.

PetaPoco is a tiny and fast single-file or library referenced micro-ORM for .NET and Mono. It prides itself on being an easy to use and no fuss. Support for all the common databases engines are included (SQL Server, SQL Server CE, MS Access, SQLite, MySQL, MariaDB, PostgreSQL, and Oracle databases).

Single file

PetaPoco is available as a single file nuget package, with or without T4 templates to generate POCOs from an existing database schema. In the single file form PetaPoco has zero dependencies.

Speed

PetaPoco benchmarks done by the author can be found here. (Note that there have been several performance improvements made in the code since these benchmarks.)

Frans Bouma's benchmarks can be found here


See the PetaPoco website for a full list of features.

429 questions
0
votes
1 answer

Difference Between Column and ResultColumn Using Petapoco?

I have Class like public class Myclass { [Column] public string no{ get; set; } [Column] public string Name{ get; set; } [Column] public string Address{ get; set; } [Column] …
Prasanna Kumar J
  • 1,288
  • 3
  • 17
  • 35
0
votes
1 answer

Wrap Sql query inside another Sql query using Peta Poco

How can you wrap a Sql query with arguments inside another query? For instance: var sqlCount = new Sql("COUNT(*) as Result").From("ArticleGroups"); sqlCount.LeftJoin("Articles").On("Articles.ArticleGroupId =…
Mivaweb
  • 5,580
  • 3
  • 27
  • 53
0
votes
1 answer

SQL Server Transaction rollback or commit using Petapoco?

I have list of rows for insert to database within a transaction using Asp.Net. But it will not commit fully. That means the last fews rows are only inserted. My code is: using (PetaPoco.Database db = new Database("Mydb")) { using (var trn =…
Prasanna Kumar J
  • 1,288
  • 3
  • 17
  • 35
0
votes
1 answer

Difference between Database.BeginTransaction() and Database.GetTransaction() Using petapoco?

using (var trn =database.GetTransaction()) { database.BeginTransaction();//it is required or not? database.Save(Table); trn.complete() } what is use of BeginTransaction() in petapoco?
Prasanna Kumar J
  • 1,288
  • 3
  • 17
  • 35
0
votes
2 answers

Petapoco with Datatable

I am new in Petapoco,Can I retrieve table data as Datatable using stored procedure in petapoco ORM ? I tried in google but I didn't get any answer from google.Any one know that?
achu
  • 43
  • 1
  • 7
0
votes
1 answer

Error on inserting decimal into the database with petapoco

I'm having a problem inserting a decimal value into the database using PetaPoco. In my model I have the proeprty: [Column("Price")] public decimal PriceTotal { get; set; } and in the databse the relevant column Price is of type decimal(18,…
nickornotto
  • 1,946
  • 4
  • 36
  • 68
0
votes
0 answers

Refactoring a project generated from Petapoco

I'm creating a C# Win Forms app using PetaPoco as micro ORM. I want to refactor the generated classes to make them easily testable and mockable. When I started to write the Unit Test I get stuck with Mock because I do not use interfaces, but I dont…
JJ Yong
  • 63
  • 9
0
votes
0 answers

Vs 2013 Ultimate Build Error or View in Browser error

When I try Build, Rebuild , View on browser click the error is.This error comes after I publish my project to azure Error 3 The command "if Release == Release NuGet.exe pack…
Alican Kablan
  • 399
  • 8
  • 17
0
votes
2 answers

PetaPoco returns empty object

Inside my applocation, the petapoco poco returns an empty object (all values are null). Using the UI-O-Matic Nuget package inside my Umbraco 7.5.12. The query i'm currently running: var dbContext = ApplicationContext.Current.DatabaseContext; …
RunnicFusion
  • 193
  • 1
  • 3
  • 12
0
votes
0 answers

Correctly passing string based parameters with PetaPoco

Whilst working with PetaPoco in our development environment, we wrote a Fetch command a little like this: DB.Fetch("SELECT Col1, Col2 FROM Tablename WHERE Col1 = @0, parameter) The resultant command looks a lot like this: SELECT Col1, Col2…
Ashilta
  • 173
  • 1
  • 10
0
votes
2 answers

Petapoco missing attributes IgnoreOnInsert, IgnoreOnUpdate

I'm trying to use Petapoco in my Umbraco powered website. On my poco's I have a column called Created which has a default sql value (getDate()). I would like that column to be ignored on insert and update by Petapoco, but not on read. Any idea how…
Andrei
  • 31
  • 1
  • 6
0
votes
1 answer

Dynamic list from GetType?

Type t = Type.GetType("classname"); I got 't' like as class classname. I need like this. List list = db.Fetch("select * from classname"); I get error: "t" could not be found. How can i use this?
Prasanna Kumar J
  • 1,288
  • 3
  • 17
  • 35
0
votes
1 answer

PetaPoco Insert includes my Ignored properties?

My poco object looks like the following: public class Poco { public int Id { get; set; } public string Name { get; set; } public string Url { get; set; } [Ignore] public string IgnoreMe { get; set; } …
xaisoft
  • 3,343
  • 8
  • 44
  • 72
0
votes
1 answer

Preventing duplicate inserts into SQL db when comparing a specific column, must use PetaPoco

Background info I am currently working on a email crawler which will make records in a db of emails which I have crawled for information. Currently my company has constrained me into using Petapoco for code maintenance issue. The current issue I…
EasyE
  • 560
  • 5
  • 26
0
votes
0 answers

How can I use petapoco with sync and async Repository pattern + Unit of Work?

Because petapoco it's not async, I found another library https://github.com/tmenier/AsyncPoco But this AsyncPoco it's 100% async. If one library ( petapoco ) it's 100% sync and another (AsyncPoco) is 100% async, is it possible to use petapoco with…
Lucas Roselli
  • 2,810
  • 1
  • 15
  • 18