Intro To Class Libraries in C#

แชร์
ฝัง
  • เผยแพร่เมื่อ 23 พ.ย. 2024

ความคิดเห็น • 151

  • @Ellehsdee
    @Ellehsdee 2 ปีที่แล้ว +4

    The best C# tutorials on TH-cam. Thank you sir for all your wisdom.

  • @Duelweb
    @Duelweb 2 ปีที่แล้ว +32

    Got up this morning to have coffee, found this in my feed!!!! Your channel is state of the art Tim. You don't make assumptions about your users and always explain so clearly. Roll on 1 million subs is what I say, you surely deserve it!!

    • @IAmTimCorey
      @IAmTimCorey  2 ปีที่แล้ว

      Thank you! I’m glad you enjoyed it.

  • @ParasizAsker
    @ParasizAsker ปีที่แล้ว +2

    As I was learning Clean Architecture, I had no idea what and why Class Libraries and Interfaces were used. I now have a better understanding of the context thanks to you.

    • @IAmTimCorey
      @IAmTimCorey  ปีที่แล้ว +1

      Seems like you might have been learning C# backwards. Trying to take on Clean Architecture is pretty advanced.

  • @ranjanadissanayaka5390
    @ranjanadissanayaka5390 9 หลายเดือนก่อน +2

    This video is awesome. I had no idea what class libraries are before I watched this video. But after watching this I have cleared all doubts and myths about class library. Thanks Tim Corey.

    • @IAmTimCorey
      @IAmTimCorey  9 หลายเดือนก่อน

      I’m glad it was so helpful!

  • @sgtbarak1869
    @sgtbarak1869 2 ปีที่แล้ว +11

    Well isn't this just a pickle. As a hobbyist coder, I have made a lot of bad coding decisions. After watching several of your DB/SQL videos, and then this one, I now have to do a LOT of rewriting and code organization. I love your videos. And plan on purchasing a course or 2. Your ideas/practices make a ton of sense and the way you present them is awesome. Thank you for what you do. And everyone should watch the vid on what you use the money for.

    • @IAmTimCorey
      @IAmTimCorey  2 ปีที่แล้ว +8

      We all do that as we progress. I'm glad you are learning and growing in your skills.

  • @BrokenSword17
    @BrokenSword17 2 ปีที่แล้ว +2

    Thank you so very much for being one of the backbones in the c# dev community.

  • @keegan6470
    @keegan6470 ปีที่แล้ว +1

    This channel is like finding gold.

  • @Dekurio
    @Dekurio ปีที่แล้ว

    Thank you for your wide range of helpful videos for programing in C#.

  • @torrvic1156
    @torrvic1156 ปีที่แล้ว

    This channel is the nexus of C# programming wisdom. Thank you so much, Mr. Corey!
    Regards to libraries and Clean Architecture classical approach (four layers: Domain, Application or Use Cases, Infrastructure and Presentation) can you tell me folks or Mr. Corey if it’s still valid and not obsoleted? Many people nowadays are saying that it’s better to use Sliced architecture (separate library for a feature as far as I concerned) in most of the cases but frankly I think that it makes things more complicated.

  • @ABMedia83
    @ABMedia83 2 ปีที่แล้ว +8

    Great Video! I have plenty of Class Libraries I use, some of them are my own, some of them are NuGet Package's. I don't like using MVVM Libraries, I write my own implementation of it. (I DO NOT write MVVM from scratch all the time, that is way too much work.) I have a Notify and Item class that implements the IPropertyChanged. It's very useful making Model's ,ViewModel's, and Custom List types. I also have a WPF Libary I use to clean up some of it's... plumbing. I don't really use Windows Forms anymore for new projects, although I do understand if people still want to use it. I am looking at the new WinUI(Cough: Upgraded UWP) framework. I do still use UWP, just for the Map Control. (You can do some cool things with that control)

  • @josephh8117
    @josephh8117 ปีที่แล้ว +1

    My interpretation from the second section is that the "Class Library" ("...for creating a class library that targets .NET or .NET Standard") is the best one to use for .NET Core projects as well - is that right? There used to be a Library choice that explicitly said it could be used for .NET Core - not anymore. Thanks for the videos Tim!

    • @IAmTimCorey
      @IAmTimCorey  ปีที่แล้ว +1

      .NET is .NET Core. Once .NET Core's numbering moved beyond 4 (which it skipped), they dropped the "Core" since it was no longer necessary. This explains the transition: th-cam.com/video/X75vbT-Yv-c/w-d-xo.html

  • @Rick-tg4oy
    @Rick-tg4oy 2 ปีที่แล้ว +2

    I use class library projects for a lot for my AutoCAD plugins. What I always fall into to is curb-stomping DRY by making my methods too specific to a thing I am doing.
    The section in this video about dependencies reminded me of something I really messed up and that was shared projects and crazy dependency loops I somehow set myself up with. I ended up putting code in my shared libraries that had dependencies on AutoCAD .dlls that were being referenced by the projects that I was referencing the shared library with, and then THOSE projects were referenced by projects that didn't need AutoCAD .dlls but because a shared project compiles itself into every project that it's referenced to, I ended up having to add AutoCAD .dlls to projects in my solution that had nothing to do with AutoCAD just to get them to compile.
    I think I should stop using shared projects lol. (or learn how to use them correctly).

  • @austinmudadi9178
    @austinmudadi9178 ปีที่แล้ว +1

    I am impressed , Tim you brilliant!

  • @chrisjohansson9971
    @chrisjohansson9971 2 ปีที่แล้ว +1

    Hey Tim, just curious, when would you choose a class library over using an API rest project for example? I have my understanding and reasons but I'm just curious on your point of view.

  • @saadaldulaijan4957
    @saadaldulaijan4957 2 ปีที่แล้ว +1

    Hi Tim, thanks for your effort. I think this concept has already been covered long time ago on your channel. I would love to see new C# concepts which have not been touched by C# instructors yet.

    • @IAmTimCorey
      @IAmTimCorey  2 ปีที่แล้ว +4

      I had never covered this as its own topic, just as parts of other videos.

  • @SinaDelta
    @SinaDelta 2 ปีที่แล้ว +2

    I hope to see thousands of videos from you.

    • @IAmTimCorey
      @IAmTimCorey  2 ปีที่แล้ว +2

      I have over 400 so far.

  • @artyspost
    @artyspost 2 ปีที่แล้ว +2

    Tim, fantastic content. It would be great if you included interfaces to the clas library as many times you may not know all the methods available in the dll.

    • @IAmTimCorey
      @IAmTimCorey  2 ปีที่แล้ว

      Interfaces don't tell you what is available, they give you a sub-set of properties, methods, and events that a class implements. I cover interfaces more here: th-cam.com/video/A7qwuFnyIpM/w-d-xo.html

  • @gahshunker
    @gahshunker 2 ปีที่แล้ว +1

    What a timing!!!! Thanks for posting this, i really needed it!♥️

  • @MegaSkahn
    @MegaSkahn 2 ปีที่แล้ว +1

    Thank you Tim. I keep learning everyday I see your video.
    I want to make a request please.
    Can you help with video tutorial on how to use documentation when writing a program?
    Documentation is very important, sadly most of of don't know how to use it. What to search for and so on.

    • @IAmTimCorey
      @IAmTimCorey  2 ปีที่แล้ว +1

      Thanks for the suggestion. Please add it to the list on the suggestion site so others can vote on it as well: suggestions.iamtimcorey.com/

  • @Dash3105
    @Dash3105 2 ปีที่แล้ว +1

    Hi Tim. In the example around 38:29, if I wanted empty strings not to be processed so the message box doesn't show an empty name, where would I implement that? In the library itself, or logic in the GUI?

    • @IAmTimCorey
      @IAmTimCorey  2 ปีที่แล้ว

      That would be logic you create. Just put the messagebox inside of an if statement that does that check.

  • @ShambhuChouhan-o6f
    @ShambhuChouhan-o6f 7 หลายเดือนก่อน

    Great value of class library

  • @paulegan3783
    @paulegan3783 2 ปีที่แล้ว +1

    Thanks for another great video Tim! I tried moving more of my WPF code into a class library but started to get thread / dispatcher errors on my observable collections. Should observable collections stay in the WPF project in the view models?

  • @kitsurubami
    @kitsurubami 2 ปีที่แล้ว

    I didn't know that trick with the namespace. Thank you!

  • @RalfsBalodis
    @RalfsBalodis 2 ปีที่แล้ว +20

    0:00 - Intro
    0:59 - Class Library projects explained
    6:37 - Creating a Class Library project
    11:06 - Why and how to use Class Library
    18:35 - What is a Class Library and how to build one
    22:30 - Using Class Library with an Application (Console App)
    28:00 - Value of Class Library
    32:42 - Using Class Library with an Application (Windows Forms App)
    38:43 - Summary of Class Library Usage in different Applications
    44:41 - Class Library sharing, versions and NuGet packages
    49:40 - Project Dependencies
    55:44 - Summary and final remarks

    • @IAmTimCorey
      @IAmTimCorey  2 ปีที่แล้ว +3

      Welcome back! And thank you so much!

  • @frednicholson
    @frednicholson 2 ปีที่แล้ว

    It seems it would be a less common scenario, in a professional setting, to be starting out with a fresh project and building a class library from scratch. More likely, someone unfamiliar with .NET class libraries inherits a rather complex hierarchy of preexisting projects/class libraries, and needs to sort it out. Perhaps a video directed to this scenario would be beneficial.

  • @micro2743
    @micro2743 2 ปีที่แล้ว +1

    You are missing "Class Library (WinUI 3 in Desktop). I guess you do not have the Window App SDK installed. There are new features in WinUI3 that I am reallly loving, especially tearable tabs.

    • @IAmTimCorey
      @IAmTimCorey  2 ปีที่แล้ว

      Yep, I don't have that installed.

  • @bradleyhodgins6354
    @bradleyhodgins6354 3 หลายเดือนก่อน

    Would you say most libraries contain static methods? Eg: If you had an library that access a particular web API? How do you decide whether to make it static or not?

  • @pawel89pawel
    @pawel89pawel 2 ปีที่แล้ว +1

    I have a question of switching class libraries. Meaning that a have a nice class library of standard .net2.0 but I decided that I would like to change it into .net6.0 and than in the future into .net7.0. Now the question is is there a way to switch between class libraries types (I saw on yt that you just simply change the type from net standard to net6.0 however is it sufficient enough. And another question is about this razor class. Let’s face it is a class library as well another layer of the application so to speak. Now is it wise to add a business logic class library to that class library and than just use the components in for example blazor project or is there a better way?

  • @kifayat123456
    @kifayat123456 ปีที่แล้ว +1

    Thank you for sharing such in depth knowledge sessions.. I think I know stuff clearly until I go through your videos 😂

  • @haozheng8400
    @haozheng8400 2 ปีที่แล้ว +1

    Really clear and useful!!!

  • @perviguana
    @perviguana 2 ปีที่แล้ว +1

    Maybe a dumb question, but should a class library that is referenced by multiple different projects be entirely in it's own Visual Studio solution (without the UI projects in the same solution like in this video)? I'm just thinking that if any changes need to be made in the class library code alone, it's unnecessary to open it up in the same solution with a UI project that may not need changing?

    • @IAmTimCorey
      @IAmTimCorey  2 ปีที่แล้ว

      It depends on your situation but remember that the solution is just a "bucket" that holds projects. You can have a project in multiple solutions. Also, having a project in a solution doesn't mean it has any relationship with other projects in that solution. It is simply a convenience for development.

    • @perviguana
      @perviguana 2 ปีที่แล้ว +1

      @@IAmTimCorey Thanks for the clarification and speedy reply, Tim! And keep up the good work 👍

  • @VitaliChuzha
    @VitaliChuzha 2 ปีที่แล้ว

    Great video. Tim, thank you!

  • @vargaszilvia774
    @vargaszilvia774 2 ปีที่แล้ว

    Great explanation, thank you!helped a lot!

  • @ishfaqbabar1192
    @ishfaqbabar1192 2 ปีที่แล้ว

    Dear Tim, Please Make a dedicated video about how to avoid and resolve circular dependencies of libraries .

    • @IAmTimCorey
      @IAmTimCorey  2 ปีที่แล้ว +3

      Thanks for the suggestion. Please add it to the list on the suggestion site so others can vote on it as well: suggestions.iamtimcorey.com/ I will say that circular dependencies should never happen. They only happen when you try to have project 1 reference project 2 when project 2 already references project 1. That should never happen. For example, if you have a Windows Forms project. It might reference a class library. That class library should not try to reference the Windows Forms project. It needs to be a one-way dependency.

  • @Otonium
    @Otonium 2 ปีที่แล้ว +1

    It would be great to watch modern demos, i.e. for the latest versions of Dapper access from within a library

    • @dalmirogranas9990
      @dalmirogranas9990 2 ปีที่แล้ว +1

      I watched the Dapper one 4 days ago and the content was still 95% relevant when used on a .NET 6 library class like I did 🌈

    • @IAmTimCorey
      @IAmTimCorey  2 ปีที่แล้ว

      Is there something you feel is missing? The code should be the same.

  • @jeffsherman9638
    @jeffsherman9638 6 หลายเดือนก่อน

    Hello Tim, how do you know when to create your own class library rather than use one from the massive manage nuget packages? The problem is, there are so many nuget packages out there that there may be one that was already created for your project but the problem is there is no way to tell if there was one created already to meet your needs without examining each and every one?

    • @IAmTimCorey
      @IAmTimCorey  6 หลายเดือนก่อน +1

      I would look at it from a different direction - what are the things you absolutely need someone else to do? The more NuGet packages you rely on, the harder it will be to upgrade your application. You want as few dependencies as possible while at the same time, you don't want to reinvent the wheel. For example, I tend to lean on external dependencies for logging, authentication, data access (Dapper), and anything that is deeply specialized or difficult such as a library to write to Excel. Otherwise, I try to avoid taking on another dependency if possible.

  • @mekes8541
    @mekes8541 2 ปีที่แล้ว

    Alright, the video I was waiting for

  • @windowsbuilderthegreat3121
    @windowsbuilderthegreat3121 2 ปีที่แล้ว +2

    Would events help to mitigate the issue of the class library needing to talk to ui

    • @IAmTimCorey
      @IAmTimCorey  2 ปีที่แล้ว +2

      Yes and no. First, I don't think there is an "issue" with the class library not talking to the UI. That's like saying it is an issue that your screwdriver doesn't do work without you holding it. As for your solution, the UI is still doing the work. It is saying "when x happens, do this work". However, that is triggered by the class library, so you could look at it that way. Just remember that the class library doesn't do anything on its own. You have to call a method in order for it to fire an event. You could have just returned data from that method call. There is a time for each. You just need to be paying attention to when each is necessary.

  • @RewindFPV
    @RewindFPV ปีที่แล้ว

    would be nice if you could tell us more about static and dynamic linking with those dll's.
    i guess what you just did by referencing it was static linking so it get's compiled in the .exe?
    also what happens if you wanna do dynamic linking but you want to have the dll somehere else on the drive and what does registering the .dll on the system do and change for your project?

  • @ElCidPhysics90
    @ElCidPhysics90 2 ปีที่แล้ว +1

    Really need to work on implementing this concept. I put waaaayyyy too much logic in my UI project.

    • @IAmTimCorey
      @IAmTimCorey  2 ปีที่แล้ว +1

      This is a great time to start.

    • @ElCidPhysics90
      @ElCidPhysics90 2 ปีที่แล้ว

      @@IAmTimCorey ha! True!

  • @Odium_DOB
    @Odium_DOB 8 หลายเดือนก่อน

    this broke it down into a much simplier way. I UNDERSTAND, and I'm a doofus.

    • @IAmTimCorey
      @IAmTimCorey  8 หลายเดือนก่อน

      I’m glad you understand!

  • @HotSaab
    @HotSaab 2 ปีที่แล้ว +1

    How do you get the automatic file-scope namespace formatting by adding the semicolon? Is there a setting somewhere? VS 2022 and NET 6 here and I can't get it to work. I can via a right-click on the namespace, but not by adding the semicolon. What am I missing?

    • @IAmTimCorey
      @IAmTimCorey  2 ปีที่แล้ว

      Interesting. It may be an update to Visual Studio. I keep mine up to date. Otherwise, I'm not sure.

    • @HotSaab
      @HotSaab 2 ปีที่แล้ว +1

      @@IAmTimCorey Found the problem. I was running a trial copy of Resharper. Disabled it and the semicolon technique worked as seen in your videos.

  • @gagwithgaffer8385
    @gagwithgaffer8385 2 ปีที่แล้ว

    Very useful thank you Tim :)

    • @IAmTimCorey
      @IAmTimCorey  2 ปีที่แล้ว

      You are welcome.

    • @gagwithgaffer8385
      @gagwithgaffer8385 2 ปีที่แล้ว

      @@IAmTimCorey is it acceptable to have one class library have a refeence to another class library? or should each library operate completely independantly from each other?

  • @carstenberggreen7509
    @carstenberggreen7509 ปีที่แล้ว

    Tim, greatly explained as always. But.... the idea of calling your class library projects Library makes the namespace weird when you reference them in your code. I hope you will change your recommendation so new developers would follow the advised namespace standards instead. If you teach them this, we get stackoverflow etc. filled up with more badly named solutions.

    • @IAmTimCorey
      @IAmTimCorey  ปีที่แล้ว

      How is that badly named? It communicates what it is and where it comes from. Also, once you import the library, you are going to be putting in a using directive at the top or globally that shortcuts all of your calls so you don't even use the name again.

  • @ElCidPhysics90
    @ElCidPhysics90 ปีที่แล้ว

    So I actually implemented class libraries in a small app I was putting together. Like full scale. No code in the “UI” app that didn’t have anything to do with the presentation. My first realization is the number of libraries is about double what I anticipated- granted it’s still only 3 or 4. But still, I was expecting to have 1 or two class libraries but when I actually considered future uses I needed more. Which is fine. Just an observation. My real issue is doesn’t it become harder to debug errors that are hidden inside of a dll? I happened to have written all of the code first in my UI then moved it. That took a while and I could see where it could become a much harder task to do that if you have 10+ dlls you need to implement. How do you handle debugging your class libraries?

    • @IAmTimCorey
      @IAmTimCorey  ปีที่แล้ว +2

      Debugging is fairly easy if you use the pdb files that are created on build. That way, you can step into the code of the dll easily. Also, unit testing your class libraries before using them is a valuable step to ensuring good code quality.

  • @foonlam7134
    @foonlam7134 2 ปีที่แล้ว

    I would like to create a class library and reference it from a console app just like your example but I don't want a static class library. I also want to use IOC so that I can easily write unit tests. If I create an interface for my library (coz I am using IOC), I don't know how to instantiate it in my console app and call the library method. Can you please suggest some video or tutorial that will show me how to do this? Thank you.

  • @surakshachoudhary2880
    @surakshachoudhary2880 2 ปีที่แล้ว +1

    Is it possible to reuse code from a wholly separate solutions, similar to how we reuse code from another project in the same solution?

    • @IAmTimCorey
      @IAmTimCorey  2 ปีที่แล้ว +1

      Definitely. That’s what NuGet packages are. You can just share the dll, though. You don’t need a NuGet package (but I recommend it).

  • @homersimpsons9802
    @homersimpsons9802 ปีที่แล้ว

    Its been a week im trying to create a msi of a project that contain 2 class library... it just dont want to work. Can you help?

  • @risechess7114
    @risechess7114 11 หลายเดือนก่อน

    24:00 Console.Writeline(value: ...) how to get that thing that make value appear to clearify some stuff

    • @IAmTimCorey
      @IAmTimCorey  11 หลายเดือนก่อน

      This video shows you how to turn them on: th-cam.com/video/morBKqtqmso/w-d-xo.htmlsi=QTmpA1yVmmY4ZmA3

  • @randomCADstuff
    @randomCADstuff 2 ปีที่แล้ว

    I thought I also heard that class libraries are also faster than placing the same code within other projects. That may or may not have been mentioned in this video too... I watched most of it but skipped a few parts.

    • @IAmTimCorey
      @IAmTimCorey  2 ปีที่แล้ว +2

      Nope. There isn't a positive speed difference using a class library.

  • @briannyashadzashechiunda4782
    @briannyashadzashechiunda4782 6 วันที่ผ่านมา

    bruv is very good at yapping on and on

    • @IAmTimCorey
      @IAmTimCorey  5 วันที่ผ่านมา

      And there is a reason for that - context is important. New developers tend to want to just know how to use something. "Learn" it in 2 minutes. The problem is that you then think you know something, but you have no clue how to actually use it correctly in production. Employers aren't looking for you to know trivia. They are looking for you to know how to actually do the job. That's what I try to impart in these videos - a better understanding of why, when, and when not to use something, not just how to use it.

    • @briannyashadzashechiunda4782
      @briannyashadzashechiunda4782 5 วันที่ผ่านมา

      @ you’re right. I got impatient. It’s a race between trying to understand quick to pass an exam and that. Thanks for the content though. Can’t be easy doing it for free and have assholes like me in your comment section

    • @IAmTimCorey
      @IAmTimCorey  5 วันที่ผ่านมา

      😂 I understand. There's always a balance. That's why I also have 10-minute training videos and TH-cam shorts as well. Not everything can be covered in every format, but I do my best to meet people where they are at. Just keep in mind that passing the exam is great, but it doesn't equate to real-world readiness. Take the time whenever possible to get the strong foundation you need.

  • @Mark4nov
    @Mark4nov ปีที่แล้ว

    Hello Tim, since I watched this video I made a lot of class libraries that speed my development flow, and now all my new collegues are using them on their proyects, so i thought that is possible to me to make something like a set of libraries to help to build apps for the company. My problem is that I don't know how to start, and I have no idea how to call that type of proyect, is an SDK? an API? or i must just make a big class library with folders and namespaces? I don't know.

    • @IAmTimCorey
      @IAmTimCorey  ปีที่แล้ว +2

      It sounds like you would be best served by creating a NuGet package for your colleagues. That way, you could easily distribute it, version it, and even break it into different parts. You can distribute NuGet packages locally if you want. They don't have to go to the main NuGet repository.

    • @Mark4nov
      @Mark4nov ปีที่แล้ว

      @@IAmTimCorey I already have those libraries in an azure devops feed, do you think i must keep them sepparated from each other or i must merge in one solution?

  • @bradleyhodgins6354
    @bradleyhodgins6354 3 หลายเดือนก่อน

    How would you go about reusing this class library in a different solution?

    • @IAmTimCorey
      @IAmTimCorey  3 หลายเดือนก่อน

      Either reference the project or reference the dll that the class library creates on build.

  • @marcostorres7380
    @marcostorres7380 11 หลายเดือนก่อน

    Hi Tim im a little embarassed for what i'll ask now but i have to do it.
    Im from Argentina and here things are not okey with USD Dollar, we have our currency really devaluated. Im intrested in buying the C# Mastercourse but right now it's a lot for us (argentina)
    So i wonder if at anytime of the year that course get some discount like black friday or something.
    Thank you!

    • @IAmTimCorey
      @IAmTimCorey  9 หลายเดือนก่อน +1

      That course does not get discounted, but the All Access Pass is a cheaper option if you focus on learning quickly.

    • @marcostorres7380
      @marcostorres7380 9 หลายเดือนก่อน

      @@IAmTimCorey Yes i suscribed to the access Pass im currently in the mastercourse on c# im loving it! Thank you!

  • @abdelkiki
    @abdelkiki ปีที่แล้ว

    Thank you!

  • @ericbarlow6772
    @ericbarlow6772 ปีที่แล้ว

    Having a library is also good if you have multiple projects using that library and you discover and mitigate bugs. You fix it in one place rather than having to change it in every project using the same code.

    • @IAmTimCorey
      @IAmTimCorey  ปีที่แล้ว

      Yep, following the DRY principle.

  • @victoriensukarieh3237
    @victoriensukarieh3237 2 ปีที่แล้ว

    i have been contemplating the following question: what to choose webAPI or class library. I deal with active directories and we use some code to create users or manage their data, should I create a class library to do so (considering Microsoft provide a class to connect to AD but I want it to be a bit more custom), or should i create a webAPI with CRUD functionalities to do the same job. I appreciate answers from the community thanks in advance

    • @IAmTimCorey
      @IAmTimCorey  2 ปีที่แล้ว +2

      A class library is going to be called by other applications as if it were code in that application. An API can be called by other applications as if it were an application of its own (which it is). Meaning, an API can have direct access to a database in situations where your other UIs do not have that same access. For example, a mobile app cannot talk directly to a database for security reasons. However, it can talk to an API which can then talk to the database. An API is a full application that needs to be hosted somewhere. That is an additional complexity you do not need in every case. If the UI can talk directly to the database (or whatever you want the class library to do), you probably just need a class library.

    • @victoriensukarieh3237
      @victoriensukarieh3237 2 ปีที่แล้ว

      @@IAmTimCorey thanks a lot for this clarification. everyday the picture of organizing solutions and code gets clearer, i am still going too slow wit the practice(which i will overcome) , thanks for the videos you are providing

  • @georgeselhokayem7238
    @georgeselhokayem7238 2 ปีที่แล้ว +1

    Hello can you please make a video of how to connect a blazor server app to mysql database using .net6

    • @IAmTimCorey
      @IAmTimCorey  2 ปีที่แล้ว

      I already did that with Blazor: th-cam.com/video/_JxC6EUxbDo/w-d-xo.html
      As for .NET 6, not much has changed there except the startup class, which I covered here: th-cam.com/video/vdhFw1VSowg/w-d-xo.html

    • @georgeselhokayem7238
      @georgeselhokayem7238 2 ปีที่แล้ว

      @@IAmTimCorey Thank You for your replyy!!!

  • @andywalter7426
    @andywalter7426 2 ปีที่แล้ว +1

    There has been cases where 2 libraries even though it does not do any ui stuff still has circular dependencies. Once, I had a job where when I had my first experience with class libraries and saw one was doing too much, I created a second one. However, did not know until far into development that both depended on each other. A good example is Email library and Invoice library. Until I eventually did a complete redo of the system, I ended up building both separately then reference the dll and not the project to get around the errors.

    • @IAmTimCorey
      @IAmTimCorey  2 ปีที่แล้ว +6

      If you have circular dependencies, you have one library. Splitting it into two libraries should not be done. It should be in one library. As for the Email and Invoice example, the email should not rely on the invoice library. It should not know about it. The invoice library should know about the email library but the email library should be just about sending emails. It shouldn't know who it is sending them for, or what content will be in the email. That should all be done on the invoice side.

  • @Richard-jm3um
    @Richard-jm3um 2 ปีที่แล้ว

    Thanks for sharing another great informative video!

  • @boky7731
    @boky7731 2 ปีที่แล้ว

    In what order should a beginner learn project types?

    • @IAmTimCorey
      @IAmTimCorey  2 ปีที่แล้ว +1

      I recommend starting with Console Apps. That way you can practice your C# without focusing on the UI. That's what I start with in the C# Mastercourse: www.iamtimcorey.com/courses/csharpmastercourse.html

    • @boky7731
      @boky7731 2 ปีที่แล้ว

      @@IAmTimCorey Nice course but too expensive brother not gonna lie. I bought a book called C# 10 and .NET 6 - Modern Cross-Platform Development by Mark J. Price and it is awesome so far. Thanks for answering have a nice day!

  • @veasnakoeun4294
    @veasnakoeun4294 ปีที่แล้ว

    can u guide about the reports in c# application

    • @IAmTimCorey
      @IAmTimCorey  ปีที่แล้ว

      Thanks for the suggestion. Please add it to the list on the suggestion site so others can vote on it as well: suggestions.iamtimcorey.com/

  • @vikassharma6143
    @vikassharma6143 2 ปีที่แล้ว

    Thank you!!!

  • @chedev
    @chedev ปีที่แล้ว

    what is the best library for making games?

    • @IAmTimCorey
      @IAmTimCorey  ปีที่แล้ว +1

      The one that you find easiest to work with.

  • @ziadtalaat4
    @ziadtalaat4 8 หลายเดือนก่อน

    Can i reach an advanced level in problem solving with c# instead of c++???

    • @IAmTimCorey
      @IAmTimCorey  8 หลายเดือนก่อน +1

      Absolutely.

  • @uCanCallMeBob
    @uCanCallMeBob ปีที่แล้ว

    i cant see class library in my visual studio

    • @IAmTimCorey
      @IAmTimCorey  ปีที่แล้ว

      Check your filter settings on the new project dialog box. If you have C# available in Visual Studio, you have the Class Library project type. You can also search for it.

  • @risechess7114
    @risechess7114 11 หลายเดือนก่อน

    thanks

    • @IAmTimCorey
      @IAmTimCorey  11 หลายเดือนก่อน

      You are welcome.

  • @andywalter7426
    @andywalter7426 2 ปีที่แล้ว

    There is another benefit to class libraries that was not discussed. Even if somebody only has the console UI, another benefit to class libraries is you can have 2 different apps. Its very common where even though you only have one ui, you have many different apps that has to call into the functions. Its also very common in business instead of having one app, they may have even up to 20 different apps.

    • @IAmTimCorey
      @IAmTimCorey  2 ปีที่แล้ว +1

      Huh? How is an app not a UI? And I did mention that multiple user interfaces can call the class library. That means multiple applications.

    • @andywalter7426
      @andywalter7426 2 ปีที่แล้ว +1

      @@IAmTimCorey You mentioned like console and windows forms. However, you can have 2 different console apps or more commonly 2 completely different wpf apps. Its the same type of user interface but behaves completely differently since the layout can be completely different for different purposes.

  • @andywalter7426
    @andywalter7426 2 ปีที่แล้ว

    I noticed one thing mentioned that was not quite right. You said that data access can't be done from web assembly or maui mobile. That is not quite true. Its easy to have an interface called IDataAccess. In this case, blazor can use local storage, the mobile can use mobile storage and the desktop can do database. I've had libraries that even accessed the file system and it still worked in web assembly. In that case, the webassembly just would not call the file system stuff (but may call into local storage via interfaces). Probably should have mentioned that interfaces are really great in class libraries. In that case, different UI types can implement and do things differently. Even something like Exit can be done that way.

    • @IAmTimCorey
      @IAmTimCorey  2 ปีที่แล้ว +2

      But local storage is not the same thing as data access. Local storage is just caching. It cannot be relied upon. That isn't the same thing as storing data in a database, where it can be relied upon.

    • @andywalter7426
      @andywalter7426 2 ปีที่แล้ว

      @@IAmTimCorey What would a person do if they are using web assembly but the user usually has no internet access. Even with azure static site has no database access without paying money. I am aware unfortunately that if somebody was using i phone, then after 7 days of not using the app, the data goes away in that case. I have a game package where I used interfaces where the desktop can save to disk but the web assembly has to save to local storage so for web assembly, if the data is gone, then the person has to start the game all over again and that was a sacrifice to be made to reach more people.

    • @wayne_taylor
      @wayne_taylor ปีที่แล้ว

      @@andywalter7426 that's why people use persistant stroage such as databases

  • @vencislavvidov
    @vencislavvidov 2 ปีที่แล้ว

    source code? I get always an error:(

    • @IAmTimCorey
      @IAmTimCorey  2 ปีที่แล้ว

      You can email help@iamtimcorey.com for help. We are upgrading the system hopefully this week to improve delivery.

  • @sarfraz8533
    @sarfraz8533 2 ปีที่แล้ว

    Waiting for gaming course

    • @IAmTimCorey
      @IAmTimCorey  2 ปีที่แล้ว +2

      It will be a few months, but it is coming.

  • @Roger-pw3zz
    @Roger-pw3zz 6 หลายเดือนก่อน

    This tutorial seems badly out-of-date. I'm trying to follow in VS2019 and nothing makes sense. Is it me? I certainly don't discount that possibility.

    • @IAmTimCorey
      @IAmTimCorey  6 หลายเดือนก่อน

      It is just the opposite, actually. The video is current (it uses .NET 6 and .NET 8 is out, but very little changed between those versions), but your version of Visual Studio is out of date. I use Visual Studio 2022 Community Edition in this video. In most cases, you can get that version for free and you can run it on a machine that also has Visual Studio 2019 as well.

  • @SinaDelta
    @SinaDelta 2 ปีที่แล้ว +3

    Hi tim , you are perfect , i love to see your video , you are best teacher and best programer i have ever seen 💯💯💯💯. loves your full courses , they give me wisdom , and say me why i should see the other .👌👌👌✌✌✌🫀🫀🫀❤‍🔥❤‍🔥