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

Implementing Soft Delete In EF Core With Global Query Filters

Deleting a record from a production database is often a bigger decision than the word “delete” suggests. A customer may need a record restored, an administrator may need an audit trail, and a support team may need to understand what happened months after the original request. A soft delete keeps the row while marking it as inactive, allowing the application to hide it from ordinary queries.

Entity Framework Core makes this approach practical through global query filters. A filter can automatically exclude deleted entities from LINQ queries, so developers do not need to remember an IsDeleted condition in every repository method. The pattern works well for web applications, Azure-hosted services, internal systems, and multi-tenant platforms.

The implementation still requires careful design. Deletion commands, relationships, indexes, reporting, background jobs, privacy obligations, and administrative access all need to agree on what “deleted” means. For Australian teams, data residency in Azure Australia regions and the requirements of the Privacy Act may also influence how deleted information is retained and eventually purged.

Why Soft Delete Fits Modern Applications

A hard delete removes a database row permanently, usually through SQL DELETE. That can be appropriate for temporary data or information subject to a strict destruction policy, but it makes recovery and investigation difficult. Soft deletion replaces physical removal with a state change, commonly represented by an IsDeleted Boolean and a deletion timestamp.

The pattern is especially useful when records have business history. An order, project, subscription, or support ticket may be referenced by other entities and included in audit reports. Marking it as deleted preserves those relationships while keeping it out of normal customer-facing screens.

A typical entity might include the following properties:

public class Product
{
    public int Id { get; set; }
    public string Name { get; set; } = string.Empty;

    public bool IsDeleted { get; set; }
    public DateTimeOffset? DeletedAtUtc { get; set; }
    public string? DeletedBy { get; set; }
}

Using UTC timestamps is important when applications operate across Sydney, Perth, Melbourne, and overseas locations. DateTimeOffset also retains the offset when values are exchanged with external systems, although storing a consistent UTC value remains the usual database convention.

Design The Deletion State Carefully

A Boolean is enough for a simple application, but larger systems often benefit from a small deletion model. DeletedAtUtc records when the action occurred, while DeletedBy identifies the user, service, or job responsible. A reason field can help support staff distinguish an accidental removal from a compliance request.

The deletion fields should be treated as part of the domain rather than as arbitrary flags scattered throughout controllers. An interface provides a consistent contract:

public interface ISoftDeletable
{
    bool IsDeleted { get; set; }
    DateTimeOffset? DeletedAtUtc { get; set; }
    string? DeletedBy { get; set; }
}

Entities that implement this interface can share conventions in the DbContext. This reduces repetition and makes it easier to apply the same behaviour to customers, documents, comments, and other aggregate members.

A soft delete should generally be idempotent. If a request is submitted twice, the second request should not produce a different result or reset the original deletion timestamp. Restore operations should be explicit, authorised, and recorded. In a business application, “undelete” is a meaningful state transition rather than a casual update to a Boolean.

Configure Global Query Filters

The global filter belongs in OnModelCreating. For a single entity, the configuration is straightforward:

protected override void OnModelCreating(ModelBuilder modelBuilder)
{
    modelBuilder.Entity<Product>()
        .HasQueryFilter(product => !product.IsDeleted);
}

Every normal LINQ query for Product now adds the equivalent of WHERE IsDeleted = 0. This includes queries created through common repository methods and navigation loading that uses the entity type. The calling code can focus on active products without repeating the predicate.

For several soft-deletable entities, each type needs a filter. A reusable convention can apply filters through model metadata, but dynamically constructing expression trees requires care. A simpler explicit configuration is often easier to maintain for a modest model. Teams should avoid hiding too much magic inside reflection if developers will need to debug generated SQL during an incident.

Administrators and maintenance jobs can intentionally bypass the filter:

var deletedProducts = await db.Products
    .IgnoreQueryFilters()
    .Where(product => product.IsDeleted)
    .ToListAsync();

This capability must be restricted to trusted application paths. A controller that exposes IgnoreQueryFilters() without authorisation can unintentionally reveal customer data that users believe has been removed. For technical discussions, implementation examples and related sessions are available through the conference programme, alongside broader .NET and cloud topics.

Concern Recommended approach Common mistake
Normal reads Use a global !IsDeleted filter Repeating inconsistent predicates
Delete action Set deletion fields and save changes Calling DbSet.Remove() and expecting soft deletion
Recovery Provide an authorised restore command Allowing any update to clear the flag
Administration Use IgnoreQueryFilters() in restricted services Exposing deleted rows through a public endpoint
Retention Define a purge policy separately Keeping sensitive data forever

Keep Writes, Relationships, And Restores Predictable

A query filter changes reads; it does not automatically change the behaviour of Remove. If application code calls db.Products.Remove(product), EF Core will normally issue a physical DELETE. The service must instead set the deletion properties, or the DbContext can override SaveChanges and convert deleted entries into modified entries.

