public void Save(HttpContextBase httpContext, GlobalContext globalContext)
 {
     foreach (var persistable in PersistableData)
     {
         persistable.Save(httpContext, globalContext);
     }
 }
        public void Load(HttpContextBase httpContext, GlobalContext globalContext)
        {
            var cookie = httpContext.Request.Cookies[COOKIENAME];

            if (cookie == null) return;

            globalContext.UserActivity = globalContext.UserActivity ?? new UserActivity();

            var anotherValue = cookie[VALUE];

            if (anotherValue != null)
            {
                globalContext.AnotherValue = anotherValue;
            }
        }
        public void Save(HttpContextBase httpContext, GlobalContext globalContext)
        {
            var cookie = new HttpCookie(COOKIENAME) { Path = "/"};

            if (globalContext.UserActivity == null || string.IsNullOrEmpty(globalContext.AnotherValue))
            {
                cookie = new HttpCookie(COOKIENAME) { Expires = DateTime.Now.AddDays(-2)};
                httpContext.Response.Cookies.Add(cookie);
            }
            else
            {
                cookie[VALUE] = globalContext.AnotherValue;
                cookie.Expires = DateTime.Now.AddYears(1);
            }
        }
Esempio n. 4
0
        public static void RunNormalAndStepByStep( string script, Action<RuntimeObj> test, GlobalContext ctx = null )
        {
            var e = ExprAnalyser.AnalyseString( script );

            // Tests the empty, default, visitor: no change must have been made to the AST.
            var emptyVisitor = new ExprVisitor();
            Assert.That( emptyVisitor.VisitExpr( e ), Is.SameAs( e ) );

            // Evaluates result directly.
            RuntimeObj syncResult = ScriptEngine.Evaluate( e, ctx );
            test( syncResult );

            // Step-by-step evaluation.
            ScriptEngine engine = new ScriptEngine( ctx );
            engine.Breakpoints.BreakAlways = true;
            ExecAsync( script, test, null, e, syncResult, engine, true );
        }
        public void Load(HttpContextBase httpContext, GlobalContext globalContext)
        {
            var cookie = httpContext.Request.Cookies[COOKIENAME];

            if (cookie == null) return;

            globalContext.UserActivity = globalContext.UserActivity ?? new UserActivity();

            var placesViewed = cookie[VALUE];

            if (placesViewed != null)
            {
                globalContext.UserActivity.PlacesViewed =
                    (from placeViewed in placesViewed.Split(new[] {','}, StringSplitOptions.RemoveEmptyEntries)
                     select long.Parse(placeViewed)).ToList();

            }
        }
        public void Save(HttpContextBase httpContext, GlobalContext globalContext)
        {
            var cookie = new HttpCookie(COOKIENAME);

            if (globalContext.UserActivity == null || globalContext.UserActivity.PlacesViewed.IsNullOrEmpty())
            {
                cookie = new HttpCookie(COOKIENAME) {Expires = DateTime.Now.AddDays(-2)};
            }
            else
            {
                var sb = new StringBuilder();
                foreach (var place in globalContext.UserActivity.PlacesViewed)
                {
                    sb.Append(place);
                    sb.Append(",");
                }

                cookie[VALUE] = sb.ToString();
                cookie.Domain = "/";
                cookie.Expires = DateTime.Now.AddYears(1);
            }
            httpContext.Response.Cookies.Add(cookie);
        }
Esempio n. 7
0
        public List <IModule> AddModulesAsApplicationPart(IMvcBuilder mvcBuilder, IServiceCollection services, IServiceProvider serviceProvider, ILogger logger)
        {
            _logger = logger;

            var nccSettingsService = serviceProvider.GetService <INccSettingsService>();

            foreach (var module in modules)
            {
                try
                {
                    var moduleInitializerType = module.Assembly.GetTypes().Where(x => typeof(IModule).IsAssignableFrom(x)).FirstOrDefault();

                    if (moduleInitializerType != null && moduleInitializerType != typeof(IModule))
                    {
                        var moduleInstance = (IModule)Activator.CreateInstance(moduleInitializerType);
                        LoadModuleInfo(moduleInstance, module);

                        NccModule.NccModuleStatus moduleStatus = VerifyModuleInstallation(moduleInstance, serviceProvider);
                        moduleInstance.ModuleStatus = (int)moduleStatus;

                        if (moduleStatus == NccModule.NccModuleStatus.Active)
                        {
                            // Register controller from modules
                            mvcBuilder.AddApplicationPart(module.Assembly);
                            // Register dependency in modules
                            LoadModuleDependencies(module.Path, module.Folder);
                            moduleInstance.Init(services, nccSettingsService);
                        }
                        else if (moduleStatus == NccModule.NccModuleStatus.Duplicate)
                        {
                            //TODO: Raise duplicate error message
                            GlobalMessageRegistry.RegisterMessage(
                                new GlobalMessage()
                            {
                                For         = GlobalMessage.MessageFor.Admin,
                                Registrater = "AddModulesAsApplicationPart",
                                Text        = $"Duplicate module {module.ModuleTitle}",
                                Type        = GlobalMessage.MessageType.Error
                            },
                                new TimeSpan(0, 0, 30)
                                );
                            continue;
                        }

                        instantiatedModuleList.Add(moduleInstance);
                        GlobalContext.Modules.Add(moduleInstance);
                    }
                }
                catch (ReflectionTypeLoadException rtle)
                {
                    _logger.LogWarning(rtle.Message, rtle);
                }
                catch (Exception ex)
                {
                    _logger.LogError(ex.Message, ex);
                    GlobalMessageRegistry.RegisterMessage(
                        new GlobalMessage()
                    {
                        For         = GlobalMessage.MessageFor.Admin,
                        Registrater = "AddModulesAsApplicationPart",
                        Text        = ex.Message,
                        Type        = GlobalMessage.MessageType.Error
                    },
                        new TimeSpan(0, 0, 60)
                        );
                }
            }

            GlobalContext.SetModuleDependencies(_moduleDependencies);

            services.Configure <RazorViewEngineOptions>(options =>
            {
                options.ViewLocationExpanders.Add(new ModuleViewLocationExpendar());
            });

            mvcBuilder.AddRazorOptions(o =>
            {
                foreach (var module in instantiatedModuleList.Where(x => x.ModuleStatus == (int)NccModule.NccModuleStatus.Active).ToList())
                {
                    try
                    {
                        o.AdditionalCompilationReferences.Add(MetadataReference.CreateFromFile(module.Assembly.Location));
                    }
                    catch (Exception ex)
                    {
                        _logger.LogError(ex.Message, ex);
                    }
                }
            });

            return(instantiatedModuleList);
        }
Esempio n. 8
0
        public bool Install(NccSettingsService settingsService, Func <NccDbQueryText, string> executeQuery)
        {
            var createQuery = @"
                CREATE TABLE IF NOT EXISTS `" + GlobalContext.GetTableName <NeCategory>() + @"` ( 
                    `Id` BIGINT NOT NULL AUTO_INCREMENT , 
                    `VersionNumber` INT NOT NULL , 
                    `Metadata` varchar(250) COLLATE utf8_unicode_ci NULL,
                    `Name` VARCHAR(250) COLLATE utf8_unicode_ci NULL , 
                    `CreationDate` DATETIME NOT NULL , 
                    `ModificationDate` DATETIME NOT NULL , 
                    `CreateBy` BIGINT NOT NULL , 
                    `ModifyBy` BIGINT NOT NULL , 
                    `Status` INT NOT NULL , 
                PRIMARY KEY (`Id`)) ENGINE = InnoDB;

                CREATE TABLE IF NOT EXISTS `" + GlobalContext.GetTableName <NeCategoryDetails>() + @"` ( 
                    `Id` BIGINT NOT NULL AUTO_INCREMENT , 
                    `VersionNumber` INT NOT NULL , 
                    `Metadata` varchar(250) COLLATE utf8_unicode_ci NULL,
                    `Name` VARCHAR(250) COLLATE utf8_unicode_ci NULL , 
                    `CreationDate` DATETIME NOT NULL , 
                    `ModificationDate` DATETIME NOT NULL , 
                    `CreateBy` BIGINT NOT NULL , 
                    `ModifyBy` BIGINT NOT NULL , 
                    `Status` INT NOT NULL , 

                    `Language` varchar(250) COLLATE utf8_unicode_ci NULL,
                    `NeCategoryId` BIGINT NOT NULL ,                     
                PRIMARY KEY (`Id`)) ENGINE = InnoDB;

                CREATE TABLE IF NOT EXISTS `" + GlobalContext.GetTableName <NeNews>() + @"` ( 
                    `Id` BIGINT NOT NULL AUTO_INCREMENT , 
                    `VersionNumber` INT NOT NULL , 
                    `Metadata` varchar(250) COLLATE utf8_unicode_ci NULL,
                    `Name` VARCHAR(250) NOT NULL , 
                    `CreationDate` DATETIME NOT NULL , 
                    `ModificationDate` DATETIME NOT NULL , 
                    `CreateBy` BIGINT NOT NULL , 
                    `ModifyBy` BIGINT NOT NULL , 
                    `Status` INT NOT NULL , 

                    `HasDateRange` bit(1) NOT NULL , 
                    `PublishDate` DATETIME NULL , 
                    `ExpireDate` DATETIME NULL , 
                    `Order` INT NOT NULL , 
                PRIMARY KEY (`Id`)) ENGINE = InnoDB;

                CREATE TABLE IF NOT EXISTS `" + GlobalContext.GetTableName <NeNewsDetails>() + @"` ( 
                    `Id` BIGINT NOT NULL AUTO_INCREMENT , 
                    `VersionNumber` INT NOT NULL , 
                    `Metadata` varchar(250) COLLATE utf8_unicode_ci NULL,
                    `Name` VARCHAR(250) COLLATE utf8_unicode_ci NULL , 
                    `CreationDate` DATETIME NOT NULL , 
                    `ModificationDate` DATETIME NOT NULL , 
                    `CreateBy` BIGINT NOT NULL , 
                    `ModifyBy` BIGINT NOT NULL , 
                    `Status` INT NOT NULL , 

                    `Language` varchar(250) COLLATE utf8_unicode_ci NULL,
                    `Content` longtext NULL, 
                    `MetaKeyword` varchar(250) COLLATE utf8_unicode_ci NULL,
                    `MetaDescription` varchar(250) COLLATE utf8_unicode_ci NULL,
                    `Excerpt` VARCHAR(1000) NULL, 
                    `NeNewsId` BIGINT NOT NULL ,    
                PRIMARY KEY (`Id`)) ENGINE = InnoDB;

                CREATE TABLE IF NOT EXISTS `" + GlobalContext.GetTableName <NeNewsCategory>() + @"` ( 
                    `NeCategoryId` BIGINT NOT NULL , 
                    `NeNewsId` BIGINT NOT NULL  
                ) ENGINE = InnoDB;
            ";

            var nccDbQueryText = new NccDbQueryText()
            {
                MySql_QueryText = createQuery
            };
            var retVal = executeQuery(nccDbQueryText);

            if (!string.IsNullOrEmpty(retVal))
            {
                return(true);
            }
            return(false);
        }
