Griffin.MvcContrib.SqlServer.Localization.SqlLocalizedTypesRepository.GetPrompt C# (CSharp) Method

GetPrompt() public method

Get a specific prompt
public GetPrompt ( CultureInfo culture, TypePromptKey key ) : TypePrompt
culture System.Globalization.CultureInfo Culture to get prompt for
key TypePromptKey Key which is unique in the current language
return TypePrompt
        public TypePrompt GetPrompt(CultureInfo culture, TypePromptKey key)
        {
            var sql = "SELECT * FROM LocalizedTypes WHERE LocaleId = @LocaleId AND [Key] = @TextKey";
            using (var cmd = _db.Connection.CreateCommand())
            {
                cmd.CommandText = sql;
                cmd.AddParameter("LocaleId", culture.LCID);
                cmd.AddParameter("TextKey", key.ToString());

                using (var reader = cmd.ExecuteReader())
                {
                    return !reader.Read() ? null : MapEntity(reader);
                }
            }
        }