Skip to content

Commit f9cd63a

Browse files
Comments.
1 parent ea20f72 commit f9cd63a

File tree

11 files changed

+37
-32
lines changed

11 files changed

+37
-32
lines changed

src/ResourceManager/Common/Commands.Common.Strategies/Commands.Common.Strategies.csproj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,9 @@
7979
<Compile Include="NestedResourceConfigExtensions.cs" />
8080
<Compile Include="ResourceConfigExtensions.cs" />
8181
<Compile Include="StateExtensions.cs" />
82-
<Compile Include="TargetDependencies.cs" />
8382
<Compile Include="NestedResourceConfig.cs" />
8483
<Compile Include="NestedResourceStrategy.cs" />
85-
<Compile Include="TargetState.cs" />
84+
<Compile Include="TargetStateExtensions.cs" />
8685
<Compile Include="Properties\AssemblyInfo.cs" />
8786
<Compile Include="ResourceConfig.cs" />
8887
<Compile Include="ResourceStrategy.cs" />

src/ResourceManager/Common/Commands.Common.Strategies/IEntityStrategy.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414

1515
namespace Microsoft.Azure.Commands.Common.Strategies
1616
{
17+
/// <summary>
18+
/// Base interface for ResourceStrategy and NestedResourceStrategy classes.
19+
/// </summary>
1720
public interface IEntityStrategy
1821
{
1922
}

src/ResourceManager/Common/Commands.Common.Strategies/IResourceConfig.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616

1717
namespace Microsoft.Azure.Commands.Common.Strategies
1818
{
19+
/// <summary>
20+
/// Base interface for ResourceConfig[].
21+
/// </summary>
1922
public interface IResourceConfig : IEntityConfig
2023
{
2124
new IResourceStrategy Strategy { get; }

src/ResourceManager/Common/Commands.Common.Strategies/IResourceStrategy.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
namespace Microsoft.Azure.Commands.Common.Strategies
22
{
3+
/// <summary>
4+
/// Base interface for ResourceStrategy[].
5+
/// </summary>
36
public interface IResourceStrategy : IEntityStrategy
47
{
58
string Type { get; }

src/ResourceManager/Common/Commands.Common.Strategies/NestedResourceConfig.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@
1818

1919
namespace Microsoft.Azure.Commands.Common.Strategies
2020
{
21+
/// <summary>
22+
/// Nested resource configuration. Fro example, Subnet.
23+
/// </summary>
24+
/// <typeparam name="TModel"></typeparam>
25+
/// <typeparam name="TParenModel"></typeparam>
2126
public sealed class NestedResourceConfig<TModel, TParenModel> : IEntityConfig<TModel>
2227
where TModel : class
2328
where TParenModel : class
@@ -26,6 +31,9 @@ public sealed class NestedResourceConfig<TModel, TParenModel> : IEntityConfig<TM
2631

2732
public string Name { get; }
2833

34+
/// <summary>
35+
/// Parent. For example, VirtualNetwork is a parent of Subnet.
36+
/// </summary>
2937
public IEntityConfig<TParenModel> Parent { get; }
3038

3139
public Func<TModel> CreateModel { get; }

src/ResourceManager/Common/Commands.Common.Strategies/ProgressMap.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ public ProgressMap(Dictionary<IResourceConfig, Tuple<TimeSlot, int>> map, int du
3131
}
3232

3333
/// <summary>
34-
/// Returns a value [0..1] which is used to increment a progress bar when the resource is
35-
/// created.
34+
/// Returns a value of [0..1] range which is used to increment a progress bar when the
35+
/// resource is created.
3636
/// </summary>
3737
/// <param name="config">a resource configuration.</param>
3838
/// <returns></returns>

src/ResourceManager/Common/Commands.Common.Strategies/ResourceConfig.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@
1818

1919
namespace Microsoft.Azure.Commands.Common.Strategies
2020
{
21+
/// <summary>
22+
/// Resource configuration. It contains information to create a resource,
23+
/// including name, resource group name, dependencies, model creation function, etc.
24+
/// </summary>
25+
/// <typeparam name="TModel"></typeparam>
2126
public sealed class ResourceConfig<TModel> : IEntityConfig<TModel>, IResourceConfig
2227
where TModel : class
2328
{

src/ResourceManager/Common/Commands.Common.Strategies/State.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717

1818
namespace Microsoft.Azure.Commands.Common.Strategies
1919
{
20+
/// <summary>
21+
/// Azure State. It contains information (models) of Azure resources.
22+
/// </summary>
2023
sealed class State : IState
2124
{
2225
readonly ConcurrentDictionary<string, object> _Map

src/ResourceManager/Common/Commands.Common.Strategies/TargetDependencies.cs

Lines changed: 0 additions & 26 deletions
This file was deleted.

src/ResourceManager/Common/Commands.Common.Strategies/TargetState.cs renamed to src/ResourceManager/Common/Commands.Common.Strategies/TargetStateExtensions.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,17 @@
1212
// limitations under the License.
1313
// ----------------------------------------------------------------------------------
1414

15+
using System.Collections.Generic;
16+
using System.Linq;
17+
1518
namespace Microsoft.Azure.Commands.Common.Strategies
1619
{
17-
public static class TargetState
20+
public static class TargetStateExtensions
1821
{
22+
public static IEnumerable<IResourceConfig> GetTargetDependencies(
23+
this IResourceConfig config, IState target)
24+
=> config.GetResourceDependencies().Where(target.Contains);
25+
1926
public static IState GetTargetState<TModel>(
2027
this ResourceConfig<TModel> config,
2128
IState current,

src/ResourceManager/Common/Commands.Common.Strategies/TimeSlot.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ namespace Microsoft.Azure.Commands.Common.Strategies
1616
{
1717
/// <summary>
1818
/// TimeSlot is a node of a singly linked list of TimeSlots.
19-
/// The last node of the list is always an empty time slot
19+
/// The last node of the list is always an empty time slot:
2020
/// - Duration = 0.
2121
/// - Next = null.
2222
/// - TaskCount = 0.

0 commit comments

Comments
 (0)