Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ stages:
- job: Build
steps:

- task: UseDotNet@2
displayName: 'Use .NET SDK 8.0.x'
inputs:
packageType: 'sdk'
version: '8.0.x'

- task: NuGetToolInstaller@0
inputs:
versionSpec: '>=5.2.0'
Expand All @@ -57,6 +63,7 @@ stages:
solution: '$(sln)'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
msbuildArgs: '/p:DeployExtension=false'

- task: DotNetCoreCLI@2
displayName: 'Pack Microsoft.OData.Cli package'
Expand Down
20 changes: 10 additions & 10 deletions src/Microsoft.OData.CodeGen/Templates/ODataT4CodeGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1690,10 +1690,10 @@ public override int GetHashCode()
internal abstract string GeometryMultiPolygonTypeName { get; }
internal abstract string GeometryMultiLineStringTypeName { get; }
internal abstract string GeometryMultiPointTypeName { get; }
internal abstract string DateTypeName { get; }
internal abstract string DateOnlyTypeName { get; }
internal abstract string DateTimeOffsetTypeName { get; }
internal abstract string DurationTypeName { get; }
internal abstract string TimeOfDayTypeName { get; }
internal abstract string TimeOnlyTypeName { get; }
internal abstract string XmlConvertClassName { get; }
internal abstract string EnumTypeName { get; }
internal abstract string DictionaryInterfaceName { get; }
Expand Down Expand Up @@ -4038,8 +4038,8 @@ internal static string GetPropertyInitializationValue(IEdmProperty property, boo
}
else if (valueClrType.Equals(clientTemplate.GuidTypeName)
| valueClrType.Equals(clientTemplate.DateTimeOffsetTypeName)
| valueClrType.Equals(clientTemplate.DateTypeName)
| valueClrType.Equals(clientTemplate.TimeOfDayTypeName))
| valueClrType.Equals(clientTemplate.DateOnlyTypeName)
| valueClrType.Equals(clientTemplate.TimeOnlyTypeName))
{
defaultValue = valueClrType + ".Parse(\"" + defaultValue + "\")";
}
Expand Down Expand Up @@ -4219,11 +4219,11 @@ internal static string GetClrTypeName(IEdmPrimitiveType edmPrimitiveType, ODataC
}
else if (kind== EdmPrimitiveTypeKind.Date)
{
type= clientTemplate.DateTypeName;
type= clientTemplate.DateOnlyTypeName;
}
else if (kind== EdmPrimitiveTypeKind.TimeOfDay)
{
type= clientTemplate.TimeOfDayTypeName;
type= clientTemplate.TimeOnlyTypeName;
}
else
{
Expand Down Expand Up @@ -4298,10 +4298,10 @@ public ODataClientCSharpTemplate(CodeGenerationContext context)
internal override string GeometryMultiPolygonTypeName { get { return "global::Microsoft.Spatial.GeometryMultiPolygon"; } }
internal override string GeometryMultiLineStringTypeName { get { return "global::Microsoft.Spatial.GeometryMultiLineString"; } }
internal override string GeometryMultiPointTypeName { get { return "global::Microsoft.Spatial.GeometryMultiPoint"; } }
internal override string DateTypeName { get { return "global::Microsoft.OData.Edm.Date"; } }
internal override string DateOnlyTypeName { get { return "global::System.DateOnly"; } }
internal override string DateTimeOffsetTypeName { get { return "global::System.DateTimeOffset"; } }
internal override string DurationTypeName { get { return "global::System.TimeSpan"; } }
internal override string TimeOfDayTypeName { get { return "global::Microsoft.OData.Edm.TimeOfDay"; } }
internal override string TimeOnlyTypeName { get { return "global::System.TimeOnly"; } }
internal override string XmlConvertClassName { get { return "global::System.Xml.XmlConvert"; } }
internal override string EnumTypeName { get { return "global::System.Enum"; } }
internal override string DictionaryInterfaceName { get { return "global::System.Collections.Generic.IDictionary<{0}, {1}>"; } }
Expand Down Expand Up @@ -6441,10 +6441,10 @@ public ODataClientVBTemplate(CodeGenerationContext context)
internal override string GeometryMultiPolygonTypeName { get { return "Global.Microsoft.Spatial.GeometryMultiPolygon"; } }
internal override string GeometryMultiLineStringTypeName { get { return "Global.Microsoft.Spatial.GeometryMultiLineString"; } }
internal override string GeometryMultiPointTypeName { get { return "Global.Microsoft.Spatial.GeometryMultiPoint"; } }
internal override string DateTypeName { get { return "Global.Microsoft.OData.Edm.Date"; } }
internal override string DateOnlyTypeName { get { return "Global.System.DateOnly"; } }
internal override string DateTimeOffsetTypeName { get { return "Global.System.DateTimeOffset"; } }
internal override string DurationTypeName { get { return "Global.System.TimeSpan"; } }
internal override string TimeOfDayTypeName { get { return "Global.Microsoft.OData.Edm.TimeOfDay"; } }
internal override string TimeOnlyTypeName { get { return "Global.System.TimeOnly"; } }
internal override string XmlConvertClassName { get { return "Global.System.Xml.XmlConvert"; } }
internal override string EnumTypeName { get { return "Global.System.Enum"; } }
internal override string DictionaryInterfaceName { get { return "Global.System.Collections.Generic.IDictionary(Of {0}, {1})"; } }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1547,10 +1547,10 @@ public abstract class ODataClientTemplate : TemplateBase
internal abstract string GeometryMultiPolygonTypeName { get; }
internal abstract string GeometryMultiLineStringTypeName { get; }
internal abstract string GeometryMultiPointTypeName { get; }
internal abstract string DateTypeName { get; }
internal abstract string DateOnlyTypeName { get; }
internal abstract string DateTimeOffsetTypeName { get; }
internal abstract string DurationTypeName { get; }
internal abstract string TimeOfDayTypeName { get; }
internal abstract string TimeOnlyTypeName { get; }
internal abstract string XmlConvertClassName { get; }
internal abstract string EnumTypeName { get; }
internal abstract string DictionaryInterfaceName { get; }
Expand Down Expand Up @@ -3895,8 +3895,8 @@ internal static class Utils
}
else if (valueClrType.Equals(clientTemplate.GuidTypeName)
| valueClrType.Equals(clientTemplate.DateTimeOffsetTypeName)
| valueClrType.Equals(clientTemplate.DateTypeName)
| valueClrType.Equals(clientTemplate.TimeOfDayTypeName))
| valueClrType.Equals(clientTemplate.DateOnlyTypeName)
| valueClrType.Equals(clientTemplate.TimeOnlyTypeName))
{
defaultValue = valueClrType + ".Parse(\"" + defaultValue + "\")";
}
Expand Down Expand Up @@ -4076,11 +4076,11 @@ internal static class Utils
}
else if (kind== EdmPrimitiveTypeKind.Date)
{
type= clientTemplate.DateTypeName;
type= clientTemplate.DateOnlyTypeName;
}
else if (kind== EdmPrimitiveTypeKind.TimeOfDay)
{
type= clientTemplate.TimeOfDayTypeName;
type= clientTemplate.TimeOnlyTypeName;
}
else
{
Expand Down Expand Up @@ -4155,10 +4155,10 @@ public sealed class ODataClientCSharpTemplate : ODataClientTemplate
internal override string GeometryMultiPolygonTypeName { get { return "global::Microsoft.Spatial.GeometryMultiPolygon"; } }
internal override string GeometryMultiLineStringTypeName { get { return "global::Microsoft.Spatial.GeometryMultiLineString"; } }
internal override string GeometryMultiPointTypeName { get { return "global::Microsoft.Spatial.GeometryMultiPoint"; } }
internal override string DateTypeName { get { return "global::Microsoft.OData.Edm.Date"; } }
internal override string DateOnlyTypeName { get { return "global::System.DateOnly"; } }
internal override string DateTimeOffsetTypeName { get { return "global::System.DateTimeOffset"; } }
internal override string DurationTypeName { get { return "global::System.TimeSpan"; } }
internal override string TimeOfDayTypeName { get { return "global::Microsoft.OData.Edm.TimeOfDay"; } }
internal override string TimeOnlyTypeName { get { return "global::System.TimeOnly"; } }
internal override string XmlConvertClassName { get { return "global::System.Xml.XmlConvert"; } }
internal override string EnumTypeName { get { return "global::System.Enum"; } }
internal override string DictionaryInterfaceName { get { return "global::System.Collections.Generic.IDictionary<{0}, {1}>"; } }
Expand Down Expand Up @@ -5355,10 +5355,10 @@ public sealed class ODataClientVBTemplate : ODataClientTemplate
internal override string GeometryMultiPolygonTypeName { get { return "Global.Microsoft.Spatial.GeometryMultiPolygon"; } }
internal override string GeometryMultiLineStringTypeName { get { return "Global.Microsoft.Spatial.GeometryMultiLineString"; } }
internal override string GeometryMultiPointTypeName { get { return "Global.Microsoft.Spatial.GeometryMultiPoint"; } }
internal override string DateTypeName { get { return "Global.Microsoft.OData.Edm.Date"; } }
internal override string DateOnlyTypeName { get { return "Global.System.DateOnly"; } }
internal override string DateTimeOffsetTypeName { get { return "Global.System.DateTimeOffset"; } }
internal override string DurationTypeName { get { return "Global.System.TimeSpan"; } }
internal override string TimeOfDayTypeName { get { return "Global.Microsoft.OData.Edm.TimeOfDay"; } }
internal override string TimeOnlyTypeName { get { return "Global.System.TimeOnly"; } }
internal override string XmlConvertClassName { get { return "Global.System.Xml.XmlConvert"; } }
internal override string EnumTypeName { get { return "Global.System.Enum"; } }
internal override string DictionaryInterfaceName { get { return "Global.System.Collections.Generic.IDictionary(Of {0}, {1})"; } }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ public virtual decimal DecimalPropWithLetter
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "#VersionNumber#")]

