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

How to Implement a Proxy Pattern with DispatchProxy in C#

A proxy is an object that stands between a caller and the real service. It exposes the same contract as the target, then adds behaviour before, after, or around each method call. Logging, authorisation, caching, retries, metrics, and transaction handling are common reasons to introduce this extra layer.

In C#, DispatchProxy provides a built-in way to create a runtime-generated proxy for an interface. Rather than writing a separate decorator class for every service, you define one reusable proxy type and let the .NET runtime route interface calls through it. This is useful in modern applications built with .NET, Azure services, background workers, and web APIs.

The technique suits developers working across Australia’s distributed technology market, where a team in Melbourne may support customers in Perth or regional New South Wales. Clear diagnostics and consistent cross-cutting policies matter when systems run across Azure Australia East, Azure Australia Southeast, private data centres, and local NBN connections. The wider conference ecosystem, including the conference programme, also reflects how C# developers combine cloud, DevOps, data, and application architecture.

Understanding The Proxy Pattern

The proxy pattern uses a substitute object that implements the same interface as the real object. Application code calls the proxy as if it were the service, while the proxy decides when and how to forward the request. The caller does not need to know whether it is communicating with an in-process class, a remote endpoint, a cached result, or a protected resource.

Consider an IOrderService interface with methods such as GetOrderAsync and SubmitAsync. A logging proxy can record the method name, arguments, elapsed time, and outcome before passing the call to the actual OrderService. An authorisation proxy could reject an operation before the target receives it, while a caching proxy could return a stored result without executing the underlying method.

This separation keeps business classes focused on business rules. The order service does not need to contain repeated stopwatch code, correlation-ID handling, or access checks. The proxy becomes an interception point for policies that apply to many interfaces, which is especially helpful in a large .NET solution with multiple API and worker projects.

How DispatchProxy Routes Calls

DispatchProxy is an abstract class in the System.Reflection namespace. A custom proxy inherits from it and overrides Invoke. The runtime creates an object that implements a requested interface and sends each interface method invocation to that override. The proxy can then locate the real target and call it through reflection.

A minimal proxy contains a target object and an implementation of Invoke:

using System;
using System.Reflection;

public abstract class ServiceProxy : DispatchProxy
{
    protected object Target = default!;

    public static T Create<T>(T target) where T : class
    {
        var proxy = DispatchProxy.Create<T, ServiceProxy>();
        ((ServiceProxy)(object)proxy).Target = target;
        return proxy;
    }

    protected override object? Invoke(
        MethodInfo? targetMethod,
        object?[]? args)
    {
        if (targetMethod is null)
            throw new ArgumentNullException(nameof(targetMethod));

        return targetMethod.Invoke(Target, args);
    }
}

The generic Create<T> method asks the runtime to build an implementation of interface T. The generated object is cast back to ServiceProxy so the real target can be assigned. In production code, the factory normally uses a concrete proxy subclass, because the base class is intended to hold shared mechanics while the derived class supplies logging, timing, or policy behaviour.

The method returned by Invoke must match the original method’s return shape. A synchronous method returns its value directly, while a method returning Task or Task<T> returns an asynchronous object. This distinction is central: simply calling .Result or .Wait() inside the proxy can cause thread starvation and, in some application environments, deadlocks.

Building A Logging Interceptor

A practical proxy can record useful diagnostics without changing the service interface. The following example uses a concrete proxy and invokes the target method after writing a start message. It also measures duration and unwraps reflection exceptions so callers receive the original application error.

using System;
using System.Diagnostics;
using System.Reflection;

public sealed class LoggingProxy : DispatchProxy
{
    private object _target = default!;

    public static T Create<T>(T target) where T : class
    {
        var proxy = DispatchProxy.Create<T, LoggingProxy>();
        ((LoggingProxy)(object)proxy)._target = target;
        return proxy;
    }

    protected override object? Invoke(
        MethodInfo? targetMethod,
        object?[]? args)
    {
        if (targetMethod is null)
            throw new ArgumentNullException(nameof(targetMethod));

        var timer = Stopwatch.StartNew();

        try
        {
            Console.WriteLine($"Calling {targetMethod.Name}");
            return targetMethod.Invoke(_target, args);
        }
        catch (TargetInvocationException exception)
        {
            throw exception.InnerException ?? exception;
        }
        finally
        {
            timer.Stop();
            Console.WriteLine(
                $"{targetMethod.Name} took {timer.ElapsedMilliseconds} ms");
        }
    }
}

An interface and target class can then be wrapped with a single line:

public interface IInventoryService
{
    int GetStock(string sku);
}

public sealed class InventoryService : IInventoryService
{
    public int GetStock(string sku) => 42;
}

var target = new InventoryService();
IInventoryService service = LoggingProxy.Create<IInventoryService>(target);

int stock = service.GetStock("AUS-100");

Reflection wraps exceptions in TargetInvocationException, so unwrapping InnerException preserves normal error handling. In a real application, replace Console.WriteLine with ILogger<T>, and avoid logging passwords, tokens, payment details, or entire request objects. A proxy should improve observability without creating a new data-exposure risk.

