Skip to content

Commit 1216ee5

Browse files
committed
TypeHelper methods became obsolete
for further deletion or making them internal
1 parent 2f91cdb commit 1216ee5

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

ChangeLog/7.2.0-Beta-1-dev.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
[main] DomainConfiguration.MaxNumberOfConditions is introduced
77
[main] SqlDml.Truncate() is introduced.
88
[main] WellKnown.MaxNumberOfConditions became obsolete, use new DomainConfiguration.MaxNumberOfConditions if needed
9+
[main] TypeHelper.GetSingleConstructor() and .GetSingleConstructorOrDefault() are marked obsolete
910
[main] Temporary tables cleanup now uses TRUNCATE instead of DELETE when possible
1011
[main] Temporary tables population is increased with multi-row inserts - 256 and 16 items per INSERT
1112
[main] PersistParameterBinding has new field RowIndex, use it for multi-row inserts if needed

Orm/Xtensive.Orm/IoC/ServiceContainer.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,11 +227,13 @@ public static IServiceContainer Create(Type containerType, object configuration,
227227
private static ConstructorInvoker FindConstructorInvoker(Type containerType, params Type[] argumentTypes) =>
228228
containerType.GetSingleConstructorInvokerOrDefault(argumentTypes);
229229
#else
230+
#pragma warning disable CS0612 // Type or member is obsolete
230231
private static ConstructorInfo FindConstructor(Type containerType, params Type[] argumentTypes) =>
231232
containerType.GetSingleConstructorOrDefault(argumentTypes);
233+
#pragma warning restore CS0612 // Type or member is obsolete
232234
#endif
233235

234-
#endregion
236+
#endregion
235237

236238
/// <summary>
237239
/// Creates <see cref="IServiceContainer"/> by default configuration.

Orm/Xtensive.Orm/Reflection/TypeHelper.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -687,6 +687,7 @@ internal static ConstructorInvoker GetSingleConstructorInvoker(this Type type, T
687687
/// The <paramref name="type"/> has no constructors suitable for <paramref name="argumentTypes"/>
688688
/// -or- more than one such constructor.
689689
/// </exception>
690+
[Obsolete]// obsolete to safely make it internal later on or delete
690691
public static ConstructorInfo GetSingleConstructor(this Type type, Type[] argumentTypes) =>
691692
ConstructorInfoByTypes.GetOrAdd((type, argumentTypes), ConstructorExtractor)
692693
?? throw new InvalidOperationException(Strings.ExGivenTypeHasNoOrMoreThanOneCtorWithGivenParameters);
@@ -719,6 +720,7 @@ internal static ConstructorInvoker GetSingleConstructorInvokerOrDefault(this Typ
719720
/// otherwise, <see langword="null"/>.
720721
/// </returns>
721722
[CanBeNull]
723+
[Obsolete]// obsolete to safely make it internal later on
722724
public static ConstructorInfo GetSingleConstructorOrDefault(this Type type, Type[] argumentTypes) =>
723725
ConstructorInfoByTypes.GetOrAdd((type, argumentTypes), ConstructorExtractor);
724726

0 commit comments

Comments
 (0)