ok there they have shown for insert, update and delete, when I tried the same to fetch some data which is in the form of multiple rows and columns, I am unable to get the result. I tried like this:
using (var command1 = CreateCommand("SelectFormFields", CommandType.StoredProcedure))
{
var dataReader= (await command1.ExecuteReaderAsync());
}
& I do not want to use Read() function to read each value.
So, I want the data to be read at once with all rows and columns ;)
Actually I want the result to be directly converted into some entity (or variable), unlike reading each and every record as it is shown on [https://www.codeproject.com/Articles/1199648/Using-Stored-Procedure-User-Defined-Function-and-V]) like this : while (dataReader.Read()) { result.Add(dataReader["UserName"].ToString()); }
This will might hamper the performance.
In MVC structure, we use SQlQuery() function to get the result in one statement
var number= _context.Database.SqlQuery<int>("exec StoredProcedure@centerID", sqlCenterId).Single();
so, is there something like this for ABP framework?
<cite>aaron: </cite>
What will be best way to do so?
Also can I get the implementation?
Source code is published on Github: https://github.com/aspnetboilerplate/aspnetboilerplate-samples/tree/master/storedProcedureDemo
I have implemented this method shown on : Using Stored Procedure, User Defined Function and Views in a Custom Repository with ASP.NET Boilerplate . But, there they have used DataReader to read each value, I do not want to use that as it will deteriorate application performance. Is there better way to read whole data at once?
Got page not found on:- <a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate-samples/tree/master/storedProcedureDemo">https://github.com/aspnetboilerplate/as ... cedureDemo</a>
Hi, I got it..
I forgot to add the entity to DbContext file . Now it is working .
Thanks.
Please reply as soon as possible..
Can we implement such functionality in asp net zero?