@@ -11,7 +11,7 @@ private ExtendedEntityChanged() { } // Ensure create is used.
11
11
public string ProjectId { get ; private set ; }
12
12
public string StackId { get ; private set ; }
13
13
14
- public static ExtendedEntityChanged Create ( EntityChanged entityChanged ) {
14
+ public static ExtendedEntityChanged Create ( EntityChanged entityChanged , bool removeWhenSettingProperties = true ) {
15
15
var model = new ExtendedEntityChanged {
16
16
Id = entityChanged . Id ,
17
17
Type = entityChanged . Type ,
@@ -21,17 +21,20 @@ public static ExtendedEntityChanged Create(EntityChanged entityChanged) {
21
21
22
22
if ( model . Data . TryGetValue ( KnownKeys . OrganizationId , out var organizationId ) ) {
23
23
model . OrganizationId = organizationId . ToString ( ) ;
24
- model . Data . Remove ( KnownKeys . OrganizationId ) ;
24
+ if ( removeWhenSettingProperties )
25
+ model . Data . Remove ( KnownKeys . OrganizationId ) ;
25
26
}
26
27
27
28
if ( model . Data . TryGetValue ( KnownKeys . ProjectId , out var projectId ) ) {
28
29
model . ProjectId = projectId . ToString ( ) ;
29
- model . Data . Remove ( KnownKeys . ProjectId ) ;
30
+ if ( removeWhenSettingProperties )
31
+ model . Data . Remove ( KnownKeys . ProjectId ) ;
30
32
}
31
33
32
34
if ( model . Data . TryGetValue ( KnownKeys . StackId , out var stackId ) ) {
33
35
model . StackId = stackId . ToString ( ) ;
34
- model . Data . Remove ( KnownKeys . StackId ) ;
36
+ if ( removeWhenSettingProperties )
37
+ model . Data . Remove ( KnownKeys . StackId ) ;
35
38
}
36
39
37
40
return model ;
0 commit comments