Skip to content

Commit fd8250c

Browse files
committed
Merge remote-tracking branch 'origin/master' into forklmaster
2 parents 2a0358d + cef1ea3 commit fd8250c

File tree

6 files changed

+54
-18
lines changed

6 files changed

+54
-18
lines changed

Templates/CSharp/Model/ComplexType.cs.tt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ namespace <#=complex.Namespace.GetNamespaceName()#>
5050
var propertyName = isMethodResponse
5151
? property.Name.Substring(property.Name.IndexOf('.') + 1).ToCheckedCase()
5252
: property.Name.ToCheckedCase().GetSanitizedPropertyName();
53+
54+
var attributeDefinition = string.Format("[DataMember(Name = \"{0}\", EmitDefaultValue = false, IsRequired = false)]", property.Name);
5355

5456
if (property.IsTypeNullable() || property.IsCollection)
5557
{
@@ -58,7 +60,7 @@ namespace <#=complex.Namespace.GetNamespaceName()#>
5860
/// <summary>
5961
/// Gets or sets <#=property.Name#>.
6062
/// </summary>
61-
[DataMember(Name = "<#=property.Name#>", EmitDefaultValue = false, IsRequired = false)]
63+
<#=attributeDefinition#>
6264
public <#=propertyType#> <#=propertyName#> { get; set; }
6365
<#
6466
}
@@ -69,7 +71,7 @@ namespace <#=complex.Namespace.GetNamespaceName()#>
6971
/// <summary>
7072
/// Gets or sets <#=property.Name#>.
7173
/// </summary>
72-
[DataMember(Name = "<#=property.Name#>", EmitDefaultValue = false, IsRequired = false)]
74+
<#=attributeDefinition#>
7375
public <#=propertyType#>? <#=propertyName#> { get; set; }
7476
<#
7577
}

Templates/CSharp/Model/EntityType.cs.tt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ namespace <#=entity.Namespace.GetNamespaceName()#>
6060

6161
var propertyName = property.Name.ToCheckedCase();
6262
var propertyCollectionPage = property.IsReference() ? string.Concat(entityName, propertyName, "CollectionWithReferencesPage") : string.Concat(entityName, propertyName, "CollectionPage");
63+
64+
var attributeDefinition = string.Format("[DataMember(Name = \"{0}\", EmitDefaultValue = false, IsRequired = false)]", property.Name);
6365

6466
if (property.IsCollection())
6567
{
@@ -70,7 +72,7 @@ namespace <#=entity.Namespace.GetNamespaceName()#>
7072
/// <summary>
7173
/// Gets or sets <#=property.Name.SplitCamelCase().ToLower()#>.
7274
/// </summary>
73-
[DataMember(Name = "<#=property.Name#>", EmitDefaultValue = false, IsRequired = false)]
75+
<#=attributeDefinition#>
7476
public I<#=propertyCollectionPage#> <#=propertyName.GetSanitizedPropertyName()#> { get; set; }
7577
<#
7678
}
@@ -81,7 +83,7 @@ namespace <#=entity.Namespace.GetNamespaceName()#>
8183
/// <summary>
8284
/// Gets or sets <#=property.Name.SplitCamelCase().ToLower()#>.
8385
/// </summary>
84-
[DataMember(Name = "<#=property.Name#>", EmitDefaultValue = false, IsRequired = false)]
86+
<#=attributeDefinition#>
8587
public IEnumerable<<#=propertyType#>> <#=propertyName.GetSanitizedPropertyName()#> { get; set; }
8688
<#
8789
}
@@ -93,7 +95,7 @@ namespace <#=entity.Namespace.GetNamespaceName()#>
9395
/// <summary>
9496
/// Gets or sets <#=property.Name.SplitCamelCase().ToLower()#>.
9597
/// </summary>
96-
[DataMember(Name = "<#=property.Name#>", EmitDefaultValue = false, IsRequired = false)]
98+
<#=attributeDefinition#>
9799
public <#=propertyType#> <#=propertyName.GetSanitizedPropertyName()#> { get; set; }
98100
<#
99101
}

graphmetadata2.xml

