Skip to content
Merged
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
285 changes: 5 additions & 280 deletions src/Microsoft.OData.ModelBuilder/Microsoft.OData.ModelBuilder.xml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,11 @@ namespace Microsoft.OData.ModelBuilder.Capabilities.V1
/// </summary>
public partial class AnnotationValuesInQuerySupportedConfiguration : VocabularyTermConfiguration
{
private readonly Dictionary<string, object> _dynamicProperties = new Dictionary<string, object>();
private bool? _annotationValuesInQuerySupported;

/// <inheritdoc/>
public override string TermName => "Org.OData.Capabilities.V1.AnnotationValuesInQuerySupported";

/// <summary>
/// Dynamic properties.
/// </summary>
/// <param name="name">The name to set</param>
/// <param name="value">The value to set</param>
/// <returns><see cref="AnnotationValuesInQuerySupportedConfiguration"/></returns>
public AnnotationValuesInQuerySupportedConfiguration HasDynamicProperty(string name, object value)
{
_dynamicProperties[name] = value;
return this;
}

/// <summary>
/// Supports annotation values within system query options
/// </summary>
Expand All @@ -48,21 +35,7 @@ public AnnotationValuesInQuerySupportedConfiguration IsAnnotationValuesInQuerySu
/// <inheritdoc/>
public override IEdmExpression ToEdmExpression()
{
var properties = new List<IEdmPropertyConstructor>();

if (_annotationValuesInQuerySupported.HasValue)
{
properties.Add(new EdmPropertyConstructor("AnnotationValuesInQuerySupported", new EdmBooleanConstant(_annotationValuesInQuerySupported.Value)));
}

properties.AddRange(_dynamicProperties.ToEdmProperties());

if (!properties.Any())
{
return null;
}

return new EdmRecordExpression(properties);
return _annotationValuesInQuerySupported.HasValue ? new EdmBooleanConstant(_annotationValuesInQuerySupported.Value) : null;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,11 @@ namespace Microsoft.OData.ModelBuilder.Capabilities.V1
/// </summary>
public partial class AsynchronousRequestsSupportedConfiguration : VocabularyTermConfiguration
{
private readonly Dictionary<string, object> _dynamicProperties = new Dictionary<string, object>();
private bool? _asynchronousRequestsSupported;

/// <inheritdoc/>
public override string TermName => "Org.OData.Capabilities.V1.AsynchronousRequestsSupported";

/// <summary>
/// Dynamic properties.
/// </summary>
/// <param name="name">The name to set</param>
/// <param name="value">The value to set</param>
/// <returns><see cref="AsynchronousRequestsSupportedConfiguration"/></returns>
public AsynchronousRequestsSupportedConfiguration HasDynamicProperty(string name, object value)
{
_dynamicProperties[name] = value;
return this;
}

/// <summary>
/// Service supports the asynchronous request preference
/// </summary>
Expand All @@ -48,21 +35,7 @@ public AsynchronousRequestsSupportedConfiguration IsAsynchronousRequestsSupporte
/// <inheritdoc/>
public override IEdmExpression ToEdmExpression()
{
var properties = new List<IEdmPropertyConstructor>();

if (_asynchronousRequestsSupported.HasValue)
{
properties.Add(new EdmPropertyConstructor("AsynchronousRequestsSupported", new EdmBooleanConstant(_asynchronousRequestsSupported.Value)));
}

properties.AddRange(_dynamicProperties.ToEdmProperties());

if (!properties.Any())
{
return null;
}

return new EdmRecordExpression(properties);
return _asynchronousRequestsSupported.HasValue ? new EdmBooleanConstant(_asynchronousRequestsSupported.Value) : null;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,11 @@ namespace Microsoft.OData.ModelBuilder.Capabilities.V1
/// </summary>
public partial class BatchContinueOnErrorSupportedConfiguration : VocabularyTermConfiguration
{
private readonly Dictionary<string, object> _dynamicProperties = new Dictionary<string, object>();
private bool? _batchContinueOnErrorSupported;

/// <inheritdoc/>
public override string TermName => "Org.OData.Capabilities.V1.BatchContinueOnErrorSupported";

/// <summary>
/// Dynamic properties.
/// </summary>
/// <param name="name">The name to set</param>
/// <param name="value">The value to set</param>
/// <returns><see cref="BatchContinueOnErrorSupportedConfiguration"/></returns>
public BatchContinueOnErrorSupportedConfiguration HasDynamicProperty(string name, object value)
{
_dynamicProperties[name] = value;
return this;
}

/// <summary>
/// Service supports the continue on error preference. Supports $batch requests. Services that apply the BatchContinueOnErrorSupported term should also specify the ContinueOnErrorSupported property from the BatchSupport term.
/// </summary>
Expand All @@ -48,21 +35,7 @@ public BatchContinueOnErrorSupportedConfiguration IsBatchContinueOnErrorSupporte
/// <inheritdoc/>
public override IEdmExpression ToEdmExpression()
{
var properties = new List<IEdmPropertyConstructor>();

if (_batchContinueOnErrorSupported.HasValue)
{
properties.Add(new EdmPropertyConstructor("BatchContinueOnErrorSupported", new EdmBooleanConstant(_batchContinueOnErrorSupported.Value)));
}

properties.AddRange(_dynamicProperties.ToEdmProperties());

if (!properties.Any())
{
return null;
}

return new EdmRecordExpression(properties);
return _batchContinueOnErrorSupported.HasValue ? new EdmBooleanConstant(_batchContinueOnErrorSupported.Value) : null;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,11 @@ namespace Microsoft.OData.ModelBuilder.Capabilities.V1
/// </summary>
public partial class BatchSupportedConfiguration : VocabularyTermConfiguration
{
private readonly Dictionary<string, object> _dynamicProperties = new Dictionary<string, object>();
private bool? _batchSupported;

/// <inheritdoc/>
public override string TermName => "Org.OData.Capabilities.V1.BatchSupported";

/// <summary>
/// Dynamic properties.
/// </summary>
/// <param name="name">The name to set</param>
/// <param name="value">The value to set</param>
/// <returns><see cref="BatchSupportedConfiguration"/></returns>
public BatchSupportedConfiguration HasDynamicProperty(string name, object value)
{
_dynamicProperties[name] = value;
return this;
}

/// <summary>
/// Supports $batch requests. Services that apply the BatchSupported term should also apply the more comprehensive BatchSupport term.
/// </summary>
Expand All @@ -48,21 +35,7 @@ public BatchSupportedConfiguration IsBatchSupported(bool batchSupported)
/// <inheritdoc/>
public override IEdmExpression ToEdmExpression()
{
var properties = new List<IEdmPropertyConstructor>();

if (_batchSupported.HasValue)
{
properties.Add(new EdmPropertyConstructor("BatchSupported", new EdmBooleanConstant(_batchSupported.Value)));
}

properties.AddRange(_dynamicProperties.ToEdmProperties());

if (!properties.Any())
{
return null;
}

return new EdmRecordExpression(properties);
return _batchSupported.HasValue ? new EdmBooleanConstant(_batchSupported.Value) : null;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,11 @@ namespace Microsoft.OData.ModelBuilder.Capabilities.V1
/// </summary>
public partial class ComputeSupportedConfiguration : VocabularyTermConfiguration
{
private readonly Dictionary<string, object> _dynamicProperties = new Dictionary<string, object>();
private bool? _computeSupported;

/// <inheritdoc/>
public override string TermName => "Org.OData.Capabilities.V1.ComputeSupported";

/// <summary>
/// Dynamic properties.
/// </summary>
/// <param name="name">The name to set</param>
/// <param name="value">The value to set</param>
/// <returns><see cref="ComputeSupportedConfiguration"/></returns>
public ComputeSupportedConfiguration HasDynamicProperty(string name, object value)
{
_dynamicProperties[name] = value;
return this;
}

/// <summary>
/// Supports $compute
/// </summary>
Expand All @@ -48,21 +35,7 @@ public ComputeSupportedConfiguration IsComputeSupported(bool computeSupported)
/// <inheritdoc/>
public override IEdmExpression ToEdmExpression()
{
var properties = new List<IEdmPropertyConstructor>();

if (_computeSupported.HasValue)
{
properties.Add(new EdmPropertyConstructor("ComputeSupported", new EdmBooleanConstant(_computeSupported.Value)));
}

properties.AddRange(_dynamicProperties.ToEdmProperties());

if (!properties.Any())
{
return null;
}

return new EdmRecordExpression(properties);
return _computeSupported.HasValue ? new EdmBooleanConstant(_computeSupported.Value) : null;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,11 @@ namespace Microsoft.OData.ModelBuilder.Capabilities.V1
/// </summary>
public partial class CrossJoinSupportedConfiguration : VocabularyTermConfiguration
{
private readonly Dictionary<string, object> _dynamicProperties = new Dictionary<string, object>();
private bool? _crossJoinSupported;

/// <inheritdoc/>
public override string TermName => "Org.OData.Capabilities.V1.CrossJoinSupported";

/// <summary>
/// Dynamic properties.
/// </summary>
/// <param name="name">The name to set</param>
/// <param name="value">The value to set</param>
/// <returns><see cref="CrossJoinSupportedConfiguration"/></returns>
public CrossJoinSupportedConfiguration HasDynamicProperty(string name, object value)
{
_dynamicProperties[name] = value;
return this;
}

/// <summary>
/// Supports cross joins for the entity sets in this container
/// </summary>
Expand All @@ -48,21 +35,7 @@ public CrossJoinSupportedConfiguration IsCrossJoinSupported(bool crossJoinSuppor
/// <inheritdoc/>
public override IEdmExpression ToEdmExpression()
{
var properties = new List<IEdmPropertyConstructor>();

if (_crossJoinSupported.HasValue)
{
properties.Add(new EdmPropertyConstructor("CrossJoinSupported", new EdmBooleanConstant(_crossJoinSupported.Value)));
}

properties.AddRange(_dynamicProperties.ToEdmProperties());

if (!properties.Any())
{
return null;
}

return new EdmRecordExpression(properties);
return _crossJoinSupported.HasValue ? new EdmBooleanConstant(_crossJoinSupported.Value) : null;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,11 @@ namespace Microsoft.OData.ModelBuilder.Capabilities.V1
/// </summary>
public partial class IndexableByKeyConfiguration : VocabularyTermConfiguration
{
private readonly Dictionary<string, object> _dynamicProperties = new Dictionary<string, object>();
private bool? _indexableByKey;

/// <inheritdoc/>
public override string TermName => "Org.OData.Capabilities.V1.IndexableByKey";

/// <summary>
/// Dynamic properties.
/// </summary>
/// <param name="name">The name to set</param>
/// <param name="value">The value to set</param>
/// <returns><see cref="IndexableByKeyConfiguration"/></returns>
public IndexableByKeyConfiguration HasDynamicProperty(string name, object value)
{
_dynamicProperties[name] = value;
return this;
}

/// <summary>
/// Supports key values according to OData URL conventions
/// </summary>
Expand All @@ -48,21 +35,7 @@ public IndexableByKeyConfiguration IsIndexableByKey(bool indexableByKey)
/// <inheritdoc/>
public override IEdmExpression ToEdmExpression()
{
var properties = new List<IEdmPropertyConstructor>();

if (_indexableByKey.HasValue)
{
properties.Add(new EdmPropertyConstructor("IndexableByKey", new EdmBooleanConstant(_indexableByKey.Value)));
}

properties.AddRange(_dynamicProperties.ToEdmProperties());

if (!properties.Any())
{
return null;
}

return new EdmRecordExpression(properties);
return _indexableByKey.HasValue ? new EdmBooleanConstant(_indexableByKey.Value) : null;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,11 @@ namespace Microsoft.OData.ModelBuilder.Capabilities.V1
/// </summary>
public partial class KeyAsSegmentSupportedConfiguration : VocabularyTermConfiguration
{
private readonly Dictionary<string, object> _dynamicProperties = new Dictionary<string, object>();
private bool? _keyAsSegmentSupported;

/// <inheritdoc/>
public override string TermName => "Org.OData.Capabilities.V1.KeyAsSegmentSupported";

/// <summary>
/// Dynamic properties.
/// </summary>
/// <param name="name">The name to set</param>
/// <param name="value">The value to set</param>
/// <returns><see cref="KeyAsSegmentSupportedConfiguration"/></returns>
public KeyAsSegmentSupportedConfiguration HasDynamicProperty(string name, object value)
{
_dynamicProperties[name] = value;
return this;
}

/// <summary>
/// Supports [key-as-segment convention](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part2-url-conventions.html#sec_KeyasSegmentConvention) for addressing entities within a collection
/// </summary>
Expand All @@ -48,21 +35,7 @@ public KeyAsSegmentSupportedConfiguration IsKeyAsSegmentSupported(bool keyAsSegm
/// <inheritdoc/>
public override IEdmExpression ToEdmExpression()
{
var properties = new List<IEdmPropertyConstructor>();

if (_keyAsSegmentSupported.HasValue)
{
properties.Add(new EdmPropertyConstructor("KeyAsSegmentSupported", new EdmBooleanConstant(_keyAsSegmentSupported.Value)));
}

properties.AddRange(_dynamicProperties.ToEdmProperties());

if (!properties.Any())
{
return null;
}

return new EdmRecordExpression(properties);
return _keyAsSegmentSupported.HasValue ? new EdmBooleanConstant(_keyAsSegmentSupported.Value) : null;
}
}
}
Loading