fremag/MemoScope.Net

View on GitHub
MemoScope/Core/Cache/SqliteHelper.cs

Summary

Maintainability
A
0 mins
Test Coverage
using System.Data.SQLite;

namespace MemoScope.Core.Cache
{
    public static class SqliteHelper
    {
        public static SQLiteParameter CreateParameter(this SQLiteCommand cmd, string paramName)
        {
            SQLiteParameter param = cmd.CreateParameter();
            param.ParameterName = paramName;
            cmd.Parameters.Add(param);
            return param;
        }

        public static SQLiteCommand PrepareCommand(this SQLiteConnection cxion, string sqlCmd)
        {
            var cmd = cxion.CreateCommand();
            cmd.CommandText = sqlCmd;
            cmd.Prepare();
            return cmd;
        }
    }
}