This is super useful to get into the compiler. I bet probably 80% of the exceptions I encounter are Null Reference Exceptions. Also I shoutout to a quick Yield video.
I’m starting out with c# kinda and am going through a c# book and doing the activities when I seen an null warning and wanted to see what it meant and ways to fix it. Great vid
Hi Filip, great content and an outstanding presentation. I work as a trainer myself and use OBS for a lot of video training nowadays. What do you use for this awesome green screen effect in the video? Keep this great stuff coming also really like your Pluralsight courses! Thanks
Thank you very much Sebastian! For the green screen and keying it, I use DaVinci Resolve. If you want GPU acceleration you can pay a one-time license fee, otherwise it's a free tool. I can't praise it enough, such a great software that "just works" :) I've used OBS as well, but it's two completely different tools in my opinion. I stitch everything together manually and do my edits in Resolve. What's even better is that if I badly light my green screen, which does happen, I can select multiple shades and tweak the keying until it's good enough. It's not the fastest process, but I quite enjoy the post processing part! Hope this helps
@@FilipEkberg I agree that OBS and DaVinci Resolve are two completely different tools that serve two distinct purposes. I use OBS for my live video productions via Teams. Actually I use Resolve for my post production stuff as well. Great to see what results you achieve using it. I have also used Final Cut Pro as well as Premiere Pro for video processing. But currently Resolve is my favourite tool for this purpose as well. Thanks for letting me know what you use in your toolchain! It's those tools which make the process enjoyable ;-) Thanks again
Very clear thanks. Using Nullable Ref Types with EF POCO classes feels awkward, I've been suppressing it with the null forgivable operator, but maybe 'init' from C#9 will improve this? And yes for Yield
Thanks for watching! 'init' will just ensure that the property won't be changed after it's constructed, so probably wouldn't help in your case I'm afraid. Have you seen this: docs.microsoft.com/en-us/ef/core/miscellaneous/nullable-reference-types ? An interesting read on nullable reference types with EF.
Good Video Filip. Can you explain about the #nullable restore and where to add the #nullable enable directive either before namespace or class when applying to the class? The indention was to understand the best practices.
Thank you! If you are slowly refactoring a project I would add the #nullable enable directive in the file before the namespace. When you have completely refactored the project, I'd recommend enabling the setting in the project file instead, and remove "#nullable enable" from the files, to make it a bit more clean. Hope this helps!
@@FilipEkberg Run this and check if there will be null reference: class Program { static void Main(string[] args) { test t = new test(); Console.WriteLine(":" + t.Str + ":"); Console.ReadKey(); } } class test { public string Str { get; set; } }
It's name is "null coalescing operator". Simply put, it's a way to check if everything on the left of ?? is null, for example: var name = person.Name ?? "Filip"; If the property "Name" is null, the variable "name" will now contain the value "Filip". What ?? did was to check if person.Name was null, if it was it uses "Filip". The "old" way of writing this would be: string name; if(person.Name == null) { name = "Filip"; } else { name = person.Name; } You can read more about it on the Microsoft docs: docs.microsoft.com/en-us/dotnet/csharp/language-reference/operators/null-coalescing-operator Really handy language feature!
Hi Filip . It’s a grt content . Thanks for that . I have an question on nullable types Where in memory are nullable types stored ?? Say for example : int? I = null ; Is it in stack or heap ? Pls explain me with example . Thank you in advance
@@kiranshetty8342 Nullable types are reference types, when they are instantiated they are stored on the heap. If it's null, you don't have an instance and there's no object allocated.
Microsoft solves probles that created by his own. Not nullable references should exist since C# 1. And there is a lack of keyword which should enforce programmer to check whether method result is null or not null.
If they recreated C# from scatch without nulls, I think there would be some another issue, caused by other workarounds that would have been required to deal with the root causes, which made them introduce nulls in the first place; and that another issue because of those workarounds would have costed just as much, that's my theory))
Unfortunately it's been a while since I put new content on RU-vid. I've got a lot of new content published on Pluralsight ( www.pluralsight.com/authors/filip-ekberg ) and I do have a long "todo" list with videos I want to make for this channel, but other things had to take priority for a while!