Skip to content
This repository has been archived by the owner on Jun 14, 2024. It is now read-only.

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
kenjiuno committed Nov 21, 2015
1 parent 05d118b commit 12f4815
Show file tree
Hide file tree
Showing 6 changed files with 111 additions and 13 deletions.
6 changes: 4 additions & 2 deletions DbContext_EFv6.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity;
using System.Data.Entity.Infrastructure;

Expand All @@ -20,7 +22,7 @@ namespace @Model.Namespace {
@EndEach

@Each.EntityType
[Table("@Current.Name")]
[Table("@Current.Name", Schema = "@Current.Schema")]
public class @Current.Name {
public @Current.Name() {
@Each.NavigationProperty
Expand All @@ -32,7 +34,7 @@ namespace @Model.Namespace {

@Each.Property
@If.Identity
[Key]
[Key][Column(Order = @Current.Order)]
@EndIf
public @Current.TypeSigned @Current.Name { get; set; }
@EndEach
Expand Down
10 changes: 7 additions & 3 deletions EdmGen06.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
</ItemGroup>
<ItemGroup>
<Compile Include="EdmGenBase.cs" />
<Compile Include="EdmGenClassGen.cs" />
<Compile Include="EdmGenDataSet.cs" />
<Compile Include="EdmGenModelGen.cs" />
<Compile Include="MView45.cs" Condition=" '$(Configuration)' == 'Debug-net45-EF6' Or '$(Configuration)' == 'Release-net45-EF6' " />
Expand Down Expand Up @@ -119,6 +120,9 @@
<Service Include="{508349B6-6B84-4DF5-91F0-309BEEBAD82D}" />
</ItemGroup>
<ItemGroup>
<None Include="DbContext_EFv5.txt" />
<None Include="DbContext_EFv6.txt" />
<None Include="ObjectContext.txt" />
<Content Include="Usage.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
Expand All @@ -135,9 +139,9 @@
<Target Name="BeforeBuild" DependsOnTargets="MakeMView45">
</Target>
<Target Name="MakeMView45" Condition="(!Exists('$(MSBuildProjectDirectory)\MView45.cs)')) AND ('$(Configuration)' == 'Debug-net45-EF6' Or '$(Configuration)' == 'Release-net45-EF6')">
<Message Text="Autogenerating MView45.cs since it is missing..." Importance="High" />
<Message Text="Autogenerating MView45.cs since it is missing..." Importance="High" />
<Exec Command="Conv40To45.bat" ContinueOnError="false" Condition="'$(OS)' == 'Windows_NT'" WorkingDirectory="$(MSBuildProjectDirectory)" />
<Exec Command="Conv40To45.sh" ContinueOnError="false" Condition="'$(OS)' != 'Windows_NT'" WorkingDirectory="$(MSBuildProjectDirectory)" />
<Message Text="Autogenerated MView45.cs succesfully" Importance="High" />
<Exec Command="Conv40To45.sh" ContinueOnError="false" Condition="'$(OS)' != 'Windows_NT'" WorkingDirectory="$(MSBuildProjectDirectory)" />
<Message Text="Autogenerated MView45.cs succesfully" Importance="High" />
</Target>
</Project>
1 change: 0 additions & 1 deletion EdmGen06.sln
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ Global
{B9B34ACB-3CB7-4B76-937E-C74141C40E3A}.Debug-net45|Any CPU.ActiveCfg = Debug-net45-EF4|Any CPU
{B9B34ACB-3CB7-4B76-937E-C74141C40E3A}.Debug-net45|Any CPU.Build.0 = Debug-net45-EF4|Any CPU
{B9B34ACB-3CB7-4B76-937E-C74141C40E3A}.Debug-net45-EF6|Any CPU.ActiveCfg = Debug-net45-EF6|Any CPU
{B9B34ACB-3CB7-4B76-937E-C74141C40E3A}.Debug-net45-EF6|Any CPU.Build.0 = Debug-net45-EF6|Any CPU
{B9B34ACB-3CB7-4B76-937E-C74141C40E3A}.Release|Any CPU.ActiveCfg = Release-net45-EF6|Any CPU
{B9B34ACB-3CB7-4B76-937E-C74141C40E3A}.Release|Any CPU.Build.0 = Release-net45-EF6|Any CPU
{B9B34ACB-3CB7-4B76-937E-C74141C40E3A}.Release-net45|Any CPU.ActiveCfg = Release-net45-EF4|Any CPU
Expand Down
4 changes: 3 additions & 1 deletion EdmGenClassGen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public void CodeFirstGen(String fpEdmx, String fpcs, String generator) {
SortedDictionary<string, Assoc> dAssoc = new SortedDictionary<string, Assoc>();
List<Assoc> alAssoc = new List<Assoc>();
var Alias = Schema.Attribute("Alias").Value;
var Namespace= Schema.Attribute("Namespace").Value;
var Namespace = Schema.Attribute("Namespace").Value;
foreach (var Association in Schema.Elements(nsCSDL + "Association")) {
var Name = Association.Attribute("Name").Value;
var assoc12 = new Assoc(Association, nsCSDL, true);
Expand Down Expand Up @@ -169,6 +169,8 @@ public String RelationshipMultiplicity2 {
}

String CheckTypeSigned(String edmType, bool nullable) {
if (edmType == "Time")
edmType = "TimeSpan";
if (nullable && "/Boolean/Int16/Int32/Int64/Guid/Single/Double/Decimal/DateTime/DateTimeOffset/Time/".IndexOf("/" + edmType + "/") >= 0)
edmType += "?";
if (edmType == "Binary")
Expand Down
94 changes: 88 additions & 6 deletions Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,15 @@
<data name="ConceptualSchemaDefinitionVersion3" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\conceptualschemadefinitionversion3.csdl;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="DbContext_EFv5" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\DbContext_EFv5.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
</data>
<data name="DbContext_EFv6" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\DbContext_EFv6.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
</data>
<data name="ObjectContext" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\ObjectContext.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
</data>
<data name="Usage" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\usage.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
</data>
Expand Down

0 comments on commit 12f4815

Please sign in to comment.