frodo 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.autotest +2 -0
- data/.circleci/config.yml +54 -0
- data/.gitignore +24 -0
- data/.gitlab-ci.yml +9 -0
- data/.rspec +2 -0
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/.travis.yml +75 -0
- data/CHANGELOG.md +163 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +23 -0
- data/README.md +479 -0
- data/Rakefile +7 -0
- data/TODO.md +55 -0
- data/frodo.gemspec +39 -0
- data/images/frodo.jpg +0 -0
- data/lib/frodo/abstract_client.rb +11 -0
- data/lib/frodo/client.rb +6 -0
- data/lib/frodo/concerns/api.rb +292 -0
- data/lib/frodo/concerns/authentication.rb +32 -0
- data/lib/frodo/concerns/base.rb +84 -0
- data/lib/frodo/concerns/caching.rb +26 -0
- data/lib/frodo/concerns/connection.rb +79 -0
- data/lib/frodo/concerns/verbs.rb +68 -0
- data/lib/frodo/config.rb +143 -0
- data/lib/frodo/entity.rb +335 -0
- data/lib/frodo/entity_container.rb +75 -0
- data/lib/frodo/entity_set.rb +131 -0
- data/lib/frodo/errors.rb +70 -0
- data/lib/frodo/middleware/authentication/token.rb +13 -0
- data/lib/frodo/middleware/authentication.rb +87 -0
- data/lib/frodo/middleware/authorization.rb +18 -0
- data/lib/frodo/middleware/caching.rb +30 -0
- data/lib/frodo/middleware/custom_headers.rb +14 -0
- data/lib/frodo/middleware/gzip.rb +33 -0
- data/lib/frodo/middleware/instance_url.rb +20 -0
- data/lib/frodo/middleware/logger.rb +42 -0
- data/lib/frodo/middleware/multipart.rb +64 -0
- data/lib/frodo/middleware/odata_headers.rb +13 -0
- data/lib/frodo/middleware/raise_error.rb +47 -0
- data/lib/frodo/middleware.rb +33 -0
- data/lib/frodo/navigation_property/proxy.rb +80 -0
- data/lib/frodo/navigation_property.rb +29 -0
- data/lib/frodo/properties/binary.rb +50 -0
- data/lib/frodo/properties/boolean.rb +37 -0
- data/lib/frodo/properties/collection.rb +50 -0
- data/lib/frodo/properties/complex.rb +114 -0
- data/lib/frodo/properties/date.rb +27 -0
- data/lib/frodo/properties/date_time.rb +83 -0
- data/lib/frodo/properties/date_time_offset.rb +17 -0
- data/lib/frodo/properties/decimal.rb +54 -0
- data/lib/frodo/properties/enum.rb +62 -0
- data/lib/frodo/properties/float.rb +67 -0
- data/lib/frodo/properties/geography/base.rb +162 -0
- data/lib/frodo/properties/geography/line_string.rb +33 -0
- data/lib/frodo/properties/geography/point.rb +31 -0
- data/lib/frodo/properties/geography/polygon.rb +38 -0
- data/lib/frodo/properties/geography.rb +13 -0
- data/lib/frodo/properties/guid.rb +17 -0
- data/lib/frodo/properties/integer.rb +107 -0
- data/lib/frodo/properties/number.rb +14 -0
- data/lib/frodo/properties/string.rb +72 -0
- data/lib/frodo/properties/time.rb +40 -0
- data/lib/frodo/properties/time_of_day.rb +27 -0
- data/lib/frodo/properties.rb +32 -0
- data/lib/frodo/property.rb +139 -0
- data/lib/frodo/property_registry.rb +41 -0
- data/lib/frodo/query/criteria/comparison_operators.rb +49 -0
- data/lib/frodo/query/criteria/date_functions.rb +61 -0
- data/lib/frodo/query/criteria/geography_functions.rb +21 -0
- data/lib/frodo/query/criteria/lambda_operators.rb +27 -0
- data/lib/frodo/query/criteria/string_functions.rb +40 -0
- data/lib/frodo/query/criteria.rb +92 -0
- data/lib/frodo/query/in_batches.rb +58 -0
- data/lib/frodo/query.rb +221 -0
- data/lib/frodo/railtie.rb +19 -0
- data/lib/frodo/schema/complex_type.rb +79 -0
- data/lib/frodo/schema/enum_type.rb +95 -0
- data/lib/frodo/schema.rb +164 -0
- data/lib/frodo/service.rb +199 -0
- data/lib/frodo/service_registry.rb +52 -0
- data/lib/frodo/version.rb +3 -0
- data/lib/frodo.rb +67 -0
- data/spec/fixtures/auth_success_response.json +11 -0
- data/spec/fixtures/error.json +11 -0
- data/spec/fixtures/files/entity_to_xml.xml +18 -0
- data/spec/fixtures/files/error.xml +5 -0
- data/spec/fixtures/files/metadata.xml +150 -0
- data/spec/fixtures/files/metadata_with_error.xml +157 -0
- data/spec/fixtures/files/product_0.json +10 -0
- data/spec/fixtures/files/product_0.xml +28 -0
- data/spec/fixtures/files/products.json +106 -0
- data/spec/fixtures/files/products.xml +308 -0
- data/spec/fixtures/files/supplier_0.json +26 -0
- data/spec/fixtures/files/supplier_0.xml +32 -0
- data/spec/fixtures/leads.json +923 -0
- data/spec/fixtures/refresh_error_response.json +8 -0
- data/spec/frodo/abstract_client_spec.rb +13 -0
- data/spec/frodo/client_spec.rb +57 -0
- data/spec/frodo/concerns/authentication_spec.rb +79 -0
- data/spec/frodo/concerns/base_spec.rb +68 -0
- data/spec/frodo/concerns/caching_spec.rb +40 -0
- data/spec/frodo/concerns/connection_spec.rb +65 -0
- data/spec/frodo/config_spec.rb +127 -0
- data/spec/frodo/entity/shared_examples.rb +83 -0
- data/spec/frodo/entity_container_spec.rb +38 -0
- data/spec/frodo/entity_set_spec.rb +169 -0
- data/spec/frodo/entity_spec.rb +153 -0
- data/spec/frodo/errors_spec.rb +48 -0
- data/spec/frodo/middleware/authentication/token_spec.rb +87 -0
- data/spec/frodo/middleware/authentication_spec.rb +83 -0
- data/spec/frodo/middleware/authorization_spec.rb +17 -0
- data/spec/frodo/middleware/custom_headers_spec.rb +21 -0
- data/spec/frodo/middleware/gzip_spec.rb +68 -0
- data/spec/frodo/middleware/instance_url_spec.rb +27 -0
- data/spec/frodo/middleware/logger_spec.rb +21 -0
- data/spec/frodo/middleware/odata_headers_spec.rb +15 -0
- data/spec/frodo/middleware/raise_error_spec.rb +66 -0
- data/spec/frodo/navigation_property/proxy_spec.rb +46 -0
- data/spec/frodo/navigation_property_spec.rb +55 -0
- data/spec/frodo/properties/binary_spec.rb +50 -0
- data/spec/frodo/properties/boolean_spec.rb +72 -0
- data/spec/frodo/properties/collection_spec.rb +44 -0
- data/spec/frodo/properties/date_spec.rb +23 -0
- data/spec/frodo/properties/date_time_offset_spec.rb +30 -0
- data/spec/frodo/properties/date_time_spec.rb +23 -0
- data/spec/frodo/properties/decimal_spec.rb +50 -0
- data/spec/frodo/properties/float_spec.rb +45 -0
- data/spec/frodo/properties/geography/line_string_spec.rb +33 -0
- data/spec/frodo/properties/geography/point_spec.rb +29 -0
- data/spec/frodo/properties/geography/polygon_spec.rb +55 -0
- data/spec/frodo/properties/geography/shared_examples.rb +72 -0
- data/spec/frodo/properties/guid_spec.rb +17 -0
- data/spec/frodo/properties/integer_spec.rb +58 -0
- data/spec/frodo/properties/string_spec.rb +46 -0
- data/spec/frodo/properties/time_of_day_spec.rb +23 -0
- data/spec/frodo/properties/time_spec.rb +15 -0
- data/spec/frodo/property_registry_spec.rb +16 -0
- data/spec/frodo/property_spec.rb +71 -0
- data/spec/frodo/query/criteria_spec.rb +229 -0
- data/spec/frodo/query_spec.rb +156 -0
- data/spec/frodo/schema/complex_type_spec.rb +97 -0
- data/spec/frodo/schema/enum_type_spec.rb +112 -0
- data/spec/frodo/schema_spec.rb +113 -0
- data/spec/frodo/service_registry_spec.rb +19 -0
- data/spec/frodo/service_spec.rb +153 -0
- data/spec/frodo/usage_example_spec.rb +161 -0
- data/spec/spec_helper.rb +35 -0
- data/spec/support/coverage.rb +2 -0
- data/spec/support/fixture_helpers.rb +14 -0
- data/spec/support/middleware.rb +19 -0
- metadata +479 -0
@@ -0,0 +1,150 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<edmx:Edmx Version="4.0" xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx">
|
3
|
+
<edmx:DataServices>
|
4
|
+
<Schema Namespace="ODataDemo" xmlns="http://docs.oasis-open.org/odata/ns/edm">
|
5
|
+
<EntityType Name="Product">
|
6
|
+
<Key>
|
7
|
+
<PropertyRef Name="ID" />
|
8
|
+
</Key>
|
9
|
+
<Property Name="ID" Type="Edm.Int32" Nullable="false" />
|
10
|
+
<Property Name="Name" Type="Edm.String" />
|
11
|
+
<Property Name="Description" Type="Edm.String" />
|
12
|
+
<Property Name="ReleaseDate" Type="Edm.DateTimeOffset" Nullable="false" />
|
13
|
+
<Property Name="DiscontinuedDate" Type="Edm.DateTimeOffset" />
|
14
|
+
<Property Name="Rating" Type="Edm.Int16" Nullable="false" />
|
15
|
+
<Property Name="Price" Type="Edm.Double" Nullable="false" />
|
16
|
+
<Property Name="ProductStatus" Type="ODataDemo.ProductStatus" Nullable="false" />
|
17
|
+
<NavigationProperty Name="Categories" Type="Collection(ODataDemo.Category)" Partner="Products" />
|
18
|
+
<NavigationProperty Name="Supplier" Type="ODataDemo.Supplier" Partner="Products" />
|
19
|
+
<NavigationProperty Name="ProductDetail" Type="ODataDemo.ProductDetail" Partner="Product" />
|
20
|
+
</EntityType>
|
21
|
+
<EnumType Name="ProductStatus" UnderlyingType="Edm.Byte">
|
22
|
+
<Member Name="Available" />
|
23
|
+
<Member Name="LowStock" />
|
24
|
+
<Member Name="Backordered" />
|
25
|
+
<Member Name="Discontinued" />
|
26
|
+
</EnumType>
|
27
|
+
<EntityType Name="FeaturedProduct" BaseType="ODataDemo.Product">
|
28
|
+
<NavigationProperty Name="Advertisement" Type="ODataDemo.Advertisement" Partner="FeaturedProduct" />
|
29
|
+
</EntityType>
|
30
|
+
<EntityType Name="ProductDetail">
|
31
|
+
<Key>
|
32
|
+
<PropertyRef Name="ProductID" />
|
33
|
+
</Key>
|
34
|
+
<Property Name="ProductID" Type="Edm.Int32" Nullable="false" />
|
35
|
+
<Property Name="Details" Type="Edm.String" />
|
36
|
+
<NavigationProperty Name="Product" Type="ODataDemo.Product" Partner="ProductDetail" />
|
37
|
+
</EntityType>
|
38
|
+
<EntityType Name="Category" OpenType="true">
|
39
|
+
<Key>
|
40
|
+
<PropertyRef Name="ID" />
|
41
|
+
</Key>
|
42
|
+
<Property Name="ID" Type="Edm.Int32" Nullable="false" />
|
43
|
+
<Property Name="Name" Type="Edm.String" />
|
44
|
+
<NavigationProperty Name="Products" Type="Collection(ODataDemo.Product)" Partner="Categories" />
|
45
|
+
</EntityType>
|
46
|
+
<EntityType Name="Supplier">
|
47
|
+
<Key>
|
48
|
+
<PropertyRef Name="ID" />
|
49
|
+
</Key>
|
50
|
+
<Property Name="ID" Type="Edm.Int32" Nullable="false" />
|
51
|
+
<Property Name="Name" Type="Edm.String" />
|
52
|
+
<Property Name="Address" Type="ODataDemo.Address" />
|
53
|
+
<Property Name="Location" Type="Edm.GeographyPoint" SRID="Variable" />
|
54
|
+
<Property Name="Concurrency" Type="Edm.Int32" ConcurrencyMode="Fixed" Nullable="false" />
|
55
|
+
<NavigationProperty Name="Products" Type="Collection(ODataDemo.Product)" Partner="Supplier" />
|
56
|
+
</EntityType>
|
57
|
+
<ComplexType Name="Address">
|
58
|
+
<Property Name="Street" Type="Edm.String" />
|
59
|
+
<Property Name="City" Type="Edm.String" />
|
60
|
+
<Property Name="State" Type="Edm.String" />
|
61
|
+
<Property Name="ZipCode" Type="Edm.String" />
|
62
|
+
<Property Name="Country" Type="Edm.String" />
|
63
|
+
</ComplexType>
|
64
|
+
<EntityType Name="Person">
|
65
|
+
<Key>
|
66
|
+
<PropertyRef Name="ID" />
|
67
|
+
</Key>
|
68
|
+
<Property Name="ID" Type="Edm.Int32" Nullable="false" />
|
69
|
+
<Property Name="Name" Type="Edm.String" />
|
70
|
+
<NavigationProperty Name="PersonDetail" Type="ODataDemo.PersonDetail" Partner="Person" />
|
71
|
+
</EntityType>
|
72
|
+
<EntityType Name="Customer" BaseType="ODataDemo.Person">
|
73
|
+
<Property Name="TotalExpense" Type="Edm.Decimal" Nullable="false" />
|
74
|
+
</EntityType>
|
75
|
+
<EntityType Name="Employee" BaseType="ODataDemo.Person">
|
76
|
+
<Property Name="EmployeeID" Type="Edm.Int64" Nullable="false" />
|
77
|
+
<Property Name="HireDate" Type="Edm.DateTimeOffset" Nullable="false" />
|
78
|
+
<Property Name="Salary" Type="Edm.Single" Nullable="false" />
|
79
|
+
</EntityType>
|
80
|
+
<EntityType Name="PersonDetail">
|
81
|
+
<Key>
|
82
|
+
<PropertyRef Name="PersonID" />
|
83
|
+
</Key>
|
84
|
+
<Property Name="PersonID" Type="Edm.Int32" Nullable="false" />
|
85
|
+
<Property Name="Age" Type="Edm.Byte" Nullable="false" />
|
86
|
+
<Property Name="Gender" Type="Edm.Boolean" Nullable="false" />
|
87
|
+
<Property Name="Phone" Type="Edm.String" />
|
88
|
+
<Property Name="Address" Type="ODataDemo.Address" />
|
89
|
+
<Property Name="Photo" Type="Edm.Stream" Nullable="false" />
|
90
|
+
<NavigationProperty Name="Person" Type="ODataDemo.Person" Partner="PersonDetail" />
|
91
|
+
</EntityType>
|
92
|
+
<EntityType Name="Advertisement" HasStream="true">
|
93
|
+
<Key>
|
94
|
+
<PropertyRef Name="ID" />
|
95
|
+
</Key>
|
96
|
+
<Property Name="ID" Type="Edm.Guid" Nullable="false" />
|
97
|
+
<Property Name="Name" Type="Edm.String" />
|
98
|
+
<Property Name="AirDate" Type="Edm.DateTimeOffset" Nullable="false" />
|
99
|
+
<NavigationProperty Name="FeaturedProduct" Type="ODataDemo.FeaturedProduct" Partner="Advertisement" />
|
100
|
+
</EntityType>
|
101
|
+
<EntityContainer Name="DemoService">
|
102
|
+
<EntitySet Name="Products" EntityType="ODataDemo.Product">
|
103
|
+
<NavigationPropertyBinding Path="ODataDemo.FeaturedProduct/Advertisement" Target="Advertisements" />
|
104
|
+
<NavigationPropertyBinding Path="Categories" Target="Categories" />
|
105
|
+
<NavigationPropertyBinding Path="Supplier" Target="Suppliers" />
|
106
|
+
<NavigationPropertyBinding Path="ProductDetail" Target="ProductDetails" />
|
107
|
+
</EntitySet>
|
108
|
+
<EntitySet Name="ProductDetails" EntityType="ODataDemo.ProductDetail">
|
109
|
+
<NavigationPropertyBinding Path="Product" Target="Products" />
|
110
|
+
</EntitySet>
|
111
|
+
<EntitySet Name="Categories" EntityType="ODataDemo.Category">
|
112
|
+
<NavigationPropertyBinding Path="Products" Target="Products" />
|
113
|
+
</EntitySet>
|
114
|
+
<EntitySet Name="Suppliers" EntityType="ODataDemo.Supplier">
|
115
|
+
<NavigationPropertyBinding Path="Products" Target="Products" />
|
116
|
+
</EntitySet>
|
117
|
+
<EntitySet Name="Persons" EntityType="ODataDemo.Person">
|
118
|
+
<NavigationPropertyBinding Path="PersonDetail" Target="PersonDetails" />
|
119
|
+
</EntitySet>
|
120
|
+
<EntitySet Name="PersonDetails" EntityType="ODataDemo.PersonDetail">
|
121
|
+
<NavigationPropertyBinding Path="Person" Target="Persons" />
|
122
|
+
</EntitySet>
|
123
|
+
<EntitySet Name="Advertisements" EntityType="ODataDemo.Advertisement">
|
124
|
+
<NavigationPropertyBinding Path="FeaturedProduct" Target="Products" />
|
125
|
+
</EntitySet>
|
126
|
+
</EntityContainer>
|
127
|
+
<Annotations Target="ODataDemo.DemoService">
|
128
|
+
<Annotation Term="Org.OData.Display.V1.Description" String="This is a sample OData service with vocabularies" />
|
129
|
+
</Annotations>
|
130
|
+
<Annotations Target="ODataDemo.Product">
|
131
|
+
<Annotation Term="Org.OData.Display.V1.Description" String="All Products available in the online store" />
|
132
|
+
</Annotations>
|
133
|
+
<Annotations Target="ODataDemo.Product/Name">
|
134
|
+
<Annotation Term="Org.OData.Display.V1.DisplayName" String="Product Name" />
|
135
|
+
</Annotations>
|
136
|
+
<Annotations Target="ODataDemo.DemoService/Suppliers">
|
137
|
+
<Annotation Term="Org.OData.Publication.V1.PublisherName" String="Microsoft Corp." />
|
138
|
+
<Annotation Term="Org.OData.Publication.V1.PublisherId" String="MSFT" />
|
139
|
+
<Annotation Term="Org.OData.Publication.V1.Keywords" String="Inventory, Supplier, Advertisers, Sales, Finance" />
|
140
|
+
<Annotation Term="Org.OData.Publication.V1.AttributionUrl" String="http://www.odata.org/" />
|
141
|
+
<Annotation Term="Org.OData.Publication.V1.AttributionDescription" String="All rights reserved" />
|
142
|
+
<Annotation Term="Org.OData.Publication.V1.DocumentationUrl " String="http://www.odata.org/" />
|
143
|
+
<Annotation Term="Org.OData.Publication.V1.TermsOfUseUrl" String="All rights reserved" />
|
144
|
+
<Annotation Term="Org.OData.Publication.V1.PrivacyPolicyUrl" String="http://www.odata.org/" />
|
145
|
+
<Annotation Term="Org.OData.Publication.V1.LastModified" String="4/2/2013" />
|
146
|
+
<Annotation Term="Org.OData.Publication.V1.ImageUrl " String="http://www.odata.org/" />
|
147
|
+
</Annotations>
|
148
|
+
</Schema>
|
149
|
+
</edmx:DataServices>
|
150
|
+
</edmx:Edmx>
|
@@ -0,0 +1,157 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<edmx:Edmx Version="4.0" xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx">
|
3
|
+
<edmx:DataServices>
|
4
|
+
<Schema Namespace="ODataDemo" xmlns="http://docs.oasis-open.org/odata/ns/edm">
|
5
|
+
<EntityType Name="Product">
|
6
|
+
<Key>
|
7
|
+
<PropertyRef Name="ID" />
|
8
|
+
</Key>
|
9
|
+
<Property Name="ID" Type="Edm.Int32" Nullable="false" />
|
10
|
+
<Property Name="Name" Type="Edm.String" />
|
11
|
+
<Property Name="Description" Type="Edm.String" />
|
12
|
+
<Property Name="ReleaseDate" Type="Edm.DateTimeOffset" Nullable="false" />
|
13
|
+
<Property Name="DiscontinuedDate" Type="Edm.DateTimeOffset" />
|
14
|
+
<Property Name="Rating" Type="Edm.Int16" Nullable="false" />
|
15
|
+
<Property Name="Price" Type="Edm.Double" Nullable="false" />
|
16
|
+
<Property Name="ProductStatus" Type="ODataDemo.ProductStatus" Nullable="false" />
|
17
|
+
<NavigationProperty Name="Categories" Type="Collection(ODataDemo.Category)" Partner="Products" />
|
18
|
+
<NavigationProperty Name="Supplier" Type="ODataDemo.Supplier" Partner="Products" />
|
19
|
+
<NavigationProperty Name="ProductDetail" Type="ODataDemo.ProductDetail" Partner="Product" />
|
20
|
+
</EntityType>
|
21
|
+
<EnumType Name="ProductStatus" UnderlyingType="Edm.Byte">
|
22
|
+
<Member Name="Available" />
|
23
|
+
<Member Name="LowStock" />
|
24
|
+
<Member Name="Backordered" />
|
25
|
+
<Member Name="Discontinued" />
|
26
|
+
</EnumType>
|
27
|
+
<EntityType Name="FeaturedProduct" BaseType="ODataDemo.Product">
|
28
|
+
<NavigationProperty Name="Advertisement" Type="ODataDemo.Advertisement" Partner="FeaturedProduct" />
|
29
|
+
</EntityType>
|
30
|
+
<EntityType Name="ProductDetail">
|
31
|
+
<Key>
|
32
|
+
<PropertyRef Name="ProductID" />
|
33
|
+
</Key>
|
34
|
+
<Property Name="ProductID" Type="Edm.Int32" Nullable="false" />
|
35
|
+
<Property Name="Details" Type="Edm.String" />
|
36
|
+
<NavigationProperty Name="Product" Type="ODataDemo.Product" Partner="ProductDetail" />
|
37
|
+
</EntityType>
|
38
|
+
<EntityType Name="Category" OpenType="true">
|
39
|
+
<Key>
|
40
|
+
<PropertyRef Name="ID" />
|
41
|
+
</Key>
|
42
|
+
<Property Name="ID" Type="Edm.Int32" Nullable="false" />
|
43
|
+
<Property Name="Name" Type="Edm.String" />
|
44
|
+
<NavigationProperty Name="Products" Type="Collection(ODataDemo.Product)" Partner="Categories" />
|
45
|
+
</EntityType>
|
46
|
+
<EntityType Name="Supplier">
|
47
|
+
<Key>
|
48
|
+
<PropertyRef Name="ID" />
|
49
|
+
</Key>
|
50
|
+
<Property Name="ID" Type="Edm.Int32" Nullable="false" />
|
51
|
+
<Property Name="Name" Type="Edm.String" />
|
52
|
+
<Property Name="Address" Type="ODataDemo.Address" />
|
53
|
+
<Property Name="Location" Type="Edm.GeographyPoint" SRID="Variable" />
|
54
|
+
<Property Name="Concurrency" Type="Edm.Int32" ConcurrencyMode="Fixed" Nullable="false" />
|
55
|
+
<NavigationProperty Name="Products" Type="Collection(ODataDemo.Product)" Partner="Supplier" />
|
56
|
+
</EntityType>
|
57
|
+
<ComplexType Name="Address">
|
58
|
+
<Property Name="Street" Type="Edm.String" />
|
59
|
+
<Property Name="City" Type="Edm.String" />
|
60
|
+
<Property Name="State" Type="Edm.String" />
|
61
|
+
<Property Name="ZipCode" Type="Edm.String" />
|
62
|
+
<Property Name="Country" Type="Edm.String" />
|
63
|
+
</ComplexType>
|
64
|
+
<EntityType Name="Person">
|
65
|
+
<Key>
|
66
|
+
<PropertyRef Name="ID" />
|
67
|
+
</Key>
|
68
|
+
<Property Name="ID" Type="Edm.Int32" Nullable="false" />
|
69
|
+
<Property Name="Name" Type="Edm.String" />
|
70
|
+
<NavigationProperty Name="PersonDetail" Type="ODataDemo.PersonDetail" Partner="Person" />
|
71
|
+
</EntityType>
|
72
|
+
<EntityType Name="Customer" BaseType="ODataDemo.Person">
|
73
|
+
<Property Name="TotalExpense" Type="Edm.Decimal" Nullable="false" />
|
74
|
+
</EntityType>
|
75
|
+
<EntityType Name="Employee" BaseType="ODataDemo.Person">
|
76
|
+
<Property Name="EmployeeID" Type="Edm.Int64" Nullable="false" />
|
77
|
+
<Property Name="HireDate" Type="Edm.DateTimeOffset" Nullable="false" />
|
78
|
+
<Property Name="Salary" Type="Edm.Single" Nullable="false" />
|
79
|
+
</EntityType>
|
80
|
+
<EntityType Name="PersonDetail">
|
81
|
+
<Key>
|
82
|
+
<PropertyRef Name="PersonID" />
|
83
|
+
</Key>
|
84
|
+
<Property Name="PersonID" Type="Edm.Int32" Nullable="false" />
|
85
|
+
<Property Name="Age" Type="Edm.Byte" Nullable="false" />
|
86
|
+
<Property Name="Gender" Type="Edm.Boolean" Nullable="false" />
|
87
|
+
<Property Name="Phone" Type="Edm.String" />
|
88
|
+
<Property Name="Address" Type="ODataDemo.Address" />
|
89
|
+
<Property Name="Photo" Type="Edm.Stream" Nullable="false" />
|
90
|
+
<NavigationProperty Name="Person" Type="ODataDemo.Person" Partner="PersonDetail" />
|
91
|
+
</EntityType>
|
92
|
+
<EntityType Name="Advertisement" HasStream="true">
|
93
|
+
<Key>
|
94
|
+
<PropertyRef Name="ID" />
|
95
|
+
</Key>
|
96
|
+
<Property Name="ID" Type="Edm.Guid" Nullable="false" />
|
97
|
+
<Property Name="Name" Type="Edm.String" />
|
98
|
+
<Property Name="AirDate" Type="Edm.DateTimeOffset" Nullable="false" />
|
99
|
+
<NavigationProperty Name="FeaturedProduct" Type="ODataDemo.FeaturedProduct" Partner="Advertisement" />
|
100
|
+
</EntityType>
|
101
|
+
<EntityType Name="Error">
|
102
|
+
<Key>
|
103
|
+
<PropertyRef Name="ID" />
|
104
|
+
</Key>
|
105
|
+
<Property Name="ID" Type="Edm.Guid" Nullable="false" />
|
106
|
+
<Property Name="InvalidType" Type="Does.Not.Exist" />
|
107
|
+
</EntityType>
|
108
|
+
<EntityContainer Name="DemoService">
|
109
|
+
<EntitySet Name="Products" EntityType="ODataDemo.Product">
|
110
|
+
<NavigationPropertyBinding Path="ODataDemo.FeaturedProduct/Advertisement" Target="Advertisements" />
|
111
|
+
<NavigationPropertyBinding Path="Categories" Target="Categories" />
|
112
|
+
<NavigationPropertyBinding Path="Supplier" Target="Suppliers" />
|
113
|
+
<NavigationPropertyBinding Path="ProductDetail" Target="ProductDetails" />
|
114
|
+
</EntitySet>
|
115
|
+
<EntitySet Name="ProductDetails" EntityType="ODataDemo.ProductDetail">
|
116
|
+
<NavigationPropertyBinding Path="Product" Target="Products" />
|
117
|
+
</EntitySet>
|
118
|
+
<EntitySet Name="Categories" EntityType="ODataDemo.Category">
|
119
|
+
<NavigationPropertyBinding Path="Products" Target="Products" />
|
120
|
+
</EntitySet>
|
121
|
+
<EntitySet Name="Suppliers" EntityType="ODataDemo.Supplier">
|
122
|
+
<NavigationPropertyBinding Path="Products" Target="Products" />
|
123
|
+
</EntitySet>
|
124
|
+
<EntitySet Name="Persons" EntityType="ODataDemo.Person">
|
125
|
+
<NavigationPropertyBinding Path="PersonDetail" Target="PersonDetails" />
|
126
|
+
</EntitySet>
|
127
|
+
<EntitySet Name="PersonDetails" EntityType="ODataDemo.PersonDetail">
|
128
|
+
<NavigationPropertyBinding Path="Person" Target="Persons" />
|
129
|
+
</EntitySet>
|
130
|
+
<EntitySet Name="Advertisements" EntityType="ODataDemo.Advertisement">
|
131
|
+
<NavigationPropertyBinding Path="FeaturedProduct" Target="Products" />
|
132
|
+
</EntitySet>
|
133
|
+
</EntityContainer>
|
134
|
+
<Annotations Target="ODataDemo.DemoService">
|
135
|
+
<Annotation Term="Org.OData.Display.V1.Description" String="This is a sample OData service with vocabularies" />
|
136
|
+
</Annotations>
|
137
|
+
<Annotations Target="ODataDemo.Product">
|
138
|
+
<Annotation Term="Org.OData.Display.V1.Description" String="All Products available in the online store" />
|
139
|
+
</Annotations>
|
140
|
+
<Annotations Target="ODataDemo.Product/Name">
|
141
|
+
<Annotation Term="Org.OData.Display.V1.DisplayName" String="Product Name" />
|
142
|
+
</Annotations>
|
143
|
+
<Annotations Target="ODataDemo.DemoService/Suppliers">
|
144
|
+
<Annotation Term="Org.OData.Publication.V1.PublisherName" String="Microsoft Corp." />
|
145
|
+
<Annotation Term="Org.OData.Publication.V1.PublisherId" String="MSFT" />
|
146
|
+
<Annotation Term="Org.OData.Publication.V1.Keywords" String="Inventory, Supplier, Advertisers, Sales, Finance" />
|
147
|
+
<Annotation Term="Org.OData.Publication.V1.AttributionUrl" String="http://www.odata.org/" />
|
148
|
+
<Annotation Term="Org.OData.Publication.V1.AttributionDescription" String="All rights reserved" />
|
149
|
+
<Annotation Term="Org.OData.Publication.V1.DocumentationUrl " String="http://www.odata.org/" />
|
150
|
+
<Annotation Term="Org.OData.Publication.V1.TermsOfUseUrl" String="All rights reserved" />
|
151
|
+
<Annotation Term="Org.OData.Publication.V1.PrivacyPolicyUrl" String="http://www.odata.org/" />
|
152
|
+
<Annotation Term="Org.OData.Publication.V1.LastModified" String="4/2/2013" />
|
153
|
+
<Annotation Term="Org.OData.Publication.V1.ImageUrl " String="http://www.odata.org/" />
|
154
|
+
</Annotations>
|
155
|
+
</Schema>
|
156
|
+
</edmx:DataServices>
|
157
|
+
</edmx:Edmx>
|
@@ -0,0 +1,10 @@
|
|
1
|
+
{
|
2
|
+
"@odata.context": "http://services.odata.org/V4/OData/OData.svc/$metadata#Products/$entity",
|
3
|
+
"ID": 0,
|
4
|
+
"Name": "Bread",
|
5
|
+
"Description": "Whole grain bread",
|
6
|
+
"ReleaseDate": "1992-01-01T00:00:00Z",
|
7
|
+
"DiscontinuedDate": null,
|
8
|
+
"Rating": 4,
|
9
|
+
"Price": 2.5
|
10
|
+
}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<entry xml:base="http://services.odata.org/V4/OData/OData.svc/" xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://docs.oasis-open.org/odata/ns/data" xmlns:m="http://docs.oasis-open.org/odata/ns/metadata" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml" m:context="http://services.odata.org/V4/OData/OData.svc/$metadata#Products/$entity">
|
3
|
+
<id>http://services.odata.org/V4/OData/OData.svc/Products(0)</id>
|
4
|
+
<category term="#ODataDemo.Product" scheme="http://docs.oasis-open.org/odata/ns/scheme" />
|
5
|
+
<link rel="edit" title="Product" href="Products(0)" />
|
6
|
+
<link rel="http://docs.oasis-open.org/odata/ns/relatedlinks/Categories" type="application/xml" title="Categories" href="Products(0)/Categories/$ref" />
|
7
|
+
<link rel="http://docs.oasis-open.org/odata/ns/related/Categories" type="application/atom+xml;type=feed" title="Categories" href="Products(0)/Categories" />
|
8
|
+
<link rel="http://docs.oasis-open.org/odata/ns/relatedlinks/Supplier" type="application/xml" title="Supplier" href="Products(0)/Supplier/$ref" />
|
9
|
+
<link rel="http://docs.oasis-open.org/odata/ns/related/Supplier" type="application/atom+xml;type=entry" title="Supplier" href="Products(0)/Supplier" />
|
10
|
+
<link rel="http://docs.oasis-open.org/odata/ns/relatedlinks/ProductDetail" type="application/xml" title="ProductDetail" href="Products(0)/ProductDetail/$ref" />
|
11
|
+
<link rel="http://docs.oasis-open.org/odata/ns/related/ProductDetail" type="application/atom+xml;type=entry" title="ProductDetail" href="Products(0)/ProductDetail" />
|
12
|
+
<title />
|
13
|
+
<updated>2017-11-28T19:16:33Z</updated>
|
14
|
+
<author>
|
15
|
+
<name />
|
16
|
+
</author>
|
17
|
+
<content type="application/xml">
|
18
|
+
<m:properties>
|
19
|
+
<d:ID m:type="Int32">0</d:ID>
|
20
|
+
<d:Name>Bread</d:Name>
|
21
|
+
<d:Description>Whole grain bread</d:Description>
|
22
|
+
<d:ReleaseDate m:type="DateTimeOffset">1992-01-01T00:00:00Z</d:ReleaseDate>
|
23
|
+
<d:DiscontinuedDate m:null="true" />
|
24
|
+
<d:Rating m:type="Int16">4</d:Rating>
|
25
|
+
<d:Price m:type="Double">2.5</d:Price>
|
26
|
+
</m:properties>
|
27
|
+
</content>
|
28
|
+
</entry>
|
@@ -0,0 +1,106 @@
|
|
1
|
+
{
|
2
|
+
"@odata.context": "http://services.odata.org/V4/OData/OData.svc/$metadata#Products",
|
3
|
+
"value": [
|
4
|
+
{
|
5
|
+
"ID": 0,
|
6
|
+
"Name": "Bread",
|
7
|
+
"Description": "Whole grain bread",
|
8
|
+
"ReleaseDate": "1992-01-01T00:00:00Z",
|
9
|
+
"DiscontinuedDate": null,
|
10
|
+
"Rating": 4,
|
11
|
+
"Price": 2.5
|
12
|
+
},
|
13
|
+
{
|
14
|
+
"ID": 1,
|
15
|
+
"Name": "Milk",
|
16
|
+
"Description": "Low fat milk",
|
17
|
+
"ReleaseDate": "1995-10-01T00:00:00Z",
|
18
|
+
"DiscontinuedDate": null,
|
19
|
+
"Rating": 3,
|
20
|
+
"Price": 3.5
|
21
|
+
},
|
22
|
+
{
|
23
|
+
"ID": 2,
|
24
|
+
"Name": "Vint soda",
|
25
|
+
"Description": "Americana Variety - Mix of 6 flavors",
|
26
|
+
"ReleaseDate": "2000-10-01T00:00:00Z",
|
27
|
+
"DiscontinuedDate": null,
|
28
|
+
"Rating": 3,
|
29
|
+
"Price": 20.9
|
30
|
+
},
|
31
|
+
{
|
32
|
+
"ID": 3,
|
33
|
+
"Name": "Havina Cola",
|
34
|
+
"Description": "The Original Key Lime Cola",
|
35
|
+
"ReleaseDate": "2005-10-01T00:00:00Z",
|
36
|
+
"DiscontinuedDate": "2006-10-01T00:00:00Z",
|
37
|
+
"Rating": 3,
|
38
|
+
"Price": 19.9
|
39
|
+
},
|
40
|
+
{
|
41
|
+
"ID": 4,
|
42
|
+
"Name": "Fruit Punch",
|
43
|
+
"Description": "Mango flavor, 8.3 Ounce Cans (Pack of 24)",
|
44
|
+
"ReleaseDate": "2003-01-05T00:00:00Z",
|
45
|
+
"DiscontinuedDate": null,
|
46
|
+
"Rating": 3,
|
47
|
+
"Price": 22.99
|
48
|
+
},
|
49
|
+
{
|
50
|
+
"ID": 5,
|
51
|
+
"Name": "Cranberry Juice",
|
52
|
+
"Description": "16-Ounce Plastic Bottles (Pack of 12)",
|
53
|
+
"ReleaseDate": "2006-08-04T00:00:00Z",
|
54
|
+
"DiscontinuedDate": null,
|
55
|
+
"Rating": 3,
|
56
|
+
"Price": 22.8
|
57
|
+
},
|
58
|
+
{
|
59
|
+
"ID": 6,
|
60
|
+
"Name": "Pink Lemonade",
|
61
|
+
"Description": "36 Ounce Cans (Pack of 3)",
|
62
|
+
"ReleaseDate": "2006-11-05T00:00:00Z",
|
63
|
+
"DiscontinuedDate": null,
|
64
|
+
"Rating": 3,
|
65
|
+
"Price": 18.8
|
66
|
+
},
|
67
|
+
{
|
68
|
+
"ID": 7,
|
69
|
+
"Name": "DVD Player",
|
70
|
+
"Description": "1080P Upconversion DVD Player",
|
71
|
+
"ReleaseDate": "2006-11-15T00:00:00Z",
|
72
|
+
"DiscontinuedDate": null,
|
73
|
+
"Rating": 5,
|
74
|
+
"Price": 35.88
|
75
|
+
},
|
76
|
+
{
|
77
|
+
"ID": 8,
|
78
|
+
"Name": "LCD HDTV",
|
79
|
+
"Description": "42 inch 1080p LCD with Built-in Blu-ray Disc Player",
|
80
|
+
"ReleaseDate": "2008-05-08T00:00:00Z",
|
81
|
+
"DiscontinuedDate": null,
|
82
|
+
"Rating": 3,
|
83
|
+
"Price": 1088.8
|
84
|
+
},
|
85
|
+
{
|
86
|
+
"@odata.type": "#ODataDemo.FeaturedProduct",
|
87
|
+
"ID": 9,
|
88
|
+
"Name": "Lemonade",
|
89
|
+
"Description": "Classic, refreshing lemonade (Single bottle)",
|
90
|
+
"ReleaseDate": "1970-01-01T00:00:00Z",
|
91
|
+
"DiscontinuedDate": null,
|
92
|
+
"Rating": 7,
|
93
|
+
"Price": 1.01
|
94
|
+
},
|
95
|
+
{
|
96
|
+
"@odata.type": "#ODataDemo.FeaturedProduct",
|
97
|
+
"ID": 10,
|
98
|
+
"Name": "Coffee",
|
99
|
+
"Description": "Bulk size can of instant coffee",
|
100
|
+
"ReleaseDate": "1982-12-31T00:00:00Z",
|
101
|
+
"DiscontinuedDate": null,
|
102
|
+
"Rating": 1,
|
103
|
+
"Price": 6.99
|
104
|
+
}
|
105
|
+
]
|
106
|
+
}
|