Beispiel #1
0
        public static IRuntimeModelProvider CreateInstance(string strjson)
        {
            RuntimeModelMeta Temp = Newtonsoft.Json.JsonConvert.DeserializeObject <RuntimeModelMeta>(strjson);

            if (_instance == null || !CompareRuntimeMeta(Temp, TempCache))
            {
                TempCache = Temp;
                lock (lockHelper)
                {
                    _instance = new DefaultRuntimeModelProvider(new RuntimeModelMetaConfig()
                    {
                        Metas = new RuntimeModelMeta[] { TempCache }
                    });
                }
            }
            return(_instance);
        }
 public DynamicModelDbContext(DbContextOptions <DynamicModelDbContext> options, ICoreConventionSetBuilder builder, IRuntimeModelProvider modelProvider, IMemoryCache cache) : base(options)
 {
     _modelProvider = modelProvider;
     _builder       = builder;
     _cache         = cache;
 }
 public HomeController(IRuntimeModelProvider privader, DynamicModelDbContext dbContext, ModelDbContext modeldbContext)
 {
     _privader       = privader;
     _dbContext      = dbContext;
     _modeldbContext = modeldbContext;
 }