ASP.NET Core Web API + Entity Framework Core : REST API Methods - EP03

  Рет қаралды 41,431

CuriousDrive: Solve Coding Problems & Win Prizes!

CuriousDrive: Solve Coding Problems & Win Prizes!

Күн бұрын

Пікірлер: 53
@mrocca98
@mrocca98 4 жыл бұрын
These are the best. Helping me out so much in my first internship
@CuriousDrive
@CuriousDrive 4 жыл бұрын
Thanks for the kind words Michael. Welcome to the world of programming.
@CuriousDrive
@CuriousDrive 4 жыл бұрын
Code - github.com/CuriousDrive/BookStores Thanks for watching, please share with your friends :)
@raaz123456789
@raaz123456789 5 жыл бұрын
Great series, nice step by step explanation and I appreciate it when you make changes and show their effect/changes Can you kindly add a new video on how to consume these api endpoints in a dotnet core web application please. Thanks
@CuriousDrive
@CuriousDrive 5 жыл бұрын
Thanks. I am currently working on that demo. Hopefully I can publish it in couple of days. Stay tuned!!
@amnesia3490
@amnesia3490 4 жыл бұрын
Thanks for the videos, you explain everything very clear i was looking whole day.
@CuriousDrive
@CuriousDrive 4 жыл бұрын
Awesome. Let me know if you run into any issues? Thanks for watching Please share with your friends, it helps :)
@yashparikh3412
@yashparikh3412 7 ай бұрын
This is pure gold!
@MultiAkash1988
@MultiAkash1988 3 жыл бұрын
You made my day.... So easy explanation. Thank you very very much
@CuriousDrive
@CuriousDrive 3 жыл бұрын
Thanks for watching. Please share with your friends.
@chrisdev8615
@chrisdev8615 4 жыл бұрын
congratulations for your work , and is good if you can show some kind of commons errors that can happens during development.
@CuriousDrive
@CuriousDrive 4 жыл бұрын
That's a great idea. I will keep that in mind and make a video on it.
@stefanstefanov9860
@stefanstefanov9860 4 жыл бұрын
If you want to use postman, but you get could not get any response - you have ssl certificate problem. Go on postman, setting and then togle or togle off SSL Certificate validation.
@kandinagireddy
@kandinagireddy Жыл бұрын
Tutorial is very good. Are there any new series on .Net 6/7/8/ Web api??
@fahadmullaji
@fahadmullaji 5 жыл бұрын
#Postman is one of the best tools to test you APIs.
@CuriousDrive
@CuriousDrive 5 жыл бұрын
Yes. I started using when I watched it being used in Microsoft demos. I love it dark mode. And you can also make the font size bigger. But you gotta love how easy it was to create those API methods using visual studio.
@fahadmullaji
@fahadmullaji 5 жыл бұрын
@@CuriousDrive Totally man. that's why I love visual studio. I used to be a java developer, started learning #.NET development in #VS that's when I realized how much time I used to spend doing basic things. it's amazing how #ASP.NET Web API works to VS team to get these things done.
@giahuynguyen828
@giahuynguyen828 Жыл бұрын
Thank you so much. It’s very nice 🎉 Sir, I have a question. I need to create all controllers except Author and Publicsher if I’m in a project right?
@anonimowyanonimowy516
@anonimowyanonimowy516 2 жыл бұрын
Thank you great series if anyone have .net 6 in Programs add builder.Services.AddDbContext(options =>options.UseSqlServer(builder.Configuration.GetConnectionString("BookStoresDB"))); and remove old controller it can help with common issue
@saurabhkatrojwar2290
@saurabhkatrojwar2290 3 жыл бұрын
After publish our MVC or API project, Controllers and Models .dll created in one single bin folder not seperately. Is it possible to generate dll of Controller and Models dll seperately in seperate folders. Thanks
@CuriousDrive
@CuriousDrive 3 жыл бұрын
It looks like that feature has been removed. Please refer to this article. www.learmoreseekmore.com/2021/11/dotnet6-application-no-longer-generates-a-seperate-assembly-for-views-by-the-razor-compiler.html
@saurabhkatrojwar2290
@saurabhkatrojwar2290 3 жыл бұрын
@@CuriousDrive Thanks Sir... Great Search
@reddeimon475
@reddeimon475 3 жыл бұрын
i got this error: InvalidOperationException: Unable to resolve service for type 'BookStores.Models.BookStoresDBContext' while attempting to activate 'BookStores.Controllers.PublishersController'. what does it means?
@CuriousDrive
@CuriousDrive 3 жыл бұрын
Hello, you need to inject BookStoresDBContext in your starup class before generating the Controller from the models. I have explained that after creating the controller I believe.
@puthikma
@puthikma 5 жыл бұрын
I did the same thing as you did but i got an error while I am running like An unhandled exception occurred while processing the request. InvalidOperationException: Unable to resolve service for type 'BookStoresWebAPI.Models.BookStoresDBContext' while attempting to activate 'BookStoresWebAPI.Controllers.PublishersController'. Microsoft.Extensions.DependencyInjection.ActivatorUtilities.GetService(IServiceProvider sp, Type type, Type requiredBy, bool isDefaultParameterRequired) Stack Query Cookies Headers Routing InvalidOperationException: Unable to resolve service for type 'BookStoresWebAPI.Models.BookStoresDBContext' while attempting to activate 'BookStoresWebAPI.Controllers.PublishersController'. Microsoft.Extensions.DependencyInjection.ActivatorUtilities.GetService(IServiceProvider sp, Type type, Type requiredBy, bool isDefaultParameterRequired) lambda_method(Closure , IServiceProvider , object[] ) Microsoft.AspNetCore.Mvc.Controllers.ControllerActivatorProvider+c__DisplayClass4_0.b__0(ControllerContext controllerContext) Microsoft.AspNetCore.Mvc.Controllers.ControllerFactoryProvider+c__DisplayClass5_0.g__CreateController|0(ControllerContext controllerContext) Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(ref State next, ref Scope scope, ref object state, ref bool isCompleted) Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync() Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|19_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, object state, bool isCompleted) Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Logged|17_1(ResourceInvoker invoker) Microsoft.AspNetCore.Routing.EndpointMiddleware.g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger) Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context) Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext conte
@CuriousDrive
@CuriousDrive 5 жыл бұрын
To fix this issue you will have to add DBContext in your services. ConfigureServices function in your startup.cs class should look something like this. public void ConfigureServices(IServiceCollection services) { services.AddControllers(); services.AddDbContext(options => options.UseSqlServer(Configuration.GetConnectionString("BookStoresDB"))); } Let me know if you are still facing this issue
@puthikma
@puthikma 5 жыл бұрын
@@CuriousDrive Thanks you you are amzing
@TechTanka
@TechTanka 4 жыл бұрын
@@CuriousDrive Where does "BookStoresDB" come from? where do you configure that? Do you have that on Settings json?
@OmnislashLimitbreak4
@OmnislashLimitbreak4 4 жыл бұрын
@@CuriousDrive Being 1:09 am, Mexico City time, I sincerely thank you.
@Manu-wb2uv
@Manu-wb2uv 4 жыл бұрын
@@CuriousDrive Yes now it works for this matter, but if I call the Author controller endpoint I get the same error in code :)
@dasamsandeep6087
@dasamsandeep6087 4 жыл бұрын
I have done the exercise what u post.. I'm getting error like an unhandled exception occurred while processing the request kindly help
@CuriousDrive
@CuriousDrive 4 жыл бұрын
Can you please share the scenario for which it is failing?
@ajanyhc
@ajanyhc 4 жыл бұрын
@@CuriousDrive In Startup.cs, add the following (it worked for me, bypassing 'launchSettings.json') string connectionString = "Server=.\\SQLExpress;Database=BookStoresDB;Trusted_Connection=True"; services.AddDbContext(options => options.UseSqlServer(connectionString));
@zabola12
@zabola12 5 жыл бұрын
Is there a way to make localhost:(port) something fixed instead of auto generated by vs code?
@CuriousDrive
@CuriousDrive 5 жыл бұрын
I would create an application on IIS and point the web API there.
@minhtuan737
@minhtuan737 4 жыл бұрын
Nice sir, tks
@CuriousDrive
@CuriousDrive 4 жыл бұрын
Thanks for watching Minh.
@flaviusioan69
@flaviusioan69 4 жыл бұрын
Smoth .....
@CuriousDrive
@CuriousDrive 4 жыл бұрын
Thanks for commenting Ioan.
@mysteriouspants6082
@mysteriouspants6082 5 жыл бұрын
this is going to make me very lazy
@CuriousDrive
@CuriousDrive 5 жыл бұрын
Or you can take that time to think about real things. :)
ASP.NET Core Web API + Entity Framework Core : Loading Related Data | Eager Loading - EP04
10:18
CuriousDrive: Solve Coding Problems & Win Prizes!
Рет қаралды 34 М.
ASP.NET Core Web API + Entity Framework Core : Basic Authentication Explained - EP07
28:55
CuriousDrive: Solve Coding Problems & Win Prizes!
Рет қаралды 55 М.
人是不能做到吗?#火影忍者 #家人  #佐助
00:20
火影忍者一家
Рет қаралды 20 МЛН
黑天使被操控了#short #angel #clown
00:40
Super Beauty team
Рет қаралды 61 МЛН
小丑女COCO的审判。#天使 #小丑 #超人不会飞
00:53
超人不会飞
Рет қаралды 16 МЛН
Build a RESTful API in ASP.NET 6.0 in 9 Steps!
12:32
tutorialsEU
Рет қаралды 87 М.
ASP.NET Core Web API + Entity Framework Core : Saving Related Data - EP05
11:32
CuriousDrive: Solve Coding Problems & Win Prizes!
Рет қаралды 24 М.
.NET 6 🚀 AutoMapper & Data Transfer Objects (DTOs)
15:48
Patrick God
Рет қаралды 74 М.
Structuring Dependency Injection In ASP.NET Core The Right Way
16:22
Milan Jovanović
Рет қаралды 56 М.
Entity Framework Core : Code First | Migrations - EP02
15:43
CuriousDrive: Solve Coding Problems & Win Prizes!
Рет қаралды 14 М.
人是不能做到吗?#火影忍者 #家人  #佐助
00:20
火影忍者一家
Рет қаралды 20 МЛН