forked from nhibernate/nhibernate-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTransformers.cs
44 lines (35 loc) · 1.42 KB
/
Transformers.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
using System.Collections;
namespace NHibernate.Transform
{
public sealed class Transformers
{
private Transformers()
{
}
/// <summary>
/// Each row of results is a map (<see cref="IDictionary" />) from alias to values/entities
/// </summary>
public static readonly IResultTransformer AliasToEntityMap = new AliasToEntityMapResultTransformer();
/// <summary> Each row of results is a <see cref="IList"/></summary>
public static readonly ToListResultTransformer ToList = new ToListResultTransformer();
/// <summary>
/// Creates a resulttransformer that will inject aliased values into instances
/// of <paramref name="target"/> via property methods or fields.
/// </summary>
public static IResultTransformer AliasToBean(System.Type target)
{
return new AliasToBeanResultTransformer(target);
}
public static IResultTransformer AliasToBean<T>()
{
return AliasToBean(typeof(T));
}
public static readonly IResultTransformer DistinctRootEntity = new DistinctRootEntityResultTransformer();
public static IResultTransformer AliasToBeanConstructor(System.Reflection.ConstructorInfo constructor)
{
return new AliasToBeanConstructorResultTransformer(constructor);
}
public static readonly IResultTransformer PassThrough = new PassThroughResultTransformer();
public static readonly IResultTransformer RootEntity = new RootEntityResultTransformer();
}
}