created ApplicationController which returns an AppDetails object with the properties filled.
#48
This commit is contained in:
parent
f4e8f0a76f
commit
6f3c5931f4
@ -40,6 +40,7 @@
|
|||||||
<Reference Include="System.Xml" />
|
<Reference Include="System.Xml" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Compile Include="AppDetails.cs" />
|
||||||
<Compile Include="DailyLogs.cs" />
|
<Compile Include="DailyLogs.cs" />
|
||||||
<Compile Include="ILogger.cs" />
|
<Compile Include="ILogger.cs" />
|
||||||
<Compile Include="IRepository.cs" />
|
<Compile Include="IRepository.cs" />
|
||||||
|
|||||||
@ -0,0 +1,27 @@
|
|||||||
|
using System.Configuration;
|
||||||
|
using System.Reflection;
|
||||||
|
using System.Web.Http;
|
||||||
|
using Interfaces;
|
||||||
|
|
||||||
|
namespace WindowsDataCenter
|
||||||
|
{
|
||||||
|
[RoutePrefix("api/app")]
|
||||||
|
public class ApplicationController:ApiController
|
||||||
|
{
|
||||||
|
[Route("")]
|
||||||
|
public IHttpActionResult GetAppDetails()
|
||||||
|
{
|
||||||
|
var ninjectHelper = NinjectHelper.GetInstance();
|
||||||
|
var appDetails = new AppDetails
|
||||||
|
{
|
||||||
|
ApplicationName = "Flexitime Tracker",
|
||||||
|
DataBaseProvider = ninjectHelper.Get<IRepository>().GetType().ToString(),
|
||||||
|
LoggerProvider = ninjectHelper.Get<ILogger>().GetType().ToString(),
|
||||||
|
Version = Assembly.GetEntryAssembly().GetName().Version.ToString(),
|
||||||
|
ErrorEmailAddress = ConfigurationManager.AppSettings["BugSubmissionEmailAddress"] ?? "NONE"
|
||||||
|
};
|
||||||
|
|
||||||
|
return Ok(appDetails);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -147,6 +147,7 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="CardData.cs" />
|
<Compile Include="CardData.cs" />
|
||||||
|
<Compile Include="Controllers\ApplicationController.cs" />
|
||||||
<Compile Include="Controllers\CardsController.cs" />
|
<Compile Include="Controllers\CardsController.cs" />
|
||||||
<Compile Include="Configuration.cs" />
|
<Compile Include="Configuration.cs" />
|
||||||
<Compile Include="Controllers\TimelogController.cs" />
|
<Compile Include="Controllers\TimelogController.cs" />
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user