Zil
Need help with dapper to prevent sql injection on database parameter!
Hello, this is my current endpoint:
Now reading the documentation of dapper they implement a endpoint like this:
How can I implement this on the database parameter from my code?
Thanks in advance!
21 replies
Looping a query bad practice? Good alternative?
This is my end-point atm:
The data it receives:
(In this case there is only 2, but this can be big, can also reach like 100 objects with each multiple parameters.)
Now ofcourse I could just loop over each object and then also loop over the parameters and execute a query for each item to the table i want.
This feels like bad practice and would love to hear your opinion on it and maybe a good alternative.
Thanks in advance!
4 replies
Need some help with my end-point
So i have this end point:
My model:
The query works fine in mssql, some of the data is indeed NULL, my guess would be that calling the below function on that data gives the error?
This is the error im getting:
This is my first Dotnet project so all tips and hints are welcome!
39 replies
❔ SQL query for multiple data objects
Hello folks, Imagine i have a json array of json objects that i send to an API wich uses a SQL query to INSERT the data into the database.
Each json object in the array contains data that should be pushed into table 1.
every json object also contains a property called parameters that is an Array of objects. each object of this parameters array needs to be inserted into table 2.
Is it normal practice to for example loop over all parameters and execute the SQL query for each item? It feels wrong to do that somehow but then again i dont know what other option there is. Thanks in advance!
9 replies
Accidently closed last post. Need help with data structure(Noob).
Hello this is my function
Model:
The focus here is on the parameters of a stepmodel. Current return value of merged steps is something like this(example):
Previous help consists of changing my Model to a Record. Unfortunately i cant do this because of constraints from PO.
Thanks in advance!
53 replies