.Net Core - Extension Methods C#

Ғылым және технология

I do a mixed lesson here bridging between C# Programming Tutorials and the .Net Core series.
We learn all about extension methods, how to use them and more so make a very good and powerful use of them by chaining a construction together in a JavaScript style initialization.
Source Code: github.com/angelsix/dna-frame...
Fasetto Word Source Code: github.com/angelsix/fasetto-word
Support me on Patreon: / angelsix

Пікірлер: 22

  • @andrewmills5936
    @andrewmills59366 жыл бұрын

    How does this guy not have more views and comments. This guy needs to go viral in the c# community asap!

  • @AngelSix

    @AngelSix

    6 жыл бұрын

    Thanks :)

  • @abdullahtanveer5901
    @abdullahtanveer59015 жыл бұрын

    hey you are amazing thanks for sharing your knowledge with us.... keep it up.....

  • @AngelSix

    @AngelSix

    5 жыл бұрын

    Thanks and your welcome

  • @bioanu
    @bioanu4 жыл бұрын

    You are Gold!! I'm coming from your tutorial on delegates and lambda expressions to understand the extension methods presented there in the class Helpers.. now I understand what and why use this concept!! Thank you very much!!!!! Is there any chance to collaborate? I would like to present a project that can change a whole industry and the way people inside it works in this moment

  • @georgesi2006
    @georgesi20063 жыл бұрын

    Another great video! Since Dna.Framework is now a NuGet package, how would I go about changing the formatting of the logging output? So instead of the current output of: [2021-03-03 11:44:03] Dna Framework started in Production... [Framework.cs > Build() > Line 65] I want to make it look as the the following, slightly deviating from the default: [2021-02-28 Sun (+00:00) 22:43:07] [Framework.cs > Startup() > Line 130] Dna Framework started in Development... Now I did have the desired output while Dna.Framework was just a project within the Fasetto.Word solution and I could just change the relevant code, so I know what the relevant bits of code should look like, just not sure how to override the native formatting when it's inside the NuGet package. Could you help?

  • @NickMesisca
    @NickMesisca6 жыл бұрын

    How would you log any errors generated within the framework though? The logger isn't yet accessible until after we Build.. Am I on the wrong track in suggesting our BaseExceptionHandler (as it is) would crash with Logger=null?

  • @AngelSix

    @AngelSix

    6 жыл бұрын

    So the general theme we will adopt throughout our application is that the top level main application (lets say the Fasetto.Word windows app) should be the only thing for most calls that ever catches errors. All frameworks, libraries, class projects etc... unless doing a self-containing call where they are expecting exceptions, will instead just pass up to the top level. Then unit testing is easy to catch errors both expected and unexpected, and we will add error codes to support that. Now at the top level, we would normally have all top-level (first call) functions wrapping their entire call in a try/catch-handle type structure: try { ... { catch (Exception e) { Provider.ExceptionHandler.Handle(e); } For startup, correct logger is not there. Nor is exception handler (it should not be presumed to be) so for the startup call itself we wrap that in a try/catch with some fallback logic that should not fail, and perhaps just do a simple message dialog to the user showing the error and that it is critical. Make sense?

  • @NickMesisca

    @NickMesisca

    6 жыл бұрын

    Gotcha. Yeah definitely makes sense. Thank you (again) for the help :)

  • @daily_crypto
    @daily_crypto6 жыл бұрын

    thank you, have a question for your future lessons. What you think about creating something like chat or even a messenger? Don't get me wrong just wanna know your opinion upon this question.

  • @AngelSix

    @AngelSix

    6 жыл бұрын

    I am creating a chat app, the WPF series is all about that

  • @daily_crypto

    @daily_crypto

    6 жыл бұрын

    nice, didn' see it yet, thank you. P.S. I think this video shouldn't be in this playlist for C# beginners, guess it should be located in .NET core playlist

  • @AngelSix

    @AngelSix

    6 жыл бұрын

    It's a mix between the two as its really just talking about Extension methods, but using our .Net Core framework to show it off (thats why the image is a blend of blue and magenta a mix between .Net Core and C# screenshots)

  • @daily_crypto

    @daily_crypto

    6 жыл бұрын

    AngelSix, sorry for being that stupid

  • @AngelSix

    @AngelSix

    6 жыл бұрын

    No its not stupid or obvious. It's the first video I've done that crosses 2 series so I made the subtle screenshot change to symbolize that :)

  • @NickMesisca
    @NickMesisca6 жыл бұрын

    Hey again :) I am trying to extend your framework but I'm kind of stuck. I was wondering if it would it be ok if i drop you an email and expose the issue? In your own time, of course.. :)

  • @AngelSix

    @AngelSix

    6 жыл бұрын

    Sure just drop me an email contact@angelsix.com

  • @loam
    @loam5 жыл бұрын

    Huh, in russian language there is much more freedom on how the sentences are constructed and the order of sentence members can vary. So, we would read normally both "Test.IsEven(a)" and "a.IsEven()". (same for my native language, actually I got two native languages: Russian and Ingush). But nevertheless I find it very useful, because when I program I think in english and my mind switches it's way of thinking into English type of logic.

  • @AngelSix

    @AngelSix

    5 жыл бұрын

    Oh thats good to know. Yes I guess the preference is really derived from the way the english language works.

Келесі