[global::System.ComponentModel.DataAnnotations.RequiredAttribute(ErrorMessage = "DateProp is required.")]
public virtual global::Microsoft.OData.Edm.Date DateProp
public virtual global::System.DateOnly DateProp
{
get
{
Expand All @@ -608,15 +608,15 @@ public virtual decimal DecimalPropWithLetter
}
}
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "#VersionNumber#")]
private global::Microsoft.OData.Edm.Date _DateProp = global::Microsoft.OData.Edm.Date.Parse("2020-02-02");
partial void OnDatePropChanging(global::Microsoft.OData.Edm.Date value);
private global::System.DateOnly _DateProp = global::System.DateOnly.Parse("2020-02-02");
partial void OnDatePropChanging(global::System.DateOnly value);
partial void OnDatePropChanged();
/// <summary>
/// There are no comments for Property NullableDateProp in the schema.
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "#VersionNumber#")]

public virtual global::System.Nullable<global::Microsoft.OData.Edm.Date> NullableDateProp
public virtual global::System.Nullable<global::System.DateOnly> NullableDateProp
{
get
{
Expand All @@ -630,8 +630,8 @@ public virtual decimal DecimalPropWithLetter
}
}
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "#VersionNumber#")]
private global::System.Nullable<global::Microsoft.OData.Edm.Date> _NullableDateProp = global::Microsoft.OData.Edm.Date.Parse("2020-02-02");
partial void OnNullableDatePropChanging(global::System.Nullable<global::Microsoft.OData.Edm.Date> value);
private global::System.Nullable<global::System.DateOnly> _NullableDateProp = global::System.DateOnly.Parse("2020-02-02");
partial void OnNullableDatePropChanging(global::System.Nullable<global::System.DateOnly> value);
partial void OnNullableDatePropChanged();
/// <summary>
/// There are no comments for Property DateTimeOffsetProp in the schema.
Expand Down Expand Up @@ -684,7 +684,7 @@ public virtual decimal DecimalPropWithLetter
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "#VersionNumber#")]

