Skip to content

Commit 64ee90e

Browse files
author
Robert Anderson
committed
Missed one annotation location for deleting reference entities. Also, updated metadata to latest v1.0 + tweak to workaround a bug.
1 parent f6ebbbd commit 64ee90e

File tree

3 files changed

+12
-1062
lines changed

3 files changed

+12
-1062
lines changed

Templates/CSharp/Requests/EntityReferenceRequest.cs.tt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
OdcmClass entity = host.CurrentType.AsOdcmClass();
77
var entityName = this.GetEntityNameString(entity);
88

9+
var projection = host.CurrentType.Projection;
10+
var canDelete = projection.SupportsDelete();
11+
912
#>
1013

1114
namespace <#=this.GetNamespaceName(entity)#>
@@ -18,7 +21,9 @@ namespace <#=this.GetNamespaceName(entity)#>
1821
<#=this.GetEntityReferenceRequestClassDefinition(entity)#>
1922
{
2023
<#=this.GetEntityReferenceRequestConstructor(entity)#>
21-
24+
<# if (canDelete) { #>
25+
2226
<#=this.GetEntityReferenceDeleteAsyncMethod(entity)#>
27+
<# } #>
2328
}
2429
}

Templates/CSharp/Requests/IEntityReferenceRequest.cs.tt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ OdcmClass entity = host.CurrentType.AsOdcmClass();
66
var entityName = entity.Name.ToCheckedCase();
77
var entityRequest = entityName + "Request";
88

9+
var projection = host.CurrentType.Projection;
10+
var canDelete = projection.SupportsDelete();
11+
912
#>
1013

1114
namespace <#=this.GetNamespaceName(entity)#>
@@ -17,6 +20,8 @@ namespace <#=this.GetNamespaceName(entity)#>
1720

1821
<#=this.GetEntityReferenceRequestInterfaceDefinition(entity)#>
1922
{
23+
<# if (canDelete) { #>
2024
<#=this.GetEntityReferenceDeleteAsyncMethod(entity)#>
25+
<# } #>
2126
}
2227
}

0 commit comments

Comments
 (0)