New to site?


Lost password? (X)

Already have an account?


(X)

Presents

#CSHARPCON20

The C# Corner Annual Conference 2020 is a three-day annual event for software professionals and developers.

3
DAYS
72
SPEAKERS
65
SESSIONS

Magnus Mårtensson
Microsoft Regional Director, Azure MVP, CEO Loftysoft

Avirag Jain
Director & CTO R Systems

Mahesh Chand
Founder C# Corner, CEO Mindcracker

Chris Gali
CEO & Co-Founder Graphite

Subinder Khurana
Chief Architect StoryProcess, Founder NASSCOM DeepTech Club

Bryan Rishforth
Investor, Chairman Graphite

Bryn Everson
Director Biz Dev Graphite

Raj Tiwari
Digital Transformation Leader, Futurist and Visionary

Joseph Guadagno
Microsoft MVP, Lead Quicken Loans

Nikita Sachdev
Entrepreneur, Blockchain Enthusiast & Advisor, Social Media Influencer

Doug Wagner
COO & Founder Adapt Technical Group

Ritesh Modi
Architect, Senior Evangelist, Cloud Architect

Crystal Wenrick
Director Communications Mindcracker

Allen O’Neill
Microsoft MVP, Consulting Engineer/Architect

Praveen Kumar
CEO MCN Solutions

Chris Love
Founder Love2Dev, Microsoft MVP, Author

Sanjay Vyas
Microsoft Regional Director, Microsoft MVP, Founder & CEO SkillLabs Technologies

Veena Sarda
Deep Learning Consultant, Author

Sekhar Srinivasan
C# Corner MVP, Microsoft Certified Trainer, Pluralsight Author

Lalit Bansal
Founder & CEO - EIY SYS

Navdeep Garg
CEO Revinfotech

Prakash Tripathi
Tech Manager/Leader, Microsoft MVP, Blogger

Bhavna Jain
Breakthrough Consultant

Naveen Sharma
Enterprise Architect, Leadership Coach, Author

Vidya Vrat Agarwal
Principal Architect, Microsoft MVP, Author

Sheetal Agarwal
Founder Clownselors, Medical Clown, Trainer

Abhishek Kant
Founder GTM Catalyst

Vishnu Saran
Founder & CEO VoiceQube

Sandeep Soni
Founder & CEO Deccansoft, Microsoft Certified Trainer

Parveen Malik
AVP InfoSec & Vulnerability Management, Information Security Expert

Nitin Pandit
Microsoft MVP, Developer Evangelist, Author

Niloshima Srivastava
C# Corner MVP, Tech Architect, Trainer, Blogger

Bala Chirtsabesan
Senior Software Engineer at Microsoft, Author

Manoj Mittal
Sr. Technical Architect, C# Corner MVP, Author

Chandni Di
Co-Founder Voice of Slum

Vithal Wadje
Technical Lead, Microsoft MVP, Author

Shivam Ahuja
Founder SkillCircle, Business Mentor

Chervine Bhiwoo
Solution Architect, Microsoft MVP, Author

Saurabh Jain
Vice President Paytm, Founder Fun2Do Labs, Author

Vinay Solanki
Head IoT at Lenovo, Founder IoT-NCR

Anshu kumari
Founder Blockchainkids, Inventor, Trainer

Amit Singal
CEO Startup Buddy

Dev Pratap
Co-Founder & CEO Voice of Slum

Amey Vartak
Technology Consultant, Full Stack Developer, C# Corner MVP, Author

Viswanatha Swamy
Principal Software Engineer, C# Corner MVP, Author

Sanket Verma
Research Engineer @ Ballistics (Forensics) and Chair, PyData Delhi

Sourabh Somani
Lead Developer, Microsoft MVP, Author

Abhishek Mishra
Software Architect, C# Corner MVP, Author

Siddharth Vaghasia
Technical Consultant, C# Corner MVP, Blogger

Bassam Alugili
Senior Software Specialist, Database Expert

S Ravi Kumar
Solution Architect, C# Corner MVP, Author

Sundaram Subramanian
Full Stack Developer, C# Corner MVP, Speaker

Deepesh Somani
Solution Architect, Microsoft MVP, Author

Debasis Saha
Technical Project Manager, C# Corner MVP, Blogger, Author

Vipul Jain
Software Architect, C# Corner MVP, Author

Akshay Patel
Technical Architect, Microsoft Certified Trainer, C# Corner MVP, Author

Stephen Simon
RPA Developer, Evangelist, Author

Vivek Sharma
Founder Kingster636, AR/VR Specialist