[global::System.ComponentModel.DataAnnotations.RequiredAttribute(ErrorMessage = "TimeOfDayProp is required.")]
public virtual global::Microsoft.OData.Edm.TimeOfDay TimeOfDayProp
public virtual global::System.TimeOnly TimeOfDayProp
{
get
{
Expand All @@ -698,15 +698,15 @@ public virtual decimal DecimalPropWithLetter
}
}
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "#VersionNumber#")]
private global::Microsoft.OData.Edm.TimeOfDay _TimeOfDayProp = global::Microsoft.OData.Edm.TimeOfDay.Parse("22:44");
partial void OnTimeOfDayPropChanging(global::Microsoft.OData.Edm.TimeOfDay value);
private global::System.TimeOnly _TimeOfDayProp = global::System.TimeOnly.Parse("22:44");
partial void OnTimeOfDayPropChanging(global::System.TimeOnly value);
partial void OnTimeOfDayPropChanged();
/// <summary>
/// There are no comments for Property NullableTimeOfDayProp in the schema.
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "#VersionNumber#")]

public virtual global::System.Nullable<global::Microsoft.OData.Edm.TimeOfDay> NullableTimeOfDayProp
public virtual global::System.Nullable<global::System.TimeOnly> NullableTimeOfDayProp
{
get
{
Expand All @@ -720,8 +720,8 @@ public virtual decimal DecimalPropWithLetter
}
}
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "#VersionNumber#")]
private global::System.Nullable<global::Microsoft.OData.Edm.TimeOfDay> _NullableTimeOfDayProp = global::Microsoft.OData.Edm.TimeOfDay.Parse("22:44");
partial void OnNullableTimeOfDayPropChanging(global::System.Nullable<global::Microsoft.OData.Edm.TimeOfDay> value);
private global::System.Nullable<global::System.TimeOnly> _NullableTimeOfDayProp = global::System.TimeOnly.Parse("22:44");
partial void OnNullableTimeOfDayPropChanging(global::System.Nullable<global::System.TimeOnly> value);
partial void OnNullableTimeOfDayPropChanged();
/// <summary>
/// There are no comments for Property DurationProp in the schema.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ Namespace Namespace1
''' </summary>
<Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "#VersionNumber#")> _
<Global.System.ComponentModel.DataAnnotations.RequiredAttribute()> _
Public Overridable Property DateProp() As Global.Microsoft.OData.Edm.Date
Public Overridable Property DateProp() As Global.System.DateOnly
Get
Return Me._DateProp
End Get
Expand All @@ -556,16 +556,16 @@ Namespace Namespace1
End Set
End Property
<Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "#VersionNumber#")> _
Private _DateProp As Global.Microsoft.OData.Edm.Date = Global.Microsoft.OData.Edm.Date.Parse("2020-02-02")
Partial Private Sub OnDatePropChanging(ByVal value As Global.Microsoft.OData.Edm.Date)
Private _DateProp As Global.System.DateOnly = Global.System.DateOnly.Parse("2020-02-02")
Partial Private Sub OnDatePropChanging(ByVal value As Global.System.DateOnly)
End Sub
Partial Private Sub OnDatePropChanged()
End Sub
''' <summary>
''' There are no comments for Property NullableDateProp in the schema.
''' </summary>
<Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "#VersionNumber#")> _
Public Overridable Property NullableDateProp() As Global.System.Nullable(Of Global.Microsoft.OData.Edm.Date)
Public Overridable Property NullableDateProp() As Global.System.Nullable(Of Global.System.DateOnly)
Get
Return Me._NullableDateProp
End Get
Expand All @@ -576,8 +576,8 @@ Namespace Namespace1
End Set
End Property
<Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "#VersionNumber#")> _
Private _NullableDateProp As Global.System.Nullable(Of Global.Microsoft.OData.Edm.Date) = Global.Microsoft.OData.Edm.Date.Parse("2020-02-02")
Partial Private Sub OnNullableDatePropChanging(ByVal value As Global.System.Nullable(Of Global.Microsoft.OData.Edm.Date))
Private _NullableDateProp As Global.System.Nullable(Of Global.System.DateOnly) = Global.System.DateOnly.Parse("2020-02-02")
Partial Private Sub OnNullableDatePropChanging(ByVal value As Global.System.Nullable(Of Global.System.DateOnly))
End Sub
Partial Private Sub OnNullableDatePropChanged()
End Sub
Expand Down Expand Up @@ -627,7 +627,7 @@ Namespace Namespace1
''' </summary>
<Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "#VersionNumber#")> _
<Global.System.ComponentModel.DataAnnotations.RequiredAttribute()> _
Public Overridable Property TimeOfDayProp() As Global.Microsoft.OData.Edm.TimeOfDay
Public Overridable Property TimeOfDayProp() As Global.System.TimeOnly
Get
Return Me._TimeOfDayProp
End Get
Expand All @@ -638,16 +638,16 @@ Namespace Namespace1
End Set
End Property
<Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "#VersionNumber#")> _
Private _TimeOfDayProp As Global.Microsoft.OData.Edm.TimeOfDay = Global.Microsoft.OData.Edm.TimeOfDay.Parse("22:44")
Partial Private Sub OnTimeOfDayPropChanging(ByVal value As Global.Microsoft.OData.Edm.TimeOfDay)
Private _TimeOfDayProp As Global.System.TimeOnly = Global.System.TimeOnly.Parse("22:44")
Partial Private Sub OnTimeOfDayPropChanging(ByVal value As Global.System.TimeOnly)
End Sub
Partial Private Sub OnTimeOfDayPropChanged()
End Sub
''' <summary>
''' There are no comments for Property NullableTimeOfDayProp in the schema.
''' </summary>
<Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "#VersionNumber#")> _
Public Overridable Property NullableTimeOfDayProp() As Global.System.Nullable(Of Global.Microsoft.OData.Edm.TimeOfDay)
Public Overridable Property NullableTimeOfDayProp() As Global.System.Nullable(Of Global.System.TimeOnly)
Get
Return Me._NullableTimeOfDayProp
End Get
Expand All @@ -658,8 +658,8 @@ Namespace Namespace1
End Set
End Property
<Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "#VersionNumber#")> _
Private _NullableTimeOfDayProp As Global.System.Nullable(Of Global.Microsoft.OData.Edm.TimeOfDay) = Global.Microsoft.OData.Edm.TimeOfDay.Parse("22:44")
Partial Private Sub OnNullableTimeOfDayPropChanging(ByVal value As Global.System.Nullable(Of Global.Microsoft.OData.Edm.TimeOfDay))
Private _NullableTimeOfDayProp As Global.System.Nullable(Of Global.System.TimeOnly) = Global.System.TimeOnly.Parse("22:44")
Partial Private Sub OnNullableTimeOfDayPropChanging(ByVal value As Global.System.Nullable(Of Global.System.TimeOnly))
End Sub
Partial Private Sub OnNullableTimeOfDayPropChanged()
End Sub
Expand Down
Loading