Пример #1
0
        public static IEnumerable <Script> GetScripts()
        {
            var dbc = new SqlDbClient(ConnString);

            return(dbc.GetQuery(cmd =>
            {
                cmd.CommandText = "sp_getScripts";
                cmd.CommandType = CommandType.StoredProcedure;
            })
                   .AsEnumerable()
                   .Select(s => new Script(s)));
        }
Пример #2
0
        public static Script GetScript(int scriptId)
        {
            var dbc = new SqlDbClient(ConnString);

            return(dbc.GetQuery(cmd =>
            {
                cmd.CommandText = "sp_getScript";
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.Add(new SqlParameter("@scriptId", scriptId));
            })
                   .AsEnumerable()
                   .Select(s => new Script(s))
                   .FirstOrDefault());
        }