Esempio n. 9
0
    public override void OnServerAddPlayer(NetworkConnection conn, short playerControllerId)
    {
        GameObject player = (GameObject)Instantiate(playerPrefab, GlobalContext.GetSpawnPoint(), Quaternion.identity); // Spawn player, using Global Spawner

        NetworkServer.AddPlayerForConnection(conn, player, playerControllerId);
    }
Esempio n. 10
0
 /// <summary>
 /// Initializes a new Module with specified code, callback for output compiler messages and compiler options.
 /// </summary>
 /// <param name="code">JavaScript code.</param>
 /// <param name="messageCallback">Callback used to output compiler messages or null</param>
 /// <param name="options">Compiler options</param>
 /// <param name="globalContext">Global context</param>
 public Module(string code, CompilerMessageCallback messageCallback, Options options, GlobalContext globalContext)
     : this(null, code, messageCallback, options, globalContext)
 {
 }
Esempio n. 11
0
 /// <summary>
 /// Initializes a new Module with specified code.
 /// </summary>
 /// <param name="path">Path to file with script. Used for resolving paths to other modules for importing via import directive. Can be null or empty</param>
 /// <param name="code">JavaScript code.</param>
 /// <param name="globalContext">Global context</param>
 public Module(string path, string code, GlobalContext globalContext)
     : this(path, code, null, Options.None, globalContext)
 {
 }
Esempio n. 12
0
 public CargoInteresseService(GlobalContext context)
 {
     Repository = new CargoInteresseRepository(context);
 }
Esempio n. 13
0
 /// <summary>
 /// Makes the path to any control variable.
 /// </summary>
 /// <param name="global">The global.</param>
 /// <param name="callLevel">The call level.</param>
 /// <returns>new path to any control variable</returns>
 public static MemoryPath MakePathAnyControl(GlobalContext global, int callLevel)
 {
     return(new MemoryPath(new ControlPathSegment(), global, callLevel));
 }
Esempio n. 14
0
 public CaseCommentRepository(GlobalContext dbContext) : base(dbContext)
 {
 }
Esempio n. 15
0
 protected override Ignore CreateConfigureOptions([NotNull] GlobalContext globalContext,
                                                  [CanBeNull] string configureOptionsString, bool forceReload)
 {
     return(Ignore.Om);
 }
 public TestObjectsManager(GlobalContext globalContext, EnumConverter enumConverter, string organizationInn)
 {
     this.globalContext   = globalContext;
     this.enumConverter   = enumConverter;
     this.organizationInn = organizationInn;
 }
Esempio n. 17
0
    public CosmosApp(string name, CosmosAppArgs args, ComponentResourceOptions?options = null)
        : base("examples:azure:CosmosApp", name, options)
    {
        var resourceGroup   = args.ResourceGroup;
        var locations       = args.Locations;
        var primaryLocation = locations[0];
        var parentOptions   = (CustomResourceOptions)ResourceOptions.Merge(new CustomResourceOptions {
            Parent = this
        }, options);

        // Cosmos DB Account with multiple replicas
        var cosmosAccount = new Account($"cosmos-{name}",
                                        new AccountArgs
        {
            ResourceGroupName = resourceGroup.Name,
            Location          = primaryLocation,
            GeoLocations      = locations.Select((l, i) => new AccountGeoLocationsArgs {
                Location = l, FailoverPriority = i
            }).ToArray(),
            OfferType         = "Standard",
            ConsistencyPolicy = new AccountConsistencyPolicyArgs {
                ConsistencyLevel = "Session"
            },
            EnableMultipleWriteLocations = args.EnableMultiMaster,
        },
                                        parentOptions);

        var database = new SqlDatabase($"db-{name}",
                                       new SqlDatabaseArgs
        {
            ResourceGroupName = resourceGroup.Name,
            AccountName       = cosmosAccount.Name,
            Name = args.DatabaseName,
        },
                                       parentOptions);

        var container = new SqlContainer($"sql-{name}",
                                         new SqlContainerArgs
        {
            ResourceGroupName = resourceGroup.Name,
            AccountName       = cosmosAccount.Name,
            DatabaseName      = database.Name,
            Name = args.ContainerName,
        },
                                         parentOptions);

        // Traffic Manager as a global HTTP endpoint
        var profile = new TrafficManagerProfile($"tm{name}",
                                                new TrafficManagerProfileArgs
        {
            ResourceGroupName    = resourceGroup.Name,
            TrafficRoutingMethod = "Performance",
            DnsConfigs           =
            {
                new TrafficManagerProfileDnsConfigsArgs
                {
                    // Subdomain must be globally unique, so we default it with the full resource group name
                    RelativeName = Output.Format($"{name}{resourceGroup.Name}"),
                    Ttl          = 60,
                }
            },
            MonitorConfigs =
            {
                new TrafficManagerProfileMonitorConfigsArgs
                {
                    Protocol = "HTTP",
                    Port     = 80,
                    Path     = "/api/ping",
                }
            },
        },
                                                parentOptions);

        var globalContext   = new GlobalContext(resourceGroup, cosmosAccount, database, container, parentOptions);
        var buildLocation   = args.Factory(globalContext);
        var endpointOptions = (CustomResourceOptions)ResourceOptions.Merge(options, new CustomResourceOptions {
            Parent = profile, DeleteBeforeReplace = true
        });

        var endpoints = locations.Select(location =>
        {
            var app = buildLocation(new RegionalContext(location));

            return(new TrafficManagerEndpoint($"tm{name}{location}".Truncate(16),
                                              new TrafficManagerEndpointArgs
            {
                ResourceGroupName = resourceGroup.Name,
                ProfileName = profile.Name,
                Type = app.Type,
                TargetResourceId = app.Id,
                Target = app.Url,
                EndpointLocation = location,
            },
                                              endpointOptions));
        }).ToList();

        this.Endpoint = Output.Format($"http://{profile.Fqdn}");
        this.RegisterOutputs();
    }
Esempio n. 18
0
 public PlaceEventController(GlobalContext context)
 {
     _context  = context;
     _services = new PlaceEventServices(_context);
 }
Esempio n. 19
0
        private static List<Dependency> ProjectMarkCyclesAndBackProject(Dependency[] deps, GlobalContext globalContext)
        {
            var backProjectedDeps = new List<Dependency>();

            globalContext.RenameCurrentGraph("INPUT");
            globalContext.CurrentGraph.AddDependencies(deps);

            var pi = new ProjectItems();
            pi.Configure(globalContext,
                $"{{ {ProjectItems.ProjectionsOption} $GENERIC_2---%SIMPLE !(**) }}".Replace(" ", Environment.NewLine),
                false);
            var projectedDeps = new List<Dependency>();
            pi.Transform(globalContext, deps, "", projectedDeps, s => null);

            var mc = new MarkCycleDeps();
            mc.Transform(globalContext, projectedDeps,
                $"{{ {MarkCycleDeps.ConsiderSelfCyclesOption} {MarkCycleDeps.AddIndexedMarkerOption} C }}".Replace(" ", Environment.NewLine), new List<Dependency>(), s => null);

            pi.Transform(globalContext, projectedDeps,
                $"{{ {ProjectItems.BackProjectionGraphOption} INPUT }}".Replace(" ", Environment.NewLine),
                backProjectedDeps, s => globalContext.CurrentGraph.VisibleDependencies);

            return backProjectedDeps;
        }
