Skip to content

Commit 0a3ed9a

Browse files
committed
Missing files added and cleanup
1 parent f6e5684 commit 0a3ed9a

File tree

14 files changed

+122
-18
lines changed

14 files changed

+122
-18
lines changed

CLI.Minimal/KY.Generator.CLI.Minimal.csproj

-3
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,6 @@
5656
<Reference Include="System.Xml" />
5757
</ItemGroup>
5858
<ItemGroup>
59-
<Compile Include="..\..\Assemblies\CommonAssemblyInfo.cs">
60-
<Link>Properties\CommonAssemblyInfo.cs</Link>
61-
</Compile>
6259
<Compile Include="Program.cs" />
6360
<Compile Include="Properties\AssemblyInfo.cs" />
6461
</ItemGroup>

CLI.Minimal/Properties/AssemblyInfo.cs

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
[assembly: AssemblyProduct("KY.Generator")]
1212
[assembly: AssemblyTrademark("")]
1313
[assembly: AssemblyCulture("")]
14+
[assembly: AssemblyCompany("KY-Programming")]
15+
[assembly: AssemblyCopyright("Copyright © KY-Programming 2006-2019")]
1416

1517
// Setting ComVisible to false makes the types in this assembly not visible
1618
// to COM components. If you need to access a type in this assembly from

CLI.Standalone/KY.Generator.CLI.Standalone.csproj

-6
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,6 @@
4949
</Reference>
5050
<Reference Include="System" />
5151
<Reference Include="System.Core" />
52-
<Reference Include="System.Data.SqlClient, Version=4.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
53-
<HintPath>..\packages\System.Data.SqlClient.4.6.0\lib\net461\System.Data.SqlClient.dll</HintPath>
54-
</Reference>
5552
<Reference Include="System.Xml.Linq" />
5653
<Reference Include="System.Data.DataSetExtensions" />
5754
<Reference Include="Microsoft.CSharp" />
@@ -60,9 +57,6 @@
6057
<Reference Include="System.Xml" />
6158
</ItemGroup>
6259
<ItemGroup>
63-
<Compile Include="..\..\Assemblies\CommonAssemblyInfo.cs">
64-
<Link>Properties\CommonAssemblyInfo.cs</Link>
65-
</Compile>
6660
<Compile Include="Program.cs" />
6761
<Compile Include="Properties\AssemblyInfo.cs" />
6862
</ItemGroup>

CLI.Standalone/Properties/AssemblyInfo.cs

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
[assembly: AssemblyProduct("KY.Generator")]
1212
[assembly: AssemblyTrademark("")]
1313
[assembly: AssemblyCulture("")]
14+
[assembly: AssemblyCompany("KY-Programming")]
15+
[assembly: AssemblyCopyright("Copyright © KY-Programming 2006-2019")]
1416

1517
// Setting ComVisible to false makes the types in this assembly not visible
1618
// to COM components. If you need to access a type in this assembly from

CLI/KY.Generator.CLI.csproj

-6
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,6 @@
4848
</Reference>
4949
<Reference Include="System" />
5050
<Reference Include="System.Core" />
51-
<Reference Include="System.Data.SqlClient, Version=4.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
52-
<HintPath>..\packages\System.Data.SqlClient.4.6.0\lib\net461\System.Data.SqlClient.dll</HintPath>
53-
</Reference>
5451
<Reference Include="System.Xml.Linq" />
5552
<Reference Include="System.Data.DataSetExtensions" />
5653
<Reference Include="Microsoft.CSharp" />
@@ -59,9 +56,6 @@
5956
<Reference Include="System.Xml" />
6057
</ItemGroup>
6158
<ItemGroup>
62-
<Compile Include="..\..\Assemblies\CommonAssemblyInfo.cs">
63-
<Link>Properties\CommonAssemblyInfo.cs</Link>
64-
</Compile>
6559
<Compile Include="Program.cs" />
6660
<Compile Include="Properties\AssemblyInfo.cs" />
6761
</ItemGroup>

