Posts

Showing posts from April, 2026

jj

SOLID Principles Blog ``` SOLID Principles in C# A beginner-friendly guide to writing clean and maintainable code using SOLID principles. 1. Single Responsibility Principle (SRP) A class should have only one reason to change. Example: ``` public class Invoice { public void Calculate() { } } public class InvoiceRepository { public void Save(Invoice invoice) { } } ``` 2. Open/Closed Principle (OCP) Software should be open for extension but closed for modification. Example: ``` public interface IDiscount { double GetDiscount(); } public class StudentDiscount : IDiscount { public double GetDiscount() => 10; } ``` 3. Liskov Substitution Principle (LSP) Derived classes should be replaceable with their base classes. Example: ``` public interface IBird { } public interface IFlyingBird { void Fly(); } public class Sparrow : IFlyingBird { public void Fly() { } } ``` 4. Interface Segregation Principle (ISP) Clients should not be forced to de...

Liwansh Software Blog

Liwansh Software Blog ``` ``` Liwansh Software Blog Tech • Coding • AI • Development Home Blog About Contact ``` Getting Started with Ollama Ollama is a powerful tool to run AI models locally. You can use models like Llama3 directly on your machine without cloud dependency. Read More Dependency Injection in MVC Learn about Singleton, Scoped, and Transient lifetimes in ASP.NET MVC and how they affect your application performance and behavior. Read More Build AI Apps with C# Integrate AI into your .NET applications using Ollama API and create powerful automation tools and chatbots. Read More ``` © 2026 Liwansh Software Solutions | Email: javherikg@outlook.com