Esempio n. 20
0
 public static IServiceCollection SetGlobalCache(this IServiceCollection services, IServiceProvider serviceProvider)
 {
     GlobalContext.SetGlobalCache(serviceProvider);
     return(services);
 }
Esempio n. 21
0
        public override int Transform([NotNull] GlobalContext globalContext, Ignore Ignore,
                                      [NotNull] TransformOptions transformOptions, [NotNull][ItemNotNull] IEnumerable <Dependency> dependencies,
                                      [NotNull] List <Dependency> transformedDependencies)
        {
            var items       = new HashSet <Item>(dependencies.SelectMany(d => new[] { d.UsingItem, d.UsedItem }));
            var sourceItems = new List <Item>(items.Where(i => transformOptions.SourceMatches.Any(m => m.Matches(i).Success)));
            var targetItems = new HashSet <Item>(items.Where(i => transformOptions.TargetMatches.Any(m => m.Matches(i).Success)));

            if (!sourceItems.Any())
            {
                throw new ApplicationException("No source items found - minimal cut cannot be computed");
            }
            else if (!targetItems.Any())
            {
                throw new ApplicationException("No target items found - minimal cut cannot be computed");
            }
            else if (targetItems.Overlaps(sourceItems))
            {
                throw new ApplicationException("Source and target items overlap - minimal cut cannot be computed");
            }

            // According to the "Max-flow min-cut theorem" (see e.g.
            // http://www.cs.princeton.edu/courses/archive/spr04/cos226/lectures/maxflow.4up.pdf,
            // http://web.stanford.edu/class/cs97si/08-network-flow-problems.pdf,
            // https://en.wikipedia.org/wiki/Max-flow_min-cut_theorem), we first find the maximum
            // flow; then the residual graph; and from this the minimal cut.

            // Find maximal flow from sources to targets via the Ford-Fulkerson algorithm - see e.g.
            // http://www.cs.princeton.edu/courses/archive/spr04/cos226/lectures/maxflow.4up.pdf;
            Dictionary <Dependency, EdgeWithFlow> edges = dependencies.ToDictionary(d => d,
                                                                                    d => new EdgeWithFlow(d, transformOptions.WeightForCut));

            Dictionary <Item, List <EdgeWithFlow> > outgoing = Item.CollectMap(dependencies, d => d.UsingItem, d => edges[d]);

            SortByFallingCapacity(outgoing);

            Dictionary <Item, List <EdgeWithFlow> > incoming = Item.CollectMap(dependencies, d => d.UsedItem, d => edges[d]);

            SortByFallingCapacity(incoming);

            bool flowIncreased;

            do
            {
                flowIncreased = false;
                foreach (var i in sourceItems)
                {
                    int increase = IncreaseFlow(i, int.MaxValue, new HashSet <Item> {
                        i
                    }, outgoing, incoming, targetItems);
                    flowIncreased |= increase > 0;
                }
            } while (flowIncreased);

            // Find residual graph (only on sources side)
            var reachableFromSources = new HashSet <Item>(sourceItems);

            foreach (var i in sourceItems)
            {
                AddReachableInResidualGraph(i, reachableFromSources, outgoing, incoming);
            }

            // Find minimal cut and add markers
            foreach (var s in reachableFromSources)
            {
                if (transformOptions.MarkerToAddToSourceSide != null)
                {
                    s.IncrementMarker(transformOptions.MarkerToAddToSourceSide);
                }
                foreach (var d in GetList(outgoing, s).Where(e => !reachableFromSources.Contains(e.UsedItem)))
                {
                    d.Dependency.IncrementMarker(transformOptions.MarkerToAddToCut);
                }
            }

            transformedDependencies.AddRange(dependencies);

            return(Program.OK_RESULT);
        }
Esempio n. 22
0
 public UserController(GlobalContext context, UserModel model)
 {
     _context = context;
     _model   = model;
 }
Esempio n. 23
0
 public PasswordsCardView(GlobalContext context)
 {
     InitializeComponent();
     _context = context;
 }
Esempio n. 24
0
        protected void RunFile(string fileName)
        {
            string code;

            using (var f = new FileStream(fileName, FileMode.Open, FileAccess.Read))
                using (var sr = new StreamReader(f))
                    code = sr.ReadToEnd();

            var globalContext = new GlobalContext();

            try
            {
                globalContext.ActivateInCurrentThread();

                var output    = new StringBuilder();
                var oldOutput = Console.Out;
                Console.SetOut(new StringWriter(output));
                var    pass = true;
                Module module;
                var    moduleName = fileName.Split(new[] { '/', '\\' }).Last();
                if (!string.IsNullOrEmpty(_sta))
                {
                    module = new Module(moduleName, _sta);
                    module.Run();
                }
                else
                {
                    module = new Module(moduleName, "");
                }

                var preambleEnd     = 0;
                var preambleEndTemp = 0;
                do
                {
                    preambleEnd = preambleEndTemp;
                    try
                    {
                        preambleEndTemp = Parser.SkipComment(code, preambleEndTemp, true);
                    }
                    catch
                    {
                        break;
                    }
                }while (preambleEnd < preambleEndTemp);

                if (code.IndexOf("@negative") != -1)
                {
                    System.Diagnostics.Debugger.Break();
                }

                var negative = code.IndexOf("* @negative", 0, preambleEnd) != -1;
                var strict   = code.IndexOf("* @onlyStrict", 0, preambleEnd) != -1;

                try
                {
                    try
                    {
                        module.Context.Eval(code, !strict);
                    }
                    finally
                    {
                        pass ^= negative;
                    }
                }
                catch (JSException e)
                {
                    pass = negative;
                    if (!pass)
                    {
                        output.Append(e);
                    }
                }
                catch (Exception e)
                {
                    System.Diagnostics.Debugger.Break();
                    output.Append(e);
                    pass = false;
                }
                finally
                {
                    Console.SetOut(oldOutput);
                }

                Assert.IsTrue(pass, output.ToString());
                Assert.AreEqual(string.Empty, output.ToString().Trim());
            }
            finally
            {
                globalContext.Deactivate();
            }
        }
Esempio n. 25
0
 public void Configure([NotNull] GlobalContext globalContext, [CanBeNull] string configureOptions, bool forceReload)
 {
     // empty
 }