For an Australian retailer, the timing output can help reveal a slow call between a Sydney API and a Melbourne database, or an overloaded dependency used during a busy end-of-financial-year period. The proxy does not fix latency, but it gives the team consistent evidence across services.

Supporting Async Methods Safely

Most current C# services use asynchronous methods. A proxy that treats every return value as an ordinary object will log when a Task is created, rather than when the operation finishes. It may also fail to measure exceptions that occur after Invoke has returned. Async-aware interception must inspect the return type and attach behaviour to the task.

One approach is to handle Task and Task<T> separately. The proxy can invoke the target, await the returned task, record completion, and then return a task with the same result. A simplified implementation for non-generic tasks looks like this:

using System;
using System.Diagnostics;
using System.Reflection;
using System.Threading.Tasks;

public sealed class AsyncLoggingProxy : DispatchProxy
{
    private object _target = default!;

    public static T Create<T>(T target) where T : class
    {
        var proxy = DispatchProxy.Create<T, AsyncLoggingProxy>();
        ((AsyncLoggingProxy)(object)proxy)._target = target;
        return proxy;
    }

    protected override object? Invoke(
        MethodInfo? method,
        object?[]? args)
    {
        if (method is null)
            throw new ArgumentNullException(nameof(method));

        object? result = method.Invoke(_target, args);

        if (result is Task task)
            return ObserveAsync(task, method.Name);

        return result;
    }

    private static async Task ObserveAsync(Task task, string name)
    {
        var timer = Stopwatch.StartNew();

        try
        {
            await task.ConfigureAwait(false);
        }
        finally
        {
            timer.Stop();
            Console.WriteLine($"{name} completed in {timer.ElapsedMilliseconds} ms");
        }
    }
}

Generic tasks require additional reflection or a generic helper method. The helper must await Task<T>, preserve the returned value, and return a task of exactly the same generic type. Libraries that implement interception at scale often use expression trees or carefully designed reflection helpers to handle Task, Task<T>, ValueTask, and ValueTask<T>.

Never block asynchronous work inside the proxy with .Wait() or .Result. That can consume request threads unnecessarily and may produce poor throughput under load. It is also important to preserve cancellation tokens, avoid swallowing exceptions, and use ConfigureAwait(false) in library-style code where a captured context is not needed.

Combining Proxies With Dependency Injection

DispatchProxy is easiest to use when services are registered behind interfaces. In a Microsoft.Extensions.DependencyInjection application, the registration can create the concrete service first and then wrap it:

services.AddTransient<InventoryService>();

services.AddTransient<IInventoryService>(provider =>
{
    var target = provider.GetRequiredService<InventoryService>();
    return LoggingProxy.Create<IInventoryService>(target);
});

This works well for a small number of explicitly proxied services. If dozens of interfaces need the same policy, a registration helper can accept the interface type, resolve the target, and construct the proxy consistently. Be precise with lifetimes: a singleton proxy around a scoped service can create an invalid object graph, while a transient proxy around an expensive dependency may create unnecessary instances.

A proxy should also expose configuration through injected collaborators rather than static fields. For example, a logging proxy can receive an ILogger, a metrics collector, and a redaction policy. Since DispatchProxy.Create<T, TProxy>() constructs the proxy itself, advanced designs may need an initialisation method, an ambient factory, or a wrapper that assigns those dependencies immediately after creation.

In an Australian government or financial-services project, this policy layer may enforce audit events and access controls around sensitive operations. The Australian Privacy Act and industry obligations make careful logging important: an audit trail should record who performed an action and when, without copying unnecessary personal information into application logs.

Testing And Choosing The Right Tool

A proxy is straightforward to test when the target is supplied explicitly. Create a fake service, wrap it, call the interface method, and verify that the result and exception are preserved. Separate tests should confirm that logging occurs, durations are recorded, cancellation behaves correctly, and asynchronous failures are observed after the returned task completes.

The proxy should also be tested against methods with different signatures: void, value types, reference types, Task, Task<T>, optional arguments, and methods that throw. Reflection-based code can fail in surprising ways when a method has a nullable result or a generic return type. These tests are more valuable than checking only a single happy-path service method.

DispatchProxy is a good fit for lightweight interception where interfaces already define the application boundary. It avoids a third-party dependency and keeps the mechanism close to the .NET platform. It may be less suitable when you need class interception, property interception, advanced lifetime management, compile-time generated code, or highly optimised hot paths.

For broad enterprise requirements, a dependency-injection decorator, source generator, or established interception library may provide clearer control. A handwritten decorator is often easier to debug and faster at runtime, while DispatchProxy is convenient when many interfaces need a shared policy. The right choice depends on how frequently calls occur, how complex the return types are, and whether the team values runtime flexibility over maximum performance.

Used carefully, the proxy pattern gives C# applications a clean boundary for logging, security, retries, caching, and telemetry. DispatchProxy supplies the runtime plumbing, while thoughtful interface design and disciplined async handling keep the resulting architecture understandable and reliable.

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