Skip to content

Commit

Permalink
Sample application updated
Browse files Browse the repository at this point in the history
Updated to new KonfDB Client Framework
  • Loading branch information
punitganshani committed Oct 31, 2014
1 parent 51e7484 commit d0dff5e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,16 @@ public static void GetAppConfiguration()
{
try
{
// Create connection to Command Service of KonfDB based on settings
// in app.config file
ICommandService commandService = ConnectionFactory.GetInstance();

// Get the user token if authenticated
var userToken = ConnectionFactory.GetUserToken();

// var commands = commandService.GetCommandsStartingWith("");

var userToken = CConnectionFactory.GetUserToken();
var commandService = CConnectionFactory.GetInstance();
// If we got back a token, means user was authenticated
if (userToken != null)
{
var output = commandService.ExecuteCommand("get /app:6 /env:8 /region:8 /server:9", userToken);
if (output != null)
{
var parameters = (List<ConfigurationModel>)output.Data;
parameters.ForEach(param =>
{
Console.WriteLine(param.ParameterName + "=" + param.ParameterValue);
});
parameters.ForEach(param => Console.WriteLine(param.ParameterName + "=" + param.ParameterValue));
}
}
}
Expand Down
14 changes: 6 additions & 8 deletions Samples/KonfDB.Samples/KonfDBCF.Sample/KonfDBCF.Sample.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,19 @@
<StartupObject>KonfDBCF.Sample.Program</StartupObject>
</PropertyGroup>
<ItemGroup>
<Reference Include="KonfDBCF, Version=0.1.0.0, Culture=neutral, PublicKeyToken=b39646439164054e, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\packages\KonfDBCF.0.1.0.0\lib\net40\KonfDBCF.dll</HintPath>
<Reference Include="KonfDBC">
<HintPath>..\packages\KonfDBCF.0.4.0.1\lib\net40\KonfDBC.dll</HintPath>
</Reference>
<Reference Include="KonfDBI, Version=0.1.0.0, Culture=neutral, PublicKeyToken=b39646439164054e, processorArchitecture=MSIL">
<Reference Include="KonfDBCF, Version=0.4.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\packages\KonfDBCF.0.1.0.0\lib\net40\KonfDBI.dll</HintPath>
<HintPath>..\packages\KonfDBCF.0.4.0.1\lib\net40\KonfDBCF.dll</HintPath>
</Reference>
<Reference Include="log4net, Version=1.2.13.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\packages\log4net.2.0.3\lib\net40-full\log4net.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\packages\Newtonsoft.Json.6.0.5\lib\net40\Newtonsoft.Json.dll</HintPath>
<Reference Include="Newtonsoft.Json">
<HintPath>..\packages\Newtonsoft.Json.6.0.6\lib\net40\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.DataAnnotations" />
Expand Down
4 changes: 2 additions & 2 deletions Samples/KonfDB.Samples/KonfDBCF.Sample/packages.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="KonfDBCF" version="0.2.0.0" targetFramework="net40" />
<package id="KonfDBCF" version="0.4.0.1" targetFramework="net40" />
<package id="log4net" version="2.0.3" targetFramework="net40" />
<package id="Newtonsoft.Json" version="6.0.5" targetFramework="net40" />
<package id="Newtonsoft.Json" version="6.0.6" targetFramework="net40" />
</packages>

0 comments on commit d0dff5e

Please sign in to comment.