ruby_odata 0.0.10 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (173) hide show
  1. data/.gitignore +9 -3
  2. data/.travis.yml +4 -0
  3. data/CHANGELOG.rdoc +18 -1
  4. data/README.rdoc +77 -19
  5. data/config/cucumber.yml +4 -3
  6. data/features/basic_auth.feature +5 -7
  7. data/features/batch_request.feature +11 -11
  8. data/features/complex_types.feature +11 -11
  9. data/features/query_builder.feature +27 -18
  10. data/features/service.feature +8 -8
  11. data/features/service_manage.feature +27 -12
  12. data/features/service_methods.feature +37 -0
  13. data/features/ssl.feature +4 -4
  14. data/features/step_definitions/pickle_steps.rb +100 -0
  15. data/features/step_definitions/service_steps.rb +99 -65
  16. data/features/support/constants.rb +3 -0
  17. data/features/support/custom_helpers.rb +54 -0
  18. data/features/support/env.rb +0 -10
  19. data/features/support/hooks.rb +1 -1
  20. data/features/support/pickle.rb +82 -0
  21. data/features/type_conversion.feature +10 -10
  22. data/lib/ruby_odata.rb +4 -1
  23. data/lib/ruby_odata/association.rb +36 -0
  24. data/lib/ruby_odata/class_builder.rb +96 -16
  25. data/lib/ruby_odata/helpers.rb +10 -0
  26. data/lib/ruby_odata/operation.rb +7 -5
  27. data/lib/ruby_odata/property_metadata.rb +11 -6
  28. data/lib/ruby_odata/query_builder.rb +20 -1
  29. data/lib/ruby_odata/service.rb +407 -94
  30. data/lib/ruby_odata/version.rb +1 -1
  31. data/ruby_odata.gemspec +2 -0
  32. data/spec/association_spec.rb +48 -0
  33. data/spec/class_builder_spec.rb +11 -2
  34. data/spec/fixtures/inheritance/edmx_pluralsight.xml +111 -0
  35. data/spec/fixtures/inheritance/result_pluralsight_courses.xml +229 -0
  36. data/spec/fixtures/links/result_links_query.xml +6 -0
  37. data/spec/fixtures/partial/partial_feed_metadata.xml +25 -0
  38. data/spec/fixtures/partial/partial_feed_part_1.xml +42 -0
  39. data/spec/fixtures/partial/partial_feed_part_2.xml +42 -0
  40. data/spec/fixtures/partial/partial_feed_part_3.xml +40 -0
  41. data/spec/fixtures/sample_service/edmx_categories_products.xml +1 -0
  42. data/spec/fixtures/sample_service/result_category_names.xml +5 -0
  43. data/spec/fixtures/sample_service/result_entity_category_web_get.xml +29 -0
  44. data/spec/fixtures/sample_service/result_entity_single_category_web_get.xml +23 -0
  45. data/spec/fixtures/sample_service/result_first_category_id.xml +2 -0
  46. data/spec/fixtures/sample_service/result_multiple_category_products.xml +57 -0
  47. data/spec/fixtures/sample_service/result_single_category.xml +18 -0
  48. data/spec/fixtures/sample_service/result_single_product.xml +26 -0
  49. data/spec/fixtures/sample_service/result_single_product_not_found.xml +4 -0
  50. data/spec/fixtures/sap/edmx_sap_demo_flight.xml +62 -58
  51. data/spec/property_metadata_spec.rb +9 -2
  52. data/spec/query_builder_spec.rb +11 -0
  53. data/spec/revised_service_spec.rb +197 -0
  54. data/spec/service_spec.rb +463 -4
  55. data/test/RubyODataService/RubyODataService.sln +20 -0
  56. data/test/RubyODataService/RubyODataService/App_Start/EntityFramework.SqlServerCompact.cs +12 -0
  57. data/test/RubyODataService/RubyODataService/BasicAuth/RubyOData.svc +3 -0
  58. data/test/RubyODataService/RubyODataService/BasicAuth/RubyOData.svc.cs +107 -0
  59. data/test/RubyODataService/RubyODataService/Global.asax +1 -0
  60. data/test/RubyODataService/RubyODataService/Global.asax.cs +49 -0
  61. data/test/RubyODataService/RubyODataService/Models/AuditFields.cs +16 -0
  62. data/test/RubyODataService/RubyODataService/Models/Category.cs +16 -0
  63. data/test/RubyODataService/RubyODataService/Models/Product.cs +20 -0
  64. data/test/RubyODataService/RubyODataService/Properties/AssemblyInfo.cs +35 -0
  65. data/test/RubyODataService/RubyODataService/RubyOData.svc +3 -0
  66. data/test/RubyODataService/RubyODataService/RubyOData.svc.cs +57 -0
  67. data/test/RubyODataService/RubyODataService/RubyODataContext.cs +16 -0
  68. data/test/RubyODataService/RubyODataService/RubyODataService.csproj +159 -0
  69. data/test/RubyODataService/RubyODataService/RubyODataService.csproj.user +31 -0
  70. data/test/RubyODataService/RubyODataService/Web.Debug.config +30 -0
  71. data/test/RubyODataService/RubyODataService/Web.Release.config +31 -0
  72. data/test/RubyODataService/RubyODataService/Web.config +27 -0
  73. data/test/RubyODataService/RubyODataService/bin/EntityFramework.dll +0 -0
  74. data/test/RubyODataService/RubyODataService/bin/Microsoft.Data.Edm.dll +0 -0
  75. data/test/RubyODataService/RubyODataService/bin/Microsoft.Data.OData.dll +0 -0
  76. data/test/RubyODataService/RubyODataService/bin/Microsoft.Data.Services.Client.dll +0 -0
  77. data/test/RubyODataService/RubyODataService/bin/Microsoft.Data.Services.dll +0 -0
  78. data/test/RubyODataService/RubyODataService/bin/Microsoft.Data.Spatial.dll +0 -0
  79. data/test/RubyODataService/RubyODataService/bin/RubyODataService.dll +0 -0
  80. data/test/RubyODataService/RubyODataService/bin/System.Data.SqlServerCe.Entity.dll +0 -0
  81. data/test/RubyODataService/RubyODataService/bin/System.Data.SqlServerCe.dll +0 -0
  82. data/test/RubyODataService/RubyODataService/bin/System.Spatial.dll +0 -0
  83. data/test/RubyODataService/RubyODataService/bin/WebActivator.dll +0 -0
  84. data/test/RubyODataService/RubyODataService/bin/amd64/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest +6 -0
  85. data/test/RubyODataService/RubyODataService/bin/amd64/Microsoft.VC90.CRT/README_ENU.txt +0 -0
  86. data/test/RubyODataService/RubyODataService/bin/amd64/Microsoft.VC90.CRT/msvcr90.dll +0 -0
  87. data/test/RubyODataService/RubyODataService/bin/amd64/sqlcecompact40.dll +0 -0
  88. data/test/RubyODataService/RubyODataService/bin/amd64/sqlceer40EN.dll +0 -0
  89. data/test/RubyODataService/RubyODataService/bin/amd64/sqlceme40.dll +0 -0
  90. data/test/RubyODataService/RubyODataService/bin/amd64/sqlceqp40.dll +0 -0
  91. data/test/RubyODataService/RubyODataService/bin/amd64/sqlcese40.dll +0 -0
  92. data/test/RubyODataService/RubyODataService/bin/x86/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest +6 -0
  93. data/test/RubyODataService/RubyODataService/bin/x86/Microsoft.VC90.CRT/README_ENU.txt +0 -0
  94. data/test/RubyODataService/RubyODataService/bin/x86/Microsoft.VC90.CRT/msvcr90.dll +0 -0
  95. data/test/RubyODataService/RubyODataService/bin/x86/sqlcecompact40.dll +0 -0
  96. data/test/RubyODataService/RubyODataService/bin/x86/sqlceer40EN.dll +0 -0
  97. data/test/RubyODataService/RubyODataService/bin/x86/sqlceme40.dll +0 -0
  98. data/test/RubyODataService/RubyODataService/bin/x86/sqlceqp40.dll +0 -0
  99. data/test/RubyODataService/RubyODataService/bin/x86/sqlcese40.dll +0 -0
  100. data/test/RubyODataService/RubyODataService/packages.config +7 -0
  101. data/test/RubyODataService/packages/EntityFramework.4.2.0.0/EntityFramework.4.2.0.0.nupkg +0 -0
  102. data/test/RubyODataService/packages/EntityFramework.4.2.0.0/lib/net40/EntityFramework.dll +0 -0
  103. data/test/RubyODataService/packages/EntityFramework.4.2.0.0/lib/net40/EntityFramework.xml +13488 -0
  104. data/test/RubyODataService/packages/EntityFramework.SqlServerCompact.4.1.8482.2/Content/App_Start/EntityFramework.SqlServerCompact.cs.pp +12 -0
  105. data/test/RubyODataService/packages/EntityFramework.SqlServerCompact.4.1.8482.2/EULA_ENU.rtf +969 -0
  106. data/test/RubyODataService/packages/EntityFramework.SqlServerCompact.4.1.8482.2/EntityFramework.SqlServerCompact.4.1.8482.2.nupkg +0 -0
  107. data/test/RubyODataService/packages/EntityFramework.SqlServerCompact.4.1.8482.2/lib/System.Data.SqlServerCe.Entity.dll +0 -0
  108. data/test/RubyODataService/packages/EntityFramework.SqlServerCompact.4.1.8482.2/tools/install.ps1 +3 -0
  109. data/test/RubyODataService/packages/SqlServerCompact.4.0.8482.1/Content/web.config.transform +8 -0
  110. data/test/RubyODataService/packages/SqlServerCompact.4.0.8482.1/NativeBinaries/amd64/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest +6 -0
  111. data/test/RubyODataService/packages/SqlServerCompact.4.0.8482.1/NativeBinaries/amd64/Microsoft.VC90.CRT/README_ENU.txt +0 -0
  112. data/test/RubyODataService/packages/SqlServerCompact.4.0.8482.1/NativeBinaries/amd64/Microsoft.VC90.CRT/msvcr90.dll +0 -0
  113. data/test/RubyODataService/packages/SqlServerCompact.4.0.8482.1/NativeBinaries/amd64/sqlcecompact40.dll +0 -0
  114. data/test/RubyODataService/packages/SqlServerCompact.4.0.8482.1/NativeBinaries/amd64/sqlceer40EN.dll +0 -0
  115. data/test/RubyODataService/packages/SqlServerCompact.4.0.8482.1/NativeBinaries/amd64/sqlceme40.dll +0 -0
  116. data/test/RubyODataService/packages/SqlServerCompact.4.0.8482.1/NativeBinaries/amd64/sqlceqp40.dll +0 -0
  117. data/test/RubyODataService/packages/SqlServerCompact.4.0.8482.1/NativeBinaries/amd64/sqlcese40.dll +0 -0
  118. data/test/RubyODataService/packages/SqlServerCompact.4.0.8482.1/NativeBinaries/x86/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest +6 -0
  119. data/test/RubyODataService/packages/SqlServerCompact.4.0.8482.1/NativeBinaries/x86/Microsoft.VC90.CRT/README_ENU.txt +0 -0
  120. data/test/RubyODataService/packages/SqlServerCompact.4.0.8482.1/NativeBinaries/x86/Microsoft.VC90.CRT/msvcr90.dll +0 -0
  121. data/test/RubyODataService/packages/SqlServerCompact.4.0.8482.1/NativeBinaries/x86/sqlcecompact40.dll +0 -0
  122. data/test/RubyODataService/packages/SqlServerCompact.4.0.8482.1/NativeBinaries/x86/sqlceer40EN.dll +0 -0
  123. data/test/RubyODataService/packages/SqlServerCompact.4.0.8482.1/NativeBinaries/x86/sqlceme40.dll +0 -0
  124. data/test/RubyODataService/packages/SqlServerCompact.4.0.8482.1/NativeBinaries/x86/sqlceqp40.dll +0 -0
  125. data/test/RubyODataService/packages/SqlServerCompact.4.0.8482.1/NativeBinaries/x86/sqlcese40.dll +0 -0
  126. data/test/RubyODataService/packages/SqlServerCompact.4.0.8482.1/SQLCE_EULA_ENU.rtf +778 -0
  127. data/test/RubyODataService/packages/SqlServerCompact.4.0.8482.1/SqlServerCompact.4.0.8482.1.nupkg +0 -0
  128. data/test/RubyODataService/packages/SqlServerCompact.4.0.8482.1/Tools/GetSqlCEPostBuildCmd.ps1 +12 -0
  129. data/test/RubyODataService/packages/SqlServerCompact.4.0.8482.1/Tools/install.ps1 +11 -0
  130. data/test/RubyODataService/packages/SqlServerCompact.4.0.8482.1/Tools/uninstall.ps1 +9 -0
  131. data/test/RubyODataService/packages/SqlServerCompact.4.0.8482.1/lib/System.Data.SqlServerCe.dll +0 -0
  132. data/test/RubyODataService/packages/WCF DataServices October 2011 CTP/DataSvcUtil.exe +0 -0
  133. data/test/RubyODataService/packages/WCF DataServices October 2011 CTP/License.rtf +708 -0
  134. data/test/RubyODataService/packages/WCF DataServices October 2011 CTP/Microsoft.Data.Edm.dll +0 -0
  135. data/test/RubyODataService/packages/WCF DataServices October 2011 CTP/Microsoft.Data.Edm.xml +4150 -0
  136. data/test/RubyODataService/packages/WCF DataServices October 2011 CTP/Microsoft.Data.OData.dll +0 -0
  137. data/test/RubyODataService/packages/WCF DataServices October 2011 CTP/Microsoft.Data.OData.xml +1969 -0
  138. data/test/RubyODataService/packages/WCF DataServices October 2011 CTP/Microsoft.Data.Services.Client.dll +0 -0
  139. data/test/RubyODataService/packages/WCF DataServices October 2011 CTP/Microsoft.Data.Services.Client.xml +1442 -0
  140. data/test/RubyODataService/packages/WCF DataServices October 2011 CTP/Microsoft.Data.Services.Design.dll +0 -0
  141. data/test/RubyODataService/packages/WCF DataServices October 2011 CTP/Microsoft.Data.Services.Design.xml +191 -0
  142. data/test/RubyODataService/packages/WCF DataServices October 2011 CTP/Microsoft.Data.Services.dll +0 -0
  143. data/test/RubyODataService/packages/WCF DataServices October 2011 CTP/Microsoft.Data.Services.xml +2559 -0
  144. data/test/RubyODataService/packages/WCF DataServices October 2011 CTP/Microsoft.Data.Spatial.dll +0 -0
  145. data/test/RubyODataService/packages/WCF DataServices October 2011 CTP/Microsoft.Data.Spatial.xml +15 -0
  146. data/test/RubyODataService/packages/WCF DataServices October 2011 CTP/Microsoft.VsDesigner.DataServices.Adapter.dll +0 -0
  147. data/test/RubyODataService/packages/WCF DataServices October 2011 CTP/README.txt +6 -0
  148. data/test/RubyODataService/packages/WCF DataServices October 2011 CTP/System.Spatial.dll +0 -0
  149. data/test/RubyODataService/packages/WCF DataServices October 2011 CTP/System.Spatial.xml +2276 -0
  150. data/test/RubyODataService/packages/WebActivator.1.0.0.0/WebActivator.1.0.0.0.nupkg +0 -0
  151. data/test/RubyODataService/packages/WebActivator.1.0.0.0/lib/WebActivator.dll +0 -0
  152. data/test/RubyODataService/packages/repositories.config +4 -0
  153. data/test/applicationhost.config.template +2 -2
  154. data/test/blueprints.rb +5 -4
  155. data/test/iisExpress x64.bat b/data/test/iisExpress → x64.bat +0 -0
  156. data/test/iisExpress x86.bat b/data/test/iisExpress → x86.bat +0 -0
  157. data/test/setpath.rb +13 -3
  158. data/test/usage_samples/querying.rb +45 -0
  159. data/test/usage_samples/reflection.rb +16 -0
  160. data/test/usage_samples/sample_data.rb +30 -0
  161. metadata +327 -36
  162. data/test/Cassini x64.bat +0 -1
  163. data/test/Cassini x86.bat +0 -1
  164. data/test/SampleService/App_Code/AuditFields.cs +0 -13
  165. data/test/SampleService/App_Code/Entities.cs +0 -145
  166. data/test/SampleService/App_Code/Model.Designer.cs +0 -578
  167. data/test/SampleService/App_Code/Model.edmx +0 -157
  168. data/test/SampleService/App_Code/ModelContainerExtended.cs +0 -32
  169. data/test/SampleService/App_Data/_TestDB.mdf +0 -0
  170. data/test/SampleService/App_Data/_TestDB_Log.ldf +0 -0
  171. data/test/SampleService/BasicAuth/Entities.svc +0 -1
  172. data/test/SampleService/Entities.svc +0 -1
  173. data/test/SampleService/web.config +0 -37
