Skip to content

Commit 5a0c099

Browse files
committed
the hell happened with NuGet yet again. CHECKPOINT - everything compiles
1 parent b6c5738 commit 5a0c099

File tree

7 files changed

+101
-7
lines changed

7 files changed

+101
-7
lines changed

src/Examples.FirstAutomappedProject/Examples.FirstAutomappedProject.csproj

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,8 @@
7272
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
7373
</PropertyGroup>
7474
<ItemGroup>
75-
<Reference Include="NHibernate, Version=2.0.0.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4, processorArchitecture=MSIL">
76-
<SpecificVersion>False</SpecificVersion>
77-
<HintPath>..\..\tools\NHibernate\NHibernate.dll</HintPath>
75+
<Reference Include="NHibernate">
76+
<HintPath>..\packages\NHibernate.3.3.1.4000\lib\Net35\NHibernate.dll</HintPath>
7877
</Reference>
7978
<Reference Include="System" />
8079
<Reference Include="System.Core">
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<packages>
3+
<package id="Iesi.Collections" version="3.2.0.4000" targetFramework="net35" />
4+
<package id="NHibernate" version="3.0.0.4000" targetFramework="net35" />
5+
</packages>

src/Examples.FirstProject/Examples.FirstProject.csproj

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,8 @@
7272
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
7373
</PropertyGroup>
7474
<ItemGroup>
75-
<Reference Include="NHibernate, Version=2.0.0.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4, processorArchitecture=MSIL">
76-
<SpecificVersion>False</SpecificVersion>
77-
<HintPath>..\..\tools\NHibernate\NHibernate.dll</HintPath>
75+
<Reference Include="NHibernate">
76+
<HintPath>..\packages\NHibernate.3.3.1.4000\lib\Net35\NHibernate.dll</HintPath>
7877
</Reference>
7978
<Reference Include="System" />
8079
<Reference Include="System.Core">

src/Examples.FirstProject/Examples.FirstProject.csproj.user

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<PropertyGroup>
4-
<ProjectView>ShowAllFiles</ProjectView>
4+
<ProjectView>ProjectFiles</ProjectView>
55
<PublishUrlHistory />
66
<InstallUrlHistory />
77
<SupportUrlHistory />
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<packages>
3+
<package id="Iesi.Collections" version="3.2.0.4000" targetFramework="net35" />
4+
<package id="NHibernate" version="3.0.0.4000" targetFramework="net35" />
5+
</packages>
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using FluentNHibernate.Conventions;
6+
using FluentNHibernate.Conventions.Instances;
7+
using FluentNHibernate.Mapping;
8+
using FluentNHibernate.MappingModel.ClassBased;
9+
using Machine.Specifications;
10+
11+
namespace FluentNHibernate.Specs.Conventions
12+
{
13+
public class when_specifying_component_convention
14+
{
15+
Establish context = () =>
16+
{
17+
model = new FluentNHibernate.PersistenceModel();
18+
model.Conventions.Add<ComponentConvention>();
19+
model.Add(new EntityWithComponentMap());
20+
model.Add(new AddressMap());
21+
};
22+
23+
Because of = () =>
24+
{
25+
mapping = model.BuildMappingFor<EntityWithComponent>();
26+
};
27+
28+
It should_be_able_to_specify_column_name = () =>
29+
{
30+
mapping.Components.First()
31+
.Properties.Single(x => x.Name == "Count")
32+
.Columns.FirstOrDefault().Name.ShouldEqual("different");
33+
};
34+
35+
static FluentNHibernate.PersistenceModel model;
36+
static ClassMapping mapping;
37+
}
38+
39+
public class EntityWithComponent
40+
{
41+
public int Id { get; set; }
42+
public string Description { get; set; }
43+
public Address Address { get; set; }
44+
}
45+
46+
public class Address
47+
{
48+
public int Count { get; set; }
49+
public string Line1 { get; set; }
50+
public string Line2 { get; set; }
51+
}
52+
53+
class AddressMap: ComponentMap<Address>
54+
{
55+
public AddressMap()
56+
{
57+
Map(x => x.Line1);
58+
Map(x => x.Line2);
59+
Map(x => x.Count);
60+
}
61+
}
62+
63+
public class ComponentConvention: IComponentConvention
64+
{
65+
public void Apply(IComponentInstance instance)
66+
{
67+
if (instance.Type == typeof(Address))
68+
{
69+
instance.Properties.First(p => p.Type.GetType() == typeof(int))
70+
.Column("different");
71+
}
72+
}
73+
}
74+
75+
public class EntityWithComponentMap: ClassMap<EntityWithComponent>
76+
{
77+
public EntityWithComponentMap()
78+
{
79+
Id(x => x.Id);
80+
Map(x => x.Description);
81+
Component(x => x.Address);
82+
}
83+
}
84+
}

src/packages/repositories.config

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<repositories>
3+
<repository path="..\Examples.FirstAutomappedProject\packages.config" />
4+
<repository path="..\Examples.FirstProject\packages.config" />
35
<repository path="..\FluentNHibernate.Specs.ExternalFixtures\packages.config" />
46
<repository path="..\FluentNHibernate.Specs\packages.config" />
57
<repository path="..\FluentNHibernate.Testing\packages.config" />

0 commit comments

Comments
 (0)