Esempio n. 26
0
 public CustomerRepository(GlobalContext dbContext) : base(dbContext)
 {
 }
        protected override void BuildModel(ModelBuilder modelBuilder)
        {
            var NccModule           = GlobalContext.GetTableName <NccModule>();
            var NccModuleDependency = GlobalContext.GetTableName <NccModuleDependency>();
            var NccMenu             = GlobalContext.GetTableName <NccMenu>();
            var NccMenuItem         = GlobalContext.GetTableName <NccMenuItem>();
            var NccPage             = GlobalContext.GetTableName <NccPage>();
            var NccPageHistory      = GlobalContext.GetTableName <NccPageHistory>();

            var NccPageDetails        = GlobalContext.GetTableName <NccPageDetails>();
            var NccPageDetailsHistory = GlobalContext.GetTableName <NccPageDetailsHistory>();
            var NccPlugins            = GlobalContext.GetTableName <NccPlugins>();
            var NccPost                = GlobalContext.GetTableName <NccPost>();
            var NccCategory            = GlobalContext.GetTableName <NccCategory>();
            var NccPostCategory        = GlobalContext.GetTableName <NccPostCategory>();
            var NccComment             = GlobalContext.GetTableName <NccComment>();
            var NccTag                 = GlobalContext.GetTableName <NccTag>();
            var NccPostTag             = GlobalContext.GetTableName <NccPostTag>();
            var NccCategoryDetails     = GlobalContext.GetTableName <NccCategoryDetails>();
            var NccPostDetails         = GlobalContext.GetTableName <NccPostDetails>();
            var NccRole                = GlobalContext.GetTableName <NccRole>();
            var NccSettings            = GlobalContext.GetTableName <NccSettings>();
            var NccScheduleTaskHistory = GlobalContext.GetTableName <NccScheduleTaskHistory>();
            var NccStartup             = GlobalContext.GetTableName <NccStartup>();
            var NccUser                = GlobalContext.GetTableName <NccUser>();
            var NccUserRole            = GlobalContext.GetTableName <NccUserRole>();
            var NccWebSite             = GlobalContext.GetTableName <NccWebSite>();
            var NccWebSiteInfo         = GlobalContext.GetTableName <NccWebSiteInfo>();

            var NccPermission        = GlobalContext.GetTableName <NccPermission>();
            var NccPermissionDetails = GlobalContext.GetTableName <NccPermissionDetails>();
            var NccUserPermission    = GlobalContext.GetTableName <NccUserPermission>();
            var NccWebSiteWidget     = GlobalContext.GetTableName <NccWebSiteWidget>();
            var NccWidget            = GlobalContext.GetTableName <NccWidget>();
            var NccWidgetSection     = GlobalContext.GetTableName <NccWidgetSection>();
            var IdentityUserClaim    = GlobalContext.GetTableName <IdentityUserClaim <long> >();
            var IdentityRoleClaim    = GlobalContext.GetTableName <IdentityRoleClaim <long> >();
            var IdentityUserLogin    = GlobalContext.GetTableName <IdentityUserLogin <long> >();
            var IdentityUserToken    = GlobalContext.GetTableName <IdentityUserToken <long> >();

#pragma warning disable 612, 618
            modelBuilder
            .HasAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn)
            .HasAnnotation("ProductVersion", "2.0.1-rtm-125");

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<long>", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd();

                b.Property <string>("ClaimType");

                b.Property <string>("ClaimValue");

                b.Property <long>("RoleId");

                b.HasKey("Id");

                b.HasIndex("RoleId");

                b.ToTable(IdentityRoleClaim);
            });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<long>", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd();

                b.Property <string>("ClaimType");

                b.Property <string>("ClaimValue");

                b.Property <long?>("NccUserId");

                b.Property <long>("UserId");

                b.HasKey("Id");

                b.HasIndex("NccUserId");

                b.HasIndex("UserId");

                b.ToTable(IdentityUserClaim);
            });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<long>", b =>
            {
                b.Property <string>("LoginProvider");

                b.Property <string>("ProviderKey");

                b.Property <long?>("NccUserId");

                b.Property <string>("ProviderDisplayName");

                b.Property <long>("UserId");

                b.HasKey("LoginProvider", "ProviderKey");

                b.HasIndex("NccUserId");

                b.HasIndex("UserId");

                b.ToTable(IdentityUserLogin);
            });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<long>", b =>
            {
                b.Property <long>("UserId");

                b.Property <string>("LoginProvider");

                b.Property <string>("Name");

                b.Property <string>("Value");

                b.HasKey("UserId", "LoginProvider", "Name");

                b.ToTable(IdentityUserToken);
            });

            modelBuilder.Entity("DamaCoreCMS.Framework.Core.Models.NccCategory", b =>
            {
                b.Property <long>("Id")
                .ValueGeneratedOnAdd();

                b.Property <string>("CategoryImage");

                b.Property <long>("CreateBy");

                b.Property <DateTime>("CreationDate");

                b.Property <string>("Metadata");

                b.Property <DateTime>("ModificationDate");

                b.Property <long>("ModifyBy");

                b.Property <string>("Name");

                b.Property <long?>("ParentId");

                b.Property <int>("Status");

                b.Property <int>("VersionNumber");

                b.HasKey("Id");

                b.HasIndex("ParentId");

                b.ToTable(NccCategory);
            });

            modelBuilder.Entity("DamaCoreCMS.Framework.Core.Models.NccCategoryDetails", b =>
            {
                b.Property <long>("Id")
                .ValueGeneratedOnAdd();

                b.Property <long?>("CategoryId");

                b.Property <long>("CreateBy");

                b.Property <DateTime>("CreationDate");

                b.Property <string>("Language");

                b.Property <string>("MetaDescription");

                b.Property <string>("MetaKeyword");

                b.Property <string>("Metadata");

                b.Property <DateTime>("ModificationDate");

                b.Property <long>("ModifyBy");

                b.Property <string>("Name");

                b.Property <string>("Slug");

                b.Property <int>("Status");

                b.Property <string>("Title");

                b.Property <int>("VersionNumber");

                b.HasKey("Id");

                b.HasIndex("CategoryId");

                b.ToTable(NccCategoryDetails);
            });

            modelBuilder.Entity("DamaCoreCMS.Framework.Core.Models.NccComment", b =>
            {
                b.Property <long>("Id")
                .ValueGeneratedOnAdd();

                b.Property <long?>("AuthorId");

                b.Property <string>("AuthorName");

                b.Property <int>("CommentStatus");

                b.Property <string>("Content");

                b.Property <long>("CreateBy");

                b.Property <DateTime>("CreationDate");

                b.Property <string>("Email");

                b.Property <string>("Metadata");

                b.Property <DateTime>("ModificationDate");

                b.Property <long>("ModifyBy");

                b.Property <string>("Name");

                b.Property <long?>("PostId");

                b.Property <int>("Status");

                b.Property <string>("Title");

                b.Property <int>("VersionNumber");

                b.Property <string>("WebSite");

                b.HasKey("Id");

                b.HasIndex("AuthorId");

                b.HasIndex("PostId");

                b.ToTable(NccComment);
            });

            modelBuilder.Entity("DamaCoreCMS.Framework.Core.Models.NccMenu", b =>
            {
                b.Property <long>("Id")
                .ValueGeneratedOnAdd();

                b.Property <long>("CreateBy");

                b.Property <DateTime>("CreationDate");

                b.Property <string>("MenuIconCls");

                b.Property <string>("MenuLanguage");

                b.Property <int>("MenuOrder");

                b.Property <string>("Metadata");

                b.Property <DateTime>("ModificationDate");

                b.Property <long>("ModifyBy");

                b.Property <string>("Name");

                b.Property <string>("Position");

                b.Property <int>("Status");

                b.Property <int>("VersionNumber");

                b.HasKey("Id");

                b.ToTable(NccMenu);
            });

            modelBuilder.Entity("DamaCoreCMS.Framework.Core.Models.NccMenuItem", b =>
            {
                b.Property <long>("Id")
                .ValueGeneratedOnAdd();

                b.Property <string>("Action");

                b.Property <string>("Controller");

                b.Property <string>("Area");

                b.Property <long>("CreateBy");

                b.Property <DateTime>("CreationDate");

                b.Property <string>("Data");

                b.Property <int>("MenuActionType");

                b.Property <int>("MenuFor");

                b.Property <string>("MenuIconCls");

                b.Property <int>("MenuOrder");

                b.Property <string>("Metadata");

                b.Property <DateTime>("ModificationDate");

                b.Property <long>("ModifyBy");

                b.Property <string>("Module");

                b.Property <string>("Name");

                b.Property <long?>("NccMenuId");

                b.Property <long?>("NccMenuItemId");

                b.Property <long?>("NccMenuItemId1");

                b.Property <long?>("ParentId");

                b.Property <int>("Position");

                b.Property <int>("Status");

                b.Property <string>("Target");

                b.Property <bool>("IsAnonymous");

                b.Property <bool>("IsAllowAuthenticated");

                b.Property <string>("Url");

                b.Property <int>("VersionNumber");

                b.HasKey("Id");

                b.HasIndex("NccMenuId");

                b.HasIndex("NccMenuItemId");

                b.HasIndex("NccMenuItemId1");

                b.HasIndex("ParentId");

                b.ToTable(NccMenuItem);
            });

            modelBuilder.Entity("DamaCoreCMS.Framework.Core.Models.NccModule", b =>
            {
                b.Property <long>("Id")
                .ValueGeneratedOnAdd();

                b.Property <int>("ExecutionOrder");

                b.Property <bool>("AntiForgery");

                b.Property <string>("Author");

                b.Property <string>("Category");

                b.Property <long>("CreateBy");

                b.Property <DateTime>("CreationDate");

                b.Property <string>("Description");

                b.Property <string>("Folder");

                b.Property <bool>("IsCore");

                b.Property <string>("Metadata");

                b.Property <string>("NccVersion");

                b.Property <DateTime>("ModificationDate");

                b.Property <long>("ModifyBy");

                b.Property <string>("ModuleName");

                b.Property <int>("ModuleStatus");

                b.Property <string>("ModuleTitle");

                b.Property <string>("Name");

                b.Property <string>("Path");

                b.Property <int>("Status");

                b.Property <string>("Version");

                b.Property <int>("VersionNumber");

                b.Property <string>("WebSite");

                b.HasKey("Id");

                b.ToTable(NccModule);
            });

            modelBuilder.Entity("DamaCoreCMS.Framework.Core.Models.NccModuleDependency", b =>
            {
                b.Property <long>("Id")
                .ValueGeneratedOnAdd();

                b.Property <long>("CreateBy");

                b.Property <DateTime>("CreationDate");

                b.Property <string>("Metadata");

                b.Property <string>("ModuleVersion");

                b.Property <DateTime>("ModificationDate");

                b.Property <long>("ModifyBy");

                b.Property <string>("ModuleName");

                b.Property <string>("Name");

                b.Property <long?>("NccModuleId");

                b.Property <int>("Status");

                b.Property <int>("VersionNumber");

                b.HasKey("Id");

                b.HasIndex("NccModuleId");

                b.ToTable(NccModuleDependency);
            });

            modelBuilder.Entity("DamaCoreCMS.Framework.Core.Models.NccPage", b =>
            {
                b.Property <long>("Id")
                .ValueGeneratedOnAdd();

                b.Property <long>("CreateBy");

                b.Property <DateTime>("CreationDate");

                b.Property <string>("Layout");

                b.Property <string>("Metadata");

                b.Property <DateTime>("ModificationDate");

                b.Property <long>("ModifyBy");

                b.Property <string>("Name");

                b.Property <int>("PageOrder");

                b.Property <int>("PageStatus");

                b.Property <int>("PageType");

                b.Property <long?>("ParentId");

                b.Property <DateTime>("PublishDate");

                b.Property <int>("Status");

                b.Property <int>("VersionNumber");

                b.HasKey("Id");

                b.HasIndex("ParentId");

                b.ToTable(NccPage);
            });

            modelBuilder.Entity("DamaCoreCMS.Framework.Core.Models.NccPageDetails", b =>
            {
                b.Property <long>("Id")
                .ValueGeneratedOnAdd();

                b.Property <string>("Content")
                .HasMaxLength(2147483647);

                b.Property <long>("CreateBy");

                b.Property <DateTime>("CreationDate");

                b.Property <string>("Language");

                b.Property <string>("MetaDescription");

                b.Property <string>("MetaKeyword");

                b.Property <string>("Metadata");

                b.Property <DateTime>("ModificationDate");

                b.Property <long>("ModifyBy");

                b.Property <string>("Name");

                b.Property <long?>("PageId");

                b.Property <string>("Slug");

                b.Property <int>("Status");

                b.Property <string>("Title");

                b.Property <int>("VersionNumber");

                b.HasKey("Id");

                b.HasIndex("PageId");

                b.ToTable(NccPageDetails);
            });

            modelBuilder.Entity("DamaCoreCMS.Framework.Core.Models.NccPageDetailsHistory", b =>
            {
                b.Property <long>("Id")
                .ValueGeneratedOnAdd();

                b.Property <string>("Content")
                .HasMaxLength(2147483647);

                b.Property <long>("CreateBy");

                b.Property <DateTime>("CreationDate");

                b.Property <string>("Language");

                b.Property <string>("MetaDescription");

                b.Property <string>("MetaKeyword");

                b.Property <string>("Metadata");

                b.Property <DateTime>("ModificationDate");

                b.Property <long>("ModifyBy");

                b.Property <string>("Name");

                b.Property <long>("PageDetailsId");

                b.Property <long?>("PageHistoryId");

                b.Property <string>("Slug");

                b.Property <int>("Status");

                b.Property <string>("Title");

                b.Property <int>("VersionNumber");

                b.HasKey("Id");

                b.HasIndex("PageHistoryId");

                b.ToTable(NccPageDetailsHistory);
            });

            modelBuilder.Entity("DamaCoreCMS.Framework.Core.Models.NccPageHistory", b =>
            {
                b.Property <long>("Id")
                .ValueGeneratedOnAdd();

                b.Property <long>("CreateBy");

                b.Property <DateTime>("CreationDate");

                b.Property <string>("Layout");

                b.Property <string>("Metadata");

                b.Property <DateTime>("ModificationDate");

                b.Property <long>("ModifyBy");

                b.Property <string>("Name");

                b.Property <long>("PageId");

                b.Property <int>("PageOrder");

                b.Property <int>("PageStatus");

                b.Property <int>("PageType");

                b.Property <long?>("ParentId");

                b.Property <DateTime>("PublishDate");

                b.Property <int>("Status");

                b.Property <int>("VersionNumber");

                b.HasKey("Id");

                b.HasIndex("ParentId");

                b.ToTable(NccPageHistory);
            });

            modelBuilder.Entity("DamaCoreCMS.Framework.Core.Models.NccPermission", b =>
            {
                b.Property <long>("Id")
                .ValueGeneratedOnAdd();

                b.Property <long>("CreateBy");

                b.Property <DateTime>("CreationDate");

                b.Property <string>("Description");

                b.Property <string>("Group");

                b.Property <string>("Metadata");

                b.Property <DateTime>("ModificationDate");

                b.Property <long>("ModifyBy");

                b.Property <string>("Name");

                b.Property <int>("Rank");

                b.Property <int>("Status");

                b.Property <int>("VersionNumber");

                b.HasKey("Id");

                b.ToTable(NccPermission);
            });

            modelBuilder.Entity("DamaCoreCMS.Framework.Core.Models.NccPermissionDetails", b =>
            {
                b.Property <long>("Id")
                .ValueGeneratedOnAdd();

                b.Property <string>("Action");

                b.Property <string>("Controller");

                b.Property <long>("CreateBy");

                b.Property <DateTime>("CreationDate");

                b.Property <long?>("ExtraAllowUserId");

                b.Property <long?>("ExtraDenyUserId");

                b.Property <string>("MenuType");

                b.Property <string>("Metadata");

                b.Property <DateTime>("ModificationDate");

                b.Property <long>("ModifyBy");

                b.Property <string>("ModuleName");

                b.Property <string>("Name");

                b.Property <int>("Order");

                b.Property <long?>("PermissionId");

                b.Property <string>("Requirements");

                b.Property <int>("Status");

                b.Property <int>("VersionNumber");

                b.HasKey("Id");

                b.HasIndex("ExtraAllowUserId");

                b.HasIndex("ExtraDenyUserId");

                b.HasIndex("PermissionId");

                b.ToTable(NccPermissionDetails);
            });

            modelBuilder.Entity("DamaCoreCMS.Framework.Core.Models.NccPlugins", b =>
            {
                b.Property <long>("Id")
                .ValueGeneratedOnAdd();

                b.Property <bool>("AntiForgery");

                b.Property <string>("Author");

                b.Property <string>("Category");

                b.Property <long>("CreateBy");

                b.Property <DateTime>("CreationDate");

                b.Property <string>("Dependencies");

                b.Property <string>("Description");

                b.Property <string>("Metadata");

                b.Property <DateTime>("ModificationDate");

                b.Property <long>("ModifyBy");

                b.Property <string>("Name");

                b.Property <string>("DamaCoreCMSVersion");

                b.Property <string>("Path");

                b.Property <int>("PluginsStatus");

                b.Property <string>("SortName");

                b.Property <int>("Status");

                b.Property <string>("Version");

                b.Property <int>("VersionNumber");

                b.Property <string>("Website");

                b.HasKey("Id");

                b.ToTable(NccPlugins);
            });

            modelBuilder.Entity("DamaCoreCMS.Framework.Core.Models.NccPost", b =>
            {
                b.Property <long>("Id")
                .ValueGeneratedOnAdd();

                b.Property <bool>("AllowComment");

                b.Property <long?>("AuthorId");

                b.Property <long>("CommentCount");

                b.Property <long>("CreateBy");

                b.Property <DateTime>("CreationDate");

                b.Property <bool>("IsFeatured");

                b.Property <bool>("IsStiky");

                b.Property <string>("Layout");

                b.Property <string>("Metadata");

                b.Property <DateTime>("ModificationDate");

                b.Property <long>("ModifyBy");

                b.Property <string>("Name");

                b.Property <long?>("ParentId");

                b.Property <int>("PostStatus");

                b.Property <int>("PostType");

                b.Property <DateTime>("PublishDate");

                b.Property <string>("RelatedPosts");

                b.Property <int>("Status");

                b.Property <string>("ThumImage");

                b.Property <int>("VersionNumber");

                b.HasKey("Id");

                b.HasIndex("AuthorId");

                b.HasIndex("ParentId");

                b.ToTable(NccPost);
            });

            modelBuilder.Entity("DamaCoreCMS.Framework.Core.Models.NccPostCategory", b =>
            {
                b.Property <long>("PostId");

                b.Property <long>("CategoryId");

                b.HasKey("PostId", "CategoryId");

                b.HasIndex("CategoryId");

                b.ToTable(NccPostCategory);
            });

            modelBuilder.Entity("DamaCoreCMS.Framework.Core.Models.NccPostDetails", b =>
            {
                b.Property <long>("Id")
                .ValueGeneratedOnAdd();

                b.Property <string>("Content")
                .HasMaxLength(2147483647);

                b.Property <long>("CreateBy");

                b.Property <DateTime>("CreationDate");

                b.Property <string>("Language");

                b.Property <string>("MetaDescription");

                b.Property <string>("MetaKeyword");

                b.Property <string>("Metadata");

                b.Property <DateTime>("ModificationDate");

                b.Property <long>("ModifyBy");

                b.Property <string>("Name");

                b.Property <long?>("PostId");

                b.Property <string>("Slug");

                b.Property <int>("Status");

                b.Property <string>("Title");

                b.Property <int>("VersionNumber");

                b.HasKey("Id");

                b.HasIndex("PostId");

                b.ToTable(NccPostDetails);
            });

            modelBuilder.Entity("DamaCoreCMS.Framework.Core.Models.NccPostTag", b =>
            {
                b.Property <long>("PostId");

                b.Property <long>("TagId");

                b.HasKey("PostId", "TagId");

                b.HasIndex("TagId");

                b.ToTable(NccPostTag);
            });

            modelBuilder.Entity("DamaCoreCMS.Framework.Core.Models.NccRole", b =>
            {
                b.Property <long>("Id")
                .ValueGeneratedOnAdd()
                .HasAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);

                b.Property <string>("ConcurrencyStamp")
                .IsConcurrencyToken();

                b.Property <long>("CreateBy");

                b.Property <DateTime>("CreationDate");

                b.Property <string>("Metadata");

                b.Property <DateTime>("ModificationDate");

                b.Property <long>("ModifyBy");

                b.Property <string>("Name")
                .HasMaxLength(256);

                b.Property <string>("NormalizedName")
                .HasMaxLength(256);

                b.Property <string>("Slug");

                b.Property <int>("Status");

                b.Property <int>("VersionNumber");

                b.HasKey("Id");

                b.HasIndex("NormalizedName")
                .IsUnique()
                .HasName("RoleNameIndex");

                b.ToTable(NccRole);
            });

            modelBuilder.Entity("DamaCoreCMS.Framework.Core.Models.NccScheduleTaskHistory", b =>
            {
                b.Property <long>("Id")
                .ValueGeneratedOnAdd();

                b.Property <long>("CreateBy");

                b.Property <DateTime>("CreationDate");

                b.Property <string>("Data");

                b.Property <string>("Metadata");

                b.Property <DateTime>("ModificationDate");

                b.Property <long>("ModifyBy");

                b.Property <string>("Name");

                b.Property <int>("Status");

                b.Property <string>("TaskCreator");

                b.Property <string>("TaskId");

                b.Property <string>("TaskOf");

                b.Property <string>("TaskType");

                b.Property <int>("VersionNumber");

                b.HasKey("Id");

                b.ToTable(NccScheduleTaskHistory);
            });

            modelBuilder.Entity("DamaCoreCMS.Framework.Core.Models.NccSettings", b =>
            {
                b.Property <long>("Id")
                .ValueGeneratedOnAdd();

                b.Property <long>("CreateBy");

                b.Property <DateTime>("CreationDate");

                b.Property <string>("GroupId");

                b.Property <string>("Key");

                b.Property <string>("Metadata");

                b.Property <DateTime>("ModificationDate");

                b.Property <long>("ModifyBy");

                b.Property <string>("Name");

                b.Property <int>("Status");

                b.Property <string>("Value");

                b.Property <int>("VersionNumber");

                b.HasKey("Id");

                b.ToTable(NccSettings);
            });

            modelBuilder.Entity("DamaCoreCMS.Framework.Core.Models.NccStartup", b =>
            {
                b.Property <long>("Id")
                .ValueGeneratedOnAdd();

                b.Property <long>("CreateBy");

                b.Property <DateTime>("CreationDate");

                b.Property <string>("Metadata");

                b.Property <DateTime>("ModificationDate");

                b.Property <long>("ModifyBy");

                b.Property <string>("Name");

                b.Property <long?>("PermissionId");

                b.Property <long>("RoleId");

                b.Property <int>("StartupFor");

                b.Property <int>("StartupType");

                b.Property <string>("StartupUrl");

                b.Property <int>("Status");

                b.Property <long>("UserId");

                b.Property <int>("VersionNumber");

                b.HasKey("Id");

                b.HasIndex("PermissionId");

                b.ToTable(NccStartup);
            });

            modelBuilder.Entity("DamaCoreCMS.Framework.Core.Models.NccTag", b =>
            {
                b.Property <long>("Id")
                .ValueGeneratedOnAdd();

                b.Property <long>("CreateBy");

                b.Property <DateTime>("CreationDate");

                b.Property <string>("Metadata");

                b.Property <DateTime>("ModificationDate");

                b.Property <long>("ModifyBy");

                b.Property <string>("Name");

                b.Property <int>("Status");

                b.Property <int>("VersionNumber");

                b.HasKey("Id");

                b.ToTable(NccTag);
            });

            modelBuilder.Entity("DamaCoreCMS.Framework.Core.Models.NccUser", b =>
            {
                b.Property <long>("Id")
                .ValueGeneratedOnAdd()
                .HasAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);

                b.Property <int>("AccessFailedCount");

                b.Property <string>("ConcurrencyStamp")
                .IsConcurrencyToken();

                b.Property <long>("CreateBy");

                b.Property <DateTime>("CreationDate");

                b.Property <string>("Email")
                .HasMaxLength(256);

                b.Property <bool>("EmailConfirmed");

                b.Property <string>("FullName");

                b.Property <bool>("LockoutEnabled");

                b.Property <DateTimeOffset?>("LockoutEnd");

                b.Property <string>("Metadata");

                b.Property <string>("Mobile");

                b.Property <bool>("IsRequireLogin");

                b.Property <DateTime>("ModificationDate");

                b.Property <long>("ModifyBy");

                b.Property <string>("Name");

                b.Property <string>("NormalizedEmail")
                .HasMaxLength(256);

                b.Property <string>("NormalizedUserName")
                .HasMaxLength(256);

                b.Property <string>("PasswordHash");

                b.Property <string>("PhoneNumber");

                b.Property <bool>("PhoneNumberConfirmed");

                b.Property <string>("SecurityStamp");

                b.Property <string>("Slug");

                b.Property <int>("Status");

                b.Property <bool>("TwoFactorEnabled");

                b.Property <string>("UserName")
                .HasMaxLength(256);

                b.Property <int>("VersionNumber");

                b.HasKey("Id");

                b.HasIndex("NormalizedEmail")
                .HasName("EmailIndex");

                b.HasIndex("NormalizedUserName")
                .IsUnique()
                .HasName("UserNameIndex");

                b.ToTable(NccUser);
            });

            modelBuilder.Entity("DamaCoreCMS.Framework.Core.Models.NccUserPermission", b =>
            {
                b.Property <long>("UserId");

                b.Property <long>("PermissionId");

                b.HasKey("UserId", "PermissionId");

                b.HasIndex("PermissionId");

                b.ToTable(NccUserPermission);
            });

            modelBuilder.Entity("DamaCoreCMS.Framework.Core.Models.NccUserRole", b =>
            {
                b.Property <long>("UserId");

                b.Property <long>("RoleId");

                b.HasKey("UserId", "RoleId");

                b.HasIndex("RoleId");

                b.ToTable(NccUserRole);
            });

            modelBuilder.Entity("DamaCoreCMS.Framework.Core.Models.NccWebSite", b =>
            {
                b.Property <long>("Id")
                .ValueGeneratedOnAdd();

                b.Property <int>("AdminPageSize");

                b.Property <bool>("AllowRegistration");

                b.Property <long>("CreateBy");

                b.Property <DateTime>("CreationDate");

                b.Property <string>("DateFormat");

                b.Property <string>("DomainName");

                b.Property <string>("EmailAddress");

                b.Property <bool>("EnableCache")
                .ValueGeneratedOnAdd()
                .HasDefaultValue(false);

                b.Property <string>("GoogleAnalyticsId");

                b.Property <bool>("IsMultiLangual");

                b.Property <bool>("IsShowFullPost");

                b.Property <string>("Language");

                b.Property <string>("Metadata");

                b.Property <DateTime>("ModificationDate");

                b.Property <long>("ModifyBy");

                b.Property <string>("Name");

                b.Property <string>("NewUserRole");

                b.Property <int>("Status");

                b.Property <string>("TablePrefix");

                b.Property <string>("TimeFormat");

                b.Property <string>("TimeZone");

                b.Property <int>("VersionNumber");

                b.Property <int>("WebSitePageSize");

                b.HasKey("Id");

                b.ToTable(NccWebSite);
            });

            modelBuilder.Entity("DamaCoreCMS.Framework.Core.Models.NccWebSiteInfo", b =>
            {
                b.Property <long>("Id")
                .ValueGeneratedOnAdd();

                b.Property <string>("Copyrights");

                b.Property <long>("CreateBy");

                b.Property <DateTime>("CreationDate");

                b.Property <string>("FaviconUrl");

                b.Property <string>("Language");

                b.Property <string>("Metadata");

                b.Property <DateTime>("ModificationDate");

                b.Property <long>("ModifyBy");

                b.Property <string>("Name");

                b.Property <long?>("NccWebSiteId");

                b.Property <string>("PrivacyPolicyUrl");

                b.Property <string>("SiteLogoUrl");

                b.Property <string>("SiteTitle");

                b.Property <int>("Status");

                b.Property <string>("Tagline");

                b.Property <string>("TermsAndConditionsUrl");

                b.Property <int>("VersionNumber");

                b.HasKey("Id");

                b.HasIndex("NccWebSiteId");

                b.ToTable(NccWebSiteInfo);
            });

            modelBuilder.Entity("DamaCoreCMS.Framework.Core.Models.NccWebSiteWidget", b =>
            {
                b.Property <long>("Id")
                .ValueGeneratedOnAdd();

                b.Property <long>("CreateBy");

                b.Property <DateTime>("CreationDate");

                b.Property <string>("LayoutName");

                b.Property <string>("Metadata");

                b.Property <DateTime>("ModificationDate");

                b.Property <long>("ModifyBy");

                b.Property <string>("ModuleName");

                b.Property <string>("Name");

                b.Property <int>("Status");

                b.Property <string>("ThemeId");

                b.Property <int>("VersionNumber");

                b.Property <long?>("WebSiteId");

                b.Property <string>("WidgetConfigJson");

                b.Property <string>("WidgetData");

                b.Property <string>("WidgetId");

                b.Property <int>("WidgetOrder");

                b.Property <string>("Zone");

                b.HasKey("Id");

                b.HasIndex("WebSiteId");

                b.ToTable(NccWebSiteWidget);
            });

            modelBuilder.Entity("DamaCoreCMS.Framework.Core.Models.NccWidget", b =>
            {
                b.Property <long>("Id")
                .ValueGeneratedOnAdd();

                b.Property <byte[]>("Content");

                b.Property <long>("CreateBy");

                b.Property <DateTime>("CreationDate");

                b.Property <string>("Dependencies");

                b.Property <string>("Description");

                b.Property <string>("Metadata");

                b.Property <DateTime>("ModificationDate");

                b.Property <long>("ModifyBy");

                b.Property <string>("Name");

                b.Property <long?>("NccPluginsId");

                b.Property <string>("DamaCoreCMSVersion");

                b.Property <string>("SortName");

                b.Property <int>("Status");

                b.Property <string>("Title");

                b.Property <int>("VersionNumber");

                b.HasKey("Id");

                b.HasIndex("NccPluginsId");

                b.ToTable(NccWidget);
            });

            modelBuilder.Entity("DamaCoreCMS.Framework.Core.Models.NccWidgetSection", b =>
            {
                b.Property <long>("Id")
                .ValueGeneratedOnAdd();

                b.Property <long>("CreateBy");

                b.Property <DateTime>("CreationDate");

                b.Property <string>("Dependencies");

                b.Property <string>("Description");

                b.Property <string>("Metadata");

                b.Property <DateTime>("ModificationDate");

                b.Property <long>("ModifyBy");

                b.Property <string>("Name");

                b.Property <string>("DamaCoreCMSVersion");

                b.Property <string>("SortName");

                b.Property <int>("Status");

                b.Property <string>("Title");

                b.Property <int>("VersionNumber");

                b.HasKey("Id");

                b.ToTable(NccWidgetSection);
            });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<long>", b =>
            {
                b.HasOne("DamaCoreCMS.Framework.Core.Models.NccRole")
                .WithMany()
                .HasForeignKey("RoleId")
                .OnDelete(DeleteBehavior.Cascade);
            });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<long>", b =>
            {
                b.HasOne("DamaCoreCMS.Framework.Core.Models.NccUser")
                .WithMany("Claims")
                .HasForeignKey("NccUserId");

                b.HasOne("DamaCoreCMS.Framework.Core.Models.NccUser")
                .WithMany()
                .HasForeignKey("UserId")
                .OnDelete(DeleteBehavior.Cascade);
            });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<long>", b =>
            {
                b.HasOne("DamaCoreCMS.Framework.Core.Models.NccUser")
                .WithMany("Logins")
                .HasForeignKey("NccUserId");

                b.HasOne("DamaCoreCMS.Framework.Core.Models.NccUser")
                .WithMany()
                .HasForeignKey("UserId")
                .OnDelete(DeleteBehavior.Cascade);
            });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<long>", b =>
            {
                b.HasOne("DamaCoreCMS.Framework.Core.Models.NccUser")
                .WithMany()
                .HasForeignKey("UserId")
                .OnDelete(DeleteBehavior.Cascade);
            });

            modelBuilder.Entity("DamaCoreCMS.Framework.Core.Models.NccCategory", b =>
            {
                b.HasOne("DamaCoreCMS.Framework.Core.Models.NccCategory", "Parent")
                .WithMany()
                .HasForeignKey("ParentId");
            });

            modelBuilder.Entity("DamaCoreCMS.Framework.Core.Models.NccCategoryDetails", b =>
            {
                b.HasOne("DamaCoreCMS.Framework.Core.Models.NccCategory", "Category")
                .WithMany("CategoryDetails")
                .HasForeignKey("CategoryId");
            });

            modelBuilder.Entity("DamaCoreCMS.Framework.Core.Models.NccComment", b =>
            {
                b.HasOne("DamaCoreCMS.Framework.Core.Models.NccUser", "Author")
                .WithMany()
                .HasForeignKey("AuthorId");

                b.HasOne("DamaCoreCMS.Framework.Core.Models.NccPost", "Post")
                .WithMany("Comments")
                .HasForeignKey("PostId");
            });

            modelBuilder.Entity("DamaCoreCMS.Framework.Core.Models.NccMenuItem", b =>
            {
                b.HasOne("DamaCoreCMS.Framework.Core.Models.NccMenu")
                .WithMany("MenuItems")
                .HasForeignKey("NccMenuId");

                b.HasOne("DamaCoreCMS.Framework.Core.Models.NccMenuItem")
                .WithMany("SubActions")
                .HasForeignKey("NccMenuItemId");

                b.HasOne("DamaCoreCMS.Framework.Core.Models.NccMenuItem")
                .WithMany("Childrens")
                .HasForeignKey("NccMenuItemId1");

                b.HasOne("DamaCoreCMS.Framework.Core.Models.NccMenuItem", "Parent")
                .WithMany()
                .HasForeignKey("ParentId");
            });

            modelBuilder.Entity("DamaCoreCMS.Framework.Core.Models.NccModuleDependency", b =>
            {
                b.HasOne("DamaCoreCMS.Framework.Core.Models.NccModule")
                .WithMany("Dependencies")
                .HasForeignKey("NccModuleId");
            });

            modelBuilder.Entity("DamaCoreCMS.Framework.Core.Models.NccPage", b =>
            {
                b.HasOne("DamaCoreCMS.Framework.Core.Models.NccPage", "Parent")
                .WithMany()
                .HasForeignKey("ParentId");
            });

            modelBuilder.Entity("DamaCoreCMS.Framework.Core.Models.NccPageDetails", b =>
            {
                b.HasOne("DamaCoreCMS.Framework.Core.Models.NccPage", "Page")
                .WithMany("PageDetails")
                .HasForeignKey("PageId");
            });

            modelBuilder.Entity("DamaCoreCMS.Framework.Core.Models.NccPageDetailsHistory", b =>
            {
                b.HasOne("DamaCoreCMS.Framework.Core.Models.NccPageHistory", "PageHistory")
                .WithMany("PageDetailsHistory")
                .HasForeignKey("PageHistoryId");
            });

            modelBuilder.Entity("DamaCoreCMS.Framework.Core.Models.NccPageHistory", b =>
            {
                b.HasOne("DamaCoreCMS.Framework.Core.Models.NccPage", "Parent")
                .WithMany()
                .HasForeignKey("ParentId");
            });

            modelBuilder.Entity("DamaCoreCMS.Framework.Core.Models.NccPermissionDetails", b =>
            {
                b.HasOne("DamaCoreCMS.Framework.Core.Models.NccUser", "AllowUser")
                .WithMany("ExtraPermissions")
                .HasForeignKey("ExtraAllowUserId");

                b.HasOne("DamaCoreCMS.Framework.Core.Models.NccUser", "DenyUser")
                .WithMany("ExtraDenies")
                .HasForeignKey("ExtraDenyUserId");

                b.HasOne("DamaCoreCMS.Framework.Core.Models.NccPermission", "Permission")
                .WithMany("PermissionDetails")
                .HasForeignKey("PermissionId");
            });

            modelBuilder.Entity("DamaCoreCMS.Framework.Core.Models.NccPost", b =>
            {
                b.HasOne("DamaCoreCMS.Framework.Core.Models.NccUser", "Author")
                .WithMany()
                .HasForeignKey("AuthorId");

                b.HasOne("DamaCoreCMS.Framework.Core.Models.NccPost", "Parent")
                .WithMany()
                .HasForeignKey("ParentId");
            });

            modelBuilder.Entity("DamaCoreCMS.Framework.Core.Models.NccPostCategory", b =>
            {
                b.HasOne("DamaCoreCMS.Framework.Core.Models.NccCategory", "Category")
                .WithMany("Posts")
                .HasForeignKey("CategoryId")
                .OnDelete(DeleteBehavior.Cascade);

                b.HasOne("DamaCoreCMS.Framework.Core.Models.NccPost", "Post")
                .WithMany("Categories")
                .HasForeignKey("PostId")
                .OnDelete(DeleteBehavior.Cascade);
            });

            modelBuilder.Entity("DamaCoreCMS.Framework.Core.Models.NccPostDetails", b =>
            {
                b.HasOne("DamaCoreCMS.Framework.Core.Models.NccPost", "Post")
                .WithMany("PostDetails")
                .HasForeignKey("PostId");
            });

            modelBuilder.Entity("DamaCoreCMS.Framework.Core.Models.NccPostTag", b =>
            {
                b.HasOne("DamaCoreCMS.Framework.Core.Models.NccPost", "Post")
                .WithMany("Tags")
                .HasForeignKey("PostId")
                .OnDelete(DeleteBehavior.Cascade);

                b.HasOne("DamaCoreCMS.Framework.Core.Models.NccTag", "Tag")
                .WithMany("Posts")
                .HasForeignKey("TagId")
                .OnDelete(DeleteBehavior.Cascade);
            });

            modelBuilder.Entity("DamaCoreCMS.Framework.Core.Models.NccStartup", b =>
            {
                b.HasOne("DamaCoreCMS.Framework.Core.Models.NccPermission", "Permission")
                .WithMany()
                .HasForeignKey("PermissionId");
            });

            modelBuilder.Entity("DamaCoreCMS.Framework.Core.Models.NccUserPermission", b =>
            {
                b.HasOne("DamaCoreCMS.Framework.Core.Models.NccPermission", "Permission")
                .WithMany("Users")
                .HasForeignKey("PermissionId")
                .OnDelete(DeleteBehavior.Cascade);

                b.HasOne("DamaCoreCMS.Framework.Core.Models.NccUser", "User")
                .WithMany("Permissions")
                .HasForeignKey("UserId")
                .OnDelete(DeleteBehavior.Cascade);
            });

            modelBuilder.Entity("DamaCoreCMS.Framework.Core.Models.NccUserRole", b =>
            {
                b.HasOne("DamaCoreCMS.Framework.Core.Models.NccRole", "Role")
                .WithMany("Users")
                .HasForeignKey("RoleId")
                .OnDelete(DeleteBehavior.Cascade);

                b.HasOne("DamaCoreCMS.Framework.Core.Models.NccUser", "User")
                .WithMany("Roles")
                .HasForeignKey("UserId")
                .OnDelete(DeleteBehavior.Cascade);
            });

            modelBuilder.Entity("DamaCoreCMS.Framework.Core.Models.NccWebSiteInfo", b =>
            {
                b.HasOne("DamaCoreCMS.Framework.Core.Models.NccWebSite")
                .WithMany("WebSiteInfos")
                .HasForeignKey("NccWebSiteId");
            });

            modelBuilder.Entity("DamaCoreCMS.Framework.Core.Models.NccWebSiteWidget", b =>
            {
                b.HasOne("DamaCoreCMS.Framework.Core.Models.NccWebSite", "WebSite")
                .WithMany()
                .HasForeignKey("WebSiteId");
            });

            modelBuilder.Entity("DamaCoreCMS.Framework.Core.Models.NccWidget", b =>
            {
                b.HasOne("DamaCoreCMS.Framework.Core.Models.NccPlugins")
                .WithMany("Widgets")
                .HasForeignKey("NccPluginsId");
            });
