-
Notifications
You must be signed in to change notification settings - Fork 685
/
Copy pathParentModelMapping.cs
49 lines (41 loc) · 1.41 KB
/
ParentModelMapping.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FluentNHibernate.Mapping;
namespace FluentNHibernate.Testing.DomainModel.Access.Mappings
{
class ParentModelMapping : ClassMap<ParentModel>
{
public ParentModelMapping()
{
Id(x => x.Id);
Version(x => x.Version);
Map(x => x.Property);
Join("Joined", j =>
{
j.KeyColumn("Id");
j.Map(x => x.JoinedProperty);
});
Component(x => x.Component, c =>
{
c.Map(x => x.Value);
});
HasOne(x => x.One);
ReferencesAny(x => x.Any)
.EntityTypeColumn("anytype")
.EntityIdentifierColumn("anyid")
.IdentityType(typeof(int));
DynamicComponent(x => x.Dynamic, x => { });
DynamicComponent(x => x.GenericDynamic, x => { });
HasMany(x => x.MapOne).AsMap("type");
HasMany(x => x.SetOne).AsSet();
HasMany(x => x.ListOne).AsList();
HasMany(x => x.BagOne).AsBag();
HasManyToMany(x => x.MapMany).AsMap("type");
HasManyToMany(x => x.SetMany).AsSet();
HasManyToMany(x => x.ListMany).AsList();
HasManyToMany(x => x.BagMany).AsBag();
}
}
}