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)); }
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)); }