Skip to content

Commit 979ef54

Browse files
[SQ] improvements
1 parent 4fa9b0e commit 979ef54

File tree

7 files changed

+21
-15
lines changed

7 files changed

+21
-15
lines changed

CDP4Common.NetCore.Tests/Helpers/NestedElementTreeGeneratorTestFixture.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -780,6 +780,8 @@ public void Verify_that_when_the_value_of_a_ValueArray_is_empty_the_algorithm_co
780780

781781
var nestedElements = this.nestedElementTreeGenerator.Generate(option, system_engineering, false).ToList();
782782

783+
Assert.That(nestedElements, Is.Not.Empty);
784+
783785
foreach (var nestedElement in nestedElements)
784786
{
785787
Console.WriteLine($"NE: - {nestedElement.ShortName}:{nestedElement.Name}");

CDP4Common.Tests/Helpers/NestedElementTreeGeneratorTestFixture.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -639,6 +639,8 @@ public void Verify_that_when_the_value_of_a_ValueArray_is_empty_the_algorithm_co
639639

640640
var nestedElements = this.nestedElementTreeGenerator.Generate(option, system_engineering, false).ToList();
641641

642+
Assert.That(nestedElements, Is.Not.Empty);
643+
642644
foreach (var nestedElement in nestedElements)
643645
{
644646
Console.WriteLine($"NE: - {nestedElement.ShortName}:{nestedElement.Name}");

CDP4Common/Types/CacheKey.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,15 +120,15 @@ public Guid? Iteration
120120
/// <summary>
121121
/// Indicates whether this instance and a specified object are equal.
122122
/// </summary>
123-
/// <param name="other">
123+
/// <param name="obj">
124124
/// The object to compare with the current instance.
125125
/// </param>
126126
/// <returns>
127127
/// true if obj and this instance are the same type and represent the same value; otherwise, false.
128128
/// </returns>
129-
public override bool Equals(object other)
129+
public override bool Equals(object obj)
130130
{
131-
return (other is CacheKey cacheKey) && Equals(cacheKey);
131+
return (obj is CacheKey cacheKey) && Equals(cacheKey);
132132
}
133133

134134
/// <summary>

CDP4Dal/Composition/INameMetaData.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ namespace CDP4Dal.Composition
2626
{
2727
/// <summary>
2828
/// The purpose of the <see cref="INameMetaData"/> interface is to define a Name property to be
29-
/// used in conjunction with a custom <see cref="ExportAttribute"/>
29+
/// used in conjunction with a custom <see cref="System.ComponentModel.Composition.ExportAttribute"/>
3030
/// </summary>
3131
public interface INameMetaData
3232
{

CDP4Dal/DAL/Dal.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ protected Dal()
9797
/// <summary>
9898
/// Write all the <see cref="Operation"/>s from all the <see cref="OperationContainer"/>s asynchronously.
9999
/// </summary>
100-
/// <param name="operationContainer">
100+
/// <param name="operationContainers">
101101
/// The provided <see cref="OperationContainer"/> to write
102102
/// </param>
103103
/// <param name="files">
@@ -106,7 +106,7 @@ protected Dal()
106106
/// <returns>
107107
/// A list of <see cref="Thing"/>s that has been created or updated since the last Read or Write operation.
108108
/// </returns>
109-
public abstract Task<IEnumerable<Thing>> Write(IEnumerable<OperationContainer> operationContainer, IEnumerable<string> files = null);
109+
public abstract Task<IEnumerable<Thing>> Write(IEnumerable<OperationContainer> operationContainers, IEnumerable<string> files = null);
110110

111111
/// <summary>
112112
/// Write all the <see cref="Operation"/>s from an <see cref="OperationContainer"/> asynchronously.
@@ -147,7 +147,7 @@ protected Dal()
147147
/// <param name="thing">
148148
/// An instance of <see cref="Thing"/> that needs to be read from the data-source
149149
/// </param>
150-
/// <param name="token">
150+
/// <param name="cancellationToken">
151151
/// The <see cref="CancellationToken"/>
152152
/// </param>
153153
/// <param name="attributes">
@@ -156,7 +156,7 @@ protected Dal()
156156
/// <returns>
157157
/// a list of <see cref="Thing"/> that are contained by the provided <see cref="Thing"/> including the <see cref="Thing"/> itself
158158
/// </returns>
159-
public abstract Task<IEnumerable<Thing>> Read<T>(T thing, CancellationToken token, IQueryAttributes attributes = null) where T : Thing;
159+
public abstract Task<IEnumerable<Thing>> Read<T>(T thing, CancellationToken cancellationToken, IQueryAttributes attributes = null) where T : Thing;
160160

161161
/// <summary>
162162
/// Reads the data related to the provided <see cref="CDP4Common.DTO.Iteration"/> from the data-source

CDP4Dal/Operations/IThingTransaction.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,9 @@ public interface IThingTransaction
123123
/// <summary>
124124
/// Creates a <see cref="Thing"/> deletion operation
125125
/// </summary>
126-
/// <param name="thing">The clone of the <see cref="Thing"/> to delete</param>
126+
/// <param name="clone">The clone of the <see cref="Thing"/> to delete</param>
127127
/// <param name="containerClone">The clone of the container (mandatory in dialogs)</param>
128-
void Delete(Thing thing, Thing containerClone = null);
128+
void Delete(Thing clone, Thing containerClone = null);
129129

130130
/// <summary>
131131
/// Registers the provided clone of a <see cref="Thing"/> as a copy with its destination

CDP4ServicesDal/CdpServicesDal.cs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -238,11 +238,13 @@ public override async Task<IEnumerable<Thing>> Write(OperationContainer operatio
238238
Logger.Info("JSON Deserializer completed in {0} [ms]", deserializationWatch.ElapsedMilliseconds);
239239
break;
240240
case ContentTypeKind.MESSAGEPACK:
241-
Logger.Info("Deserializing MESSAGEPACK response");
242-
var cts = new CancellationTokenSource();
243-
var things = await this.MessagePackSerializer.DeserializeAsync(resultStream, cts.Token);
244-
result.AddRange(things);
245-
Logger.Info("MESSAGEPACK Deserializer completed in {0} [ms]", deserializationWatch.ElapsedMilliseconds);
241+
using (var cts = new CancellationTokenSource())
242+
{
243+
Logger.Info("Deserializing MESSAGEPACK response");
244+
var things = await this.MessagePackSerializer.DeserializeAsync(resultStream, cts.Token);
245+
result.AddRange(things);
246+
Logger.Info("MESSAGEPACK Deserializer completed in {0} [ms]", deserializationWatch.ElapsedMilliseconds);
247+
}
246248
break;
247249
}
248250

0 commit comments

Comments
 (0)