Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You can use the classes.tt template (in linqtemplates, plus SQLServer.ttinclude) in subsonic 3 (run in visual studio). <a href="http://subsonicproject.com/" rel="nofollow">http://subsonicproject.com/</a> The generated properties have backing variables, and some extra lines to support INotifyPropertyChanging and INotifyPropertyChanged, but you can edit the template to take out those lines.</p> <p>Here is sample output and template:</p> <pre><code>public partial class Order { public int OrderID { get; set; } public string CustomerID { get; set; } public int? EmployeeID { get; set; } public DateTime? OrderDate { get; set; } public DateTime? RequiredDate { get; set; } public DateTime? ShippedDate { get; set; } public int? ShipVia { get; set; } public decimal? Freight { get; set; } public string ShipName { get; set; } public string ShipAddress { get; set; } public string ShipCity { get; set; } public string ShipRegion { get; set; } public string ShipPostalCode { get; set; } public string ShipCountry { get; set; } } &lt;#@ template language="C#" debug="False" hostspecific="True" #&gt; &lt;#@ output extension=".cs" #&gt; &lt;#@ include file="SQLServer.ttinclude" #&gt; &lt;# var tables = LoadTables(); #&gt; using System; using System.ComponentModel; using System.Linq; namespace &lt;#=Namespace#&gt; { &lt;# foreach(Table tbl in tables){#&gt; /// &lt;summary&gt; /// A class which represents the &lt;#=tbl.Name#&gt; table in the &lt;#=DatabaseName#&gt; Database. /// This class is queryable through &lt;#=DatabaseName#&gt;DB.&lt;#=tbl.ClassName#&gt; /// &lt;/summary&gt; public partial class &lt;#=tbl.ClassName#&gt; { #region Properties &lt;# foreach(var col in tbl.Columns){ if (tbl.ClassName == col.CleanName) { col.CleanName += "X"; } #&gt; public &lt;#=col.SysType#&gt;&lt;#=CheckNullable(col)#&gt; &lt;#=col.CleanName#&gt; { get; set; } &lt;# }#&gt; #endregion } &lt;#}#&gt; } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload