Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tool for generating POCO/DTO from database (SQL Server) [closed]

What free tools can generate simple POCO/DTO classes from MS SQL Server database? With Properties and fields, but nothing more.

like image 300
bretddog Avatar asked Jan 29 '11 10:01

bretddog


2 Answers

Have a look at MyGeneration - it's a free code generation tool for SQL Server that lets you define templates that will be driven by the database structure.

You decide what will come out on the other side.

like image 155
Oded Avatar answered Nov 08 '22 08:11

Oded


Found nothing suitable so created a very simple TSQL script. Here is the gist.

Sample output:

public class EmployeeDto
{
        public int Id { get; set; }
        public int AccountId { get; set; }
        public string ExternalId { get; set; }
        public string EmailAddress { get; set; }
        public bool IsActive { get; set; }
        public string UniqueId { get; set; }
        public bool IsBuiltIn { get; set; }
        public string LastName { get; set; }
        public string FirstName { get; set; }
        public string MiddleName { get; set; }
        public bool IsAuthorizedOnAllDepartments { get; set; }
}
like image 39
evgeny.myasishchev Avatar answered Nov 08 '22 08:11

evgeny.myasishchev