shps951023 / pococlassgenerator Goto Github PK
View Code? Open in Web Editor NEWMini POCO Class Generator (Support POCO, DTO, Dapper Contrib)
License: MIT License
Mini POCO Class Generator (Support POCO, DTO, Dapper Contrib)
License: MIT License
dotnet poco generate -cs "connectionString" -sql "select * from table"
public class Employee
{
[Key]
public int EmployeeId { get; set; }
public string Name { get; set; }
}
0.9.2 version :
public class MyClass {
public DateTime? BirthDate { get; set; }
}
should fix like
public class MyClass {
public System.DateTime? BirthDate { get; set; }
}
HI
請問我新增PocoClassGenerator 這個CS檔,但是實際實行後出現錯誤訊息:[資料行 'IsAutoIncrement' 不屬於資料表 SchemaTable。]
經查詢為 generatorBehavior.HasFlag(GeneratorBehavior.Comment) 與 generatorBehavior.HasFlag(GeneratorBehavior.DapperContrib)
不一致導致 在 (bool)row["IsAutoIncrement"] 找不到元素。然後引發錯誤,請問該如何處理?
DB:oracle
below code in pococlassgenerator will get test class not viewtest
create view ViewTest as select * from Test
e.g
[Table("Report")]
public class Report
{
[Key]
public string Id { get; set; }
public string Name { get; set; }
public string Type { get; set; }
public string Sql { get; set; }
public string Updatetime { get; set; }
public string ReportDataBaseId { get; set; }
public ReportDataBase ReportDataBase { get; set; }
}
[Table("ReportDataBase")]
public class ReportDataBase
{
[Key]
public string Id { get; set; }
public string Name { get; set; }
public string DbType { get; set; }
public string ConnectionString { get; set; }
}
Query by
var sql = "SELECT * FROM Report A left JOIN ReportDataBase B on A.ReportDataBaseId = B.ID";
var result = Connection.Query<Report, ReportDataBase, Report>(sql,
(b, a) => { b.ReportDataBase = a; return b; });
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.