Lines changed: 41 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -733,16 +733,13 @@
733733
<Property Name="width" Type="Edm.Int32" />
734734
<Annotation Term="Org.OData.Core.V1.LongDescription" String="navigable" />
735735
</ComplexType>
736-
<ComplexType Name="driveRecipient">
737-
<Property Name="email" Type="Edm.String" Unicode="false" />
738-
<Property Name="alias" Type="Edm.String" Unicode="false" />
739-
<Property Name="objectId" Type="Edm.String" Unicode="false" />
740-
</ComplexType>
741-
<ComplexType Name="uploadSession">
742-
<Property Name="uploadUrl" Type="Edm.String" Unicode="false" />
736+
<EntityType Name="subscription" BaseType="microsoft.graph.entity">
737+
<Property Name="resource" Type="Edm.String" Nullable="false" Unicode="false" />
738+
<Property Name="changeType" Type="Edm.String" Nullable="false" Unicode="false" />
739+
<Property Name="clientState" Type="Edm.String" Unicode="false" />
740+
<Property Name="notificationUrl" Type="Edm.String" Nullable="false" Unicode="false" />
743741
<Property Name="expirationDateTime" Type="Edm.DateTimeOffset" />
744-
<Property Name="nextExpectedRanges" Type="Collection(Edm.String)" Unicode="false" />
745-
</ComplexType>
742+
</EntityType>
746743
<Action Name="checkMemberGroups" IsBound="true">
747744
<Parameter Name="bindingParameter" Type="microsoft.graph.directoryObject" Nullable="false" />
748745
<Parameter Name="groupIds" Type="Collection(Edm.String)" Nullable="false" Unicode="false" />
@@ -947,6 +944,7 @@
947944
<NavigationPropertyBinding Path="microsoft.graph.driveItem/createdByUser" Target="users" />
948945
<Annotation Term="Org.OData.Core.V1.LongDescription" String="readonly" />
949946
</EntitySet>
947+
<EntitySet Name="subscriptions" EntityType="microsoft.graph.subscription" />
950948
<Singleton Name="me" Type="microsoft.graph.user">
951949
<NavigationPropertyBinding Path="ownedDevices" Target="directoryObjects" />
952950
<NavigationPropertyBinding Path="registeredDevices" Target="directoryObjects" />
@@ -1024,6 +1022,40 @@
10241022
<Annotation Term="Org.OData.Capabilities.V1.TopSupported" Bool="false" />
10251023
<Annotation Term="Org.OData.Capabilities.V1.SkipSupported" Bool="false" />
10261024
</Annotations>
1025+
<Annotations Target="microsoft.graph.subscription">
1026+
<Annotation Term="Org.OData.Capabilities.V1.ExpandRestrictions">
1027+
<Record>
1028+
<PropertyValue Property="Expandable" Bool="false" />
1029+
</Record>
1030+
</Annotation>
1031+
<Annotation Term="Org.OData.Capabilities.V1.NavigationRestrictions">
1032+
<Record>
1033+
<PropertyValue Property="Referenceable" Bool="false" />
1034+
</Record>
1035+
</Annotation>
1036+
<Annotation Term="Org.OData.Capabilities.V1.SelectRestrictions">
1037+
<Record>
1038+
<PropertyValue Property="Selectable" Bool="false" />
1039+
</Record>
1040+
</Annotation>
1041+
<Annotation Term="Org.OData.Capabilities.V1.CountRestrictions">
1042+
<Record>
1043+
<PropertyValue Property="Countable" Bool="false" />
1044+
</Record>
1045+
</Annotation>
1046+
<Annotation Term="Org.OData.Capabilities.V1.FilterRestrictions">
1047+
<Record>
1048+
<PropertyValue Property="Filterable" Bool="false" />
1049+
</Record>
1050+
</Annotation>
1051+
<Annotation Term="Org.OData.Capabilities.V1.SortRestrictions">
1052+
<Record>
1053+
<PropertyValue Property="Sortable" Bool="false" />
1054+
</Record>
1055+
</Annotation>
1056+
<Annotation Term="Org.OData.Capabilities.V1.SkipSupported" Bool="false" />
1057+
<Annotation Term="Org.OData.Capabilities.V1.TopSupported" Bool="false" />
1058+
</Annotations>
10271059
</Schema>
10281060
</edmx:DataServices>
10291061
</edmx:Edmx>

src/GraphODataTemplateWriter/.config/TemplateWriterSettings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"AvailableLanguages": [ "Android", "ObjC", "CSharp", "Python", "JavaScript" ],
3-
"TargetLanguage": "Android",
3+
"TargetLanguage": "CSharp",
44
"Plugins": [ ],
55
"PrimaryNamespaceName": "com",
66
"NamespacePrefix": "com",

src/GraphODataTemplateWriter/CodeHelpers/CSharp/TypeHelperCSharp.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ public static string GetTypeString(this string type)
132132
case "boolean":
133133
return "bool";
134134
case "date":
135-
return "DateTimeOffset";
135+
return "Date";
136136
default:
137137
return type.ToCheckedCase();
138138
}
@@ -156,7 +156,7 @@ public static bool IsTypeNullable(this OdcmProperty property)
156156
public static bool IsTypeNullable(this OdcmType type)
157157
{
158158
var t = type.GetTypeString();
159-
return type is OdcmClass || t == "Stream" || t == "string" || t == "byte[]";
159+
return type is OdcmClass || t == "Date" || t == "Stream" || t == "string" || t == "byte[]";
160160
}
161161

162162
public static bool IsByteArray(this OdcmProperty property)

submodules/vipr

Submodule vipr updated 78 files

0 commit comments

Comments
 (0)