Skip to content

Commit faf21e5

Browse files
committed
Rename EdmDate to Date
1 parent 301b345 commit faf21e5

File tree

5 files changed

+44
-22
lines changed

5 files changed

+44
-22
lines changed

Templates/CSharp/Model/ComplexType.cs.tt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,6 @@ namespace <#=complex.Namespace.GetNamespaceName()#>
5252
: property.Name.ToCheckedCase().GetSanitizedPropertyName();
5353

5454
var attributeDefinition = string.Format("[DataMember(Name = \"{0}\", EmitDefaultValue = false, IsRequired = false)]", property.Name);
55-
56-
if (string.Equals(property.Type.FullName, "Edm.Date", StringComparison.OrdinalIgnoreCase))
57-
{
58-
attributeDefinition = string.Concat("[EdmDateConverter]", Environment.NewLine, " ", attributeDefinition);
59-
}
6055

6156
if (property.IsTypeNullable() || property.IsCollection)
6257
{

Templates/CSharp/Model/EntityType.cs.tt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,6 @@ namespace <#=entity.Namespace.GetNamespaceName()#>
6262
var propertyCollectionPage = property.IsReference() ? string.Concat(entityName, propertyName, "CollectionWithReferencesPage") : string.Concat(entityName, propertyName, "CollectionPage");
6363

6464
var attributeDefinition = string.Format("[DataMember(Name = \"{0}\", EmitDefaultValue = false, IsRequired = false)]", property.Name);
65-
66-
if (string.Equals(property.Type.FullName, "Edm.Date", StringComparison.OrdinalIgnoreCase))
67-
{
68-
attributeDefinition = string.Concat("[EdmDateConverter]", Environment.NewLine, " ", attributeDefinition);
69-
}
7065

7166
if (property.IsCollection())
7267
{

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
}
@@ -157,7 +157,7 @@ public static bool IsTypeNullable(this OdcmProperty property)
157157
public static bool IsTypeNullable(this OdcmType type)
158158
{
159159
var t = type.GetTypeString();
160-
return type is OdcmClass || t == "Stream" || t == "string" || t == "byte[]";
160+
return type is OdcmClass || t == "Date" || t == "Stream" || t == "string" || t == "byte[]";
161161
}
162162

163163
public static bool IsByteArray(this OdcmProperty property)

0 commit comments

Comments
 (0)