#pragma warning restore 612, 618
        }
Esempio n. 28
0
 public ScreenChangerUnitController(GlobalContext context, ScreenChangerUnitModel model, GameObject screenRoot)
 {
     _context    = context;
     _model      = model;
     _screenRoot = screenRoot;
 }
Esempio n. 29
0
 /// <summary>
 /// Makes the path which points to single any variable.
 /// </summary>
 /// <param name="global">The global.</param>
 /// <param name="callLevel">The call level.</param>
 /// <returns>New path which points to single any variable</returns>
 public static MemoryPath MakePathAnyVariable(GlobalContext global, int callLevel)
 {
     return(new MemoryPath(new VariablePathSegment(true), global, callLevel));
 }
Esempio n. 30
0
 protected BaseStep(GlobalContext context)
 {
     _context = context;
 }
Esempio n. 31
0
 /// <summary>
 /// Makes the path to control variables with given names.
 /// </summary>
 /// <param name="names">The names.</param>
 /// <param name="global">The global.</param>
 /// <param name="callLevel">The call level.</param>
 /// <returns>New path to control variables with given names</returns>
 public static MemoryPath MakePathControl(IEnumerable <string> names, GlobalContext global, int callLevel)
 {
     return(new MemoryPath(new ControlPathSegment(names), global, callLevel));
 }
