Releases: Net-Http-OData/Net.Http.OData
Net.Http.OData 5.1.0
This release contains the following:
Enhancements
#10 - Add support for the time function in OData 4.0
#11 - Add support for the totalseconds function in OData 4.0
#12 - Add details to ODataError
#13 - Set the ODataException.Target to an appropriate value
API Changes
+ public class ODataErrorDetail
+ public class ODataPropertyNames
ODataError
+ public IEnumerable<ODataErrorDetail> Details { get; set; }
ODataErrorContent
- public static ODataErrorContent Create(int code, string message, string target)
+ public static ODataErrorContent Create(int code, string message, string target, IEnumerable<ODataErrorDetail> details = null)
ODataException
- public static ODataException BadRequest(string message)
- public static ODataException NotAcceptable(string message)
- public static ODataException NotImplemented(string message)
- public static ODataException PreconditionFailed(string message)
- public static ODataException UnsupportedMediaType(string message)
+ public static ODataException BadRequest(string message, string target = null, ODataException innerException = null)
+ public static ODataException NotAcceptable(string message, string target = null, ODataException innerException = null)
+ public static ODataException NotImplemented(string message, string target = null, ODataException innerException = null)
+ public static ODataException PreconditionFailed(string message, string target = null, ODataException innerException = null)
+ public static ODataException UnsupportedMediaType(string message, string target = null, ODataException innerException = null)
+ public ODataErrorDetail ToODataErrorDetail()
Query
AllowedFunctions
+ Time
+ TotalSeconds
Net.Http.OData 5.0.1
This release contains the following:
Fixes
#3 - Boolean values in the CSDL which are calculated are cased incorrectly
#4 - NaN, INF and -INF are not handled
#8 - HTTP 406 Not Acceptable should be used instead of 415 Media Type Not Supported when validating ACCEPT header
Enhancements
#5 - Add additional unit tests based upon the ABNF test cases
#6 - Implement caching for PropertyPaths
#7 - Optimise the token definitions in Lexer
API Changes
ODataError
+static ODataException NotAcceptable(string message)
Net.Http.OData 5.0.0
The initial migration from Net.Http.WebApi.OData 4.2.1 to contain the core OData classes and has some enhancements and breaking changes.
- Added a .NET Standard 2.0 build
- Added support for nested property paths in
$select
,$format
and$orderby
- Optimised string parsing, reduced some use of substrings & concatenation
- Library is JSON only, some parts did work with XML but not completely so removed XML for the time being
- Added a generic implementation of
ConstantNode
asConstantNode<T>
which can be used to avoid boxing/unboxing if the value is a value type (struct). - DateTimeOffset now assumes Universal instead of Local, configurable via
Net.Http.OData.Query.Parsers.ParserSettings.DateTimeStyles
API Changes
+ public sealed class ODataError
+ public sealed class ODataErrorContent
- public static class ODataHeaderNames
+ public static class ODataRequestHeaderNames
+ public static class ODataResponseHeaderNames
+ public sealed class ODataServiceOptions
+ public static class ODataUtility
+ public sealed class ODataVersion
ODataError
- string Code { get; }
- string Message { get; }
- string Target { get; }
+ string Code { get; set; }
+ string Message { get; set; }
+ string Target { get; set; }
ODataErrorContent
- private ODataErrorContent(ODataError error)
- ODataError Error { get; }
+ ODataError Error { get; set; }
+ static ODataErrorContent Create(int code, string message)
ODataException
- public ODataException(HttpStatusCode statusCode, string message)
- public ODataException(HttpStatusCode statusCode, string message, string target)
+ public ODataException(string message, HttpStatusCode statusCode)
+ public ODataException(string message, HttpStatusCode statusCode, string target)
+ static ODataException BadRequest(string message)
+ static ODataException NotImplemented(string message)
+ static ODataException PreconditionFailed(string message)
+ static ODataException UnsupportedMediaType(string message)
+ ODataErrorContent ToODataErrorContent()
ODataRequestOptions
- public ODataRequestOptions(Uri dataServiceUri, ODataIsolationLevel isolationLevel, ODataMetadataLevel metadataLevel)
+ public ODataRequestOptions(Uri serviceRootUri, ODataIsolationLevel isolationLevel, ODataMetadataLevel metadataLevel, ODataVersion odataVersion, ODataVersion odataMaxVersion)
- Uri DataServiceUri { get; }
+ ODataVersion ODataMaxVersion { get; }
+ ODataVersion ODataVersion { get; }
+ Uri ServiceRootUri { get; }
ODataResponseContent
- public ODataResponseContent(Uri context, object value)
- public ODataResponseContent(Uri context, object value, int? count)
- public ODataResponseContent(Uri context, object value, int? count, Uri nextLink)
- Uri Context { get; }
- int? Count { get; }
- Uri NextLink { get; }
- object Value { get; }
+ string Context { get; set; }
+ long? Count { get; set; }
+ string NextLink { get; set; }
+ object Value { get; set; }
Metadata
Some classes within Net.Http.WebApi.OData.Model moved to Net.Http.OData.Model (within Net.Http.OData 5.0.0)
+ public static class ServiceDocumentProvider
+ public static class XmlMetadataProvider
Model
All classes within Net.Http.WebApi.OData.Model moved to Net.Http.OData.Model (within Net.Http.OData 5.0.0)
EdmProperty
+ PropertyInfo ClrProperty { get; }
EdmType
- static EdmType GetEdmType(string edmTypeName)
EntityDataModel
- IReadOnlyCollection<string> FilterFunctions { get; }
- IReadOnlyCollection<string> SupportedFormats { get; }
+ EntitySet EntitySetForPath(string path)
- bool IsEntitySet(EdmType edmType)
EntityDataModelBuilder
+ public EntityDataModelBuilder(IEqualityComparer<string> entitySetNameComparer)
- void RegisterEntitySet<T>(Expression<Func<T, object>> entityKeyExpression)
- void RegisterEntitySet<T>(Expression<Func<T, object>> entityKeyExpression, Capabilities capabilities)
- void RegisterEntitySet<T>(string entitySetName, Expression<Func<T, object>> entityKeyExpression)
+ EntityDataModelBuilder RegisterEntitySet<T>(string entitySetName, Expression<Func<T, object>> entityKeyExpression)
- void RegisterEntitySet<T>(string entitySetName, Expression<Func<T, object>> entityKeyExpression, Capabilities capabilities)
+ EntityDataModelBuilder RegisterEntitySet<T>(string entitySetName, Expression<Func<T, object>> entityKeyExpression, Capabilities capabilities)
Query
All classes within Net.Http.WebApi.OData.Query not specific to ASP.NET WebApi moved to Net.Http.OData.Query (within Net.Http.OData 5.0.0)
ODataQueryOptions
- public ODataQueryOptions(HttpRequestMessage request, EntitySet entitySet)
+ public ODataQueryOptions(string query, EntitySet entitySet, IODataQueryOptionsValidator validator)
- HttpRequestMessage Request { get; }
- string Search { get; }
+ SearchQueryOption Search { get; }
+ void Validate(ODataValidationSettings validationSettings)
ODataQueryOptionsExtensions
Removed, instance validate method added to ODataQueryOptions and IODataQueryOptionsValidator supplied via ODataQueryOptions constructor.
OrderByProperty
- EdmProperty Property { get; }
+ PropertyPath PropertyPath { get; }
SearchQueryOption
Added to make search equal to other query options in ODataQueryOptions
SelectExpandQueryOption
- IReadOnlyList<EdmProperty> Properties { get; }
+ IReadOnlyList<PropertyPath> PropertyPaths { get; }
Query.Binders
All classes within Net.Http.WebApi.OData.Query.Binders moved to Net.Http.OData.Query.Binders (within Net.Http.OData 5.0.0)
AbstractSelectExpandBinder
- abstract void Bind(EdmProperty edmProperty)
+ abstract void Bind(PropertyPath propertyPath)
Query.Expressions
All classes within Net.Http.WebApi.OData.Query.Expressions moved to Net.Http.OData.Query.Expressions (within Net.Http.OData 5.0.0)
PropertyAccessNode
- EdmProperty Property { get; }
+ PropertyPath PropertyPath { get; }
Query.Parsers
+ public static class ParserSettings