Пример #1
0
        private void SetupVariablesAndLocalization(IApplicationBuilder app, IWebHostEnvironment env)
        {
            ServerBaseDefines.ContentRootPath  = env.ContentRootPath;
            ServerBaseDefines.WWWRootPath      = env.WebRootPath;
            ServerBaseDefines.ConnectionString = Configuration["ConnectionStrings:SampleConnection"];
            var   regex = new Regex("server=(\\d+.\\d+.\\d+.\\d+)", RegexOptions.None, TimeSpan.FromMilliseconds(1000));
            Match match = regex.Match(ServerBaseDefines.ConnectionString);

            if (match.Success)
            {
                SDefines.ServerIPAddress = match.Groups[1].Value;
            }
            ServerBaseDefines.FireBaseServerKey = Configuration["FireBaseServerKey"];
            SLogger.LogDebug("Colocar o conteudo do Angular na pasta " + ServerBaseDefines.WWWRootPath + " para testar sem docker");
            var locale = "pt-BR";
            RequestLocalizationOptions localizationOptions = new RequestLocalizationOptions {
                SupportedCultures = new List <CultureInfo> {
                    new CultureInfo(locale)
                },
                SupportedUICultures = new List <CultureInfo> {
                    new CultureInfo(locale)
                },
                DefaultRequestCulture = new RequestCulture(locale)
            };

            app.UseRequestLocalization(localizationOptions);
#if DEBUG
            ServerBaseDefines.AppleDevelopmentPushMode = true; //sandbox, debug .p12
#else
            ServerBaseDefines.AppleDevelopmentPushMode = false;
#endif
        }
Пример #2
0
        public void Teste()
        {
            var t       = EntityType.Client | EntityType.Driver;
            var hasFlag = t.HasFlag(EntityType.Employee);

            SLogger.LogDebug($"HasFlag: {hasFlag}: {t.ToString()}");
        }
Пример #3
0
        private string Validate(ValidationResult result)
        {
            if (!result.IsValid)
            {
                string validationExceptions = this.validationMessageManager.GetValidationString(result);

                SLogger.LogWarnFormat("Found validationExceptions {0}", validationExceptions);

                return(validationExceptions);
            }

            SLogger.LogDebug("Validation succeeded. No issues noticed.");

            return(string.Empty);
        }