Domain Introduction and Entity Framework Setup - FULL STACK WPF (.NET CORE) MVVM #1

  Рет қаралды 85,747

SingletonSean

SingletonSean

Күн бұрын

Пікірлер: 100
@markbratcher9095
@markbratcher9095 4 жыл бұрын
I've watched numerous videos on the topic of WPF and MVVM, and this series is far and away the best. No video answers all questions, but your series helps pull it all together with a well-done structure. It might go by a little fast for beginners, but that's why there's a pause button and a video position navigator. :) Keep up the great work.
@SingletonSean
@SingletonSean 4 жыл бұрын
Thank you Mark, I appreciate the feedback! More videos on the way :)
@artolaganus
@artolaganus 4 жыл бұрын
made the switch to core 3.0 way easier.
@brandonberisford
@brandonberisford 3 жыл бұрын
This video series is wonderful. My workplace uses C#/WPF/SQL Servers for pretty much all of our applications, so having some up to date WPF content is extremely useful. Thanks so much!
@SingletonSean
@SingletonSean 3 жыл бұрын
Awesome Brandon! Glad the content is helpful. That pretty much sums up my current stack as well, haha.
@Ownage4lif31
@Ownage4lif31 4 жыл бұрын
You have no idea how many searches I had to do to fund this video. I'm trying to learn wpf and all the vids out there suck. This is by far the best. Good mix of everything. Thank you so much for this.
@SingletonSean
@SingletonSean 4 жыл бұрын
Thanks RandomSilly! I agree, not much content out there. My goal is to fix that.
@TheJessejunior
@TheJessejunior 4 жыл бұрын
finally some new up to date content in wpf!! I don´t understand why is it so hard to find great content about wpf... thank you!
@SingletonSean
@SingletonSean 4 жыл бұрын
Thanks Jessé! Desktop development just isn't as mainstream anymore, but it is still extremely useful and widely used in the real world. Glad I can push out up to date content, especially with the growth of .NET Core!
@georgebreje
@georgebreje Жыл бұрын
This is the project I was looking for to take my understanding of MVVM to the next level as a Junior C# developer.
@faraz-online
@faraz-online 3 жыл бұрын
Hey Singleton! A masterpiece collection of entire series, till date, for sure!
@rd07dz
@rd07dz 2 жыл бұрын
your channel is a trully hidden gem, just amazing
@SingletonSean
@SingletonSean 2 жыл бұрын
Thanks RD07, glad this is all helpful!
@neniugrava
@neniugrava 4 жыл бұрын
Thank you so much for making this series. I only wish you had made it sooner so I could have benefited from it when writing my first WPF application ;) I only missed you by six months or so. I spent a lot of my time on that project trying to figure out how the hell I am supposed to use WPF: how to organize the project, how to interface to the database, and how to do this fancy MVVM thing. It was very frustrating to have all of my search results yield information about heavy frameworks for MVVM that assumed you already knew all about it (but were just looking to cut out the boilerplate). I come from low-level systems programming (my main gig) so these "don't worry about how it works or why to use it" tutorials were not doing it for me. My project ended up being a somewhat controlled mess: especially the UI, since I didn't quite figure out how to elegantly do navigation. It is incredibly helpful to have an "over the shoulder" video that goes through the process from start to finish, and which shows WHY you are doing what you are doing. I think way too many people make tutorial videos and blogs that claim to explain something, but they don't truly show why these things exist and why you want to use them. I am only on part 5 right now, but I am already eagerly anticipating making use of what I have learned on my own project.
@SingletonSean
@SingletonSean 4 жыл бұрын
That's awesome kashperanto, sounds like you're on the right track! I feel the same way about the frameworks that try and hide what's going on. It really helps understanding how WPF and binding works from a low level. In fact, I've looked into a few MVVM frameworks for WPF, and just don't feel like they are necessary at all. WPF binding is already powerful enough, so it seems crazy to be using frameworks for frameworks, haha. As you mentioned, navigation seems to be the biggest issue that people face (including myself in the past), and a lot of the MVVM frameworks just use highly questionable techniques to handle navigation in my opinion, hahaha. I really want to do a series dedicated to navigation just to demonstrate several different scenarios and how I think it is best to handle them. Anyways, it's great to hear you're building your own project along with following the series. That's the best (and most fun) way to learn!
@mickdostie
@mickdostie Жыл бұрын
Still very relevant. I've always programmed in Java for my personnal projects and wanted to try C# for my current project but wanted a structure as well as explanations. Very well done, whatever I did not understand was a google search away and I truly enjoy this series. Thanks a lot mate
@SingletonSean
@SingletonSean Жыл бұрын
awesome, glad this is helpful AD2!
@mickdostie
@mickdostie Жыл бұрын
@@SingletonSean Only issue I have had so far is with the Update() task. For some reason it won't let it be async and it gives me an error saying I didn't override all the methods.
@Psymun747
@Psymun747 4 жыл бұрын
I have a suggestion for future content: in working through this series, it struck me that you have a particularly efficient design process: your UML and UI sketches are simple but useful and you can translate them quickly into objects and projects. I've always struggled with design and planning and particularly have never properly gotten my brain around UML. Maybe you could create something like a UML tutorial or just an overview of your design process? Having dived into code with no real design so many times, only to get pissed off when everything inevitably unravels, I think your thoughts on these pre-coding stages would be really valuable!
@SingletonSean
@SingletonSean 4 жыл бұрын
That's a good idea Simon! Perhaps for my next application series I will go through my design process. The most important thing is to practice and at least attempt to establish a design before beginning. The design can be simple and doesn't have to be perfect. In fact, it usually isn't perfect (I think I make adjustments and improvements throughout this series). To make the designing easier, I usually like to establish the requirements for the application first and then design my application/UML around those requirements. Also, I wouldn't focus too much on the structure of the UML. UML is meant to be flexible, so you really just organize it in whatever way is most efficient for you or your team.
@KeatonCOD
@KeatonCOD 4 жыл бұрын
@@SingletonSean I agree that this would be an awesome thing to learn from you. I am working with a company as an intern to help with the redesign of an application that they use for an analyzer. The idea is to get away from a heavy overhead cost for deployment fees on each analyzer and design our own software. That being said it is on me to find what would work best for the company and the path I picked is .net core wpf. I am going to be spending my weekend going through your tutorials and trying to learn how to structure our application. So far I know that I want to work in MVVM, but didn't know much about when I started my first test project. The test project came to a screeching hault when I learned that I need to be using dependancy injection and learned that my way of structuring MVVM was only half right. I think that this problems stems from me not having a stucture (UML) before going in and simply the lack of experience . All of this isn't a bad thing because I learned alot, but I would benefit greatly from seeing how you develop UML. Also, do you have a discord or something?
@SingletonSean
@SingletonSean 4 жыл бұрын
That's crazy Wakestrife, I was in the same situation when I was an intern and had to redesign applications in WPF/MVVM as well! I think it's definitely the best choice for .NET Core desktop development. MVVM can be hard to get correct at first and I agree that dependency injection is very helpful (but not necessarily required), so hopefully my tutorials will give you a good start on structuring an application :- ). My biggest suggestion for structuring is to simply think about what you want your application to do. This sounds simple, but when I was an intern I really did not fully grasp the requirements of the application I was working on. I'm not sure what domain your analyzer will deal with it, but perhaps it analyzes sounds. For example, you might structure some UML class diagrams for a "Sound" object or an "ISoundAnalyzer" service that analyzes "Sound" objects. Lack of experience definitely does play a role, but don't let that hold you back from trying your best and practicing because the more you practice first-hand and the more you design, the better you will get :- ). Even if your design turns out bad from inexperience, you will learn so much (as you suggested)! Also, I just made a discord, my username is SingletonSean#7577.
@runo1019
@runo1019 3 жыл бұрын
Man thanks a lot, i was looking for db connection solution for WPF the whole day and nothing found. Great work and i am moving along with this series and share with friends :D
@SingletonSean
@SingletonSean 3 жыл бұрын
Glad to help, Bvrtek!
@thomasbarratt5333
@thomasbarratt5333 3 жыл бұрын
Hi Sean, I've just started this series and look forward to filling in any gaps in my knowledge of WPF, MVVM and EF. Is there any reason why you chose to use EF Core 2.2 instead of the latest versions? We are now on EF Core 5.0.
@SingletonSean
@SingletonSean 3 жыл бұрын
Hey Thomas, this video is a bit old. Nowadays, I use .NET 5 and EF Core 5 for new projects. In fact, I have ported this project to .NET 5 in a later video: kzbin.info/www/bejne/bHaynnifi5eEj7s
@shinyshark2247
@shinyshark2247 4 жыл бұрын
Hello Sean, this is a great tutorial. Was it meant for complete beginners with WPF MVVM? There were some things that were unclear to me (such as what version to look for when installing the NuGet Microsoft.EntityFrameworkCore). You also mention having SQLEXPRESS set up prior to this, where can I find how to do the same? You then start adding migrations, but what are migrations? Maybe I am too noob for this tutorial, but these are some things that I struggled with.
@Saleca
@Saleca 4 жыл бұрын
the version was clear he said to use 2.2.6 the SQLEXPRESS was the only thing in video that he skipped the explanation. migrations transform the code you make and integrate it or migrate it into the database. its good to follow along becomes clear in the process but to fully understand this step you better off check the documentation. or you can see dotNet EFCore 101 for a practical intruduction
@DiscountITsolution
@DiscountITsolution 3 жыл бұрын
00:17:46 "It actually worked, thats awesome" ... IS the Most Used comment in my office.
@SingletonSean
@SingletonSean 3 жыл бұрын
Haha, gotta love that energy. That's a whole lot better than "it didn't actually work, that's not awesome" 😄
@reyhernandez4915
@reyhernandez4915 4 жыл бұрын
Thank you so much for this tutorial. It helps me a lot understanding more the MVVM pattern and .NET Core. Keep it up, Sir!
@ilearncode123
@ilearncode123 3 жыл бұрын
Really really nice tutorial. Hope to learn more from your very clean structured codes.
@SingletonSean
@SingletonSean 3 жыл бұрын
Thanks Trong, more on the way!
@sometexthere4169
@sometexthere4169 4 жыл бұрын
Really good! I am gonna watch all ur videos from this playlist
@atotallyextinctdinosaur
@atotallyextinctdinosaur 3 жыл бұрын
Thank you so much, that is the best tutorial that i have watched! You saved my life man
@josbexerr5166
@josbexerr5166 4 жыл бұрын
Excelente mister Singleton.... Gracas muy bien explicado
@facundopugliese9632
@facundopugliese9632 4 жыл бұрын
Great video, Sean. I really enjoyed it. I would like to ask you about the deploy stage of an app like this one. For example, Databases created as you did it will be inside of the app after deployment? Can I modify them from Microsoft SQL Server Management or only from the Solution inside VS? How about if the user want to see all the data in the interface or download it? I think some series showing the deployment of an app would be awesome! I'm learning a lot from you. Thanks!
@SingletonSean
@SingletonSean 4 жыл бұрын
Thanks for watching Facundo. We will definitely have to dig into deployment for this application. As you suggested, the database is the most important concept to consider. Our options are to have the user provide connection information to a SQL Server database, or to configure the app to use a file database (like SQLite). Luckily, migrations aren't a problem in Entity Framework, and we can simply generate the database on startup with migrations. I think a series would be great for these concepts. If you are using a SQL Server database (whether it be production, local, or express), all the data is accessible from SQL Server Management Studio (SSMS), so that is helpful. If users are already providing there own database/connection string, I would assume they would have SSMS or other software to snag their data. For SQLite, I wouldn't assume they would know anything about a database, so it might be best to provide a way to export data from the app. Thanks for the ideas!
@lukak6549
@lukak6549 4 жыл бұрын
First, great job! It would be nice if you can demonstrate deployment and database creation (migration & database update)
@SingletonSean
@SingletonSean 4 жыл бұрын
That's a great idea Luka! I'm sure we will get into that further into the series once we finish the basic functionality. Automatic migrations would be easier than having to use the CLI during development too.
@lukak6549
@lukak6549 4 жыл бұрын
@@SingletonSean Fantastic! Thanks Sean
@m.germanguerreroz.644
@m.germanguerreroz.644 3 жыл бұрын
Excellent!!!
@markmulder4887
@markmulder4887 4 жыл бұрын
Thanks for this! Really helpfull for me
@SingletonSean
@SingletonSean 4 жыл бұрын
No problem, glad you enjoyed Mark!
@DIYMindset
@DIYMindset 2 жыл бұрын
Hi, how would you deal with a FK relationship structure? Some child tables need to show some of the parent table columns. Do you need to use Join or something?
@skull6740
@skull6740 4 жыл бұрын
I can hear you smiling in the intro)
@polarisnation201
@polarisnation201 3 жыл бұрын
Hello, thanks to the video you uploaded, I'm enjoying it. I have a question. Due to the database structure currently being used, it is difficult to use the entity framework. So I'm going to send SQL directly. Is there a video of you writing a direct SQL, not an entity framework?
@SingletonSean
@SingletonSean 3 жыл бұрын
Thanks Polaris! I've faced similar issues with Entity Framework, and have started using Dapper a bit more. Dapper allows you to write SQL directly, and still takes care of mapping SQL results to objects. I think Dapper perfectly solves the problems you're facing! I'm planning a Dapper quick start tutorial, but their documentation is pretty helpful too. I'd recommend starting there!
@polarisnation201
@polarisnation201 3 жыл бұрын
@@SingletonSean Thank you for your answers. I'm looking forward to the lecture that you're planning. I want to see it as soon as possible.
@jeffnichols4578
@jeffnichols4578 4 жыл бұрын
SingletonSean - Hey, Sean! At time 17:40 you talk about the relationship between the navigation property between AssetTransactions and Stock. I'm stuck attempting to have a default value for that owned entity type. Do you have any suggestions on how to address that?
@SingletonSean
@SingletonSean 4 жыл бұрын
Hey Jeff, that's a great question. Have you taken a look at this? docs.microsoft.com/en-us/ef/core/modeling/generated-properties?tabs=data-annotations#default-values After the .OwnsOne(a => a.Asset) method, you can add the .Property().HasDefaultValue() builder methods from the link above. I tested it out and the migration looked good. I didn't actually run the migration though, so let me know if you run into any trouble with that :)
@jpd018
@jpd018 4 жыл бұрын
First off I want to say that this series is so awesome. I've learned so much from it, so thank you for that. But I do have one question that I can't find the answer for in any of the videos, and that is what the benefit of separating Users from Accounts is? Why not give the Users the account balance and leave it at that?
@SingletonSean
@SingletonSean 4 жыл бұрын
Hey jpd, looking back I think it would be better to combine those tables since it is simply a one-to-one relationship. Separating the tables is actually a bit worse for performance since now we require a join to query user/account data. At the time, I think I split the tables just because I perceive an account and a user as separate entities. Great question, thanks for making me ponder that!
@jpd018
@jpd018 4 жыл бұрын
​@@SingletonSean No problem and thanks for the answer, I hadn't seen that before so I wasn't sure if there was some underlying reason. And again thanks for all the content you put out. It has all been insanely helpful.
@sanhongzheng3193
@sanhongzheng3193 4 жыл бұрын
great job.thanks
@alexandrufilipescu1301
@alexandrufilipescu1301 3 жыл бұрын
Hi, is there any command to reset the database and delete the migrations so I can add-migration and update-database once again?
@msontrent9936
@msontrent9936 3 жыл бұрын
Please recommend some good WPF books, or what resources you used to learn WPF.
@SingletonSean
@SingletonSean 3 жыл бұрын
Hey MSon, most of my WPF learning comes just from building apps and solving problems as I go. I also reflected on projects that I finished and thought "hmm this was kind of messed up, maybe next time I should structure _______ differently". If I were to recommend a book, it would be Pro WPF 4.5 by Matthew MacDonald. However, the best way to learn is to just by practicing and trying to build something semi-small that interests you.
@greggseipp
@greggseipp Жыл бұрын
Couldn't get past add-migration initial. Build Failed. Had to stop there.
@fahamarahmani7223
@fahamarahmani7223 3 жыл бұрын
thanks alot for your effort this series helped me alot for my project , i have a suggestion please make font bigger ! to can see.
@SingletonSean
@SingletonSean 3 жыл бұрын
Thanks fahama, it gets bigger :)
@fahamarahmani7223
@fahamarahmani7223 3 жыл бұрын
@@SingletonSean thanks for your reply , and also can you please do this full stack tutorail on sql server database desktop application 😊
@nishantpatil7002
@nishantpatil7002 4 жыл бұрын
Great job.
@gamedev3874
@gamedev3874 3 жыл бұрын
Hello! I tried following the video, but it fell apart towards the end, when it came time to add migration. First, it said it needed the Tools framework. Then, it said the Tools framework needed the Design framework. And finally, it is saying that it can't load the the assembly EntityFramework, from the Domain one. None of this is in the video, and it would have been nice to show how the SQL server was created. Thanks for the video!
@SingletonSean
@SingletonSean 3 жыл бұрын
Thanks for the feedback Game Dev! Glad you were able to resolve this on your own. Unfortunately, it's a little late for me to address this, but I should definitely walk through these steps in future applications. In the meantime, I've added the EF migrations walk-through link in the description.
@hassanhilaly8810
@hassanhilaly8810 4 жыл бұрын
Thank you fery for shiring. quest: Please how to avoid hard coded connection string in the dbcontext?
@SingletonSean
@SingletonSean 4 жыл бұрын
Hey hassan, I will definitely take a look at adding this real quick. In the meantime, this video might help with managing secret values: kzbin.info/www/bejne/hWeQXqKXh6iBeLs. You will just need to add a connection string to the App.config and then pass the connection string to your DbContext factory.
@shaswatsoni3228
@shaswatsoni3228 4 жыл бұрын
hey man! these tutorials are great just had one question - is it possible for you to also make series in .net framework(WPF MVVM)(using the easier way-sqlserver management studio)
@SingletonSean
@SingletonSean 4 жыл бұрын
Hi shaswhat, are you referring to a database first approach with Entity Framework?
@PrevalentAA
@PrevalentAA 3 жыл бұрын
Love it
@konturgestalter
@konturgestalter 4 жыл бұрын
LOVE IT!
@venetsiakrasteva9250
@venetsiakrasteva9250 2 жыл бұрын
OMG I actually managed to get though this video. It is a great video but without your getting all the common error messages it is quite hard to figure out. For anyone who does not see ASP.Net Core Class Library they can use the .Net Framework with 4.7.2 version and still install Microsoft.EntityFrameworkCore. For anyone who has the error: Your target project 'ShareTrader.Domain' doesn't match your migrations assembly 'ShareTrader.EntityFramework'. Either change your target project or change your migrations assembly. Change your migrations assembly by using DbContextOptionsBuilder. E.g. options.UseSqlServer(connection, b => b.MigrationsAssembly("ShareTrader.Domain")). By default, the migrations assembly is the assembly containing the DbContext. Change your target project to the migrations project by using the Package Manager Console's Default project drop-down list, or by executing "dotnet ef" from the directory containing the migrations project. -> Setting the project as start up does not fix it but rather you have to change the Default Project in Package Manger Console to be ShareTrader.EntityFramework as shown in the tutorial. If you swapped versions of any of the installed packages it is better to just start a new project.
@matthewkeen6281
@matthewkeen6281 6 ай бұрын
nice.
@VinuP2023
@VinuP2023 3 жыл бұрын
Sean, it would help a lot if you can provide us with database diagrams, domain services, which you showed in visio in the video :)
@_samirdahal
@_samirdahal 4 жыл бұрын
why there is just account id in assettransactions table? why not other properties of account object?
@SingletonSean
@SingletonSean 4 жыл бұрын
Hey Samir, the account ID is used as a foreign key. For more info, be sure to look up concepts such as "foreign key" or "normalization". Thanks for watching!
@BudiSantoso-er6cq
@BudiSantoso-er6cq 4 жыл бұрын
Thanks for sharing this series video, G B U ..
@on4ayl
@on4ayl 2 жыл бұрын
Would have been a great series if only I could see the tiny text.
@asoftraiden
@asoftraiden 3 жыл бұрын
Hi there, distinguished developer, I adapted your services approach, But with a GridView ItemsSource property attached to a ViewModel property of type: ObservableCollection, It successfully edits the ObservableCollection, Add new rows, Edit existing ones, but how to keep the ObservableCollection in the ViewModel in sync with the Database using your EF Core, Services approach, No direct references to the EF Core in the ViewModel, Codebehind file must not be modified as we are distinguished WPF developers, I successfully achieved the GOAL of syncing the ObservableCollection to a DB but the code is nightmarish to say the least, hardly reusable, made the otherwise beautiful ViewModel, so ugly, based on event of the ObservableCollections, CollectionChanged. I Wish You Have a Say to This,
@newplayer1334
@newplayer1334 4 жыл бұрын
Why you don't imported DB with SQL in your project???
@SingletonSean
@SingletonSean 4 жыл бұрын
Hello Михаил, are you referring to adding the database MDF file or using database first migrations?
@newplayer1334
@newplayer1334 4 жыл бұрын
@@SingletonSean DB first
@SingletonSean
@SingletonSean 4 жыл бұрын
@@newplayer1334 Oh, I didn't use database first because I didn't have a database first.
@simplelivinghighthinking5520
@simplelivinghighthinking5520 3 жыл бұрын
hi i thought my internet speed was low, but I think your whole video is hazy, most of the code cannot be clearly seen...can you make a clearer video
@sunayvatansever5905
@sunayvatansever5905 3 жыл бұрын
Type of solution????
@scorpinking7403
@scorpinking7403 3 жыл бұрын
how the database created by itself? i think this very advance for me ^_^
@SingletonSean
@SingletonSean 3 жыл бұрын
Haha, it is crazy scorpin, but that is just the power of EF code-first migrations. The database creation boils down to the "update-database" command. It does seem a bit advanced, but luckily EF takes care of all the hard stuff! For more information specifically on just getting EF setup, checkout docs.microsoft.com/en-us/ef/core/get-started/overview/first-app?tabs=netcore-cli
@TioPew
@TioPew Жыл бұрын
After migration AssetTransaction got his own ID xD
@AzizjanAyupov_leo
@AzizjanAyupov_leo 3 жыл бұрын
Y don't u use the Identity ?
@SingletonSean
@SingletonSean 3 жыл бұрын
I'll be using Identity later in my ASP.NET authentication series. Honestly, I haven't used Identity in about 2 years, and I mostly just thought it was specifically for ASP.NET front-end web applications. I had another viewer recently point out that a lot of the Identity services can be used outside of ASP.NET front-ends. Not sure if I'll end up integrating Identity with this application, but it's definitely great for quickly implementing authentication. I've grown to like it, and I do recommend it. Never want to get caught reinventing the wheel when you don't have to, especially when Identity is so much more robust. Good question Azizjan!
@AzizjanAyupov_leo
@AzizjanAyupov_leo 3 жыл бұрын
@@SingletonSean Thank you so much, sir, for your incredibly detailed answer! Yeah, that's a good thing enough, and there is no normal sources out there on how to integrate an Identity into WPF project... Good luck to you and your channel :D
@santifl1798
@santifl1798 4 жыл бұрын
What is WPF?
@shaswatsoni3228
@shaswatsoni3228 4 жыл бұрын
Window presentation foundation, think of it as an upgraded version of Win forms Application (desktop application used like 20 years ago)
Entity Framework CRUD - FULL STACK WPF (.NET CORE) MVVM #2
21:27
SingletonSean
Рет қаралды 40 М.
ROSÉ & Bruno Mars - APT. (Official Music Video)
02:54
ROSÉ
Рет қаралды 102 МЛН
VAMPIRE DESTROYED GIRL???? 😱
00:56
INO
Рет қаралды 8 МЛН
Всё пошло не по плану 😮
00:36
Miracle
Рет қаралды 3,4 МЛН
REAL 3D brush can draw grass Life Hack #shorts #lifehacks
00:42
MrMaximus
Рет қаралды 12 МЛН
Brutally honest advice for new .NET Web Developers
7:19
Ed Andersen
Рет қаралды 224 М.
Getting Started with Entity Framework Core in .NET
26:51
Nick Chapsas
Рет қаралды 22 М.
What is the MVVM pattern, What benefits does MVVM have?
22:38
James Montemagno
Рет қаралды 100 М.
Денис Цветцих - Как приручить реактивное программирование в XAML приложениях
43:28
DotNext — конференция для .NET‑разработчиков
Рет қаралды 5 М.
Models - WPF MVVM TUTORIAL #1
15:21
SingletonSean
Рет қаралды 208 М.
ROSÉ & Bruno Mars - APT. (Official Music Video)
02:54
ROSÉ
Рет қаралды 102 МЛН