-
-
Notifications
You must be signed in to change notification settings - Fork 408
/
Copy pathPropertyInfoFactory.cs
36 lines (32 loc) · 1.18 KB
/
PropertyInfoFactory.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
//-----------------------------------------------------------------------
// <copyright file="PropertyInfoFactory.cs" company="Marimer LLC">
// Copyright (c) Marimer LLC. All rights reserved.
// Website: https://cslanet.com
// </copyright>
// <summary>Creates the factory object that</summary>
//-----------------------------------------------------------------------
using System.Diagnostics.CodeAnalysis;
namespace Csla.Core.FieldManager
{
/// <summary>
/// Creates the factory object that
/// creates PropertyInfo objects.
/// </summary>
public static class PropertyInfoFactory
{
/// <summary>
/// Gets the PropertyInfoFactory type.
/// </summary>
#if NET8_0_OR_GREATER
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)]
#endif
public static Type FactoryType { get; internal set; } = typeof(DefaultPropertyInfoFactory);
private static IPropertyInfoFactory _factory;
/// <summary>
/// Gets the factory object that
/// creates PropertyInfo objects.
/// </summary>
public static IPropertyInfoFactory Factory =>
_factory ??= (IPropertyInfoFactory) Activator.CreateInstance(FactoryType);
}
}