Coding Tutorials
Coding Tutorials
  • Видео 171
  • Просмотров 614 231
Blazor Progressive Web Apps. Part 1 - The Basics.
PWAs - Progressive Web Applications - allow users to instal and run web applications almost as if they were native programs. Let's see how to create them in Blazor.
Source code available at: github.com/JasperKent/Basic-PWA-Demo
Topics include:
- What are PWAs? Discoverable, available, usable, responsive, fresh, secure and installable.
- Creating a Blazor PWA in Visual Studio.
- Configuring a PWA with manifest.webmanifest.
- Making content available with service-worker.js.
- Debugging a PWA with Chrome Dev Tools.
- Running a PWA offline.
- Installing a PWA on the desktop.
Просмотров: 290

Видео

Blazor Media Queries
Просмотров 43019 часов назад
CSS Media Queries make responsive design really easy. But what if we want our C# Blazor code to behave differently for different screen sizes? Source code available at: github.com/JasperKent/Blazor-Media-Queries Topics include: - CSS Media Queries - Responsive web design - Blazor CSS isolation - Hiding elements with Media Queries - Using the ProBlazor.BlazorSize package to access Media Queries ...
Blazor RenderFragment
Просмотров 1,3 тыс.3 месяца назад
Writing software is all about the DRY Principle - Don't Repeat Yourself. But how can we do that in Blazor component? Enter the RenderFragment class. Source code available at: github.com/JasperKent/Blazor-Render-Fragments Related video: C#11 String Things ruclips.net/video/_jG_RgLYijI/видео.html Topics include: - Creating Razor markup as strings - The MarkupString class - The problems of raw str...
.NET 8 Blazor Rendering
Просмотров 1,4 тыс.3 месяца назад
It's a big decision: Blazor Server of Blazor WebAssembly? In .NET, you can decide on a component by component basis. Source code available at: github.com/JasperKent/Blazor-DotNet-8 Topics include: - Visual Studio Blazor Templates - Project structure - Static rendering - The [StreamRendering] attribute - Selecting the best render mode - InteractiveServer - InteractiveWebAssembly - InteractiveAut...
.NET 8 - HTTP Files
Просмотров 2,1 тыс.5 месяцев назад
Played-out with Postman? Sick of Swagger? Test your APIs with an HTTP file. Source code available at: github.com/JasperKent/HTTP-Files Topics include: - Using .http files in a new project. - Analysing APIs with the endpoint explorer. - Generating .http files from a Controller-based or minimal API. - Sending requests from a .http files. - Using variables in request URLs. - Using variables for th...
.NET 8 FakeTimeProvider
Просмотров 8715 месяцев назад
As well as giving us TimeProvider, .NET also brings a predefined mock: FakeTimeProvider. Unfortunately, it doesn't quite work as expected. Source code available at: github.com/JasperKent/Timer-Testing Related videos: - .NET 8 Testing Times: ruclips.net/video/L6xlzZdw2As/видео.html Topics include: - The TimeProvider base class - Testing time-based applications - Using FakeTimeProvider to set the...
.NET 8 Testing Times
Просмотров 1 тыс.6 месяцев назад
It's always been difficult to test anything that depends on time, because time is out of control. But with the .NET 8 TimeProvider, we can take control of time itself. Source code available at: github.com/JasperKent/Timer-Testing There were a couple of imperfections in the final version on the video, which I've fixed in the latest revision on GitHub. The mocking of GetUtcNow() in TickFiresEvent...
.NET 8 Keyed Dependency Injection
Просмотров 1,3 тыс.6 месяцев назад
Want to dynamically switch between service implementations? In .NET 8 you can. Source code available at: github.com/JasperKent/RockPaperScissorsInjection Related videos: - C# 12 Collection Expressions ruclips.net/video/Sx-U6vb6CoQ/видео.html - The Single Responsibility Principle ruclips.net/video/IrcMr0Xqz8Q/видео.html - SignalR ruclips.net/video/oQ7OSX7bRto/видео.html - C# 12 Primary Construct...
C# 12 Spread Operator Performance Pitfalls
Просмотров 1,1 тыс.6 месяцев назад
Visual Studio gives us lots of hints on how to improve our code. Mostly it's right. Sometimes it's dead wrong. Source code available at: github.com/JasperKent/Spread-Benchmark Topics include: - The various ways of creating an empty array - The performance benefits of using a predefined empty array - How all ways of creating an empty string work the same way - Benchmarking of spread operator per...
C# 12 Collection Expressions and the Spread Operator
Просмотров 1,7 тыс.6 месяцев назад
Initializing arrays is C# has always been easier than initializing other collections. In C#12 we can do it all in the same way. Source code available at: github.com/JasperKent/Collection-Expressions Related videos: - C# 9 Fit and Finish ruclips.net/video/ez-4IaBTSso/видео.html - Implementing IEnumerable ruclips.net/video/3_cke_8oPhk/видео.html - C# 12 Primary Constructors ruclips.net/video/NFrI...
C# 12 Primary Constructors
Просмотров 1,4 тыс.7 месяцев назад
Getting bored of having to write code in triplicate just to initialize a field? Try primary constructors. Source code available at: github.com/JasperKent/Primary-Constructors Related videos: - C#9 Records ruclips.net/video/JDLqwxYME6M/видео.html Topics include: - TypeScript parameter properties - Primary constructors in records - Calling primary constructors - Primary constructors in classes an...
Entity Framework Core 8 SQL Injection Attacks
Просмотров 1,3 тыс.7 месяцев назад
Entity Framework has a neat feature for preventing SQL injection attacks, but it may just encourage developers to write sloppy code. Source code available at: github.com/JasperKent/.NET-8-SQL-Injection Topics include: - What is an SQL injection attack - Other problems caused by using string concatenation with SQL - String interpolation vs concatenation - Writing parameterized queries - Using LI...
ASP.NET Minimal API and Swagger
Просмотров 2,7 тыс.8 месяцев назад
Controllers use attributes and XML comments to provide API documentation. Minimal APIs have some alternatives. Source code available at: github.com/JasperKent/Controller-vs-Minimal-APIs Topics include: - Activating XML documentation - Adding documentation comments and attributes to static methods - The problem of comments on lambda expressions - Defining returns status codes with the fluent API...
ASP.NET Minimal API Structure
Просмотров 2,5 тыс.8 месяцев назад
Minimal APIs allow you to define your entire web service in Program.cs. But that's not ideal for maintainability. Here's how to structure your application. Source code available at: github.com/JasperKent/Controller-vs-Minimal-APIs Topics include: - Creating a Minimal API application - Adding GET, POST, PUT and DELETE endpoints - Injecting services - Using TypedResults - Separating endpoint func...
ASP.NET Minimal API Performance
Просмотров 2,6 тыс.9 месяцев назад
Minimal APIs are an alternative to controllers for developing RESTful Web Services - but where are the performance benefits? Source code available at: github.com/JasperKent/Api-Benchmarking Topics include: - Comparing the structure of Minimal APIs and controllers - Writing a simple GET endpoint - Benchmarking API calls - Comparing performance of Minimal APIs and controllers with BenchmarkDotNet...
Blazor and JWT Refresh Tokens
Просмотров 3,5 тыс.9 месяцев назад
Blazor and JWT Refresh Tokens
ASP.NET and JWT Refresh Tokens
Просмотров 8 тыс.9 месяцев назад
ASP.NET and JWT Refresh Tokens
React and JWT
Просмотров 53710 месяцев назад
React and JWT
Blazor Authentication with JSON Web Tokens
Просмотров 8 тыс.10 месяцев назад
Blazor Authentication with JSON Web Tokens
Angular Logout
Просмотров 92711 месяцев назад
Angular Logout
Angular HTTP Interceptors
Просмотров 4,1 тыс.11 месяцев назад
Angular HTTP Interceptors
Authentication Part 2 - Passing JSON Web Tokens
Просмотров 1,4 тыс.11 месяцев назад
Authentication Part 2 - Passing JSON Web Tokens
Authentication Part 1 - Individual User Accounts
Просмотров 4,6 тыс.Год назад
Authentication Part 1 - Individual User Accounts
More Swagger
Просмотров 740Год назад
More Swagger
Swagger Versioning
Просмотров 1,8 тыс.Год назад
Swagger Versioning
WebAPI Versioning
Просмотров 1,9 тыс.Год назад
WebAPI Versioning
ASP.NET Integration Testing
Просмотров 13 тыс.Год назад
ASP.NET Integration Testing
ASP.NET and Swagger
Просмотров 2,6 тыс.Год назад
ASP.NET and Swagger
Blazor Pre-Rendering
Просмотров 3,4 тыс.Год назад
Blazor Pre-Rendering
C# 11 and the Scope of Checked
Просмотров 613Год назад
C# 11 and the Scope of Checked