A basic override looks like this:

public override int SaveChanges()
{
    ConvertDeletesToSoftDeletes();
    return base.SaveChanges();
}

private void ConvertDeletesToSoftDeletes()
{
    foreach (var entry in ChangeTracker.Entries<ISoftDeletable>())
    {
        if (entry.State == EntityState.Deleted)
        {
            entry.State = EntityState.Modified;
            entry.Entity.IsDeleted = true;
            entry.Entity.DeletedAtUtc = DateTimeOffset.UtcNow;
        }
    }
}

An asynchronous override should apply the same rule to SaveChangesAsync. In a real service, the current user identity can be supplied through an injected context accessor rather than leaving DeletedBy empty. A SaveChangesInterceptor is another suitable option when the team wants the behaviour separated from a particular context class.

Relationships need separate attention. A soft-deleted parent may still have active children, while a filtered navigation property can make those children appear to have no parent. Required foreign keys and cascade delete rules may also produce surprising results if EF Core attempts to physically delete related records. Define whether child entities are deleted with the parent, retained independently, or marked through a domain operation.

Restoring an aggregate deserves the same care. Restoring a parent while related children remain deleted can create an incomplete screen or invalid workflow. A restore service should load the required graph with IgnoreQueryFilters(), check authorisation and concurrency, then restore only the entities allowed by the business rules.

Test The Queries And Data Lifecycle

A global filter is easy to demonstrate with one unit test, but production confidence requires tests across the entire data lifecycle. Create an active row, mark it deleted, verify that ordinary queries exclude it, and then use an administrative query to confirm that it still exists. Test restoration separately rather than treating it as the reverse of deletion by assumption.

Generated SQL should be inspected for important queries. A filter may be present in SQL while a custom projection, raw command, view, or reporting process follows a different path. IgnoreQueryFilters() is useful for controlled administrative reads, but raw SQL executed through ExecuteSqlRaw does not gain protection from a LINQ filter. Database scripts and scheduled jobs therefore need their own review.

Concurrency matters when two administrators act on the same record. Add a row-version column or another concurrency token where deletion and restoration can race with edits. An operation that restores stale data should fail clearly instead of silently overwriting a newer deletion decision.

The retention policy must be documented separately from the read filter. Soft delete is not the same as permanent erasure. Australian organisations may need to consider the Privacy Act, contractual retention terms, industry rules, and a customer’s request for personal information to be removed. A scheduled purge can permanently delete records after the approved retention period, with appropriate backups and audit controls.

Avoid Hidden Data Access Traps

Global filters are convenient because they operate implicitly, but implicit behaviour can confuse developers working on reports, exports, and background processing. A nightly job might count only active records when finance expects a historical total. A support screen might show an empty result because the operator forgot that deleted rows are filtered.

Document which services are allowed to see inactive data. Separate application methods such as GetActiveProductsAsync and GetDeletedProductsForAdminAsync are clearer than allowing every caller to append IgnoreQueryFilters(). The naming makes intent visible during code review and reduces accidental exposure.

Be especially careful with navigation properties and projections. If an order points to a soft-deleted customer, a query may return the order while the customer navigation is absent or filtered. That behaviour can be correct for a user-facing page but unsuitable for an audit export. Explicitly choose whether a query needs active data only, historical data, or a mixture of both.

Database indexes should support the filtered access pattern. An index beginning with IsDeleted, tenant ID, status, or a frequently searched business key may reduce the cost of active-record queries. On large SQL Server installations, filtered indexes can be useful, subject to the database provider and the query shapes generated by EF Core.

Operational Checks For Production

A reliable soft-delete implementation depends on conventions that survive staff changes and urgent fixes. This is particularly relevant for Australian teams supporting customers across AEST, ACST, and AWST, where an overnight purge or incident response may cross several reporting periods.

Before releasing the feature

  • Confirm every delete path uses the domain service or interception rule.
  • Review foreign keys, cascade behaviour, and filtered navigation properties.
  • Add tests for active reads, deleted reads, restoration, and concurrency.
  • Decide which data must eventually be permanently purged.

During ongoing operations

  • Monitor queries that use IgnoreQueryFilters() and restrict them by role.
  • Log the actor, timestamp, reason, and correlation ID for deletion events.
  • Check indexes and query plans as the archive grows.
  • Verify backups, replicas, exports, and search indexes follow the retention policy.

Teams hosting workloads in Azure Australia East or Australia Southeast should also check where database backups, logs, and replicas are stored. Data residency can affect the overall privacy design even when the application itself behaves correctly. For a business operating around Sydney or Melbourne, an application may appear responsive and compliant while a third-party export quietly copies deleted records to another region.

Soft delete works best when it is treated as a complete data lifecycle rather than a single EF Core configuration line. Global query filters provide a strong default for ordinary reads, while explicit commands, authorisation, auditing, relationship rules, testing, and retention controls determine whether the pattern remains safe at scale.

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