CLI/Properties/AssemblyInfo.cs

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
[assembly: AssemblyProduct("KY.Generator")]
1212
[assembly: AssemblyTrademark("")]
1313
[assembly: AssemblyCulture("")]
14+
[assembly: AssemblyCompany("KY-Programming")]
15+
[assembly: AssemblyCopyright("Copyright © KY-Programming 2006-2019")]
1416

1517
// Setting ComVisible to false makes the types in this assembly not visible
1618
// to COM components. If you need to access a type in this assembly from

Reflection.Tests/Data/OneField.cs

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
{
33
internal class OneField
44
{
5+
#pragma warning disable 649
56
public string Field1;
7+
#pragma warning restore 649
68
}
79
}

Reflection.Tests/Data/Types.cs

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System.Collections.Generic;
1+
#pragma warning disable 169
2+
using System.Collections.Generic;
23

34
namespace KY.Generator.Reflection.Tests
45
{
@@ -73,4 +74,5 @@ public class SubType
7374
{
7475
public string Property { get; set; }
7576
}
76-
}
77+
}
78+
#pragma warning restore 169
+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
using KY.Generator.Csharp.Languages;
2+
using KY.Generator.Mappings;
3+
using KY.Generator.Tsql.Language;
4+
using KY.Generator.TypeScript.Languages;
5+
6+
namespace KY.Generator.Tsql.Extensions
7+
{
8+
public static class TypeMappingExtension
9+
{
10+
public static ITypeMapping Initialize(this ITypeMapping typeMapping)
11+
{
12+
typeMapping.Add(TsqlLanguage.Instance, "smallint", CsharpLanguage.Instance, "short", true);
13+
typeMapping.Add(TsqlLanguage.Instance, "bigint", CsharpLanguage.Instance, "long", true);
14+
typeMapping.Add(TsqlLanguage.Instance, "bit", CsharpLanguage.Instance, "bool", true);
15+
typeMapping.Add(TsqlLanguage.Instance, "int", CsharpLanguage.Instance, "int", true);
16+
typeMapping.Add(TsqlLanguage.Instance, "date", CsharpLanguage.Instance, "DateTime", true, "System");
17+
typeMapping.Add(TsqlLanguage.Instance, "datetime", CsharpLanguage.Instance, "DateTime", true, "System");
18+
typeMapping.Add(TsqlLanguage.Instance, "datetime2", CsharpLanguage.Instance, "DateTime", true, "System");
19+
typeMapping.Add(TsqlLanguage.Instance, "decimal", CsharpLanguage.Instance, "decimal", true);
20+
typeMapping.Add(TsqlLanguage.Instance, "nchar", CsharpLanguage.Instance, "string");
21+
typeMapping.Add(TsqlLanguage.Instance, "nvarchar", CsharpLanguage.Instance, "string");
22+
typeMapping.Add(TsqlLanguage.Instance, "char", CsharpLanguage.Instance, "string");
23+
typeMapping.Add(TsqlLanguage.Instance, "varchar", CsharpLanguage.Instance, "string");
24+
typeMapping.Add(TsqlLanguage.Instance, "varbinary", CsharpLanguage.Instance, "byte[]");
25+
typeMapping.Add(TsqlLanguage.Instance, "timestamp", CsharpLanguage.Instance, "byte[]");
26+
typeMapping.Add(TsqlLanguage.Instance, "uniqueidentifier", CsharpLanguage.Instance, "Guid", false, "System");
27+
typeMapping.Add(TsqlLanguage.Instance, "float", CsharpLanguage.Instance, "double", true);
28+
29+
typeMapping.Add(TsqlLanguage.Instance, "smallint", TypeScriptLanguage.Instance, "number", true);
30+
typeMapping.Add(TsqlLanguage.Instance, "bigint", TypeScriptLanguage.Instance, "number", true);
31+
typeMapping.Add(TsqlLanguage.Instance, "bit", TypeScriptLanguage.Instance, "boolean", true);
32+
typeMapping.Add(TsqlLanguage.Instance, "int", TypeScriptLanguage.Instance, "number", true);
33+
typeMapping.Add(TsqlLanguage.Instance, "date", TypeScriptLanguage.Instance, "Date", true);
34+
typeMapping.Add(TsqlLanguage.Instance, "datetime", TypeScriptLanguage.Instance, "Date", true);
35+
typeMapping.Add(TsqlLanguage.Instance, "datetime2", TypeScriptLanguage.Instance, "Date", true);
36+
typeMapping.Add(TsqlLanguage.Instance, "decimal", TypeScriptLanguage.Instance, "number", true);
37+
typeMapping.Add(TsqlLanguage.Instance, "nchar", TypeScriptLanguage.Instance, "string", true);
38+
typeMapping.Add(TsqlLanguage.Instance, "nvarchar", TypeScriptLanguage.Instance, "string", true);
39+
typeMapping.Add(TsqlLanguage.Instance, "char", TypeScriptLanguage.Instance, "string", true);
40+
typeMapping.Add(TsqlLanguage.Instance, "varchar", TypeScriptLanguage.Instance, "string", true);
41+
typeMapping.Add(TsqlLanguage.Instance, "varbinary", TypeScriptLanguage.Instance, "number[]", true);
42+
typeMapping.Add(TsqlLanguage.Instance, "timestamp", TypeScriptLanguage.Instance, "number[]", true);
43+
typeMapping.Add(TsqlLanguage.Instance, "uniqueidentifier", TypeScriptLanguage.Instance, "string", true);
44+
typeMapping.Add(TsqlLanguage.Instance, "float", TypeScriptLanguage.Instance, "number", true);
45+
return typeMapping;
46+
}
47+
}
48+
}