@@ -1,157 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8"?>
2
- <edmx:Edmx Version="2.0" xmlns:edmx="http://schemas.microsoft.com/ado/2008/10/edmx">
3
- <!-- EF Runtime content -->
4
- <edmx:Runtime>
5
- <!-- SSDL content -->
6
- <edmx:StorageModels>
7
- <Schema Namespace="Model.Store" Alias="Self" Provider="System.Data.SqlClient" ProviderManifestToken="2008" xmlns:store="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator" xmlns="http://schemas.microsoft.com/ado/2009/02/edm/ssdl">
8
- <EntityContainer Name="ModelStoreContainer">
9
- <EntitySet Name="Categories" EntityType="Model.Store.Categories" store:Type="Tables" Schema="dbo" />
10
- <EntitySet Name="Products" EntityType="Model.Store.Products" store:Type="Tables" Schema="dbo" />
11
- <AssociationSet Name="FK_CategoryProduct" Association="Model.Store.FK_CategoryProduct">
12
- <End Role="Categories" EntitySet="Categories" />
13
- <End Role="Products" EntitySet="Products" />
14
- </AssociationSet>
15
- </EntityContainer>
16
- <EntityType Name="Categories">
17
- <Key>
18
- <PropertyRef Name="Id" />
19
- </Key>
20
- <Property Name="Id" Type="int" Nullable="false" StoreGeneratedPattern="Identity" />
21
- <Property Name="Name" Type="nvarchar(max)" Nullable="false" />
22
- </EntityType>
23
- <EntityType Name="Products">
24
- <Key>
25
- <PropertyRef Name="Id" />
26
- </Key>
27
- <Property Name="Id" Type="int" Nullable="false" StoreGeneratedPattern="Identity" />
28
- <Property Name="Name" Type="nvarchar(max)" Nullable="false" />
29
- <Property Name="Description" Type="nvarchar(max)" Nullable="false" />
30
- <Property Name="Price" Type="money" Nullable="false" />
31
- <Property Name="Category_Id" Type="int" Nullable="false" />
32
- <Property Name="CreateDate" Type="datetime" Nullable="false" />
33
- <Property Name="ModifiedDate" Type="datetime" Nullable="false" />
34
- <Property Name="CreatedBy" Type="nvarchar" MaxLength="50" />
35
- <Property Name="DiscontinuedDate" Type="datetime" />
36
- </EntityType>
37
- <Association Name="FK_CategoryProduct">
38
- <End Role="Categories" Type="Model.Store.Categories" Multiplicity="1" />
39
- <End Role="Products" Type="Model.Store.Products" Multiplicity="*" />
40
- <ReferentialConstraint>
41
- <Principal Role="Categories">
42
- <PropertyRef Name="Id" />
43
- </Principal>
44
- <Dependent Role="Products">
45
- <PropertyRef Name="Category_Id" />
46
- </Dependent>
47
- </ReferentialConstraint>
48
- </Association>
49
- </Schema></edmx:StorageModels>
50
- <!-- CSDL content -->
51
- <edmx:ConceptualModels>
52
- <Schema xmlns="http://schemas.microsoft.com/ado/2008/09/edm" xmlns:cg="http://schemas.microsoft.com/ado/2006/04/codegeneration" xmlns:store="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator" Namespace="Model" Alias="Self" xmlns:annotation="http://schemas.microsoft.com/ado/2009/02/edm/annotation">
53
- <EntityContainer Name="ModelContainer" annotation:LazyLoadingEnabled="true">
54
- <EntitySet Name="Products" EntityType="Model.Product" />
55
- <EntitySet Name="Categories" EntityType="Model.Category" />
56
- <AssociationSet Name="CategoryProduct" Association="Model.CategoryProduct">
57
- <End Role="Category" EntitySet="Categories" />
58
- <End Role="Product" EntitySet="Products" />
59
- </AssociationSet>
60
- </EntityContainer>
61
- <EntityType Name="Product">
62
- <Key>
63
- <PropertyRef Name="Id" />
64
- </Key>
65
- <Property Type="Int32" Name="Id" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
66
- <Property Type="String" Name="Name" Nullable="false" />
67
- <Property Type="String" Name="Description" Nullable="false" />
68
- <Property Type="Decimal" Name="Price" Nullable="false" />
69
- <NavigationProperty Name="Category" Relationship="Model.CategoryProduct" FromRole="Product" ToRole="Category" />
70
- <Property Name="AuditFields" Type="Model.AuditFields" Nullable="false" />
71
- <Property Type="DateTime" Name="DiscontinuedDate" Nullable="true" />
72
- </EntityType>
73
- <EntityType Name="Category">
74
- <Key>
75
- <PropertyRef Name="Id" />
76
- </Key>
77
- <Property Type="Int32" Name="Id" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
78
- <Property Type="String" Name="Name" Nullable="false" />
79
- <NavigationProperty Name="Products" Relationship="Model.CategoryProduct" FromRole="Category" ToRole="Product" />
80
- </EntityType>
81
- <Association Name="CategoryProduct">
82
- <End Type="Model.Category" Role="Category" Multiplicity="1" />
83
- <End Type="Model.Product" Role="Product" Multiplicity="*" />
84
- </Association>
85
- <ComplexType Name="AuditFields">
86
- <Property Type="DateTime" Name="CreateDate" Nullable="false" />
87
- <Property Type="DateTime" Name="ModifiedDate" Nullable="false" />
88
- <Property Type="String" Name="CreatedBy" Nullable="true" />
89
- </ComplexType>
90
- </Schema>
91
- </edmx:ConceptualModels>
92
- <!-- C-S mapping content -->
93
- <edmx:Mappings>
94
- <Mapping Space="C-S" xmlns="http://schemas.microsoft.com/ado/2008/09/mapping/cs">
95
- <EntityContainerMapping StorageEntityContainer="ModelStoreContainer" CdmEntityContainer="ModelContainer">
96
- <EntitySetMapping Name="Products">
97
- <EntityTypeMapping TypeName="IsTypeOf(Model.Product)">
98
- <MappingFragment StoreEntitySet="Products">
99
- <ScalarProperty Name="DiscontinuedDate" ColumnName="DiscontinuedDate" />
100
- <ScalarProperty Name="Id" ColumnName="Id" />
101
- <ScalarProperty Name="Name" ColumnName="Name" />
102
- <ScalarProperty Name="Description" ColumnName="Description" />
103
- <ScalarProperty Name="Price" ColumnName="Price" />
104
- <ComplexProperty Name="AuditFields">
105
- <ScalarProperty Name="CreatedBy" ColumnName="CreatedBy" />
106
- <ScalarProperty Name="ModifiedDate" ColumnName="ModifiedDate" />
107
- <ScalarProperty Name="CreateDate" ColumnName="CreateDate" />
108
- </ComplexProperty>
109
- </MappingFragment>
110
- </EntityTypeMapping>
111
- </EntitySetMapping>
112
- <EntitySetMapping Name="Categories">
113
- <EntityTypeMapping TypeName="IsTypeOf(Model.Category)">
114
- <MappingFragment StoreEntitySet="Categories">
115
- <ScalarProperty Name="Id" ColumnName="Id" />
116
- <ScalarProperty Name="Name" ColumnName="Name" />
117
- </MappingFragment>
118
- </EntityTypeMapping>
119
- </EntitySetMapping>
120
- <AssociationSetMapping Name="CategoryProduct" TypeName="Model.CategoryProduct" StoreEntitySet="Products">
121
- <EndProperty Name="Category">
122
- <ScalarProperty Name="Id" ColumnName="Category_Id" />
123
- </EndProperty>
124
- <EndProperty Name="Product">
125
- <ScalarProperty Name="Id" ColumnName="Id" />
126
- </EndProperty>
127
- </AssociationSetMapping>
128
- </EntityContainerMapping>
129
- </Mapping></edmx:Mappings>
130
- </edmx:Runtime>
131
- <!-- EF Designer content (DO NOT EDIT MANUALLY BELOW HERE) -->
132
- <edmx:Designer xmlns="http://schemas.microsoft.com/ado/2008/10/edmx">
133
- <edmx:Connection>
134
- <DesignerInfoPropertySet>
135
- <DesignerProperty Name="MetadataArtifactProcessing" Value="EmbedInOutputAssembly" />
136
- </DesignerInfoPropertySet>
137
- </edmx:Connection>
138
- <edmx:Options>
139
- <DesignerInfoPropertySet>
140
- <DesignerProperty Name="ValidateOnBuild" Value="true" />
141
- <DesignerProperty Name="EnablePluralization" Value="True" />
142
- <DesignerProperty Name="IncludeForeignKeysInModel" Value="True" />
143
- </DesignerInfoPropertySet>
144
- </edmx:Options>
145
- <!-- Diagram content (shape and connector positions) -->
146
- <edmx:Diagrams>
147
- <Diagram Name="Model" >
148
- <EntityTypeShape EntityType="Model.Product" Width="1.5" PointX="8" PointY="1.75" Height="2.172587890625" />
149
- <EntityTypeShape EntityType="Model.Category" Width="1.5" PointX="5.25" PointY="1.875" Height="1.59568359375" />
150
- <AssociationConnector Association="Model.CategoryProduct">
151
- <ConnectorPoint PointX="6.75" PointY="2.672841796875" />
152
- <ConnectorPoint PointX="8" PointY="2.672841796875" />
153
- </AssociationConnector>
154
- </Diagram>
155
- </edmx:Diagrams>
156
- </edmx:Designer>
157
- </edmx:Edmx>
@@ -1,32 +0,0 @@
1
- using System;
2
- using System.Data;
3
- using System.Data.Objects;
4
- using System.Linq;
5
-
6
- namespace Model
7
- {
8
- /// <summary>
9
- /// Extensions to the default container
10
- /// </summary>
11
- public partial class ModelContainer
12
- {
13
- partial void OnContextCreated()
14
- {
15
- SavingChanges += ContainerSavingChanges;
16
- }
17
-
18
- private static void ContainerSavingChanges(object sender, EventArgs e)
19
- {
20
- var updatedEntites = ((ObjectContext) sender).ObjectStateManager.GetObjectStateEntries(EntityState.Modified);
21
- foreach (var ose in updatedEntites)
22
- {
23
- var type = ose.Entity.GetType();
24
- if (type.GetProperties().Any(p => typeof(AuditFields).IsAssignableFrom(p.PropertyType)))
25
- {
26
- dynamic entity = ose.Entity;
27
- entity.AuditFields.ModifiedDate = DateTime.UtcNow;
28
- }
29
- }
30
- }
31
- }
32
- }
@@ -1 +0,0 @@
1
- <%@ ServiceHost Language="C#" Factory="System.Data.Services.DataServiceHostFactory" Service="Entities" %>
@@ -1 +0,0 @@
1
- <%@ ServiceHost Language="C#" Factory="System.Data.Services.DataServiceHostFactory" Service="Entities" %>
@@ -1,37 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8"?>
2
- <!--
3
- For more information on how to configure your ASP.NET application, please visit
4
- http://go.microsoft.com/fwlink/?LinkId=169433
5
- -->
6
- <configuration>
7
-
8
- <system.webServer>
9
- <modules>
10
- <add name="OurBasicAuthenticationModule"
11
- type="OurBasicAuthenticationModule"/>
12
- </modules>
13
- </system.webServer>
14
-
15
- <system.web>
16
- <compilation debug="true" targetFramework="4.0">
17
- <assemblies>
18
- <add assembly="System.Security, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
19
- <add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
20
- <add assembly="System.Data.Entity.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
21
- <add assembly="System.Data.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
22
- <add assembly="System.Data.Services.Client, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
23
- </assemblies>
24
- <buildProviders>
25
- <add extension=".edmx" type="System.Data.Entity.Design.AspNet.EntityDesignerBuildProvider" />
26
- </buildProviders>
27
- </compilation>
28
- </system.web>
29
- <connectionStrings>
30
- <add name="ModelContainer" connectionString="metadata=res://*/App_Code.Model.csdl|res://*/App_Code.Model.ssdl|res://*/App_Code.Model.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\TestDB.mdf;Integrated Security=True;User Instance=True;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient" />
31
- </connectionStrings>
32
- <system.serviceModel>
33
- <serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
34
- </system.serviceModel>
35
- </configuration>
36
-
37
-