DotNet Core MVC CRUD With Dapper

  Рет қаралды 22,509

Ravindra Devrani

Ravindra Devrani

Күн бұрын

Пікірлер: 83
@goodmantshabalala-ei9vm
@goodmantshabalala-ei9vm 7 ай бұрын
This is quality content nice one jita
@sm1166
@sm1166 Жыл бұрын
this video was helpful
@鄭海寅-s8d
@鄭海寅-s8d Жыл бұрын
I really appreciate your kind example lecture. I expect CRUD processing of jQuery DataTables with jQuery next. Thanks!
@hutchm92
@hutchm92 9 ай бұрын
This is an excellent video. I would only suggest to add chapters to easily navigate back to concepts or steps to review.
@ravindradevrani
@ravindradevrani 9 ай бұрын
I would appreciate, if someone give some timestamps. 🙏🏽🙂
@SuvedhiniReddiyar
@SuvedhiniReddiyar Ай бұрын
Thanks a lottt!
@codingislife6387
@codingislife6387 Жыл бұрын
thanks Sir
@gauravsrivastava8504
@gauravsrivastava8504 9 ай бұрын
Good video but one suggestion, could you please add search filters in display all records , Search filter (multiple search at a time)
@ravindradevrani
@ravindradevrani 9 ай бұрын
kzbin.info/www/bejne/oKDJiGBoaq6YrdUsi=kVtUk1Rbg4FnRhJ8 At this project you can find search filter with dapper, but it is a blazor server project. But you can find some logic there. Project link will be in description of video. 2nd project in mvc with ef core. Here u can find filter, pagination, sorting etc. ( kzbin.info/www/bejne/Y3iZhmZqrM6ZhJYsi=kJbZ24BdSAp0mtjg)
@Sankets90
@Sankets90 Жыл бұрын
hello sir , how to pass multiple data in a single datatable from POST API to table valued parameter stored procedure ?
@DennyMapleSyrup
@DennyMapleSyrup 11 ай бұрын
I’m getting an “AmbiguousMatchException” because of the overloaded edit function. Any ideas what might be causing this? Just like your example I have one with an int id as a parameter and one with a Person person parameter. Also why does there need to be 2 separate edit functions? Can you not put all the functionality into one where the input is just the id?
@DennyMapleSyrup
@DennyMapleSyrup 11 ай бұрын
Update: I’m an idiot. I forgot to put [HttpPost] before the second edit function. If you are having the same issue, highly recommend you try this fix.
@ravindradevrani
@ravindradevrani 11 ай бұрын
😃 don't be too harsh on yourself. It happens all the time.
@cissemy
@cissemy 8 ай бұрын
Do you recommend Dapper for large application vs EF ?
@ravindradevrani
@ravindradevrani 8 ай бұрын
Both are fine. But with dapper alone you can't use identity for authentication. You have to use 3rd party auth system like okta/azure.
@sryaan3
@sryaan3 10 ай бұрын
How to extract code from github ... I've downloaded to pc and in next procedure in visual studio 2022 I'm not able to open only ... can you guide me
@ravindradevrani
@ravindradevrani 10 ай бұрын
There would a .sln file..click on it. It will automatically open on visual studio.
@sryaan3
@sryaan3 10 ай бұрын
How to get my sql server in vs studio
@ravindradevrani
@ravindradevrani 10 ай бұрын
In connection string, Change the server name according to ur SQL server instance name .. you will find it before logging it to sql sever mgt studio
@sryaan3
@sryaan3 10 ай бұрын
Thank you so much for your response I'm very grateful I'm not getting appsetings.json
@sryaan3
@sryaan3 10 ай бұрын
I'm doing in vs 2022
@vedadrishilpa8738
@vedadrishilpa8738 3 ай бұрын
Hello sir, I am actually getting an error when I click on person. Win32Exception: the system cannot find the file specified. SqlException: A network related error occured while establishing a connection to SQL server. The server was not found or not accessible. I am also unable to connect the db
@ravindradevrani
@ravindradevrani 3 ай бұрын
It is clearly the DB related error. If it is happening only in this project then your connection string is wrong. But, if you are not even able to open the sql server mgt studio, it might be possible that your sql server service is not running. Please try to find it in google (specially the stack over flow) One solution i find there stackoverflow.com/questions/61757548/how-to-fix-the-system-cannot-find-the-file-specified-error-in-asp-net-mvc-and-sq
@mayur2021
@mayur2021 Жыл бұрын
Hello Sir, please make a video on menus using database. Thank you!
@ravindradevrani
@ravindradevrani Жыл бұрын
hahaha... hey, it should not be that much bigger deal, if you are following my project-based tutorial for a while or have the understanding of database design, it won't be a big deal. Just create table, Menu (Id, Title,ParentMenu_Id, PageLink) , display it in a page. You have to use self-join, if you are creating nested menus.
@shreyass4394
@shreyass4394 4 ай бұрын
I am not able to rename the folder
@lesedipitoyi2228
@lesedipitoyi2228 7 ай бұрын
An unhandled exception occurred while processing the request. InvalidOperationException: Unable to resolve service for type 'DapperDemo.DataLayer.Repository.PersonRepository' while attempting to activate 'DapperDemo.UI.Controllers.PersonController'. I did the project as you did but it keeps on throwing the above error when I click on Person on the NavBar.Can I please get some assistance on how to correct it
@ravindradevrani
@ravindradevrani 7 ай бұрын
You have to register your service in program.cs . Services.AddTransient()
@lesedipitoyi2228
@lesedipitoyi2228 7 ай бұрын
@@ravindradevrani I did add that as one of the builders
@ravindradevrani
@ravindradevrani 7 ай бұрын
It looks like dependency injection related problem to me. Please checkout these links code-maze.com/dotnet-how-to-solve-unable-to-resolve-service-for-a-type/ stackoverflow.com/questions/40900414/dependency-injection-error-unable-to-resolve-service-for-type-while-attempting Notify me, about the situation after this.
@lesedipitoyi2228
@lesedipitoyi2228 7 ай бұрын
@@ravindradevrani still no progress did you post the project anywhere by any chance so that I can troubleshoot mine using yours
@ravindradevrani
@ravindradevrani 7 ай бұрын
Yes... I always provide source code. Link is available in the description.
@md.yeasin5214
@md.yeasin5214 Жыл бұрын
❤❤❤❤❤
@1BY21CS04_CHARANKS
@1BY21CS04_CHARANKS 2 ай бұрын
hellosir my delete button is not working...i tried copying the code from your githuub as well it didnt work can u help me with this
@ravindradevrani
@ravindradevrani 2 ай бұрын
I have forgot to add try catch block, add try catch block as i have described below. put the breakpoint in catch block and try to check the value of ex.Message or ex.InnerMessage, you will surely find the error. public async Task Delete(int id) { try{ var deleteResult = await _personRepo.DeleteAsync(id); } catch(Exception ex) { // put breakpoint here and try to check the value of ex.Message or ex.InnerMessage, you will surely find error. } return RedirectToAction(nameof(DisplayAll)); }
@1BY21CS04_CHARANKS
@1BY21CS04_CHARANKS 2 ай бұрын
@@ravindradevrani actuall i was able to solve it… in personRepository .. we have it as sp_delete_person in github but in sql its sp_delete_people .. so just changing the names made kt work
@faisalusmani692
@faisalusmani692 Жыл бұрын
Sir why didn't you register connection string in program.cs file?
@ravindradevrani
@ravindradevrani Жыл бұрын
If you define connection string in apsettings.json then in future,you can change it without recompiling the code. You can define connection strings specific to different environments such as development, testing, and production. This allows you to easily switch between different databases or servers based on the environment without modifying the code.
@faisalusmani692
@faisalusmani692 Жыл бұрын
@@ravindradevrani thank you sir👍
@ravindradevrani
@ravindradevrani Жыл бұрын
👍
@abhijeetkale5853
@abhijeetkale5853 Жыл бұрын
What about database stored procedures
@chiragpadhyal9394
@chiragpadhyal9394 Жыл бұрын
Hello sir, I am getting an error Whenever i am trying to add new person it is not getting added in the data
@ravindradevrani
@ravindradevrani Жыл бұрын
Put a break point and try to look into error msg
@badriaran1943
@badriaran1943 Жыл бұрын
Can you make a video for mapping model to view and view to model.
@ravindradevrani
@ravindradevrani Жыл бұрын
what does it mean ' mapping model to view and view to model'
@badriaran1943
@badriaran1943 Жыл бұрын
@@ravindradevrani implementation of mappers. For example sometimes we may have model which are not directly mapped to database ex. Maybe iform file(images) which are not stored in database but its path will be stored. So making model for view purposes one and for database purpose another. And connecting them to each other.
@badriaran1943
@badriaran1943 Жыл бұрын
Making viewModel and mappers to map to model.
@ravindradevrani
@ravindradevrani Жыл бұрын
Yeah yeah...i understand.. you are talking about automappers I already have created a video kzbin.info/www/bejne/m57dfX2EdtV9hZY it is a short one, but it is in .net core 3.0 and does not have any sound. You have to do little bit of modification in program.cs file. May be i will create .net 7 version of it.
@badriaran1943
@badriaran1943 Жыл бұрын
@@ravindradevrani okay thank you in advance. You can make a full video on Mysql queries from beginner to Ultima level including join queries. . It would be so helpful for beginners like me.
@delightful730
@delightful730 Жыл бұрын
Is it DB First Approch?
@ravindradevrani
@ravindradevrani Жыл бұрын
Yes
@mushaffiq457
@mushaffiq457 Жыл бұрын
Hello sir you video is good cab i get the source code of the project
@ravindradevrani
@ravindradevrani Жыл бұрын
yeah i always provide source code in every video. Find the Link is in the description.
@mushaffiq457
@mushaffiq457 Жыл бұрын
Sir the link is not working
@ravindradevrani
@ravindradevrani Жыл бұрын
Ok..i have to see, why it is not working. I will notify when its updated
@ravindradevrani
@ravindradevrani Жыл бұрын
I have accidentally created a private repository, thanks for noticing. Now everything is working fine.
@glrithika8276
@glrithika8276 Жыл бұрын
DapperMvcDemo.Data.DataAccess.SqlDataAccess.GetData(string spName, P parameters, string connectionId) in SqlDataAccess.cs + IEnumerable enumerable = await connection.QueryAsync(spName, parameters, commandType: CommandType.StoredProcedure); DapperMvcDemo.Data.Repository.PersonRepository.GetAllAsync() in PersonRepository.cs + return await _db.GetData(query, new { }); DapperMvcDemo.UI.Controllers.PersonController.DisplayAll() in PersonController.cs + IEnumerable people = await _personRepo.GetAllAsync(); sir why do i keep getting this error? ..it shows internal server error in these statements
@ravindradevrani
@ravindradevrani Жыл бұрын
Sorry, but It's hard to tell
@nazlimervekilic2377
@nazlimervekilic2377 Жыл бұрын
Hi sir, i can't create this=> procedure sp_update_person( @id int, @name nvarchar(100), @email nvarchar(100), @address nvarchar(200) ) as begin update dbo.Person set name=@name, email=@email, [address]=@address where id=@id end Why?
@ravindradevrani
@ravindradevrani Жыл бұрын
Command should be Create procedure sp_update_person( ...... ) You are missing the term "create"
@nazlimervekilic2377
@nazlimervekilic2377 Жыл бұрын
i write that create procedure sp_update_person( @id int, @name nvarchar(100), @email nvarchar(100), @address nvarchar(200) ) as begin update dbo.Person set name=@name, email=@email, [address]=@address where id=@id end but it does not. mistake is = Msg 207, Level 16, State 1, Procedure sp_update_person, Line 11 [Batch Start Line 0] Invalid column name 'id'. @@ravindradevrani
@ravindradevrani
@ravindradevrani Жыл бұрын
Can you check the definition of table "person". Error is indicating that it is missing the column id... Just run the query select * from person And check it have a column 'id' or not
@nazlimervekilic2377
@nazlimervekilic2377 Жыл бұрын
table's names are id, name, email, address @@ravindradevrani
@nazlimervekilic2377
@nazlimervekilic2377 Жыл бұрын
okey sir, i found the mistake. thank you@@ravindradevrani
Dapper tutorial with dot net 7 apis | .net core api crud
1:15:28
Ravindra Devrani
Рет қаралды 13 М.
I thought one thing and the truth is something else 😂
00:34
عائلة ابو رعد Abo Raad family
Рет қаралды 16 МЛН
SIZE DOESN’T MATTER @benjaminjiujitsu
00:46
Natan por Aí
Рет қаралды 8 МЛН
Creative Justice at the Checkout: Bananas and Eggs Showdown #shorts
00:18
Fabiosa Best Lifehacks
Рет қаралды 34 МЛН
Turn Off the Vacum And Sit Back and Laugh 🤣
00:34
SKITSFUL
Рет қаралды 9 МЛН
Building a Dapper CRUD API From Scratch In .NET 7 - For Beginners
22:50
Milan Jovanović
Рет қаралды 29 М.
Getting Started with Dapper in .NET
23:42
Nick Chapsas
Рет қаралды 23 М.
Registration page in mvc using dapper
7:37
Fun & Learn
Рет қаралды 1,8 М.
CRUD without Entity Framework in ASP.NET Core MVC
44:30
CodAffection
Рет қаралды 107 М.
Learn ASP.NET Core MVC (.NET 6) - Full Course
3:07:28
freeCodeCamp.org
Рет қаралды 1,5 МЛН
ASP.NET Core Crash Course - C# App in One Hour
1:00:44
freeCodeCamp.org
Рет қаралды 1,6 МЛН
Forget Controllers and Minimal APIs in .NET!
14:07
Nick Chapsas
Рет қаралды 77 М.
I thought one thing and the truth is something else 😂
00:34
عائلة ابو رعد Abo Raad family
Рет қаралды 16 МЛН