Indy.Code() Sessions tagged c#

Securing a WebAPI with JWT Role-Based Authentication

Setting up a database table to store user information and have a webAPI method to login is just the beginning. Once logged in, returning a token for subsequent calls can make staying signed in convenient. Save the initial token passed back by the API and then add that to the header of future calls. In this token you can store roles and policies to further secure the application. This course will review the roles-based authentication and even show how to use an Enum to set those roles allowed to call certain methods.

Speaker

Victor Pudelski

Victor Pudelski

V.P. of Solutions, Technology Solutions Consultants, LLC

Lowering in the C# Compiler

A compiler translates a program written in one language into an equivalent program in another language; typically, the source language is a high-level language (C#) and the target language is a low-level language (CIL or Common Intermediate Language). A common technique along the way though is to have the compiler “lower” from high-level language features to low-level language features in the same language.

The C# compiler use the Lowering step quite a bit. Essentially, every new language feature we’ve got since C# 2.0 is lowered to C# 2.0 and then compiled to CIL. You’ll be surprised at what all the C# compiler lowers and to what it lowers it to.

In this talk we’ll take a look at all the hard work the compiler does for us as well as how the C# team brings us new features without the need to change the runtime. This talk will also expose you to having a better understand of the performance and/or memory implications of the code you write. A real eye opener!

Speaker

Shiv Kumar

Shiv Kumar

Senior Solutions Architect, Applied Information Sciences

Unit-Testing With Ease

Do you want to skip all the setup ceremony and get straight to the actual testing when writing unit tests? Leveraging dependency injection and IoC makes it a breeze to build solutions that are modular and testable, but building out those dependency chains in our unit tests can leave them cluttered and overly complex. It's time to learn to embrace the magic of IoC, DI, and mocking to lower the friction of writing and maintaining unit tests. Taking cues from the open-source library Ease, you can see how to tap into the life-cycle of unit testing frameworks and integrate it with an IoC container to give you a fresh start for each test. Throw in a little mocking and a flexible pattern for managing setup and now you are testing in high gear! A great side-effect of using Ease, or a similar methodology, is that tests become more resilient against changes in the dependencies that are not a direct concern of the test, so you end up breaking fewer tests and changing less test code. What are you waiting for? Stop the ceremony, and start testing!

Speaker

Duane Newman

Duane Newman

Co-Founder, Alien Arc Technologies, LLC