DEV Community

Cover image for ๐Ÿงพ How I Rebuilt My eAdvice System with C# Console Apps
seonglinchua
seonglinchua

Posted on

๐Ÿงพ How I Rebuilt My eAdvice System with C# Console Apps

โ€œI didnโ€™t modernize my stack. I rethought my system.โ€

๐Ÿ‘‹ Background

I was tasked with supporting and enhancing an eAdvice distribution system at my bank.

The problem? It was built on tight coupling, manual triggers, and legacy UI dependencies.

The workflow was error-prone, slow, and hard to scale.

So, I tore it down โ€” and rebuilt it as a headless C# console application.

This is how I did it, and why you might want to do the same.


๐Ÿง  What Was Wrong with the Old System?

  • โš ๏ธ UI tightly coupled with core logic
  • ๐Ÿข Manual click events to fetch data
  • ๐Ÿงท Dependencies that made automation nearly impossible
  • โŒ No logging or audit trail
  • ๐Ÿ“Ž Painful to manage errors and retries

I knew this wasnโ€™t sustainable โ€” especially with daily deadlines and growing compliance needs.


๐Ÿงฑ The Headless Approach

I rebuilt everything around this principle:

"Let the logic run without needing to be seen."

Key Design Decisions:

  • Convert UI code behind into reusable services
  • Store configs in JSON files
  • Add Serilog for structured logging
  • Use Task Scheduler to automate execution
  • Isolate mailing list fetch, PDF mapping, and Infobip sending into separate components
  • Capture every success/failure in a reconciliation table

โš™๏ธ Technologies Used

Purpose Tool/Lib
Core app C# .NET Console App
DB access Dapper
Logging Serilog
File parsing EPPlus, iText7
Email sending Infobip Email API
Scheduling Windows Task Scheduler
Config appsettings.json + ENV overrides

๐Ÿงฉ Modular Workflow

Each step was designed as an isolated module:


๐Ÿช› Dev-Friendly Features

  • Logs are written both to file and console with timestamps.
  • The app supports --dryrun mode for safe testing.
  • Failures are automatically retried in the next run.
  • Configs can be changed without recompiling the app.

โœจ Results

  • โœ… System now runs unattended every day
  • โœ… Reconciliation and error handling became transparent
  • โœ… No more relying on fragile UIs
  • โœ… Easy to support multiple advice types (e.g., PWM, V8)

๐Ÿ”ฎ Whatโ€™s Next?

  • Adding queue retry logic for failed emails
  • Creating a web dashboard for ad-hoc resend and report lookup
  • Exploring cloud-based job runners for scalability
  • Plugging in GenAI classification for incoming requests

๐Ÿ™Œ Your Turn

Have you turned a legacy system into something lean and modern?

Ever tried headless console automation in production?

Drop your experience below โ€” or ask me anything about this build.

Iโ€™ll be sharing more posts like this daily ๐Ÿ‘‡

Top comments (0)