Actually WhenAll is not Fire and Forget since you are awaiting it.
@HamzahAudehКүн бұрын
Thanks for the video. Actually I'm a big fan of the exception pattern (despite the continuous debate). I use custom exception even to handle the validation errors and the flow control of the system. This is a straight- forward approach and keeps domain logic more focused on the business, and in the global exception handler, I extract the status code with the message and any other related details and return a formatted response to the clients without having to deal with checks at each layer. I used this a lot on enterprise level systems and all things are fine.
@user-re6bu7dy1lКүн бұрын
Great video. I share much of your thoughts about modern content creation. I'm really annoyed to see experienced programmers start making great content just to slowly transaction into paywalling everything and just making funny little entertaining videos (like code cop series, which is absolute trash), which are created purely for gaining new audience and reminding that a brand new course came up on the dometrain (screw you, Nick). I wish you good luck and once more appreciate your position and decision
@parkboy3 күн бұрын
If you want to have a return url to return to return to the last page after re-login: In the custom CookieAuthenticationEvents implementation... public override Task RedirectToLogin(RedirectContext<CookieAuthenticationOptions> context) { // Get the current URL the user is trying to access var returnUrl = context.Request.Path + context.Request.QueryString; // Encode the ReturnUrl to make it URL-safe var encodedReturnUrl = Uri.EscapeDataString(returnUrl); context.RedirectUri = $"/Account/Login?ReturnUrl={encodedReturnUrl}"; return base.RedirectToLogin(context); }
@arunbm1235 күн бұрын
❤
@pratyushdeyasi33716 күн бұрын
Hi! This worker like a charm. But, I am facing an issue when trying to return an image file in response. I did return IActionResult from my controller function and the value to be returned was File(<file path>, "image/jpeg"). But in response I am not receiving physical file. Rather, I am receiving json! Can you please guide?
@devcouch69757 күн бұрын
I don't like the approach to add a ToProduct(...) Method to the ProductDto, because it adds an dependency to the Dto. The purpose of the Dto is to provide a structure for data-transfer, with a To-Method it breaks the single-responsibility-pattern as its purpose is then to convert types and provide the structure.
@essamal-mansouri26899 күн бұрын
I definitely don't agree that each part of the domain needs to have its own database. I do think they each need to have their own models but those models can still be persisted in the same database. There are other problems related to sharing but DDD doesn't really prescribe a way that you must do it
@nabeelmhd66911 күн бұрын
Great video !! This was the explanation I was looking for. Cleared many of my doubts and understood the concept of async/await.
@sitholewb12 күн бұрын
I disagree with the final conclusion of this video, I ran benchmarks with the code below, and I got good results for Guids vs TypedId | Method | Mean | Error | StdDev | Allocated | |---------------------------------------------------|-----------------:|-----------------:|---------------------:|----------------:| | Guid_Id | 798.1 us | 15.79 us | 28.47 us | 64 B | | RecordReadonlyStructTypedId | 801.1 us | 15.90 us | 21.22 us | 64 B | using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Order; using BenchmarkDotNet.Running; namespace TestBenchmarkDotNet { public class Program { private static void Main(string[] args) { BenchmarkRunner.Run<Benchmarks>(); } } public readonly record struct BookId(Guid Value) { public static Guid Empty => Guid.Empty; public static BookId NewBookId() => new(Guid.NewGuid()); } public class TypedIdService { public BookId DoSomeThing(BookId bookId) => bookId; public Guid DoSomeThing(Guid bookId) => bookId; } [MemoryDiagnoser] [Orderer(SummaryOrderPolicy.FastestToSlowest)] public class Benchmarks { private List<Guid> _ids; private TypedIdService _typedIdService = new(); [GlobalSetup] public void Setup() { _ids = Enumerable.Range(0, 10000) .Select(i => Guid.NewGuid()) .ToList(); } [Benchmark] public void RecordReadonlyStructTypedId() { _ids.ForEach(x => _typedIdService.DoSomeThing(BookId.NewBookId())); } [Benchmark] public void Guid_Id() { _ids.ForEach(x => _typedIdService.DoSomeThing(Guid.NewGuid())); } } }
@AnushaYadav0112 күн бұрын
I have a doubt if the db is used same as prod for staging slot and if any update/delete operation is done will it effect in database. If so how we can test it
@JoaoPedro-nv6xs15 күн бұрын
Brother you saved me so hard from a pitfall of stress and frustration. Love you! great job keep it up
@Pierre1O15 күн бұрын
Good content, however you don't need explicit DbContext registration (AddDbContext) as AddDbContextFactory registers scoped DbContext as well.
@mkg55120 күн бұрын
A Big Thanks from India
@TheLastRoseThatRaisedMe20 күн бұрын
if i wanna do global query filter to always add the tenantid. how can i get tenantid claim from user in a ef core service class?
@juansnow458521 күн бұрын
I saw your video where you explained how to create the layers in a project. In which layer should I configure the profile folder?
@painnagato761722 күн бұрын
I'm a Java developer, but I love your channel and I really like C# too
@kajmaring333322 күн бұрын
Thanks for the explanations. This helped me a lot! Can it be, that there is one thing on the Update function missing? If I want to remove an already checked tag, this doesn't actually work. The loop in the repository is only adding the tags but not checking if an already checked tag has been removed... Or am I missing something? Thanks again!
@enmingwang633223 күн бұрын
Great tutorial! I noticed that in your demo application it showed ApplicationUser rather than the default IdentityUser. Was the ApplicationUser inherited from IdentityUser with some customer fields? If that was the case, did you have to manually update every IdentityUser to ApplicationUser in all generated identity related files under the Account folder, such as IdentityComponentsEndpointRouteBuilderExtensions, etc? I am trying to figure out how to create a customer ApplicationUser by inheriting from IdentityUser in a Blazor app, which led me to your video.
@enmingwang633224 күн бұрын
This was the first time I came across your channel via your Blazor identity customer authentication tutorial. Great stuff, very appreciated👍👍. In my opinion you are great content creator who provides great value and contributes to the community. I subscribed to your channel to let you know you've done a great work.
@HusseinJahanbakhshAbkenar26 күн бұрын
Hi Dan, please please continue and add more videos this playlist. Thank you so much 🙏🏻
@nithinb967126 күн бұрын
In think N Layer with DI is equal to Onion Architecture and not clean architecture.
@tajpouria27 күн бұрын
Very wise l
@jeffreykleine87127 күн бұрын
I am missing what await/async really does beside not blocking the thread, why does this not block the thread, and here is a little explanation for those who wonder. Your OS is capable of offloading work to specific pieces of hardware, like harddrives and network cards, which will signal back to the cpu once their operation is done. By using await and async your code is split up into pieces which can be re-entered from these signals. Thus making your thread free to do other work until it receives an interrupt/signal that it can continue with the next piece of code.
@xybersurfer28 күн бұрын
i think this is very well said. i can't stand the result pattern for these reasons. sometimes a framework forces one into using the result pattern in a language that doesn't support it. i'm assuming you also carefully consider when you use the result pattern
@albertoizquierdo545129 күн бұрын
Thanks a lot, I was trying different methods but I couldn't make it work. Nice solution! =)
@iamakonda29 күн бұрын
Hi, Where can I find source code? Any GitHub URL
@EMAILSANJEEVJOSHIАй бұрын
Very nice explanation with code output backing it. Thanks so much !!
@arnaldofernandezАй бұрын
Very very helpful!
@allahousalamiАй бұрын
thanks a lot very clear and helpful
@_samirdahalАй бұрын
In 8:35 From line no 9 to 11 already starts executing, even before hitting the line with await Task.WhenAll() so what is happening here?
@neycandido5540Ай бұрын
Worked like a charm!!!
@nothingisreal6345Ай бұрын
Very good point here. Lets check an example. Assume you want to solve a quadratic equation 0=a*x*x+b*x+c. The general solution has potentially two results and requires to use complex numbers. You will find the two solutions of the equation using the formular x1/2=(-b +/- sqrt(b*b-4*a*c)/(2*a). In case d=b*b-4*a*c < 0 you have two complex numbers as solution else two real numbers. I implemented this with four variants 1) use complex numbers 2.) check if d is less as zero. in that case return false else return true and use reference parameters to return x1 and x2, 3.) if d is less as zero throw and argument exception else return a tuple with (x1,x2). 4.) use a library that implements the result pattern (e.g. in C# FluentResults) and considring d<- as Failure. For this task it is expected to have cases where d<0 and hence throwing exceptions appears to be "odd". But if you know that, for only a low percentage of the cases, the inputs require a complex solution, throwing exceptions is actually faster as using the Result pattern and uses way less memory allocations. The fastest by far is limiting to real solutions and returning a boolean value and the results as reference parameters, which is allocation free. You can check out the details at github.com/hjrb/TestResultPattern Also interesting: returning complex numbers is slower as limiting ourselves to real solutions. But as soon as the percentage of inputs that yield complex results reaches 10% returning complex values is faster as using the result pattern and throwing exceptions. So why not simply return the general result? As mentioned in the video: usually it is more complex as one thinks. You need to measure!
@marcouitendaal985Ай бұрын
I stumbled across your channel and subscribed for this video. I understood the need for using factories when abstracting away from the complexity of newing up instances, but this explanation also made it clear for me in the context of multiple database operations going on for a single scope. Thanks. something clicked in my brain.
@bernardvigga7472Ай бұрын
Thank you Buddy! I chanced on your channel recently and I must say, I learnt lots from your videos. Good luck in your next move!!
@lacuevadelinsectoАй бұрын
You are great!
@andypu87Ай бұрын
Great video! Thanks a lot!
@discovertheworldcАй бұрын
in 15:37 when i try to visit (ip address) page it says This site can’t be reached and why ?
@AthelstanEnglandАй бұрын
As an aside you mention at 02:11 that we can remove @attribute [StreamRendering] because you have put in @rendermode InteractiveServer but don't they do different things? StreamRendering displays the "Loading..." whilst waiting for the server to complete the OnInitialized logic. Interactive simply allows the page to respond to events. Maybe it was just your phrasing but it sounded as if you can't use both together?
@LoganDunningАй бұрын
Your content creation skills and ability to educate the community is incredible . It’s Not about being entertainer and an clickbait connoisseur …those aren’t desired qualities. Who cares about the algorithm, Who cares about money, Who cares about scam courses… money ruins everything it’s about passing on knowledge and helping others in the community on things that you learn along the way. And you do that Superbly., you’re a superior educator with a calm demeanor that we all need and I’ll look forward to.
@Scott.DurkinАй бұрын
Error 404: Code not found
@minhhieple6483Ай бұрын
May I ask, this cource done yet ?
@valterszaluzinskis2453Ай бұрын
Absolutely love this channel, more often then enywhere else im getting these "this is why" or "this is how" moments.
@WahidRezguiАй бұрын
❤❤❤❤good continuation 😢so sad to hear you stopped making videos
@AmirZhouАй бұрын
This way better than paid courses
@amurray04Ай бұрын
Well said, and I like most of your followers, you have taught me a lot with your videos so far. They are packed full of great information, and I am still going through older videos as I learn more, and find stuff I missed in previous watches. I have been through very similar situations in life where I have had to accept that a given direction was not my path in life, admitting failure is tough, but it does allow us to refocus our efforts where our strengths lie. Social media is a different beast, and there is a lot of unhealthy obsession with 'drama' (and goes beyond social media of course). Additionally, when you talk about content creators and selling courses, I suspect I can list a few KZbinrs that are on my list of favorites that you are referring to. That said, while I don't buy the courses because I feel like there is enough free content for me to learn from, making it not worthwhile for me, I am sure there are others who feel there is value in those courses. Though I have supported by other methods when I can. I look forward to following your new format and appreciate you!!!!
@AndMStАй бұрын
Your videos are great, watch from beginning to end a good amount of them and code every single line.
@RewStein4039Ай бұрын
Don't drop it. Professional to Professional. The kids aren't old enough yet
@RewStein4039Ай бұрын
Hey man as a college professor/instructor. It is tough to teach but the ones watching the most important videos to the end are the ones understanding you best. You will always have ppl that aren't going to get it. But you are instilling hensight and that comes later. All u can do is study human behavior to improve
@yshri8Ай бұрын
Hi , Can you please share source code of this sample