Skip to content
This repository has been archived by the owner on Dec 23, 2017. It is now read-only.

Commit

Permalink
Bringing Active Alias into parameter discovery as well.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ovan Crone committed Feb 20, 2015
1 parent af4dcbe commit 55d40e5
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 15 deletions.
12 changes: 6 additions & 6 deletions src/Susanoo.Core/Pipeline/Command/CommandExpression.cs
Original file line number Diff line number Diff line change
Expand Up @@ -505,27 +505,27 @@ public virtual IEnumerable<DbParameter> BuildPropertyParameters(IDatabaseManager
_parameterInclusions.Select(p => p.Key).ToArray(),
_parameterExclusions.ToArray());

foreach (var propInfo in implicitProperties.Keys)
foreach (var propInfo in implicitProperties)
{
if (!_parameterExclusions.Contains(propInfo.Name))
if (!_parameterExclusions.Contains(propInfo.Value.ActiveAlias))
{
var param = databaseManager.CreateParameter();

param.ParameterName = propInfo.Name;
param.ParameterName = propInfo.Value.ActiveAlias;
param.Direction = ParameterDirection.Input;
#if !NETFX40
param.Value = propInfo.GetValue(filter);
param.Value = propInfo.Key.GetValue(filter);
#else
param.Value = propInfo.GetValue(filter, null);
#endif

var type = CommandManager.GetDbType(propInfo.PropertyType);
var type = CommandManager.GetDbType(propInfo.Key.PropertyType);

if (type.HasValue)
param.DbType = type.Value;

Action<DbParameter> value;
if (_parameterInclusions.TryGetValue(propInfo.Name, out value))
if (_parameterInclusions.TryGetValue(propInfo.Value.ActiveAlias, out value))
{
if (value != null)
{
Expand Down
4 changes: 2 additions & 2 deletions src/Susanoo.Json/Susanoo.Json.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="Susanoo.Core, Version=0.6.3.0, Culture=neutral, PublicKeyToken=0a505ce04f8a59d5, processorArchitecture=MSIL">
<Reference Include="Susanoo.Core, Version=0.7.0.0, Culture=neutral, PublicKeyToken=0a505ce04f8a59d5, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Susanoo.Core.0.6.3.16\lib\net45\Susanoo.Core.dll</HintPath>
<HintPath>..\packages\Susanoo.Core.0.7.0.20\lib\net45\Susanoo.Core.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
Expand Down
2 changes: 1 addition & 1 deletion src/Susanoo.Json/packages.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Newtonsoft.Json" version="6.0.8" targetFramework="net45" />
<package id="Susanoo.Core" version="0.6.3.16" targetFramework="net45" />
<package id="Susanoo.Core" version="0.7.0.20" targetFramework="net45" />
</packages>
4 changes: 2 additions & 2 deletions src/Susanoo.SqlServer.Tests/Susanoo.SqlServer.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@
<HintPath>..\packages\NUnitTestAdapter.1.2\lib\NUnit.VisualStudio.TestAdapter.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Susanoo.Core, Version=0.6.3.0, Culture=neutral, PublicKeyToken=0a505ce04f8a59d5, processorArchitecture=MSIL">
<Reference Include="Susanoo.Core, Version=0.7.0.0, Culture=neutral, PublicKeyToken=0a505ce04f8a59d5, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Susanoo.Core.0.6.3.16\lib\net45\Susanoo.Core.dll</HintPath>
<HintPath>..\packages\Susanoo.Core.0.7.0.20\lib\net45\Susanoo.Core.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
Expand Down
2 changes: 1 addition & 1 deletion src/Susanoo.SqlServer.Tests/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
<package id="Moq" version="4.2.1409.1722" targetFramework="net45" />
<package id="NUnit" version="2.6.4" targetFramework="net45" />
<package id="NUnitTestAdapter" version="1.2" targetFramework="net45" />
<package id="Susanoo.Core" version="0.6.3.16" targetFramework="net45" />
<package id="Susanoo.Core" version="0.7.0.20" targetFramework="net45" />
</packages>
4 changes: 2 additions & 2 deletions src/Susanoo.SqlServer/Susanoo.SqlServer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@
<AssemblyOriginatorKeyFile>Properties\Key.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="Susanoo.Core, Version=0.6.3.0, Culture=neutral, PublicKeyToken=0a505ce04f8a59d5, processorArchitecture=MSIL">
<Reference Include="Susanoo.Core, Version=0.7.0.0, Culture=neutral, PublicKeyToken=0a505ce04f8a59d5, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Susanoo.Core.0.6.3.16\lib\net45\Susanoo.Core.dll</HintPath>
<HintPath>..\packages\Susanoo.Core.0.7.0.20\lib\net45\Susanoo.Core.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
Expand Down
2 changes: 1 addition & 1 deletion src/Susanoo.SqlServer/packages.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Susanoo.Core" version="0.6.3.16" targetFramework="net45" />
<package id="Susanoo.Core" version="0.7.0.20" targetFramework="net45" />
</packages>

0 comments on commit 55d40e5

Please sign in to comment.