diff --git a/PocoClassGenerator/PocoClassGenerator/PocoClassGenerator.cs b/PocoClassGenerator/PocoClassGenerator/PocoClassGenerator.cs index e920dee..620a72a 100644 --- a/PocoClassGenerator/PocoClassGenerator/PocoClassGenerator.cs +++ b/PocoClassGenerator/PocoClassGenerator/PocoClassGenerator.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Data; using System.Linq; diff --git a/PocoClassGenerator/PocoClassGeneratorTests/PocoClassGeneratorTest.cs b/PocoClassGenerator/PocoClassGeneratorTests/PocoClassGeneratorTest.cs index c6095fd..2590ea7 100644 --- a/PocoClassGenerator/PocoClassGeneratorTests/PocoClassGeneratorTest.cs +++ b/PocoClassGenerator/PocoClassGeneratorTests/PocoClassGeneratorTest.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Data; using System.Data.Common; using System.Data.SqlClient; diff --git a/PocoClassGenerator/PocoClassGeneratorTests/PocoClassGeneratorTests.csproj b/PocoClassGenerator/PocoClassGeneratorTests/PocoClassGeneratorTests.csproj index 8fc4a19..34fed61 100644 --- a/PocoClassGenerator/PocoClassGeneratorTests/PocoClassGeneratorTests.csproj +++ b/PocoClassGenerator/PocoClassGeneratorTests/PocoClassGeneratorTests.csproj @@ -1,4 +1,4 @@ - + netcoreapp2.2 @@ -8,7 +8,7 @@ - + diff --git a/PocoClassGenerator/PocoClassGeneratorTests/UnitTest_DDL_SQLScript.sql b/PocoClassGenerator/PocoClassGeneratorTests/UnitTest_DDL_SQLScript.sql index ba3888a..8cc5955 100644 --- a/PocoClassGenerator/PocoClassGeneratorTests/UnitTest_DDL_SQLScript.sql +++ b/PocoClassGenerator/PocoClassGeneratorTests/UnitTest_DDL_SQLScript.sql @@ -1,4 +1,4 @@ -create database GeneratorDataBase; +create database GeneratorDataBase; use GeneratorDataBase; CREATE TABLE [dbo].[table1]( diff --git a/README.md b/README.md index c01af4f..4528a57 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,10 @@ --- +

version version version version version version version version version version version version version version version version version

+ +--- + PocoClassGenerator is started with `Necroskillz`'s POCO Generator [Generate C# POCOs from SQL statement in LINQPad ](http://www.necronet.org/archive/2012/10/09/generate-c-pocos-from-sql-statement-in-linqpad.aspx) ### Features @@ -13,6 +17,16 @@ PocoClassGenerator is started with `Necroskillz`'s POCO Generator [Generate C# P - mini and faster (only in 5 seconds generate 100 tables code) - Use appropriate dialect schema table SQL for each database query +### DEMO +- [POCOGenerator Generate Class By Dynamic SQL | .NET Fiddle](https://dotnetfiddle.net/bDdSCA) +![20191009102303.png](https://i.loli.net/2019/10/09/4AOsU2X8PWBcbGS.png) +- [POCO Class Generator GenerateAllTables | .NET Fiddle](https://dotnetfiddle.net/GkdqsU) +- [DataTable POCO Class Generator | .NET Fiddle](https://dotnetfiddle.net/vVeYwA) + + +![image](https://github.com/user-attachments/assets/235c4952-259b-4ecc-90b2-d0138c17316c) + + ### GetStart 👇First : Copy&Paste [PocoClassGenerator.cs](PocoClassGenerator/PocoClassGenerator/PocoClassGenerator.cs) Code to your project or LINQPad. @@ -29,9 +43,6 @@ using (var connection = Connection) } ``` -**The Online Demo : [POCO Class Generator GenerateAllTables | .NET Fiddle](https://dotnetfiddle.net/GkdqsU)** - -![20190430141947-image.png](https://raw.githubusercontent.com/shps951023/ImageHosting/master/img/20190430141947-image.png) #### Support Dapper Contrib POCO Class - Just call method with `GeneratorBehavior.DapperContrib` @@ -43,8 +54,9 @@ using (var conn = GetConnection()) Console.WriteLine(result); } ``` -**The Online Demo : [POCO Dapper Contrib Class Generator GenerateAllTables | .NET Fiddle](https://dotnetfiddle.net/yeuK1E) -![20190502132948-image.png](https://raw.githubusercontent.com/shps951023/ImageHosting/master/img/20190502132948-image.png)** +**The Online Demo : [POCO Dapper Contrib Class Generator GenerateAllTables | .NET Fiddle](https://dotnetfiddle.net/yeuK1E)** + +![image](https://github.com/user-attachments/assets/2989c2dc-8c06-4732-9069-a09605e1b18f) #### Generate Comment @@ -99,6 +111,8 @@ using (var connection = Connection) #### DataTablePocoClass +Code at [DataTablePocoClassGenerator.cs](https://github.com/shps951023/PocoClassGenerator/blob/master/PocoClassGenerator/PocoClassGenerator/DataTablePocoClassGenerator.cs) + ```C# var dt = new DataTable(); dt.TableName = "TestTable"; @@ -111,4 +125,4 @@ var expect = public string ID { get; set; } }"; Assert.Equal(expect, result); -``` \ No newline at end of file +```