Skip to content
This repository
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 35 lines (32 sloc) 1.059 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
using System.Data;

namespace Griffin.MvcContrib.SqlServer.Localization
{
    /// <summary>
    /// Used to provide a connection for the repositories
    /// </summary>
    public interface ILocalizationDbContext
    {
        /// <summary>
        /// Gets an open and valid connection
        /// </summary>
        IDbConnection Connection { get; }

        /// <summary>
        /// Gets prefix used for query parameters (for instance '@' in Sql Server)
        /// </summary>
        char ParameterPrefix { get; }

        /// <summary>
        /// Change prefix to the one used in your db
        /// </summary>
        /// <param name="sql">Query which is using @@@ for parameters.</param>
        /// <returns>Query with valid parameters</returns>
        /// <example>
        /// <code>
        /// public void ChangePrefix(string sql)
        /// {
        /// return sql.Replace("@@@", ParameterPrefix);
        /// }
        /// </code>
        /// </example>
        string ChangePrefix(string sql);
    }
}
Something went wrong with that request. Please try again.