Categories C#

Avoid unneeded context in C#

Master the art of crafting clear and concise code by eliminating redundant context in variable names. Elevate code readability and maintainability effortlessly.

If the context is already conveyed by the class or object name, there’s no necessity to duplicate it in the variable name.

Example

public interface IItemRepository
{
    Item GetItemByID(int id);
    List<Item> GetItems();
    List<Item> GetItemByCategoryID(int iCategoryID);
    List<Item> GetItemBySupplier(int iSupplierID);
    List<Item> GetItemByCustomer(int iCustomerID);
    void UpdateItem();
    void DeleteItem();
}
C#
public interface IItemRepository
{
    Item GetByID(int id);
    List<Item> List();
    List<Item> ListByCategoryID(int iCategoryID);
    List<Item> ListBySupplier(int iSupplierID);
    List<Item> ListByCustomer(int iCustomerID);
    void Update();
    void Delete();
}
C#

Written By

With over a decade of experience in .NET technologies, SQL Server, and Agile methodologies, I am a Lead Software Developer at TEKsystems, where I design, develop, and support web-based applications for a leading market research company. I hold multiple certifications in LINQ, Entity Framework, and other .NET frameworks and tools, demonstrating my proficiency and commitment to continuous learning.

My core competencies include .NET Core, User Defined Functions, Stored Procedures, MVC, Web API, jQuery, and Bootstrap. I have successfully delivered several projects, such as a dashboard for analyzing consumer behavior, a portal for managing surveys and reports, and a tool for automating data quality checks. I am passionate about creating innovative and user-friendly solutions that help clients make informed business decisions. As part of a collaborative and agile team, I contribute to improving the quality, performance, and security of web applications, as well as providing technical support and documentation.

Email: codewithsivablog@gmail.com

More From Author

Leave a Reply

Your email address will not be published. Required fields are marked *

You May Also Like