This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
context.Configurations.ResponsePipeline.OnEntryEnded((a => | |
{ | |
Type entityType = dataServiceContext.ResolveType(a.Entry.TypeName); | |
if (typeof(Product).IsAssignableFrom(entityType)) | |
{ | |
var properties = a.Entry.Properties as List<ODataProperty>; | |
if (properties == null) | |
{ | |
properties = new List<ODataProperty>(a.Entry.Properties); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var queryString = ("/Northwind.svc/Products?" | |
+ "$filter=((Category/Category_ID eq 1)or" | |
+ "substringof('tofu',tolower" | |
+"(Product_Name)))&" | |
+ "$orderby=Category/Category_Name&" | |
+ "$select=Product_Name"); | |
$.ajax({ | |
url: queryString, | |
dataType: 'JSON', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Data.Services; | |
namespace OData101.UpdateTheSvcFileWhenBinDeploying | |
{ | |
public class BinDeploy : DataService<DummyContext> { } | |
public class DummyContext { } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.ComponentModel.DataAnnotations.Schema; | |
namespace WcfDataServices101.UsingTheNotMappedAttribute | |
{ | |
public class AccessControlEntry | |
{ | |
public int Id { get; set; } | |
// An Enum property cannot be mapped to an OData feed, so it must be |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"odata.metadata":"http://services.odata.org/Experimental/OData/OData.svc/$metadata#ODataDemo.DemoService/Products/@Element", | |
"ID":0, | |
"Name":"Bread", | |
"Description":"Whole grain bread", | |
"ReleaseDate":"1992-01-01T00:00:00", | |
"DiscontinuedDate":null, | |
"Rating":4, | |
"Price":"2.5" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Linq; | |
namespace OData101.BuildingOurFirstODataConsumer | |
{ | |
internal class Program | |
{ | |
private static void Main() | |
{ | |
var context = new Netflix.NetflixCatalog(new Uri("http://odata.netflix.com/Catalog")); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static async Task<IEnumerable<T>> ExecuteAsync<T>(this DataServiceQuery<T> query) | |
{ | |
return await Task.Factory.FromAsync<IEnumerable<T>>(query.BeginExecute(null, null), query.EndExecute); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--A marked-up model available from some $metadata endpoint--> | |
<Schema> | |
<Using Namespace="org.odata.v1" Alias="odata" /> | |
<Using Namespace="com.microsoft.geoflow.v1" Alias="geoflow" /> | |
<Using Namespace="org.odata.data.visualization.v1" Alias="dataViz" /> | |
<Using Namespace="com.tableau.visualization.v1" Alias="tableau" /> | |
<!--Crimes (e.g., robbery, arson, etc.) that occurred in the past. This entity type can be queried | |
via "normal" OData by using the Incidents entity set, but it is also marked up with visualization |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IEdmModel model = EdmxReader.Parse(XmlReader.Create("http://services.odata.org/v3/odata/odata.svc/$metadata")); | |
IEdmEntityType product = model.FindDeclaredType("ODataDemo.Product") as IEdmEntityType; | |
var orderby = ODataUriParser.ParseOrderBy("ReleaseDate desc", model, product); | |
var filter = ODataUriParser.ParseFilter("ReleaseDate ge datetime'2012-11-19T00:00:00Z'", model, product); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Collections.ObjectModel; | |
using System.Collections.Specialized; | |
using System.Data.Services.Client; | |
using System.Linq; | |
using System.Text; | |
using System.Text.RegularExpressions; | |
using System.Threading.Tasks; | |
using OData.WindowsStore.NetflixDemo.Common; |
NewerOlder