Esempio n. 32
0
 public Startup(IConfiguration configuration, IWebHostEnvironment env)
 {
     Configuration = configuration;
     GlobalContext.LogWhenStart(env);
     GlobalContext.HostingEnvironment = env;
 }
Esempio n. 33
0
        /// <summary>
        /// Initializes a new Module with specified code, callback for output compiler messages and compiler options.
        /// </summary>
        /// <param name="virtualPath">Path to file with script. Used for resolving paths to other modules for importing via import directive. Can be null or empty</param>
        /// <param name="code">JavaScript code.</param>
        /// <param name="messageCallback">Callback used to output compiler messages or null</param>
        /// <param name="options">Compiler options</param>
        public Module(string virtualPath, string code, CompilerMessageCallback messageCallback = null, Options options = Options.None, GlobalContext globalContext = null)
        {
            if (code == null)
            {
                throw new ArgumentNullException();
            }

            this.FilePath = virtualPath;

            Context           = new Context(globalContext ?? Context.CurrentGlobalContext, true, null);
            Context._module   = this;
            Context._thisBind = new GlobalObject(Context);

            Script = Script.Parse(code, messageCallback, options);

            Context._strict = Script.Root._strict;
        }
Esempio n. 34
0
 public CargoService(GlobalContext context)
 {
     Repository = new CargoRepository(context);
 }