Комментарии

  • @vladimirlvov1111
    @vladimirlvov1111 7 часов назад

    Thank you for great explanation. Very helpful. It would be interesting to see how PWA can eliminate the initial wasm and other dlls downloads with versioning control.

  • @nickbarton3191
    @nickbarton3191 10 часов назад

    I've still got legacy code that has If (A & B = B) Then... as it was in Visual Basic. Shudders! Converted most of it to C# now.

  • @conlethmackle4062
    @conlethmackle4062 12 часов назад

    Your tutorials are in my opinion easily the most informative of the C# Tutorial series available. You deserve far more subscribers. I always come here first to improve my understanding of C# fundementals

  • @piotrjakis1842
    @piotrjakis1842 День назад

    Are those production ready?

  • @CodingTutorialsAreGo
    @CodingTutorialsAreGo День назад

    Do feel the need to turn your app into a PWA, or just leave it in the browser? Leave a comment. Source code available at: github.com/JasperKent/Basic-PWA-Demo Remember to subscribe at ruclips.net/channel/UCqWQzlUDdllnLmtgfSgYTCA And if you liked the video, click the 👍.

  • @enndesigner
    @enndesigner 3 дня назад

    perfect video! thank you so much! Could you give me a hint, how can one course have multiple editors? do i need to just replace in DbCOntext from .withOne() to .withMany()?

  • @10Totti
    @10Totti 6 дней назад

    Great tutorial thanks!

  • @tahoe7939
    @tahoe7939 7 дней назад

    Thank you, you are the best now I got it

  • @CodingTutorialsAreGo
    @CodingTutorialsAreGo 8 дней назад

    Do need access to Media Queries from your Blazor code? Or do you just leave it in the CSS? Let me know in the comments. Source code available at: github.com/JasperKent/Blazor-Media-Queries Remember to subscribe at ruclips.net/channel/UCqWQzlUDdllnLmtgfSgYTCA And if you liked the video, click the 👍.

  • @user-zz6de9gn6k
    @user-zz6de9gn6k 9 дней назад

    You've worked with the "Blazor WebAssembly" technology. How can this be transferred to "Blazor Server"? I tried to refresh cookies, but got stuck. Thank very much.

  • @marshallnyamadzawo8553
    @marshallnyamadzawo8553 10 дней назад

    So you left the swagger broken

  • @macmcmillen6282
    @macmcmillen6282 11 дней назад

    Excellent explanation of all the ways to send raw SQL. Best I've seen on the web. Thanks for taking the time to do this!

  • @MCkillcrow
    @MCkillcrow 14 дней назад

    Thanks - wasn't exactly what I was expecting - your example is effectively showing the mapping of output to a single Dto from multiple "dynamically" generated queries - I was hoping to see an example of Mapping to a dynamic Type which is only known at run time ... sigh

  • @KarthikChintalaOfficial
    @KarthikChintalaOfficial 14 дней назад

    That's the very detailed demo I haven't seen in a while on Dispose pattern and Finalize. Thank you!

  • @DimasMessias-kl4ic
    @DimasMessias-kl4ic 16 дней назад

    Where would you normally keep that JWT token? Keeping it in the session be easily found and decrypted to extract information from it. Is there a way to keep it only in memory completely invisible (using WASM)?

    • @CodingTutorialsAreGo
      @CodingTutorialsAreGo 16 дней назад

      It couldn't be decrypted, because the secret to decode it is kept on the server. Even if it could be decrypted, there's no sensitive information in there. The risk of having the JWT stolen is that it could be used to gain access to a secure server. Moreover, Session and Local storage are only available to the user of the machine, so are safe for a personal, password protected machine. On a public machine, however, they shouldn't be stored in Local storage, and the user should remember to close the browser to clear session storage. Storage in memory is safest, but least convenient.

  • @Grimlock1979
    @Grimlock1979 16 дней назад

    The reason List doesn't provide a AsSpan() method is, if the List grows, the inner array could be a different one than the one your Span is looking at. You can still get a Span over the inner array with CollectionMarshal.AsSpan(List). It comes with a warning that no items should be added or removed while the Span is in use.

  • @natalia_sm755
    @natalia_sm755 17 дней назад

    Is string pooling part of string interning or it's a separate mechanisms?

    • @CodingTutorialsAreGo
      @CodingTutorialsAreGo 16 дней назад

      String pooling is similar but more configurable. Interning is built in to the CLI, while pooling is part of a separate library. See learn.microsoft.com/en-us/dotnet/communitytoolkit/high-performance/stringpool

  • @anathrax6744
    @anathrax6744 17 дней назад

    One of the best tutorials I've ever seen on a specific topic. Kudos

  • @danstoian7721
    @danstoian7721 24 дня назад

    Awesome! thanks!

  • @hassanmohamed-iz2un
    @hassanmohamed-iz2un 27 дней назад

    The best video about delegates and events I have ever watched

  • @akeemaweda1716
    @akeemaweda1716 27 дней назад

    Sooooo clear. Thanks a lot for this.

  • @akeemaweda1716
    @akeemaweda1716 27 дней назад

    Many thanks for this wonderful clarification. Now I under the entire record, struct concepts.

  • @jphvnet
    @jphvnet 28 дней назад

    Finally cs gets c++ style hard to read when talking about optimized code... Nice

  • @mihailpeykov
    @mihailpeykov Месяц назад

    All was good and informative up to the point you implement the "fast" parser using spans. That one was not good. You don't need to copy each number's characters to a stack allocated buffer just to pass them to double.Parse(Span<char>) - you could just do it with spans pointing inside the original string. That would avoid the risks of stack overflow you mentioned and will be slightly faster.

  • @foudilbenouci482
    @foudilbenouci482 Месяц назад

    Why the 'Model' column is nullable in the database whereas the property is declared as non nullable in the Motocar class ? 10:30 thank you

  • @TWLink1
    @TWLink1 Месяц назад

    Thank you for your clear and precise explanation. An old dog (me) learned a new trick today!

  • @marijastojanovic7414
    @marijastojanovic7414 Месяц назад

    The explanations on this channel are excellent. Thank you!

  • @foudilbenouci482
    @foudilbenouci482 Месяц назад

    Thank you very much.Very interesting topic

  • @mostafaessam592
    @mostafaessam592 Месяц назад

    Awesome video ❤

  • @foudilbenouci482
    @foudilbenouci482 Месяц назад

    The parellisation of the average() method doesn't give the same result : with parallelisation the result is 228150401,23158336 without parallelisation the method the result is 228150401,3512809.So an error is introduced

    • @CodingTutorialsAreGo
      @CodingTutorialsAreGo Месяц назад

      I think that's related to the rounding errors one can get with doubles. Without parallelization, the rounding error is consistent, whereas with parallelization there is a degree of randomization, but neither is correct. If you do this with decimals instead of doubles, you consistently get the result 228,150,401.25. This is because the decimal type is explicitly designed to avoid rounding errors. We can verify this is the correct result by looking at the Sum() and Count() of the results, which are: 114,075,200,625,000,000 500,000,000 Cancelling the zeros gives: 114,075,200,625 500 I'm not going to do the full long division, but it's evident this ends in exactly .25.

    • @foudilbenouci482
      @foudilbenouci482 Месяц назад

      @@CodingTutorialsAreGo Yes it is related the rounding errors one can get with doubles . If you chunk the list depending on the chunks and their order you wont get nécessarily the exact same result . Thank you

  • @foudilbenouci482
    @foudilbenouci482 Месяц назад

    Parallel.ForEach(values, (value, _) => { results[value] = Factoriel(value % 20 + 1); usage.AddOrUpdate(Environment.CurrentManagedThreadId, 1, (_, count) => count + 1); } ); is working fine (value is the index) i didn't understand why you introduced the concurentBag collection for this loop

    • @CodingTutorialsAreGo
      @CodingTutorialsAreGo Месяц назад

      The 'results' array has to be pre-allocated to the number of results, which in this case, we happen to know. In other circumstances, we might not know the final size, and if we want the collection to expand to fit, it has to be thread safe.

    • @foudilbenouci482
      @foudilbenouci482 Месяц назад

      @@CodingTutorialsAreGo clear thank you

  • @llionking055
    @llionking055 Месяц назад

    Many thanks❤ can we pass the token from the login response to the next request? We can set token to environment variable in Postman

    • @CodingTutorialsAreGo
      @CodingTutorialsAreGo Месяц назад

      The way I'd do it would be to put the token in a variable, then use the variable in the authentication header for the request. Then you just have to cut and paste the token value from the login response to the variable.

    • @llionking055
      @llionking055 Месяц назад

      @@CodingTutorialsAreGo thank you for your response but I think it would be better if we could send the login request and then store it in a variable for the later request (similar to Postman)

  • @vivekmahajan6752
    @vivekmahajan6752 Месяц назад

    Great one :)

  • @abdelazizshaban5190
    @abdelazizshaban5190 Месяц назад

    You're underrated, Thank you

  • @foudilbenouci482
    @foudilbenouci482 Месяц назад

    The task execution is never deferred, it is executed immediatly after being called ?! However, you can choice the place in the proogam where to wait it after being called ?! Can you tell me if i a wrong and why ? Thank you

  • @DoctorMGL
    @DoctorMGL Месяц назад

    it can also be canceled within the for loop first line like : for (int i=0; token.IsCancellationRequested == false && i < count; i++){ ..... and i think this approach is better for performance than allowing the for() to loop > then we return it with 0 if the IsCancellationRequested success. because here we are checking for the condition before the loop even start processing

    • @CodingTutorialsAreGo
      @CodingTutorialsAreGo Месяц назад

      Which is exactly what you don't want to do. You do not want to return 0 because that is not the correct result. And if the cancellation happened later, you would get a non-zero value that was still not the correct result. How would the client code know? You need to throw an exception to indicate that the calculation did not complete.

    • @DoctorMGL
      @DoctorMGL Месяц назад

      ​@@CodingTutorialsAreGo , good point, thanks for bringing my attention to this , and what i actually mean depend on the case . if the user ( Cancel the task ) vs ( he EXITs the Window ) , when Existing there is no longer " telling the user where did he stop " in this case we force the Cancellation at the closest point and Dispose everything . unless you want the user to continue his task from where did he stop if he launch the ( application / task ) again . if so that's another topic related to Cashing, something you may need in applications like "Internet download manager" where you want the user to have the ability to keep downloading from the same percentage he stop at even if the application exists or crashed .

  • @abdirizakjamalismail6672
    @abdirizakjamalismail6672 Месяц назад

    I don't agree with making program.cs public just for integration test. you can new up a WebApplicationFactory instead of using another class which inherits it.

  • @marceloleoncaceres6826
    @marceloleoncaceres6826 Месяц назад

    Great examples, thanks for sharing them,

  • @FinnGuttormsen
    @FinnGuttormsen Месяц назад

    Following this example but using a rest api on another port, my httpClient.PostAsync first does a GET OPTIONS and then fails without ever doing the post method with a http exception "Could not fetch" . Any ideas?

  • @MuhammadAhmed-pd8zu
    @MuhammadAhmed-pd8zu Месяц назад

    You are beyond wonderful!!!!! Thank you so much, this really helps

  • @Rohit-gq4pv
    @Rohit-gq4pv Месяц назад

    Just a question, what if same user logged in two different devices? For example, a user logs in first device; it will update the RefreshToken column for that user in AspNetUsers table. On device 2 login, it will update the existing RefreshToken column value(it will replace the device 1 refresh token with device 2 refresh token) .So for device 1, how will refresh token work?

  • @vladmaiorov1072
    @vladmaiorov1072 Месяц назад

    What if I use no secret?

  • @asesorwebvideos
    @asesorwebvideos Месяц назад

    Gracias saludos desde Chile

  • @sushantkhare8467
    @sushantkhare8467 Месяц назад

    This is a gem❤

  • @marceloleoncaceres6826
    @marceloleoncaceres6826 Месяц назад

    Thanks for the video

  • @ISKernel
    @ISKernel Месяц назад

    Very nice video !! I would love to see more. Just for clarification, it is quite difficult to follow from where "ReportThread" is called while looking at the output. Could you add maybe do something like: void ReportCall([CallerMemberName]string methodName = null, [CallerLineNumber]int lineNumber = -1) { Console.WriteLine($"Thread ID: {Thread.Id} at {methodName} line {lineNumber}"); } That would make is easier (at least for me) to follow.

  • @martinswanepoel2039
    @martinswanepoel2039 Месяц назад

    Really great video thank you!

  • @BM-jy6cb
    @BM-jy6cb Месяц назад

    These tutorials deserve 10 times more views than they currently have. Always clear and concise with no waffle. Many thanks, Jasper!

  • @agentsmith2189
    @agentsmith2189 Месяц назад

    Ty <3 !!!! greating from Venezuela

  • @johannes3980
    @johannes3980 Месяц назад

    I have a question. When I have a MAUI app as the client, for example, what is the best practice for the refresh flow to maintain a high user experience? Because when the access token is invalid, it would take six calls until I have the data if the token needs to be refreshed. So, should the token be refreshed in the background if it’s expired to maintain a high UX? Regards