
ilovedotnet
351 subscribers
About ilovedotnet
Hey folks Welcome to ilovedotnet and thank you for joining https://ilovedotnet.org - .NET knowledge sharing and learning platform. I'll be sharing content in this channel every Sunday. I'll be making announcements on new features that will be coming to ilovedotnet. I'll be exclusively sharing content here on my new learnings. Follow me on LinkedIn https://LinkedIn.com/in/thebhai and share your feedbacks. Thanks & Regards, Bhai
Similar Channels
Swipe to see more
Posts

๐ง How do you add new logic in .NET โ without touching existing code? This blog breaks down the Open/Closed Principle (OCP) with a tax calculation example in C#. โ Add new business rules and logics โ Keep current logic untouched โ Use DI + Factory + Interface combo Less regressions. More testability. Cleaner code. ๐ Read now: https://ilovedotnet.org/blogs/open-closed-principle-in-solid

Is your repository interface violating SOLID? If you're forcing consumers to depend on unused methods, you're breaking the Interface Segregation Principle. ๐ก In this blog, I show how to fix it by splitting IGenericRepository<T> into: IReadableRepository<T> ๐ IWritableRepository<T> โ๏ธ โ Cleaner code โ Lower coupling โ Easier testing ๐ Read the full blog: https://ilovedotnet.org/blogs/interface-segregation-principle-in-solid/

โ๏ธ Automate your Git commit messages with AI! I use GitHub Copilot plus prompt engineering to create detailed, context-rich commit messages without extra effort. Learn how to set this up inside VS Code with practical prompt templates. Check out the blog for exact prompt examples and setup tips. Read more: ๐ https://ilovedotnet.org/blogs/using-github-copilot-ai-for-commit-message-generation/

Still drawing diagrams manually? Let Copilot Chat do it for you ๐ง In this blog, see how to: ๐ฃ Use natural language prompts ๐ฃ Generate diagrams with MermaidJS ๐ฃ Skip the drag-drop tools Perfect for system design and fast documentation. Even better โ real examples and workflow ideas included. ๐ Read the full post: https://ilovedotnet.org/blogs/using-github-copilot-ai-for-architecture-diagram-generation/

Git Pre-commit hooks execute before a commit is made and can enforce coding standards, format code or run tests and enforce code coverage. Automating the setup of these hooks ensures consistency across a team, removing the need for manual configuration. This makes maintaining standards across different developer machines especially in large teams. In this article, we'll explore how to automate the setup of a pre-commit hook in a .NET project using MSBuild. Check out https://ilovedotnet.org/blogs/automating-git-hook-setup-in-dotnet-with-msbuild for more details and code samples

FluentAssertions Went Paid. What Did I Do? I Migrated 1000+ Tests in Seconds! January 2025 started with a surpriseโFluentAssertions, the popular free assertion library for .NET, is now paid. At $130 per developer, our enterprise (1000+ devs) decided it wasnโt worth the cost. Thatโs when I had a realization: ๐ก Over a decade, I had unknowingly introduced technical debt by relying on FluentAssertions in every project I worked on. So, I took action. I wanted a fast, automated way to migrate every test to xUnit assertions. First, I tried LLMs (Ollama)โworked for a single assertion but became slow for large-scale repo migration. Then, I switched to Regex. โก Boom! In seconds, my entire repo (1000+ test methods) was converted. โ 90%+ automated conversion โ Manual cleanup took just an hour โ Now, weโre FluentAssertions-free Lesson learned: Choose dependencies wisely. Even the best free tools can turn paid. If youโve been using FluentAssertions, itโs time to rethink. Would you pay $130 per dev or migrate? Let me know your thoughts! ๐๐ฌ Check https://ilovedotnet.org/blogs/using-regex-to-migrate-from-fluent-assertions-to-xunit-assertions for idea and code sample!!

Ever wondered how to add new behavior to existing classes without modifying them? ๐ค Learn the Visitor Patternโone of the most powerful design patterns in object-oriented programming. Why should you care? โ Helps keep your core classes clean โจ โ Enables adding operations without modifying existing code ๐ฅ โ Follows the Open-Closed Principle (OCP) in SOLID Hereโs a simple analogy: Imagine you own a mall ๐ฌ. Customers (elements) visit the mall, and different staff members perform different tasks: Security checks the customerโs ID ๐ Sales staff offer discounts ๐ท Customer service gathers feedback ๐ฌ Each staff member is like a Visitor, performing a specific operation without changing the customer! ๐ฏ Check out https://ilovedotnet.org/blogs/behavioral-design-pattern-visitor/ for code samples and in browser demo.

๐ Adding a distributed lock to Hosted Background Service in ASP.NET WEB API ๐น What? We needed to query AWS Athena every hour to fetch analytics data for a dashboard. Running it as a background service worked, but multiple API instances triggered duplicate queries, causing AWS rate limits. ๐น Why? Errors and warnings skyrocketed, increasing costs and inefficiency. The challenge worsened when the query frequency was reduced to 30 minutes. ๐น How? We implemented a distributed lock using a database table, ensuring only one instance runs the job at a time. This reduced rate limits, improved reliability, and optimized costs. Check out https://ilovedotnet.org/blogs/using-a-distributed-lock-in-hosted-service-in-asp-net-webapi/ for more visuals and code samples.