// X:\jsc.svn\examples\javascript\LINQ\test\TestSelectGroupByAndConstant\TestSelectGroupByAndConstant\ApplicationWebService.cs

        public static Func <Func <IDbConnection, Task>, Task> WithConnection(string DataSource)
        {
            // https://sites.google.com/a/jsc-solutions.net/backlog/knowledge-base/2014/201411/20141102
//#if FSQLiteConnectionStringBuilder
            // ScriptCoreLib.Extensions
            var csb = new SQLiteConnectionStringBuilder
            {
                DataSource = DataSource,

                // is there any other version?
                Version = 3
            };


            var yy = csb.AsWithConnection(Initializer: null);

            return(y =>
            {
                var ret = default(Task);

                yy(
                    c =>
                {
                    ret = y(c);
                }
                    );

                return ret;
            });
//#endif
//            throw new NotImplementedException();
        }
Beispiel #2
0
        public MyAccount()
        {
            this.WithConnection = csb.AsWithConnection();

            WithConnection(
                c =>
            {
                new MyAccountQueries.Create {
                }.ExecuteNonQuery(c);
                new MySessionQueries.Create {
                }.ExecuteNonQuery(c);
            }
                );
        }
Beispiel #3
0
        public MyDevices()
        {
            this.WithConnectionOverride = csb.AsWithConnection();

            this.WithConnection =
                y =>
            {
                this.WithConnectionOverride(
                    c =>
                {
                    new Create {
                    }.ExecuteNonQuery(c);
                    y(c);
                }
                    );
            };
        }