DeveloperLab

</> Software Developer ยท Herefordshire, UK

Modern .NET Solutions Built for Growth


public static string GetNomCode(string stockCode)
{
    if (_salesNomCache.TryGetValue(stockCode, out var cachedNomCode)
    {
        return cachedNomCode;
    }

    using var connection =
        new SqlConnection(Properties.Settings.Default.SQL_CONNECTION);

    connection.Open();

    string nomCode =
        TryGetNomCodeFromStockCode(connection, stockCode)
        ?? TryGetNomCodeFromDescription(connection, stockCode);

    if (!string.IsNullOrWhiteSpace(nomCode))
        _salesNomCache[stockCode] = nomCode;

    return nomCode;
}

Dan

I build software that works.

Web, Desktop, Mobile applications, clean architecture, built to scale. Local to Herefordshire, delivering for SMEs