Bharath Kumar J C

quick tips

Catch Smarter, Not Harder: C# Exception Handling Best Practice

โš ๏ธ Avoid Catching General Exceptions Catching all exceptions with catch (Exception ex) might seem convenient, but it can hide real problems and make debugging harder. Bad: try { // DB operation dbContext.SaveChanges(); } catch (Exception ex) { Console.WriteLine("Something went wrong: " + ex.Message); } Better try { // DB operation dbContext.SaveChanges(); } catch (SqlException

By Bharath Kumar J C
โœจ Hidden Gems: 2 Powerful but Less Used EF Core LINQ Methods (2025 Update)

quick tips

โœจ Hidden Gems: 2 Powerful but Less Used EF Core LINQ Methods (2025 Update)

Go beyond the basics โ€” Master these underrated EF Core features to write high-performance, production-grade applications! ๐Ÿš€ 1๏ธโƒฃ ExecuteUpdateAsync() โ€” Bulk Update Without Loading Entities ๐Ÿ› ๏ธ Introduced in EF Core 7 โ€” Perform direct SQL UPDATE operations without fetching entities into memory. ๐Ÿ”น Usage: await dbContext.Users .Where(u => u.LastLogin < DateTime.UtcNow.AddYears(

By Bharath Kumar J C