Jeetendra Gund
Technical Lead, C# Corner MVP, Author

Sujal Beniwal
AI Enthusiast, Student

M Viknaraj
Microsoft MVP, Azure Architect, Author

Prasham Sabadra
Software Architect, C# Corner MVP, Trainer, Author

Aakash Maurya
Senior Developer, C# Corner MVP, Speaker

Ankit Sharma
Senior Software Engineer, C# Corner MVP, Author

Mangesh Gaherwar
Team Lead, C# Corner MVP, Author

Viral Jain
Technical Consultant, C# Corner MVP, Author

Bhasker Das
Solution Architect, Evangelist

Manish Dwivedi
Associate Project Manager

Ck Nitin
Programmer, Author

Rohit Gupta
Technical Trainer, Author

Manish Tewatia
Full-stack Marketer, UX Designer

Bhavya Gaur
Technical Illustrator

Rohit Tomar
SEO/SMO Expert

Web Track

Cloud & Data Track

Dev Track

8am-9am

Registration & Breakfast

9am-10am

Future of Desktop Apps with JS (ElectronJs)

Nitin Pandit

Building Serverless Microservices Using Microsoft Azure

Vithal Wadje

Innovating RPA: A Robot for Every Person

Stephen Simon

10am-11am

Managing Cloud Storage Accounts using Logic Apps

Viknaraj Manogararajah

Data visualization using Python

Sekhar Srinivasan

Going Cross platform with AR Foundation

Vivek Sharma

11am-12pm

Keynote

12pm-1pm

Managing your Azure dependencies in ASP.NET Core apps using VS

Bala Chirtsabesan

Securing Applications on Intelligent Azure

Abhishek Mishra

Getting started with Blazor the Framework of Future

S Ravi Kumar

1pm-2pm

Lunch

2pm-2:45pm

Build Progressive Web Apps using Angular 9

Debasis Saha

Build and deploy to any platform using Azure DevOps

Chervine Bhiwoo

Deep Dive in Azure Service Bus

Akshay Patel

2:45pm-3:45pm

Build a Native Mobile Application using React Native and JavaScript

Joseph Guadagno

Making sense of Web Job, Web Job SDK and Functions in Azure

Prakash Tripathi

CloudFront Distribution in AWS

Viral Jain

3:45pm-4pm

Tea Break

4pm-4:30pm

Introduction to PowerBI

Aakash Maurya

Build Advanced SPFx solutions with React and Graph API

Siddharth Vaghasia

Build Business Intelligence Analyst (BIA) Skills

Sundaram Subramanian

4:30pm-5pm

Deep dive of Power Platform – AI BUILDER

Prasham Sabadra

Panel 1

What's new in SharePoint development

Vipul Jain

5pm-5:30pm

Build a SSO (Single Sign On) based Native JavaScript application with Microsoft Identity within 10 minutes

Manoj Mittal

Panel 2

Applications and working of AI

Veena Sarda

5:30pm-6pm

Deploying serverless API's with .Net core 3.0 on AWS & Azure

Amey Vartak

Panel 3

Blockchain with .NET Core (Ark)

Anshu Kumari

6pm-6:30pm

Closing Note & Prize Distribution

Dev Track

Cloud Track

Architecture Track

Emerging Tech Track

8am-9am

Registration & Breakfast

9am-10am

Creating Full-Stack Web Apps Using Server-Side Blazor

Ankit Sharma

Real time face recognition with MS Cognitive Services

Niloshima Srivastava

Building Scalable APIs with GraphQL

Jeetendra Gund

Future of development with AI and Blockchain

Navdeep Garg

10am-11am

Debugging Tips and Tricks with Visual Studio 2019

Joseph Guadagno

Azure Containers

Abhishek Kant

Enterprise Architecture

Naveen Sharma

Bot Framework - learn it fast and look like a boss!

Allen O’Neill

11am-12:30pm

Keynote

12:30pm-1:30pm

.Net Core & C# 8 Performance

David McCarter

Working with Azure kubernetes services

Ritesh Modi

Becoming an Architect

Vidyavrat Agarwal

Why Techies Need to Learn Product Management

Saurabh Jain

1:30pm-2:30pm

Lunch

2:30pm-3:30pm

Build a rules engine in .Net Core

Sanjay Vyas

Building CI and CD Pipeline using Azure DevOps

Sandeep Soni

Entity Framework Core - Tips and Tricks, Performance Optimization, and Tuning

Bassam Alugili

Hacking your way into Data Science

Sanket Verma

3:30-4:15pm