Esempio n. 35
0
        public void MyTestInitialize()
        {
            //Configuration.Init();
            _dataContext = new DataContext(_connectionString);
            DataContext.Current = _dataContext;

            //string modulesVirtualPath = @"c:\Projects\IbnNextTfs\4.8\Server\WebPortal\Apps\";
            string modulesDirectoryPath = @"c:\Projects\IbnNextTfs\4.8\Server\WebPortal\Apps";
            GlobalContext context = GlobalContext.Current;
            if (context == null)
            {
                context = new GlobalContext(null);
                GlobalContext.Current = context;
            }
            context.ModulesDirectoryPath = modulesDirectoryPath;
            //context.ModulesVirtualPath = modulesVirtualPath;

            int usr = Mediachase.Ibn.Data.Services.Security.CurrentUserId;
            if (usr == -1)
            {
                //usr = Mediachase.IBN.Business.Security.UserLogin("et", "ibn");
                Mediachase.Ibn.Data.Services.Security.CurrentUserId = 329;
            }
        }
Esempio n. 36
0
 public CalculateStep(GlobalContext context, IEnumerable<Calculator> calculators)
     : base(context)
 {
     _calculators = calculators;
 }
Esempio n. 37
0
 private static void InitializeGlobalContext()
 {
     _globalContext = new GlobalContext();
 }
