Great! I'm from Brazil (we wrotes Brasil), and yours tutorials was help me learn more times that I'can remember! Thank you!
@huseynmikayil51195 жыл бұрын
You are the best tutor I've ever seen.
@MosquitoMurderer5 жыл бұрын
I love when you say: "red squiggly"
@saranyasaran19164 жыл бұрын
Sir , your videos are always great and I have never seen a tutor like you. You are really great. And I love the music gets played end of the every videos of this series simply nice and soothing.
@Csharp-video-tutorialsBlogspot4 жыл бұрын
Hello Saranya - Thank you very much for the feedback. Means a lot. I have included all the .NET core tutorial videos, slides and text articles in sequence on the following page. Hope you will find it handy. www.pragimtech.com/courses/asp-net-core-mvc-tutorial-for-beginners/ When you have some time, can you please leave your rating and valuable feedback on the REVIEWS tab. It really helps us. Thank you. Good luck and all the very best with everything you are doing.
@chessgamesonline58673 жыл бұрын
its confusing.
@roadtripping2 жыл бұрын
How does the repository store information? Because we used AddSingleton for the Employee repository service. AddSingleton maintains state. If we hadn't, without the use of a database, session variable, etc. the new employee added would have been immediately lost upon clicking create.
@InamiLanzhuАй бұрын
Another awesome video
@dheemanthanand7314 жыл бұрын
Sir. Thank you very much for in detailed explanation. I have a doubt here, how is it even able to remember the created data between states in the current tutorial,When I navigate to Index method it still retains the new created data and the same is retained in every state.as we have learnt that its stateless.
@oleksandr89235 жыл бұрын
I received NullReferenceException because I had AddTransient method in startup.cs instead of AddSingleton. After I changed it the create button started working well, hope it will help someone
@pavitersingh34512 жыл бұрын
Thanks bro
@jvusa3 жыл бұрын
Excellent sir, Thanks a lot for Detail explanation....
@grandmagus86182 жыл бұрын
question , when you are creating view is that where you bind model or it can automatically understand when controller takes "Student" as parameter to assign model to it . is not view responsible to model binding?
@yasirirfan52627 ай бұрын
brilliant explanation.
@RicardoJnfrazao3 жыл бұрын
Great tutorial.
@yashaswikeote76895 жыл бұрын
Please make video on azure DevOps
@reneh54 жыл бұрын
In my case the ViewModel object has all its attributes with null value, not a single value I entered shows on it
@AbuSayed-gf8gt3 жыл бұрын
Great tutorial !
@himanshudashore38662 жыл бұрын
I got this error NullReferenceException: Object reference not set to an instance of an object. AspNetCore.Views_Home_Details.ExecuteAsync() in Details.cshtml, line 9 Line no. 9 code is : @Model.Employee.Name
@matanfadida152 жыл бұрын
you find solution?
@Dubeysaurabh592 Жыл бұрын
got any solution for this ?
@marcol53744 жыл бұрын
Hello Master, please explain me when exactly the new object as a parameter to Create(Employee employee) has been created? In the Create.cshtml file we map the property to an object of a Class Employee but i can't see the new object. Thanks a lot
@marcol53744 жыл бұрын
Automatically created by Model Binding !
@peritusdemi50284 жыл бұрын
Run the Create(Employee employee) method in debug mode, and follow your code line by line. You will understand how the object have been created.
@marcol53744 жыл бұрын
@@peritusdemi5028 of course but in the code there isnt any new keyword. The object is automatically created by model Binding and passed to the Create method
@anuyajoshi43604 жыл бұрын
Thank you for tutorial. While practicing the session I came across an issue , Parameter ID never receives value , it is holding null value even though Create method has all required details. below is code snippet: public HomeController(IEmployeeRepository employeeRepository) { _employeeRepository = employeeRepository; } [HttpPost] public RedirectToActionResult Create(Employee employee) { Employee newEmployee = _employeeRepository.Add(employee); return RedirectToAction("Details", new { id = newEmployee.Id }); } [Route("[Controller]/[action]/{id?}")] public ViewResult Details(int? empId) { HomeDetailsViewBased homeDetailsViewBased = new HomeDetailsViewBased(); homeDetailsViewBased.Employee = _employeeRepository.GetEmployee(empId ?? 1); homeDetailsViewBased.PageTitle = "Employee Details"; return View(homeDetailsViewBased); } Any guidance how to overcome empId receiving null will be helpful using .net core 3.1
@conaxlearn85664 жыл бұрын
In the Route you have {Id?}, but in the method parameter you called it 'empId' instead of 'Id'.
@turhansaltas92844 жыл бұрын
you are the king brother.
@mertkurt947 Жыл бұрын
you are awesome teacher , thank you
@mp-ot7fw5 жыл бұрын
I need some suggestions. I have been following along learning a lot. This is the first time I have gotten stumped. My Create Post action does not seem to be getting to the HomeController Post method. There are no build errors. Output shows a lot of threads exiting with error code 0. I have tried putting Break points on both the Get and Post HomeController methods. The HttpGet Create method is being hit, the HttpPost Create method is not. How can I further debug this? Thank you very much. BTW I am using VS 2019 Core 2.2
@mp-ot7fw5 жыл бұрын
Nevermind, it was my html. I changed the button for an input type="submit". Works great! TYVM for these tutorials!
@kennethcheung49114 жыл бұрын
Are there benefits to save it to an separated newEmployee object instead of below code? _employeeRepository.Add(location); return RedirectToAction("details", new { id = employee.Id });
@giokavlashvili70035 жыл бұрын
Hi Venkat, What is the lifetime of the _employeeList object after creating and adding new Employee object to it?
@lukedodson34415 жыл бұрын
Think it's just until the app is closed since its only a mock repository.
@HungVo-fp7xk5 жыл бұрын
I'm confused one thing that why in the controller we perform everything in the interface but not in the actual object? we have IEmployeeRepository is an interface and MockEmployeeRepository is an object class that implements that interface. Why we don't instantiate the object in the controller but just the interface? New to C# sorry
@codeautomate81555 жыл бұрын
null reference exception is occured when press create button how can i solve it?
@lukedodson34415 жыл бұрын
Same thing happened here
@lukedodson34415 жыл бұрын
Change the HomeController constructor
@МаксимИванов-ф8р5 жыл бұрын
How to fix the error:NullReferenceException. I already use AddSingleton.But Constructor I use with _employeeRepository = new MockEmployeeRepository();
@harag95 жыл бұрын
Check you have the below code in the Startup.cs file in the method "ConfigureServices" -- services.AddSingleton();
@mdsaddamkhan84004 жыл бұрын
I have the same code but can't help it.
@pranavsinha98214 жыл бұрын
Hi Venkat ,Department value (drop down value ) is going null with httppost. Could you please help.
@peritusdemi50284 жыл бұрын
Try to debug your code and monitor the error.
@christianloperadecastro48755 жыл бұрын
An unhandled exception occurred while processing the request. NullReferenceException: Object reference not set to an instance of an object. NullReferenceException: Object reference not set to an instance of an object. AspNetCore.Views_Home_Details.ExecuteAsync() in Details.cshtml + @Model.Employee.Name //I receive this error message. Can you show some solution for this.Thanks you
@hossammetwally075 жыл бұрын
did you get the explanation?
@lukedodson34415 жыл бұрын
Home controller constructor needs to be changed
@crimcrow5 жыл бұрын
Same issue for me
@AbdullahTaherAbubakar5 жыл бұрын
Great Lesson As Always... One Question Though : Every time you add a new employee (object) to the list; the list gets updated even after you do the redirect. The question is where is the list get stored?..is it cached or what? #kudvenkat
@javaguitarist4 жыл бұрын
It probably has to be just in memory. When he gets into the database model, you will see how it is inserted into the database where you can see it. If you close the solution and reopen it, new users do not persist.
@apositron844 жыл бұрын
Yes! I was confused about that as well. Voodoo!
@peritusdemi50284 жыл бұрын
In your " Startup.cs " class you have added a service "services.AddSingleton();" This AddSingleton is responsible for caching your data in your browser. If you delete the cache, your added data will also be removed.
@AbdullahTaherAbubakar4 жыл бұрын
@@peritusdemi5028 Thank you for making it even clearer.
@anuyajoshi43604 жыл бұрын
@@peritusdemi5028 - Thank you for sharing this information.
@vinayakh77305 жыл бұрын
Thank you Venkat sir, you are awesome!
@mohammadhilal85084 жыл бұрын
sir, when i add employee and next time when i restart the application it does not show me the added employee. what would be the reason pls help me.And it also does not add employee to my list.
@navinbadlani92114 жыл бұрын
When we are restarting our application MockEmployeeRepository constructor is getting called and list is reset to that 3 items which we are adding inside constructor and once application starts so we can add more items through create option but that newly created items will be there till the application is running once we restart it will again come back to original list
@mohammadhilal85084 жыл бұрын
@@navinbadlani9211 okay, I got it and thanks for the reply. So what we can do to overcome it.
@naodagere82104 жыл бұрын
@@mohammadhilal8508 We will use SQL database and I hope he will cover that part in the coming slides
@peritusdemi50284 жыл бұрын
Use this in your constructor: public HomeController(IEmployeeRepository employeeRepository) { _employeeRepository = employeeRepository; }
@pablosalas85864 жыл бұрын
Can someone explain to me why it created a new employee without using the instance or the keyword "new", just added it? thx
@peritusdemi50284 жыл бұрын
This is created in your MockEmployeeRepository class with it constructor.
@lukedodson34415 жыл бұрын
@Model.Employee.Name is null apparently. The Add function doesn't seem to be working for me
@MukundPatel5 жыл бұрын
did you get reason and solution? I am facing the same issue. so please share with me.
@lukedodson34415 жыл бұрын
@@MukundPatel home controller constructor needs changing
@lukedodson34415 жыл бұрын
@@MukundPatel you get it working?
@peritusdemi50284 жыл бұрын
The constructor of the MockEmployeeRepository class already has a new employee list object. So you don't need a new MockEmployeeRepository in HomeController constructor. So use this in your HomeController constructor instead: public HomeController(IEmployeeRepository employeeRepository) { _employeeRepository = employeeRepository; }
@mdsaddamkhan84004 жыл бұрын
@@peritusdemi5028 I did the same thing but it could not help
@CrivatFlorin3 жыл бұрын
How the heck is .net core doing that? Where does the info submited in the form gets stored? In memory? For how long?
@aarbiayaz47444 жыл бұрын
can anybody explain why do I need to change add transient to singleton?
@sakthir38925 жыл бұрын
Sir, nice explanation
@preetijuyal17425 жыл бұрын
hi @KudVenkat sir, it would be very helpful if a concept is explained with respect to previously used concepts and techniques in place of this concept and technique to achieve a particular functionality and how this concept is implemented in various languages.
@sunnysharma56353 жыл бұрын
Make one tutorial for web api using asp. Net core
@heemelhimaddri5345 жыл бұрын
Sir, actually I want to learn asp.net but I can't take any decisions till now because of some hesitations. should I need to start with asp.net or asp.net core ?
@Csharp-video-tutorialsBlogspot5 жыл бұрын
Hello Wag - ASP .NET Core is a new technology from Microsoft. However, there are still plenty of opportunities with ASP .NET MVC. Lot of ASP .NET MVC concepts are also relevant in ASP .NET Core. So I suggest learn both ASP .NET MVC and ASP .NET Core to expand your skill set. Hope this helps.
@sanjuds14 жыл бұрын
@@Csharp-video-tutorialsBlogspot Hello Sir , whether model binding in asp.net mvc same as asp.net core model binding.
@ShivamSingh-oe8tz4 жыл бұрын
I'm getting redirected to "create/home" instead of" home/details/id" can anyone tell why!
@ypwygk6524 жыл бұрын
i have the same prolem
@debarghyachakraborty3 жыл бұрын
Try correcting the RedirectToAction method.
@jazicasri92485 жыл бұрын
NullReferenceException: Object reference not set to an instance of an object. AspNetCore.Views_Home_Details.ExecuteAsync() in Details.cshtml + Name:@Model.Employee.Name sir help me to clear this error
@ravichandragangavarapu12593 жыл бұрын
Sir u said everything about mvc by using asp dot net core
@lukedodson34415 жыл бұрын
Got a null reference exception
@Pasaaydaan4 жыл бұрын
I am also getting null reference exception
@lukedodson34414 жыл бұрын
@@Pasaaydaan change the Home Controller constructor
@coolwaterdvr5 жыл бұрын
Thanks Venkat.
@cesareemauritanie52884 жыл бұрын
Top Thank you !!!
@naodagere82104 жыл бұрын
Thank you very much.
@eugene-white-shark3 жыл бұрын
Thank you!
@hossammetwally075 жыл бұрын
NullReferenceException: Object reference not set to an instance of an object. AspNetCore.Views_Home_Details.ExecuteAsync() in Details.cshtml
@lukedodson34415 жыл бұрын
Change the HomeController constructor
@edmond13144 жыл бұрын
@@lukedodson3441 Inconsistent accessibility: parameter type 'IEmployeeRepository' is less accessible than method 'HomeController.HomeController(ILogger, IEmployeeRepository)
@RachitJain4U3 жыл бұрын
Thanks Sir :)
@saidamir42683 жыл бұрын
Thank you.
@salmanchowdarym11105 жыл бұрын
Thanks
@codeautomate81555 жыл бұрын
thank you
@lukedodson34415 жыл бұрын
Fixed it haha
@lukedodson34415 жыл бұрын
@Marc Daniel P. Zornosa what you mean?
@chessgamesonline58673 жыл бұрын
A bit confusing. :)
@МаксимИванов-ф8р5 жыл бұрын
Who have error. public HomeController(IEmployeeRepository employeeRepository) { _employeeRepository = employeeRepository; }
@harag95 жыл бұрын
You shouldn't be getting at this point if you had been following all 40 videos, no change here in this video - It would also help if you actually said what error you're getting.
@naodagere82104 жыл бұрын
Thanks. This has solved the NullReferenceException error
@peritusdemi50284 жыл бұрын
Thanks, from this video, your proposed method is working. solving the NullReferenceException error