PetaPoco | Official PetaPoco , A tiny ORM-ish thing for your POCO | Object-Relational Mapping library
kandi X-RAY | PetaPoco Summary
kandi X-RAY | PetaPoco Summary
Originally the brainchild of Brad Robinson. PetaPoco is currently maintained and exteneded by Wade Baglin (@pleb) and Aaron Sherber (@asherber).
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of PetaPoco
PetaPoco Key Features
PetaPoco Examples and Code Snippets
Community Discussions
Trending Discussions on PetaPoco
QUESTION
This is my stored procedure:
...ANSWER
Answered 2021-Apr-13 at 19:48your proc definition is not correct, you are not passing any parameter to your function , that variable inside proc never gets any value (It's always null since no value has been assigned to it)
QUESTION
I am trying to use petapoco with my .NET core MVC application, I have installed petapoco compiled as stated in another answer but don't know what to do next, I searched many places but most of them had been using the previous versions of petapoco and not the latest one, Can someone please help and provide some resources link as to how am I supposed to connect it with my SQL server using a connection string, and since now their documentation suggested to use PetaPoco.DBEntityGenerator instead of T4 templates, I have no idea how to use it.
...ANSWER
Answered 2021-Jan-19 at 19:33Start by reading the Quick start guide
To connect to your db, you can start with the samples given:
QUESTION
In .Net Framework 4.7.2 F#, I have been using:
...ANSWER
Answered 2020-Oct-31 at 07:54That is an old type provider from F# 3.0, and it depended on svcutil for code generation. You could reference its nuget package but it's possible (likely) there is no support for the dotnet-svcutil tool. But you can use WCF from C#, so:
- Add a new C# project to your solution
- Add Connected Service in Visual Studio and configure your end point, this will generate the necessary code, build your project (and test that it works)
- From your F# project, add reference to this C# project, and
open ProjectName
- Create your type, and use it from F#. You will get intellisense on the types so the user experience is not that different from the type provider.
- If needed you can publish the self-contained exe:
dotnet publish -r win10-x64 -c Release -p:PublishSingleFile=true -p:PublishTrimmed=true
QUESTION
I am using Npgsql 3.0.3.0 and PetaPoco latest version.
When I run this command:
...ANSWER
Answered 2017-Feb-03 at 22:18You need to cast value to timestsamp:
QUESTION
I have N-Layer solution in .Net with PetaPoco as microORM. I get the entities generated from the template generator of PetaPoco. These entities T
derive from the base class Record
. Then I extend them adding more data access facilities and custom Save()
and Delete()
methods that override the Record
default methods.
Following is the overrided Delete
method from the entity (the method I want to call)
ANSWER
Answered 2017-Oct-27 at 13:23Confession: I have no knowledge of PetaPoco and its template generator.
The problem is more related to OO (specifically Inheritance) than PetaPoco IMHO. If generic repository is created with Record
which is also a base class for each entity, then what happening is as expected. You need to closely look into inheritance of your classes.
You may need to make few changes in the solution I am proposing below to match up with ORM functionality.
Solution 1:Declare a new base class or interface something like below:
QUESTION
I am trying to make a method which takes in a variable object type as a parameter, and then updates a database depending on what object was passed, a bit like how Petapoco works for C#. For this I am trying to use a generic method in which the object that is passed passes a number of checks before it is inserted/updated into its relevant table. A number of questions on Stack Overflow point me towards using a method signature like this:
...ANSWER
Answered 2019-Dec-10 at 07:58You can do it with generic type bounds.
Define:
QUESTION
I am still relatively new to EF Core and beforehand I used PetaPoco, so please forgive my ignorance. In my database, I added the following fields to my AspNetUsers table:
- Elevated
- Deactivated
- FirstName
- LastName
I then created the following classes following this blog article:
...ANSWER
Answered 2019-Sep-19 at 16:18You have to specify type parameter(s) for IdentityDbContext
. You need to inherit from IdentityDbContext
class. Without type parameters you are using classes defined in ASP.NET Core Identity. Everything you'd like to change must be reflected in your code.
QUESTION
I am using this example from Umbraco docs and when i try to save values to the database table i am getting this error: Cannot insert the value NULL into column 'Id', table 'petapoco.dbo.BlogComments'; column does not allow nulls. INSERT fails. The statement has been terminated.
Also, after table is created and i check it in database, I can see that primary key and autoincrement option is not set for id field.
And this is how i insert values:
...ANSWER
Answered 2019-Aug-26 at 13:57Good guy on Umbraco forum solved my problem. This is the missing part in my class:
QUESTION
PetaPoco PostgreSQL 11.1
I am attempting to get a list of deleted record id's. This does NOT work:
...ANSWER
Answered 2019-Aug-15 at 06:04Took me a little while to understand what was happening here.
The Fetch
runs a query and returns the result set as a typed list. Straight from the docs.
You will likely need to honour the typed part of this.
Hopefully, the following demonstrates what is happening.
QUESTION
I use C#, SQL Server and PetaPoco which auto increments the ID
by default. I just want to know that if it is possible to set this autoincremented id to another column.
I have 2 more columns needs to be set with the exact value of ID. Is it possible to do this inside the SQL CREATE TABLE
statement or doing some hook before or after ExecuteNonQuery
? I don't want to create a view or a trigger if it's possible.
ANSWER
Answered 2019-Jul-22 at 15:21Yes, of course - the CREATE TABLE
allows you to define which column will be the auto-increment column, by adding the IDENTITY
keyword to the column definition. This works for any integer-based column, or columns of type DECIMAL(p, 0)
(with a 0
scale - no after-the-dot digits).
E.g.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install PetaPoco
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page