Esempio n. 38
0
        public JsonResult ManageAjax(int draw, int start, int length)
        {
            var CommentStatus = Enum.GetValues(typeof(NccComment.NccCommentStatus)).Cast <NccComment.NccCommentStatus>().Select(v => new SelectListItem
            {
                Text  = v.ToString(),
                Value = ((int)v).ToString()
            }).ToList();

            var  data            = new List <object>();
            long recordsTotal    = 0;
            long recordsFiltered = 0;

            try
            {
                string searchText = HttpContext.Request.Form["search[value]"];
                searchText = searchText.Trim();
                #region OrderBy and Direction
                string orderBy  = HttpContext.Request.Form["order[0][column]"];
                string orderDir = HttpContext.Request.Form["order[0][dir]"];
                if (!string.IsNullOrEmpty(orderDir))
                {
                    orderDir = orderDir.ToUpper();
                }
                if (!string.IsNullOrEmpty(orderBy))
                {
                    switch (orderBy)
                    {
                    case "0":
                        orderBy = "name";
                        break;

                    default:
                        orderBy = "";
                        break;
                    }
                }
                #endregion

                recordsTotal    = _nccCommentsService.Count(false, GlobalContext.GetCurrentUserId(), searchText);
                recordsFiltered = recordsTotal;
                List <NccComment> itemList       = _nccCommentsService.Load(start, length, false, GlobalContext.GetCurrentUserId(), searchText, orderBy, orderDir);
                string            controllerName = "Comments";
                foreach (var item in itemList)
                {
                    var str = new List <string>();
                    str.Add(item.Post.Name);
                    str.Add(item.Content);
                    str.Add(item.AuthorName);

                    if (item.CreateBy == item.ModifyBy)
                    {
                        str.Add(_nccUserService.Get(item.CreateBy)?.UserName);
                    }
                    else
                    {
                        str.Add("<b>Cr:</b> " + _nccUserService.Get(item.CreateBy)?.UserName + "<br /><b>Mo:</b> " + _nccUserService.Get(item.ModifyBy)?.UserName);
                    }

                    if (item.CreationDate == item.ModificationDate)
                    {
                        str.Add(item.CreationDate.ToString("yyyy-MM-dd hh:mm tt"));
                    }
                    else
                    {
                        str.Add("<b>Cr:</b> " + item.CreationDate.ToString("yyyy-MM-dd hh:mm tt") + "<br /><b>Mo:</b> " + item.ModificationDate.ToString("yyyy-MM-dd hh:mm tt"));
                    }

                    str.Add(item.CommentStatus.ToString());

                    string actionLink = "";
                    foreach (var commentsItem in CommentStatus)
                    {
                        if (item.CommentStatus.ToString() != commentsItem.Text)
                        {
                            actionLink += " <a href='" + Url.Action("StatusUpdate", controllerName, new { id = item.Id.ToString(), commentStatus = commentsItem.Value }) + "' class='btn btn-xs btn-info btn-outline'>" + commentsItem.Text + "</a> ";
                        }
                    }

                    actionLink += " <a href='" + Url.Action("Delete", controllerName, new { id = item.Id.ToString() }) + "' class='btn btn-xs btn-danger'>Delete</a> ";
                    str.Add(actionLink);
                    data.Add(str);
                }
            }
            catch (Exception ex)
            {
                _logger.LogError(ex.Message);
            }

            return(Json(new
            {
                draw = draw,
                recordsTotal = recordsTotal,
                recordsFiltered = recordsFiltered,
                start = start,
                length = length,
                data = data
            }));
        }
Esempio n. 39
0
 protected GlobalContext(GlobalContext ctx, GameState g)
     : base(ctx, g)
 {
 }
 private void InitialiseDependencies()
 {
     GlobalContext.Instance().TransFactory = new TransManagerEntityStoreFactory();
     Container.RequestContext = new RequestContextNaive();
     ClientServiceLocator.Instance().CommandDispatcher = new DirectCommandDispatcher();
 }
 public TelefoneEmpresaService(GlobalContext context)
 {
     Repository = new TelefoneEmpresaRepository(context);
 }
Esempio n. 42
0
 public PrepareStep(GlobalContext context)
     : base(context)
 {
 }