Ejemplo n.º 1
0
        public ActionResult <string> Get()
        {
            var versionInfo = new to.Models.Version
            {
                Company        = Assembly.GetEntryAssembly().GetCustomAttribute <AssemblyCompanyAttribute>().Company,
                Product        = Assembly.GetEntryAssembly().GetCustomAttribute <AssemblyProductAttribute>().Product,
                ProductVersion = Assembly.GetEntryAssembly().GetCustomAttribute <AssemblyInformationalVersionAttribute>().InformationalVersion
            };

            return(Ok(versionInfo));
        }
Ejemplo n.º 2
0
        public ActionResult <string> Get()
        {
            Log.Information("Acquiring version info");
            Log.Warning("Some warning");
            Log.Error("Here comes an error");
            var versionInfo = new to.Models.Version
            {
                Company        = Assembly.GetEntryAssembly().GetCustomAttribute <AssemblyCompanyAttribute>().Company,
                Product        = Assembly.GetEntryAssembly().GetCustomAttribute <AssemblyProductAttribute>().Product,
                ProductVersion = Assembly.GetEntryAssembly().GetCustomAttribute <AssemblyInformationalVersionAttribute>().InformationalVersion
            };

            Log.Information($"Acquired version is {versionInfo.ProductVersion}");
            Log.Debug($"Full version info: {@versionInfo}");

            return(Ok(versionInfo));
        }