Hi, I am using asp.net core application with abp(Asp.net BoilerPlate) framework. I want to use stored procedure to get the data and also to implement CRUD operations in this code first architecture. :roll:
What will be best way to do so? Also can I get the implementation?
Thanks in advance .
8 Answer(s)
-
0
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
-
0
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>
-
0
<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?
-
0
Got page not found on:
Fixed the link - it was an uppercase S.
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?
See:
-
0
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?
-
0
The article shows how to call with "exec":
public async Task DeleteUser(EntityDto input) { await Context.Database.ExecuteSqlCommandAsync( "EXEC DeleteUserById @id", default(CancellationToken), new SqlParameter("id", input.Id) ); }
-
0
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 ;)
-
0
I provided a relevant link above: Difference Between DataReader, DataSet, DataAdapter and DataTable in C#