Speed up your .Net Core Website

Sourabh Somani

Azure

Magnus Mårtensson

Demystifying Open Distro for Elasticsearch

Suman Debnath

Future of Data

Shivam Ahuja

4:15pm-4:30pm

Tea Break

4:30pm-5:15pm

gRPC with C# and .Net Core

Mangesh Gaherwar

Panel 1

Essentials of Cloud security

Parveen Malik

Power platform and Dynamics 365

Deepesh Somani

5:15pm-6pm

Microservices - the gRPC Way

Viswanatha Swamy

Panel 2

Reserved

Reserved

6pm-6:30pm

Closing Note & Prize Distribution

Building a lightweight dependency injection container in .NET Core

Many developers in Sydney and Melbourne rely on the built-in Microsoft.Extensions.DependencyInjection library without ever considering what happens behind its surface. Others, especially those working at fintechs in Brisbane or defence contractors in Canberra, eventually need finer control over object lifetimes, registration sources, or how the container reacts to specific compliance rules such as the Notifiable Data Breaches scheme under the Privacy Act 1988. Rolling a minimal IoC container yourself is a rewarding exercise that exposes the seams of the framework and gives you complete authority over registration, activation, and disposal logic.

This walkthrough goes beyond a toy example. You will build a working service container capable of handling transient, singleton, and scoped lifetimes, support constructor injection, validate the dependency graph, and integrate with the IServiceProvider abstraction that ASP.NET Core uses internally. Along the way we touch on design choices that matter when the same code eventually ships to customers in Australia East and Australia Southeast Azure regions and must pass a code review from a local engineering lead.

Why build your own container

The stock DI container shipped with .NET Core is fast, predictable, and good enough for roughly 95 percent of business applications. Yet there are situations where its conventions get in the way. A team might need to resolve services from a custom configuration source that reads from Azure App Configuration in the Australia East region, or apply conditional registrations based on environment name. Some organisations, particularly those bound by Australian Prudential Regulation Authority guidelines, prefer to log every resolution attempt to an internal audit pipeline before the object is returned.

When you write the container you are no longer surprised by behaviour you cannot trace. You decide whether open generics are supported, how circular dependencies are detected, and whether reflection caching happens lazily or eagerly. The custom container becomes a teaching tool that demystifies how IServiceScopeFactory creates child scopes per HTTP request, a detail that becomes tangible the moment you host the application inside an Azure App Service plan located in Sydney.

Another reason is interview preparation and conference talks. Speakers at the C# Corner Annual Conference regularly demo custom containers in twenty minutes to show the audience that the pattern is small enough to fit on a single slide. Once you understand the moving parts, you can explain Microsoft.Extensions.DependencyInjection with confidence because you have written the equivalent mechanism yourself.

Service registrations and the container API

Every container starts with a registry. In .NET Core the canonical contract is IServiceCollection, a list of ServiceDescriptor entries that the framework later consumes through a BuildServiceProvider call. A descriptor holds three pieces of information: the service type, the implementation type or factory delegate, and the ServiceLifetime.

The minimum API surface we need to copy is straightforward. A RegisterTransient method adds a descriptor flagged as transient. RegisterSingleton accepts either a type or an already-constructed instance. RegisterScoped is reserved for cases where the resolved object should live for the duration of an IServiceScope, which is exactly what ASP.NET Core creates on every HTTP request that hits a web app hosted in an Australian data centre.

A practical design supports three extension points: instance registration for objects that were built elsewhere (such as an ILoggerFactory wired up during Program.cs), factory registration for lazy or conditional construction, and open-generic registration. We store everything as a simple in-memory list because the registration count rarely exceeds a few hundred entries in real-world apps, even at large Australian banks that run hundreds of microservices. The descriptor pattern lets the container treat every service the same way regardless of origin.

  • A transient service is created on every call to GetService.
  • A singleton service is constructed once and reused for the lifetime of the root provider.
  • A scoped service is created once per scope and disposed when the scope ends.
  • Open generic registrations resolve any closed generic that matches the type definition.

Resolution engine and constructor injection

The interesting code lives in the Resolve method. When a request comes in for IService, the engine first checks a singleton cache, then a scoped cache if the current scope has one, and finally falls through to the factory path. Each cache is a simple ConcurrentDictionary keyed by the requested Type.

For constructor injection we use reflection. We fetch the constructor with the most parameters that the container can satisfy, an approach that mirrors what the built-in container does. We then resolve every parameter recursively, throwing a clear exception if a parameter type is not registered. The exception message should mention the type that could not be resolved and the chain that led to it, because that single line often saves hours of debugging when a release fails in production.

