Example #1
0
        public IActionResult GetLayerPartBreakChance(
            [FromRoute] string database,
            [FromRoute] string id)
        {
            ICadmusRepository repository =
                _repositoryProvider.CreateRepository(database);

            string intervalOption = _configuration.GetSection("Editing")
                                    ["BaseToLayerToleranceSeconds"];
            int interval;

            if (!string.IsNullOrEmpty(intervalOption) &&
                int.TryParse(intervalOption, out int n))
            {
                interval = n;
            }
            else
            {
                interval = 60;
            }

            int chance = repository.GetLayerPartBreakChance(id, interval);

            return(Ok(new
            {
                Chance = chance
            }));
        }