Example #1
0
        public AfonsoftDbContext(DbContextOptions <DbContext> options) : base(options)
        {
            var opt = new AfonsoftEFOptions();

            opt.Options = options;
            EnsureCreated();
        }
Example #2
0
        internal static AfonsoftEFOptions BuildOptions(Action <AfonsoftEFOptions> configure = null)
        {
            if (configure == null)
            {
                return(null);
            }

            var opt = new AfonsoftEFOptions();

            configure(opt);
            opt.Options = GetOptions(opt.Provider, opt.ConnectionString, opt.Options);
            return(opt);
        }
Example #3
0
        private static DbContextOptions <DbContext> Build(Action <AfonsoftEFOptions> configure = null)
        {
            if (configure == null)
            {
                return(null);
            }

            var opt = new AfonsoftEFOptions();

            configure(opt);
            opt.Options = GetOptions(opt.Provider, opt.ConnectionString, opt.Options);
            return(opt.Options);
        }