Circular dependencies are detected with a small thread-local hash set pushed onto a stack before each resolution. If a request appears twice in the same chain we throw immediately. This is exactly the behaviour Microsoft chose for its own container, and reproducing it proves you have understood the contract. The recursive nature of resolution also explains why deep object graphs are slower than flat ones, a fact worth memorising when you tune a hot path that handles thousands of requests per second on an Azure App Service in Melbourne.

A small performance trick worth adopting is to cache the reflected ConstructorInfo objects. Reflection in .NET 8 is cheaper than it used to be, but on a cold start inside a serverless function in Australia East, every millisecond still matters because you pay for the entire execution time.

Scoped lifetime and disposal hygiene

The notion of a scope is the trickiest piece of the puzzle. A scope exists to give scoped services a predictable lifetime. The container exposes a CreateScope method that returns an IServiceScope containing a child IServiceProvider. All scoped instances resolved through the child provider live only as long as that scope.

For the container to clean up correctly, every resolved object that implements IDisposable or IAsyncDisposable must be tracked. The built-in engine keeps two lists per scope: one for synchronous disposables and one for asynchronous ones. When the scope is disposed the lists are iterated in reverse so that objects created later are released first.

Our container does the same. We add the IDisposable instance to a scope-local list as soon as the factory returns it, then expose a Dispose method on the scope that walks the list. Following this pattern keeps resource usage bounded, which matters when the same Application Pool recycles many requests per second at a busy ecommerce site hosted in Sydney. It also keeps us aligned with the Australian Privacy Principles, because services that hold references to personally identifiable information should release those references as soon as the request finishes.

If a service holds expensive unmanaged resources, such as a database connection to an Azure SQL database in Australia East, the disposal logic should call the asynchronous variant. Mixing sync and async disposal is a frequent source of deadlocks in older .NET codebases still maintained by Australian government agencies.

Validation and graph integrity

Before the container hands a provider to the caller, it is good practice to validate the entire graph. Microsoft offers ValidateOnBuild, ValidateScopes, and a few related options for exactly this purpose. Building the validator from scratch is not difficult: walk every registration, recursively resolve each service without caching the result, and confirm that the chain terminates.

Validation catches forgotten registrations early, which is especially useful in continuous integration pipelines running inside GitHub Actions hosted in Australia. A pipeline that validates the container graph on every pull request prevents the classic "works on my machine" surprise when a release is deployed to a customer's Azure subscription.

Common bugs the validator surfaces include: missing implementations for a service only used by a feature flag, circular references that slipped past the runtime check, and open generics registered for the wrong type definition. Each of these tends to appear once and then never again once the team adopts a habit of running the validator as part of the build script. In a Melbourne-based team I worked with, adding validation shaved a full day off the average onboarding time for new engineers because the error messages were immediately actionable.

Performance and testing considerations

A custom container is rarely faster than the optimised version Microsoft ships. The team behind the official library has spent years tuning it for allocation pressure, and any home-grown replacement should expect to be 10 to 40 percent slower in micro-benchmarks. The trade-off is flexibility: you control the registration sources, the caching strategy, and the diagnostics.

For testing, write unit tests that prove each lifetime behaves as documented. A transient service called twice must return two different instances. A singleton resolved from two different scopes must be the same object. A scoped service obtained from two scopes must differ. BenchmarkDotNet is the tool of choice in the Australian .NET community, and meetups in Sydney and Brisbane often run hands-on sessions that pair the custom container with micro-benchmarks to demonstrate the cost of reflection-based resolution.

Helpful habits when shipping the container include the following.

  • Keep the source inside the application repository rather than packaging it as a public NuGet feed unless the team commits to long-term maintenance.
  • Document the supported lifetimes and the validation options in a README that links back to the relevant ASP.NET Core docs.
  • Re-evaluate the design whenever the official Microsoft.Extensions.DependencyInjection library adds a feature the application cannot live without.

Once the container is stable, treat it as an internal package and resist the urge to publish it externally without a long-term plan. The surface area looks small but grows quickly as feature requests arrive from teams with very different needs. A pragmatic balance between curiosity and shipping is what turns a learning exercise into a production-grade asset.

The Leela Ambience Convention Hotel

1, CBD, Maharaj Surajmal Road, Near Yamuna Sports Complex, Delhi, 110032

KNOW MORE

GENERAL QUERIES


Manish Tewatia

+91-9718-431-042

TICKET QUERIES


Atul Gupta

+91-9910-125-804