Esempio n. 1
0
        public void Execute(List <string>?args = null)
        {
            string version = VersionService.GetVersion();
            string build   = BuildService.GetBuild();

            Console.Write($"Lexica {version} (CLI)");
            if (build.Length > 0)
            {
                Console.Write($" (build: {build})");
            }
            Console.WriteLine();
            Console.WriteLine("Copyright (c) Łukasz Rydzkowski");
        }
Esempio n. 2
0
        public void SetVersionInWindowTitle()
        {
            string appName = "Lexica";
            string version = VersionService.GetVersion();
            string build   = BuildService.GetBuild();
            string title   = $"{appName} {version}";

            if (build.Length > 0)
            {
                title += $" ({build})";
            }
            Console.Title = title;
        }
Esempio n. 3
0
        public IActionResult OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            Build = _context.GetBuild(id.Value);
            if (Build == null)
            {
                return(NotFound());
            }

            return(Page());
        }
Esempio n. 4
0
        public async Task <ActionResult <DsBuildResponse> > GetBuild(DsBuildRequest request)
        {
            Stopwatch sw = new Stopwatch();

            sw.Start();
            DsBuildResponse response;

            if (!memoryCache.TryGetValue(request.CacheKey, out response))
            {
                response = await BuildService.GetBuild(context, request);

                memoryCache.Set(request.CacheKey, response, CacheService.BuildCacheOptions);
                sw.Stop();
                logger.LogInformation($"Get Build in {sw.ElapsedMilliseconds} ms");
            }
            else
            {
                sw.Stop();
                logger.LogInformation($"Get Build from Cache in {sw.ElapsedMilliseconds} ms");
            }
            return(response);
        }
Esempio n. 5
0
 public async Task <DsBuildResponse> GetBuild(DsBuildRequest request)
 {
     return(await BuildService.GetBuild(context, request));
 }
 public async Task <Build> Get(string id)
 {
     return(await _buildService.GetBuild(id));
 }