Questions Tagged [Npoco]

NPoco is a simple C# micro-ORM that maps the results of a query onto a POCO object.

94 questions
0 votes
0 answers
35 views

How to use Task.WhenAll with NPoco fetchAsync?

I'm trying to use Task.WhenAll. It's not working though because fetchAsync seems to get triggered when i declare classesTask. Any ideas? Using .Net framework 4.7.2 and NPoco var classesTask = scope....
0 votes
0 answers
28 views

Can I use Cyberark credential provider to pull DB credentials on NPoco autogenerated file?

I have an old project where the database class was automatically generated by the NPoco T4 Template. Now I want to use the Cyberark credentials provider to store and provide the database credentials. ...
  • 39
1 vote
1 answer
139 views

Passing asynchronous task result from one library (NPoco) to another (Polly) - which approach to use?

Background In my C# project (.NET 5.0), I am using NPoco (an ORM) to run SQL commands. I am then looking to execute the calls via a retry policy using Polly (e.g. if certain transient SQL errors occur,...
2 votes
1 answer
1k views

Npoco new Database fails with "Value cannot be null"

I am trying to update an MVC project from NPoco 3 to NPoco 5. I could no longer use: using var db = new Database("DB"); so I changed it to: using var db = new Database(ConfigurationManager....
  • 575
0 votes
1 answer
146 views

Maintaining both FK property and joined object in NPOCO C# model without memory leaks?

Assuming I have the following classes I'm using to map objects from the db: public class OwnedThingie { public long Id {get;set;} public long OwnerId {get;set;} public UserMan Owner {get;...
0 votes
1 answer
137 views

ORA-00936: missing expression | ASP .NET CORE 3.1 MVC | WITH FILES AS | NPoco

I have a problem with my function throwing an exception "ORA-00936: missing expression" yet the query works on Oracle SQL Developer... Does anyone know where this could come from? public ...
  • 395
0 votes
1 answer
138 views

SQL query for paging received records

I want to write a query that receives informations about customers and their orders from another table and show them in this way: Customer 1 Customer 1 Order 1 Customer 1 Order 2 Customer 2 Order 1 ...
1 vote
0 answers
458 views

NPoco exhausting connection pool on .NET Core 3.1

When I call into my repository 10000 times, it either takes minutes (for a very simple keyed query, which does not take minutes to do on the database itself), or dies quickly with a connection pool ...
1 vote
1 answer
281 views

Is there any in build functions available in NPoco for applying joins without in query joins

I want to use in built NPoco functions for using join rather than any in query join support like: var users = db.FetchOneToMany<UserDto, CarDto>(x => x.UserId, "select u.*, c.* from ...
0 votes
1 answer
1k views

Error when try to insert value in database with NPoco

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'; ...
0 votes
1 answer
503 views

NPoco - include with IncludeMany with other include (ASP NET MVC)

hi i need to get a record, which is related to 3 tables: Routes -> one to one -> StartCity & EndCity Routes -> one to many -> StopoverCity -> one to one -> City ** Sorry for my bad english ...
1 vote
1 answer
405 views

NPOCO. Is it possible to insert nested objects?

I have a Dto class with two nested Dtos: [TableName("ProductComponentVariant")] public class ProductComponentVariantDto { [Column("Id")] public int Id { get; set; } [...
1 vote
2 answers
327 views

C#. NPOCO. Error: "Incorrect syntax near '&'. " when trying to join

I have this stored procedure, created by NPOCO after the next linq query: var componentVarians = _repository.Get().Include(x => x.Component) .Where(x => x.IsActive == true & ...
1 vote
1 answer
342 views

Using tuple to return single row with 2 values from NPoco returns error

I use NPoco and I would like to have a query return two results - not a single object with two properties, but just two sums of some table. I was hoping to retrieve this as a tuple, but NPoco fails ...
  • 1,376
2 votes
1 answer
415 views

Does NPOCO Append(arg1, arg2) prevents SQL injection?

It is not clear to me by looking at the source code if the method public Sql Append(string sql, params object[] args) in the NPOCO library prevents SQL injection. For simplicity(my query is more ...

15 30 50 per page
1
2 3 4 5
…
7
Maya Lin-Takahashi

Maya Lin-Takahashi

Consumer Tech & Gadget Reviewer

Maya is a hardware enthusiast who tests and reviews smart home devices, smartphones, wearables, and audio gear. She focuses on practical consumer value and build quality.

Share this article
Twitter Facebook Pinterest