Tsql/Helpers/StaticResolver.cs

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
using System;
2+
using KY.Generator.Mappings;
3+
4+
namespace KY.Generator.Tsql
5+
{
6+
[Obsolete("Do not use again!")]
7+
internal static class StaticResolver
8+
{
9+
public static ITypeMapping TypeMapping { get; set; }
10+
}
11+
}

Tsql/Type/TsqlColumn.cs

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
namespace KY.Generator.Tsql.Type
2+
{
3+
public class TsqlColumn
4+
{
5+
public string Name { get; set; }
6+
public string Type { get; set; }
7+
public int Order { get; set; }
8+
public int Length { get; set; }
9+
public bool IsNullable { get; set; }
10+
public string ForeignKeyName { get; set; }
11+
public string ForeignKeyType { get; set; }
12+
public bool IsPrimaryKey { get; set; }
13+
public bool IsForeignKey => !string.IsNullOrEmpty(this.ForeignKeyName);
14+
public bool IsIdentity { get; set; }
15+
public bool IsUnicode { get; set; }
16+
public int Precision { get; set; }
17+
public int Scale { get; set; }
18+
public string DefaultValue { get; set; }
19+
20+
public bool IsFixedString => this.Type == "char" || this.Type == "nchar";
21+
public bool IsString => this.IsFixedString || this.Type == "varchar" || this.Type == "nvarchar";
22+
public bool IsDecimal => this.Type == "decimal";
23+
public bool IsInt => this.Type == "smallint" || this.Type == "int" || this.Type == "bigint";
24+
public bool HasDefault => this.DefaultValue != null;
25+
}
26+
}

Tsql/Type/TsqlNavigationProperty.cs

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
namespace KY.Generator.Tsql.Type
2+
{
3+
public class TsqlNavigationProperty
4+
{
5+
public string Name { get; set; }
6+
public string Type { get; set; }
7+
8+
public TsqlNavigationProperty(string name, string type)
9+
{
10+
this.Name = name;
11+
this.Type = type;
12+
}
13+
}
14+
}

Tsql/Type/TsqlParameter.cs

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
namespace KY.Generator.Tsql.Type
2+
{
3+
public class TsqlParameter
4+
{
5+
public string Name { get; set; }
6+
public string Type { get; set; }
7+
public int Order { get; set; }
8+
public bool IsNullable { get; set; }
9+
}
10+
}

Watchdog/Watchdogs/HttpWatchdog.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public async Task<bool> WaitAsync()
4545
return true;
4646
}
4747
}
48-
catch (Exception exception)
48+
catch (Exception)
4949
{
5050
// Ignore all exception while we wait
5151
}

0 commit comments

Comments
 (0)