Class IntExtensions
Inheritance
System.Object
Namespace: Umbraco.Extensions
Assembly: Umbraco.Core.dll
Syntax
public static class IntExtensions
Methods
View SourceTimes(Int32, Action<Int32>)
Does something 'x' amount of times.
Declaration
public static void Times(this int n, Action<int> action)
Parameters
Type | Name | Description |
---|---|---|
System. |
n | Number of times to execute the action. |
Action<System. |
action | The action to execute. |
ToGuid(Int32)
Creates a Guid based on an integer value.
Declaration
public static Guid ToGuid(this int value)
Parameters
Type | Name | Description |
---|---|---|
System. |
value | The System. |
Returns
Type | Description |
---|---|
Guid | The converted |
TryParseFromGuid(Guid, out Nullable<Int32>)
Restores a GUID previously created from an integer value using To
Declaration
public static bool TryParseFromGuid(Guid value, out int? result)
Parameters
Type | Name | Description |
---|---|---|
Guid | value | The |
System. |
result | The converted System. |
Returns
Type | Description |
---|---|
System. |
True if the System. |
Remarks
This is used with Umbraco entities that only have integer references in the database (e.g. users).