");
+
+ sb.Append("");
+
+ foreach (InterceptCallInfo c in counter.CurrentCalls)
+ {
+ sb.AppendFormat("");
+
+ sb.AppendFormat("{0} | ", DateTime.Now - c.BeginCallTime);
+ sb.AppendFormat("{0} | ", c.CurrentPrincipal.Identity.Name);
+
+ foreach (object value in c.ParameterValues)
+ {
+ sb.AppendFormat("");
+
+ sb.Append(
+ value == null ? "" :
+ value is string ? "\"" + value.ToString().Replace("\n", " \n") + "\"" :
+ value is char ? "'" + value + "'" :
+ value.ToString());
+
+ sb.AppendFormat(" | ");
+ }
+
+ sb.AppendFormat(" ");
+ }
+
+ sb.Append(" ");
+
+ return sb.ToString();
+ }
+}
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Admin/Items.aspx
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Asp.Net/Web/Admin/Items.aspx Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,23 @@
+<%@ Page Language="C#" MasterPageFile="~/Admin/MasterPage.master" AutoEventWireup="true" CodeFile="Items.aspx.cs" Inherits="Admin_Items" Title="Items" %>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Admin/Items.aspx.cs
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Asp.Net/Web/Admin/Items.aspx.cs Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,11 @@
+using System;
+
+using PetShop.BusinessLogic;
+
+public partial class Admin_Items : System.Web.UI.Page
+{
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ binder.List = new ProductManager().GetAllItemList();
+ }
+}
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Admin/MasterPage.master
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Asp.Net/Web/Admin/MasterPage.master Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,74 @@
+<%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="Admin_MasterPage" %>
+<%@ Register Src="~/Controls/BreadCrumbControl.ascx" TagName="BreadCrumbControl" TagPrefix="PetShopControl" %>
+<%@ Register Src="~/Controls/NavigationControl.ascx" TagName="NavigationControl" TagPrefix="PetShopControl" %>
+
+
+
+ The .NET Pet Shop Admin Interface
+
+
+
+
+
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Admin/MasterPage.master.cs
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Asp.Net/Web/Admin/MasterPage.master.cs Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,8 @@
+using System;
+
+public partial class Admin_MasterPage : System.Web.UI.MasterPage
+{
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ }
+}
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Admin/Orders.aspx
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Asp.Net/Web/Admin/Orders.aspx Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,26 @@
+<%@ Page Language="C#" MasterPageFile="~/Admin/MasterPage.master" AutoEventWireup="true" CodeFile="Orders.aspx.cs" Inherits="Admin_Orders" Title="Orders" %>
+<%@ Import Namespace="PetShop.ObjectModel" %>
+
+
+
+
+
+
+
+
+ <%# FormatAddress(((Order)Container.DataItem).ShippingAddress) %>
+
+
+
+
+
+
+
+
+
+
+
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Admin/Orders.aspx.cs
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Asp.Net/Web/Admin/Orders.aspx.cs Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,26 @@
+using System;
+
+using PetShop.BusinessLogic;
+using PetShop.ObjectModel;
+
+public partial class Admin_Orders : System.Web.UI.Page
+{
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ binder.List = new OrderManager().GetAllOrderList();
+ }
+
+ protected static string FormatAddress(Address addr)
+ {
+ return string.Format(
+ "{0} {1} {2} {3} {4}, {5} {6}, {7}",
+ addr.FirstName,
+ addr.LastName,
+ addr.Line1,
+ addr.Line2,
+ addr.City,
+ addr.State,
+ addr.Zip,
+ addr.Country);
+ }
+}
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/App_Code/AssemblyInfo.cs
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Asp.Net/Web/App_Code/AssemblyInfo.cs Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,13 @@
+using System;
+using System.Reflection;
+
+[assembly: AssemblyVersion("4.0.4.50")]
+
+[assembly: AssemblyTitle(".NET Pet Shop Web")]
+[assembly: AssemblyDescription(".NET Pet Shop Web Components")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Microsoft Corporation")]
+[assembly: AssemblyProduct(".NET Pet Shop 4.0")]
+[assembly: AssemblyCopyright("Copyright \xA9 2005 Microsoft Corporation")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
\ No newline at end of file
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/App_Code/CustomGrid.cs
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Asp.Net/Web/App_Code/CustomGrid.cs Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,139 @@
+using System;
+using System.Collections;
+using System.Text.RegularExpressions;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace PetShop.Web
+{
+ public class CustomGrid : Repeater
+ {
+ private static readonly Regex RX = new Regex(@"^&page=\d+", RegexOptions.Compiled);
+
+ protected string _emptyText;
+ private IList _dataSource;
+ private int _pageSize = 10;
+ private int _currentPageIndex;
+ private int _itemCount;
+
+ public override object DataSource
+ {
+ set
+ {
+ // This try catch block is to avoid issues with the VS.NET designer
+ // The designer will try and bind a datasource which does not derive from ILIST
+ try
+ {
+ _dataSource = (IList)value;
+ ItemCount = _dataSource.Count;
+ }
+ catch
+ {
+ _dataSource = null;
+ ItemCount = 0;
+ }
+ }
+ }
+
+ public int PageSize { get { return _pageSize; } set { _pageSize = value; } }
+ protected virtual int ItemCount { get { return _itemCount; } set { _itemCount = value; } }
+ public virtual int CurrentPageIndex { get { return _currentPageIndex; } set { _currentPageIndex = value; } }
+
+ protected int PageCount { get { return (ItemCount - 1) / _pageSize; } }
+ public string EmptyText { set { _emptyText = value; } }
+
+ public void SetPage(int index)
+ {
+ OnPageIndexChanged(new DataGridPageChangedEventArgs(null, index));
+ }
+
+ protected override void OnLoad(EventArgs e)
+ {
+ if (Visible)
+ {
+ string page = Context.Request["page"];
+ int index = page != null ? int.Parse(page) : 0;
+
+ SetPage(index);
+ }
+ }
+
+ ///
+ /// Overridden method to control how the page is rendered
+ ///
+ ///
+ protected override void Render(HtmlTextWriter writer)
+ {
+ // Check there is some data attached
+ //
+ if (ItemCount == 0)
+ {
+ writer.Write(_emptyText);
+ return;
+ }
+
+ // Mask the query
+ //
+ string query = Context.Request.Url.Query.Replace("?", "&");
+ query = RX.Replace(query, string.Empty);
+
+ // Write out the first part of the control, the table header
+ //
+ writer.Write("");
+
+ // Call the inherited method
+ //
+ base.Render(writer);
+
+ // Write out a table row closure
+ //
+ writer.Write(" | ");
+
+ // Determin whether next and previous buttons are required Previous button?
+ //
+ if (_currentPageIndex > 0)
+ writer.Write(string.Format("< Previous", _currentPageIndex - 1 + query));
+
+ // Close the table data tag
+ //
+ writer.Write(" | ");
+
+ // Next button?
+ //
+ if (_currentPageIndex < PageCount)
+ writer.Write(string.Format("More >", _currentPageIndex + 1 + query));
+
+ // Close the table
+ //
+ writer.Write(" | ");
+ }
+
+ protected override void OnDataBinding(EventArgs e)
+ {
+ // Work out which items we want to render to the page
+ //
+ int start = CurrentPageIndex * _pageSize;
+ int size = Math.Min(_pageSize, ItemCount - start);
+
+ IList page = new ArrayList();
+
+ // Add the relevant items from the datasource
+ //
+ for (int i = 0; i < size; i++)
+ page.Add(_dataSource[start + i]);
+
+ // Set the base objects datasource
+ //
+ base.DataSource = page;
+ base.OnDataBinding(e);
+ }
+
+ public event DataGridPageChangedEventHandler PageIndexChanged;
+
+ protected virtual void OnPageIndexChanged(DataGridPageChangedEventArgs e)
+ {
+ if (PageIndexChanged != null)
+ PageIndexChanged(this, e);
+ }
+ }
+}
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/App_Code/CustomList.cs
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Asp.Net/Web/App_Code/CustomList.cs Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,140 @@
+using System;
+using System.Collections;
+using System.Text.RegularExpressions;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace PetShop.Web
+{
+ public class CustomList : DataList
+ {
+ private static readonly Regex RX = new Regex(@"^&page=\d+", RegexOptions.Compiled);
+
+ protected string _emptyText;
+ private IList _dataSource;
+ private int _pageSize = 10;
+ private int _currentPageIndex;
+ private int _itemCount;
+
+ public override object DataSource
+ {
+ set
+ {
+ //This try catch block is to avoid issues with the VS.NET designer
+ //The designer will try and bind a datasource which does not derive from ILIST
+ try
+ {
+ _dataSource = (IList)value;
+ ItemCount = _dataSource.Count;
+ }
+ catch
+ {
+ _dataSource = null;
+ ItemCount = 0;
+ }
+ }
+ }
+
+ public int PageSize { get { return _pageSize; } set { _pageSize = value; } }
+ protected virtual int ItemCount { get { return _itemCount; } set { _itemCount = value; } }
+ public virtual int CurrentPageIndex { get { return _currentPageIndex; } set { _currentPageIndex = value; } }
+
+ protected int PageCount { get { return (ItemCount - 1) / _pageSize; } }
+ public string EmptyText { set { _emptyText = value; } }
+
+ public void SetPage(int index)
+ {
+ OnPageIndexChanged(new DataGridPageChangedEventArgs(null, index));
+ }
+
+ protected override void OnLoad(EventArgs e)
+ {
+ if (Visible)
+ {
+ string page = Context.Request["page"];
+ int index = page != null ? int.Parse(page) : 0;
+
+ SetPage(index);
+ }
+ }
+
+ ///
+ /// Overridden method to control how the page is rendered
+ ///
+ ///
+ protected override void Render(HtmlTextWriter writer)
+ {
+ // Check there is some data attached
+ //
+ if (ItemCount == 0)
+ {
+ writer.Write(_emptyText);
+ return;
+ }
+
+ // Mask the query
+ //
+ string query = Context.Request.Url.Query.Replace("?", "&");
+
+ query = RX.Replace(query, string.Empty);
+
+ // Write out the first part of the control, the table header
+ //
+ writer.Write("");
+
+ // Call the inherited method
+ //
+ base.Render(writer);
+
+ // Write out a table row closure
+ //
+ writer.Write(" | ");
+
+ // Determin whether next and previous buttons are required Previous button?
+ //
+ if (_currentPageIndex > 0)
+ writer.Write(string.Format("< Previous", _currentPageIndex - 1 + query));
+
+ // Close the table data tag
+ //
+ writer.Write(" | ");
+
+ // Next button?
+ //
+ if (_currentPageIndex < PageCount)
+ writer.Write(string.Format("More >", _currentPageIndex + 1 + query));
+
+ // Close the table
+ //
+ writer.Write(" | ");
+ }
+
+ protected override void OnDataBinding(EventArgs e)
+ {
+ // Work out which items we want to render to the page
+ //
+ int start = CurrentPageIndex * _pageSize;
+ int size = Math.Min(_pageSize, ItemCount - start);
+
+ IList page = new ArrayList();
+
+ // Add the relevant items from the datasource
+ //
+ for (int i = 0; i < size; i++)
+ page.Add(_dataSource[start + i]);
+
+ // set the base objects datasource
+ //
+ base.DataSource = page;
+ base.OnDataBinding(e);
+ }
+
+ public event DataGridPageChangedEventHandler PageIndexChanged;
+
+ virtual protected void OnPageIndexChanged(DataGridPageChangedEventArgs e)
+ {
+ if (PageIndexChanged != null)
+ PageIndexChanged(this, e);
+ }
+ }
+}
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/App_Code/PageBase.cs
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Asp.Net/Web/App_Code/PageBase.cs Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,9 @@
+using System;
+using System.Web.UI;
+
+namespace PetShop.Web
+{
+ public class PageBase : Page
+ {
+ }
+}
\ No newline at end of file
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/App_Code/WebUtility.cs
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Asp.Net/Web/App_Code/WebUtility.cs Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,59 @@
+using System;
+using System.Text.RegularExpressions;
+using System.Web;
+using System.Web.Caching;
+using System.Configuration;
+
+using PetShop.BusinessLogic;
+
+namespace PetShop.Web
+{
+ ///
+ /// Collection of utility methods for web tier
+ ///
+ public static class WebUtility
+ {
+ ///
+ /// Method to make sure that user's inputs are not malicious
+ ///
+ /// User's Input
+ /// Maximum length of input
+ /// The cleaned up version of the input
+ public static string InputText(string text, int maxLength)
+ {
+ text = text.Trim();
+
+ if (string.IsNullOrEmpty(text))
+ return string.Empty;
+
+ text = Regex.Replace(text, "[\\s]{2,}", " "); // two or more spaces
+ text = Regex.Replace(text, "(<[b|B][r|R]/*>)+|(<[p|P](.|\\n)*?>)", "\n"); //
+ text = Regex.Replace(text, "(\\s*&[n|N][b|B][s|S][p|P];\\s*)+", " "); //
+ text = Regex.Replace(text, "<(.|\\n)*?>", string.Empty); // any other tags
+ text = text.Replace("'", "''");
+
+ if (text.Length > maxLength)
+ text = text.Substring(0, maxLength);
+
+ return text;
+ }
+
+ ///
+ /// Method to check whether input has other characters than numbers
+ ///
+ public static string CleanNonWord(string text)
+ {
+ return Regex.Replace(text, "\\W", "");
+ }
+
+ ///
+ /// Method to redirect user to search page
+ ///
+ /// Search keyword
+ public static void SearchRedirect(string key)
+ {
+ HttpContext.Current.Response.Redirect(
+ string.Format("~/Search.aspx?keywords={0}", InputText(key, 255)));
+ }
+ }
+}
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/App_Themes/PetShop/SkinFile.skin
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Asp.Net/Web/App_Themes/PetShop/SkinFile.skin Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,35 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <%--Uncomment for using with default layout of wizard control
+ --%>
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/App_Themes/PetShop/StyleSheet.css
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Asp.Net/Web/App_Themes/PetShop/StyleSheet.css Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,630 @@
+body {
+ background-color: #E3E5DC;
+ margin-left: 0px;
+ margin-top: 0px;
+ margin-right: 0px;
+ margin-bottom: 0px;
+ background-image: url(../../Comm_Images/bg-body.gif);
+ background-repeat: repeat-x;
+}
+a:visited {
+ color: #333;
+ text-decoration: none;
+}
+a:hover {
+ color: #1639A9;
+ text-decoration: underline;
+}
+a:link {
+ color: #333;
+ text-decoration: none;
+}
+.link {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 0.65em;
+ text-transform: uppercase;
+ color: #333333;
+ text-indent: 10px;
+}
+.disabledLink
+{
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 0.65em;
+ text-transform: uppercase;
+ color: #999999;
+ text-indent: 10px;
+}
+.signIn {
+ background-color: #E9EED8;
+ background-image: url(../../Comm_Images/bg-sign-in.gif);
+ background-repeat: repeat-x;
+ height: 60px;
+ margin-top: 20px;
+}
+.checkOut {
+ background-color: #ABAF94;
+ /*cursor: hand;*/
+}
+.linkCheckOut {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 0.65em;
+ text-transform: uppercase;
+ color: #333333;
+ text-indent: 7px;
+}
+.welcomeName {
+ font-size: 0.7em;
+ font-weight: bold;
+ white-space: nowrap;
+ text-indent: 37px;
+ color: #555;
+ font-family: Arial, Helvetica, sans-serif;
+}
+.textboxSearch {
+ font-size: 0.8em;
+ color: #000;
+ text-indent: 3px;
+ background-color: #FFF;
+ border-width: 1px;
+ border-style: solid;
+ border-top-color: #E9EED8;
+ border-right-color: #C6C3B3;
+ border-bottom-color: #ABAF94;
+ border-left-color: #C6C3B3;
+ height: 14px;
+}
+.breadcrumb {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 0.7em;
+ text-transform: uppercase;
+ color: #333333;
+ font-weight: bold;
+}
+.bgBreadcrumb {
+ padding-top: 12px;
+ padding-bottom: 9px;
+}
+.mainNavigation {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 0.7em;
+ text-transform: uppercase;
+ padding-left: 2px;
+ color: #333333;
+ font-weight: bold;
+ line-height: 20px;
+ padding-right: 5px;
+ display:block;
+ height:100%;
+}
+.pageHeader {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 0.9em;
+ font-weight: bold;
+ text-transform: uppercase;
+ color: #FFFFFF;
+ background-color: #0A1B50;
+ text-indent:16px;
+}
+.dottedLine {
+ background-image: url(../../Comm_Images/dotten-line.gif);
+ background-repeat: repeat-x;
+ background-position: bottom;
+ height: 8px;
+}
+input {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 0.8em;
+ color: #333333;
+ padding-left: 3px;
+ padding-right: 3px;
+}
+.footer td {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 0.65em;
+ text-transform: uppercase;
+ color: #FFF;
+ background-color: #ABAF94;
+ padding-left: 18px;
+ line-height: 16px;
+}
+.homeBody {
+ background-color: #FFF;
+ margin-left: 0px;
+ margin-top: 0px;
+ margin-right: 0px;
+ margin-bottom: 0px;
+ background-image: url(../../Comm_Images/home-bg-body.gif);
+ background-repeat: repeat-x;
+}
+.homeBgSearch {
+ background-image: url(../../Comm_Images/bg-search.gif);
+ background-repeat: repeat-x;
+ background-position: top;
+ padding-top: 20px;
+}
+.fishPosition {
+ position: relative;
+ left: -60px;
+ top: 0px;
+ width: 241px;
+ height: 300px;
+}
+.footerHome {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 0.65em;
+ text-transform: uppercase;
+ color: #FFF;
+ background-color: #122E87;
+ padding-left: 18px;
+ line-height: 16px;
+}
+.homeLink {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 0.65em;
+ text-transform: uppercase;
+ color: #333;
+ vertical-align: middle;
+}
+.homeSearchBox {
+ font-size: 0.8em;
+ color: #404040;
+ text-indent: 3px;
+ background-color: #FFF;
+ border-width: 1px;
+ border-style: solid;
+ border-top-color: #E9EED8;
+ border-right-color: #C6C3B3;
+ border-bottom-color: #ABAF94;
+ border-left-color: #C6C3B3;
+ height: 14px;
+ padding-right: 5px;
+}
+.paddingSearchicon {
+ padding-top:3px;
+ padding-left:5px;
+}
+.welcome {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 0.9em;
+ font-weight: bold;
+ color: #FFFFFF;
+ padding-left: 20px;
+ height: 27px;
+ text-transform: uppercase;
+ background-color: #ABAF94;
+ vertical-align: middle;
+}
+.intro {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 0.9em;
+ font-weight: bold;
+ color: #555555;
+ padding-top: 20px;
+ line-height: 18px;
+ padding-left: 20px;
+ padding-bottom: 20px;
+ display: block;
+ width: 300px;
+}
+.navigationLinks {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 0.9em;
+ text-transform: uppercase;
+ color: #333;
+ line-height: 1.8em;
+ font-weight: bold;
+ vertical-align:top;
+ background-image: url(../../Comm_Images/dotten-line.gif);
+ background-repeat: repeat-x;
+ background-position: bottom;
+ width:320px;
+}
+.navigationLabel {
+ color: #98A839;
+ font-size: 0.9em;
+ font-weight: bold;
+ line-height:25px;
+ font-family: Arial, Helvetica, sans-serif;
+ padding-left: 20px;
+}
+.bgControl {
+ background-color: #E3E5DC;
+}
+.productDescription {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 0.7em;
+ font-weight: normal;
+ color: #333333;
+}
+.productName {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 1em;
+ font-weight: bold;
+ color: #333333;
+ padding-bottom: 12px;
+}
+.paging {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 0.85em;
+ color:#98A839;
+ font-weight: bold;
+ text-decoration: none;
+ padding-top: 16px;
+ padding-bottom: 16px;
+ padding-left: 16px;
+ padding-right: 16px;
+}
+.productsPosition {
+ padding-top: 37px;
+ padding-bottom: 33px;
+}
+.productsLine {
+ padding-top: 16px;
+ padding-bottom: 3px;
+ border-bottom: solid 1px #E8EADD;
+}
+.itemsPosition {
+ padding-top: 5px;
+ padding-bottom: 33px;
+}
+.itemText {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 0.7em;
+ font-weight: normal;
+ color: #333333;
+ padding-bottom: 5px;
+ text-indent: 3px;
+ line-height: 1.3em;
+}
+.itemName {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 0.7em;
+ font-weight: bold;
+ color: #333333;
+ padding-bottom: 5px;
+ text-indent: 3px;
+ line-height: 1.3em;
+}
+.linkCart {
+ text-transform: uppercase;
+ font-size: 1em;
+ font-weight: bold;
+ padding-top: 16px;
+ padding-bottom: 10px;
+ padding-left: 21px;
+ cursor: hand;
+ background-image: url(../../Comm_Images/button-cart.gif);
+ background-repeat: no-repeat;
+ background-position: 0px;
+ line-height:35px;
+}
+.linkWishlist {
+ text-transform: uppercase;
+ font-size: 1em;
+ font-weight: bold;
+ padding-top: 4px;
+ padding-left: 21px;
+ cursor: hand;
+ background-image: url(../../Comm_Images/button-wishlist.gif);
+ background-repeat: no-repeat;
+ }
+.cartPosition {
+ padding-top: 50px;
+ padding-bottom: 33px;
+}
+.label {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 0.7em;
+ color: #333333;
+ margin-left: 20px;
+ margin-bottom: 10px;
+ text-align: left;
+}
+.cart {
+ background-color:#E8EADD;
+}
+.labelLists {
+ font-family: Tahoma, Arial, Helvetica, sans-serif;
+ font-size: 0.7em;
+ font-weight: bold;
+ color: #747C6D;
+ vertical-align: bottom;
+ background-image: url(../../Comm_Images/bg-labelLists.gif);
+ text-align:left;
+ line-height: 21px;
+ padding-left: 5px;
+ text-indent: 2px;
+ padding-right: 5px;
+ padding-top: 8px;
+ padding-bottom: 1px;
+ border-bottom-width: 1px;
+ border-bottom-color: #FFF;
+ border-bottom-style: solid;
+}
+.listItem {
+ font-family: Tahoma, Arial, Helvetica, sans-serif;
+ font-size: 0.7em;
+ color: #333333;
+ text-decoration: none;
+ line-height: 15px;
+ padding-left: 5px;
+ padding-right: 5px;
+ padding-bottom: 2px;
+ padding-top: 2px;
+ white-space: nowrap;
+ text-align: left;
+}
+.dottedLineCentered {
+ background-image: url(../../Comm_Images/dotten-line.gif);
+ background-repeat: repeat-x;
+ background-position: center;
+ height: 8px;
+}
+.total {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 0.7em;
+ font-weight: bold;
+ color: #000000;
+ padding-right: 2px;
+ line-height: 1.5em;
+}
+.signinButton {
+ font-family : Tahoma, Arial, Helvetica, sans-serif;
+ background-color:#FB9D00;
+ font-size: 0.85em;
+ color: #FFF;
+ text-decoration: none;
+ font-weight: bold;
+ cursor: hand;
+ border: 1px solid;
+ border-bottom-color:#F07C00;
+ border-top-color: #FFCC00;
+ border-right-color:#F07C00;
+ border-left-color:#FFCC00;
+ padding-right: 5px;
+ padding-left: 5px;
+ margin-bottom: 15px;
+ margin-right: 10px;
+}
+.signinHeader {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 1.1em;
+ font-weight: bold;
+ text-align: left;
+ white-space: nowrap;
+ color: #333333;
+ padding-top: 5px;
+ padding-bottom: 5px;
+ line-height:30px;
+
+}
+.signinTextbox {
+ font-size: 0.9em;
+ color: #000;
+ text-indent: 3px;
+ background-color: #EAE9E4;
+ border-width: 1px;
+ border-style: solid;
+ border-top-color: #C6C3B3;
+ border-right-color: #7C7D6A;
+ border-bottom-color: #000;
+ border-left-color: #7C7D6A;
+ height: 16px;
+ margin-right: 2px;
+}
+.signinLabel {
+ font-family: Arial, Helvetica, sans-serif;
+ font-weight:normal;
+ color: #333333;
+}
+.signinNewUser {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 0.8em;
+ text-transform: uppercase;
+ color: #333333;
+ text-indent: 3px;
+}
+.asterisk {
+ color: #333333;
+ vertical-align: top;
+}
+.signInContent {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 0.8em;
+ background-color: #FFFFFF;
+ white-space: nowrap;
+ color: #333333;
+ padding-top: 10px;
+ padding-bottom: 10px;
+}
+.checkoutPosition {
+ padding-top: 40px;
+ padding-bottom: 33px;
+}
+.checkoutContent {
+ font-family: Arial, Helvetica, sans-serif;
+ background-color: #FFFFFF;
+ white-space: nowrap;
+ color: #333333;
+ padding-left: 15px;
+}
+.checkoutHeaders{
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 0.9em;
+ font-weight: bold;
+ color: #333333;
+ text-transform: capitalize;
+ white-space: nowrap;
+ height: 30px;
+ padding-top: 3px;
+ padding-bottom: 5px;
+}
+.checkoutLabel {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 0.95em;
+ color: #333333;
+ margin-left: 20px;
+ margin-bottom: 10px;
+ text-align: left;
+}
+.checkoutTextbox {
+ font-size: 1em;
+ color: #000;
+ text-indent: 3px;
+ background-color: #EAE9E4;
+ border-width: 1px;
+ border-style: solid;
+ border-top-color: #C6C3B3;
+ border-right-color: #7C7D6A;
+ border-bottom-color: #000;
+ border-left-color: #7C7D6A;
+ height: 16px;
+ margin-top: 1px;
+}
+.checkoutDropdown {
+ font-size: 1em;
+ color: #000;
+ text-indent: 3px;
+ background-color: #EAE9E4;
+ border-width: 1px;
+ border-style: solid;
+ border-top-color: #C6C3B3;
+ border-right-color: #7C7D6A;
+ border-bottom-color: #000;
+ height: 16px;
+ margin-top: 2px;
+}
+.checkoutButtonBg {
+ background-image: url(../../Comm_Images/dotten-line.gif);
+ background-repeat: repeat-x;
+ background-position: top;
+}
+.back {
+ font-family: Tahoma, Arial, Helvetica, sans-serif;
+ font-size: 0.7em;
+ color: #000;
+ text-decoration: none;
+ font-weight: bold;
+ background-image: url(../../Comm_Images/button-back.gif);
+ background-repeat: no-repeat;
+ background-position: left 7px;
+ padding-left: 22px;
+ padding-top: 9px;
+ margin-left: 7px;
+ cursor: hand;
+ line-height: 40px;
+}
+.continue {
+ font-family: Tahoma, Arial, Helvetica, sans-serif;
+ font-size: 0.7em;
+ color: #000;
+ text-decoration: none;
+ font-weight: bold;
+ background-image: url(../../Comm_Images/button-continue.gif);
+ background-repeat: no-repeat;
+ background-position: right 7px;
+ padding-right: 22px;
+ padding-top: 9px;
+ margin-right: 7px;
+ cursor: hand;
+ line-height: 40px;
+}
+.submit {
+ font-family: Tahoma, Arial, Helvetica, sans-serif;
+ background-color:#FB9D00;
+ font-size: 0.7em;
+ color: #FFF;
+ text-decoration: none;
+ font-weight: bold;
+ cursor: hand;
+ line-height: 30px;
+ border: 1px solid;
+ border-bottom-color:#F07C00;
+ border-top-color: #FFCC00;
+ border-right-color:#F07C00;
+ border-left-color:#FFCC00;
+ padding-right: 10px;
+ padding-left: 10px;
+ padding-top: 1px;
+ padding-bottom: 1px;
+}
+.checkOutLabel {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 0.7em;
+ color: #333333;
+ margin-left: 3px;
+ margin-bottom: 10px;
+ text-align: left;
+}
+.info {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 0.7em;
+ color: #333333;
+ margin-bottom: 15px;
+ text-align: left;
+}
+.profilePosition {
+ padding-top: 50px;
+ padding-bottom: 33px;
+}
+.tableContent {
+ font-family: Arial, Helvetica, sans-serif;
+ background-color: #FFFFFF;
+ text-align: center;
+ font-weight:bold;
+ white-space: nowrap;
+ color: #333333;
+ padding-left: 25px;
+ padding-top: 12px;
+ padding-bottom: 3px;
+}
+.searchPosition {
+ font-family: Arial, Helvetica, sans-serif;
+ padding-top: 12px;
+ padding-bottom: 33px;
+}
+.linkNewUser {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 0.8em;
+ text-transform: uppercase;
+ color: #333333;
+ text-indent: 3px;
+}
+.cartHeader {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 0.9em;
+ font-weight: bold;
+ text-align: left;
+ white-space: nowrap;
+ color: #333333;
+ width: 387px;
+ padding-bottom: 16px;
+}
+.signinPosition {
+ padding-top: 22px;
+ padding-bottom: 33px;
+}
+.adminContent {
+ font-family: Verdana;
+ font-size: .8em;
+}
+.infoTable td {
+ padding: 4 5 0 0;
+ font-size: 0.7em;
+ text-align: right;
+}
+.grid th {
+ padding: 1 5 2 5;
+ font-size: .8em;
+}
+.grid td {
+ padding: 1 5 2 5;
+ font-size: .8em;
+}
+.pageHeader a:link, .pageHeader a:hover, .pageHeader a:visited {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 0.9em;
+ font-weight: bold;
+ color: #FFFFFF;
+ text-transform: uppercase;
+}
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/CheckOut.aspx
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Asp.Net/Web/CheckOut.aspx Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,206 @@
+<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="CheckOut.aspx.cs" Inherits="PetShop.Web.CheckOut" Title="Check Out" %>
+<%@ Register Src="Controls/CartList.ascx" TagName="CartList" TagPrefix="PetShopControl" %>
+<%@ Register Src="Controls/AddressConfirm.ascx" TagName="AddressConfirm" TagPrefix="PetShopControl" %>
+<%@ Register Src="Controls/AddressForm.ascx" TagName="AddressForm" TagPrefix="PetShopControl" %>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Credit Card Number
+ 4444123412341234
+
+ |
+
+
+ Expiration Date (MM/YYYY)
+ 12/2009
+
+
+
+ |
+
+
+ Credit card Type
+
+ Visa
+ Master Card
+ American Express
+ Discovery
+
+ |
+ |
+
+
+
+
+
+
+
+
+
+ Your order will not be processed until you select "Submit Order" below.
+ Billing address:
+
+ Shipping address:
+
+
+
+ A total of
+ will be charged to your credit card, ending with
+ .
+
+
+
+
+
+
+ Thank you for your order!
+
+
+
+ A total of
+ is being charged to your credit card, ending with
+ .
+
+ If you have any questions regarding this order, please contact our customer service at anytime.
+ The .NET Pet Shop Team
+
+
+
+
+ <%= wzdCheckOut.ActiveStep.Title %>
+
+
+
+
+ |
+
+
+
+
+
+
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/CheckOut.aspx.cs
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Asp.Net/Web/CheckOut.aspx.cs Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,111 @@
+using System;
+using System.Web.UI.WebControls;
+
+using PetShop.BusinessLogic;
+using PetShop.ObjectModel;
+
+namespace PetShop.Web
+{
+ public partial class CheckOut : System.Web.UI.Page
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ if (billingForm.Address == null)
+ billingForm.Address = Profile.AccountInfo;
+ }
+
+ ///
+ /// Process the order
+ ///
+ protected void wzdCheckOut_FinishButtonClick(object sender, WizardNavigationEventArgs e)
+ {
+ if (Profile.ShoppingCart.Items.Count > 0)
+ {
+ if (Profile.ShoppingCart.Count > 0)
+ {
+ // display ordered items
+ CartListOrdered.Bind(Profile.ShoppingCart.Items);
+
+ // display total and credit card information
+ ltlTotalComplete.Text = ltlTotal.Text;
+ ltlCreditCardComplete.Text = ltlCreditCard.Text;
+
+ // create order
+ Order order = new Order();
+
+ order.UserID = User.Identity.Name;
+ order.OrderDate = DateTime.Now;
+ order.TotalPrice = Profile.ShoppingCart.Total;
+ order.ShippingAddress = shippingForm.Address;
+ order.BillingAddress = billingForm.Address;
+ order.Lines = Profile.ShoppingCart.GetOrderLineItems();
+ order.CreditCard = GetCreditCardInfo();
+
+ new OrderManager().InsertOrder(order);
+
+ // destroy cart
+ Profile.ShoppingCart.Clear();
+ Profile.Save();
+ }
+ }
+ else
+ {
+ lblMsg.Text = " Can not process the order. Your cart is empty.
Continue shopping ";
+ wzdCheckOut.Visible = false;
+ }
+ }
+
+ ///
+ /// Create CreditCardInfo object from user input
+ ///
+ private CreditCard GetCreditCardInfo()
+ {
+ CreditCard cc = new CreditCard();
+
+ cc.Type = WebUtility.InputText(listCCType.SelectedValue, 40);
+ cc.Expiration = WebUtility.InputText(txtExpDate.Text, 7);
+ cc.Number = WebUtility.InputText(txtCCNumber.Text, 20);
+
+ return cc;
+ }
+
+ ///
+ /// Changing Wiszard steps
+ ///
+ protected void wzdCheckOut_ActiveStepChanged(object sender, EventArgs e)
+ {
+ if (wzdCheckOut.ActiveStepIndex == 3)
+ {
+ billingConfirm. Address = billingForm.Address;
+ shippingConfirm.Address = shippingForm.Address;
+ ltlTotal.Text = Profile.ShoppingCart.Total.ToString("c");
+
+ if (txtCCNumber.Text.Length > 4)
+ ltlCreditCard.Text = txtCCNumber.Text.Substring(txtCCNumber.Text.Length - 4, 4);
+ }
+ }
+
+ ///
+ /// Handler for "Ship to Billing Addredd" checkbox.
+ /// Prefill/Clear shipping address form.
+ ///
+ protected void chkShipToBilling_CheckedChanged(object sender, EventArgs e)
+ {
+ if (chkShipToBilling.Checked)
+ shippingForm.Address = billingForm.Address;
+ }
+
+ ///
+ /// Custom validator to check CC expiration date
+ ///
+ protected void ServerValidate(object source, ServerValidateEventArgs value)
+ {
+ DateTime dt;
+
+ if (DateTime.TryParse(value.Value, out dt))
+ value.IsValid = dt > DateTime.Now;
+ else
+ value.IsValid = false;
+ }
+ }
+}
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Comm_Images/Logo-home.gif
Binary file Demo/Asp.Net/Web/Comm_Images/Logo-home.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Comm_Images/Logo.gif
Binary file Demo/Asp.Net/Web/Comm_Images/Logo.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Comm_Images/bg-body.gif
Binary file Demo/Asp.Net/Web/Comm_Images/bg-body.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Comm_Images/bg-labelLists.gif
Binary file Demo/Asp.Net/Web/Comm_Images/bg-labelLists.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Comm_Images/bg-search.gif
Binary file Demo/Asp.Net/Web/Comm_Images/bg-search.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Comm_Images/bg-sign-in.gif
Binary file Demo/Asp.Net/Web/Comm_Images/bg-sign-in.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Comm_Images/button-back.gif
Binary file Demo/Asp.Net/Web/Comm_Images/button-back.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Comm_Images/button-calculate.gif
Binary file Demo/Asp.Net/Web/Comm_Images/button-calculate.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Comm_Images/button-cart-grey.gif
Binary file Demo/Asp.Net/Web/Comm_Images/button-cart-grey.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Comm_Images/button-cart.gif
Binary file Demo/Asp.Net/Web/Comm_Images/button-cart.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Comm_Images/button-checkout.gif
Binary file Demo/Asp.Net/Web/Comm_Images/button-checkout.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Comm_Images/button-continue.gif
Binary file Demo/Asp.Net/Web/Comm_Images/button-continue.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Comm_Images/button-delete.gif
Binary file Demo/Asp.Net/Web/Comm_Images/button-delete.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Comm_Images/button-home.gif
Binary file Demo/Asp.Net/Web/Comm_Images/button-home.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Comm_Images/button-search.gif
Binary file Demo/Asp.Net/Web/Comm_Images/button-search.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Comm_Images/button-wishlist-grey.gif
Binary file Demo/Asp.Net/Web/Comm_Images/button-wishlist-grey.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Comm_Images/button-wishlist.gif
Binary file Demo/Asp.Net/Web/Comm_Images/button-wishlist.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Comm_Images/dotten-line.gif
Binary file Demo/Asp.Net/Web/Comm_Images/dotten-line.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Comm_Images/home-bg-body.gif
Binary file Demo/Asp.Net/Web/Comm_Images/home-bg-body.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Comm_Images/home-fish.gif
Binary file Demo/Asp.Net/Web/Comm_Images/home-fish.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Comm_Images/seahorse.gif
Binary file Demo/Asp.Net/Web/Comm_Images/seahorse.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Comm_Images/spacer.gif
Binary file Demo/Asp.Net/Web/Comm_Images/spacer.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Comm_Images/vertigo-icon.gif
Binary file Demo/Asp.Net/Web/Comm_Images/vertigo-icon.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Controls/AddressConfirm.ascx
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Asp.Net/Web/Controls/AddressConfirm.ascx Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,12 @@
+<%@ Control Language="C#" AutoEventWireup="true" CodeFile="AddressConfirm.ascx.cs" Inherits="PetShop.Web.AddressConfirm" %>
+
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Controls/AddressConfirm.ascx.cs
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Asp.Net/Web/Controls/AddressConfirm.ascx.cs Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,32 @@
+using System;
+
+using PetShop.ObjectModel;
+
+namespace PetShop.Web
+{
+ public partial class AddressConfirm : System.Web.UI.UserControl
+ {
+ ///
+ /// Control property to set the address
+ ///
+ public Address Address
+ {
+ set
+ {
+ if (value != null)
+ {
+ ltlFirstName.Text = value.FirstName;
+ ltlLastName. Text = value.LastName;
+ ltlAddress1. Text = value.Line1;
+ ltlAddress2. Text = value.Line2;
+ ltlCity. Text = value.City;
+ ltlZip. Text = value.Zip;
+ ltlState. Text = value.State;
+ ltlCountry. Text = value.Country;
+ ltlPhone. Text = value.Phone;
+ ltlEmail. Text = value.Email;
+ }
+ }
+ }
+ }
+}
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Controls/AddressForm.ascx
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Asp.Net/Web/Controls/AddressForm.ascx Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,77 @@
+<%@ Control Language="C#" AutoEventWireup="true" CodeFile="AddressForm.ascx.cs" Inherits="PetShop.Web.AddressForm" %>
+
+
+First Name
+
+
+ | Last Name
+
+
+ |
+
+
+Address
+
+
+
+
+ |
+
+
+City
+
+
+ | State
+
+ CA
+ NY
+ TX
+
+ | Postal Code
+
+
+ |
+
+
+Country
+
+ USA
+ Canada
+ Japan
+
+ | |
+ |
+
+
+Phone Number
+
+ |
+
+
+Email
+
+
+ |
+
+
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Controls/AddressForm.ascx.cs
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Asp.Net/Web/Controls/AddressForm.ascx.cs Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,75 @@
+using System;
+using System.Text.RegularExpressions;
+
+using PetShop.ObjectModel;
+
+namespace PetShop.Web
+{
+ public partial class AddressForm : System.Web.UI.UserControl
+ {
+ ///
+ /// Control property to set or get the address
+ ///
+ public Address Address
+ {
+ get
+ {
+ // Return null if control is empty.
+ //
+ if (string.IsNullOrEmpty(txtFirstName.Text) &&
+ string.IsNullOrEmpty(txtLastName. Text) &&
+ string.IsNullOrEmpty(txtAddress1. Text) &&
+ string.IsNullOrEmpty(txtAddress2. Text) &&
+ string.IsNullOrEmpty(txtCity. Text) &&
+ string.IsNullOrEmpty(txtZip. Text) &&
+ string.IsNullOrEmpty(txtEmail. Text) &&
+ string.IsNullOrEmpty(txtPhone. Text))
+ return null;
+
+ Address addr = new Address();
+
+ // Make sure we clean the input.
+ //
+ addr.FirstName = WebUtility.InputText(txtFirstName.Text, 50);
+ addr.LastName = WebUtility.InputText(txtLastName. Text, 50);
+ addr.Line1 = WebUtility.InputText(txtAddress1. Text, 50);
+ addr.Line2 = WebUtility.InputText(txtAddress2. Text, 50);
+ addr.City = WebUtility.InputText(txtCity. Text, 50);
+ addr.Zip = WebUtility.InputText(txtZip. Text, 10);
+ addr.Phone = WebUtility.InputText(WebUtility.CleanNonWord(txtPhone.Text), 10);
+ addr.Email = WebUtility.InputText(txtEmail.Text, 80);
+ addr.State = WebUtility.InputText(listState. SelectedItem.Value, 2);
+ addr.Country = WebUtility.InputText(listCountry.SelectedItem.Value, 50);
+
+ return addr;
+ }
+
+ set
+ {
+ if (value != null)
+ {
+ txtFirstName.Text = value.FirstName;
+ txtLastName. Text = value.LastName;
+ txtAddress1. Text = value.Line1;
+ txtAddress2. Text = value.Line2;
+ txtCity. Text = value.City;
+ txtZip. Text = value.Zip;
+ txtPhone. Text = value.Phone;
+ txtEmail. Text = value.Email;
+
+ if (!string.IsNullOrEmpty(value.State))
+ {
+ listState.ClearSelection();
+ listState.SelectedValue = value.State;
+ }
+
+ if (!string.IsNullOrEmpty(value.Country))
+ {
+ listCountry.ClearSelection();
+ listCountry.SelectedValue = value.Country;
+ }
+ }
+ }
+ }
+ }
+}
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Controls/BreadCrumbControl.ascx
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Asp.Net/Web/Controls/BreadCrumbControl.ascx Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,2 @@
+<%@ Control Language="C#" AutoEventWireup="true" CodeFile="BreadCrumbControl.ascx.cs" Inherits="PetShop.Web.BreadCrumbControl" %>
+
\ No newline at end of file
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Controls/BreadCrumbControl.ascx.cs
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Asp.Net/Web/Controls/BreadCrumbControl.ascx.cs Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,86 @@
+using System;
+using System.Web.UI.WebControls;
+using System.Web.UI.HtmlControls;
+
+using PetShop.BusinessLogic;
+
+namespace PetShop.Web
+{
+ public partial class BreadCrumbControl : System.Web.UI.UserControl
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ string categoryId = Request.QueryString["categoryId"];
+
+ if (!string.IsNullOrEmpty(categoryId))
+ {
+ ProcessHomePageLink();
+
+ // Process Product page link
+ //
+ HtmlAnchor lnkProducts = new HtmlAnchor();
+
+ lnkProducts.InnerText = new ProductManager().GetCategory(categoryId).Name;
+ lnkProducts.HRef = string.Format("~/Products.aspx?page=0&categoryId={0}", categoryId);
+
+ plhControl.Controls.Add(lnkProducts);
+
+ string productId = Request.QueryString["productId"];
+
+ if (!string.IsNullOrEmpty(productId))
+ {
+ // Process Item page link
+ //
+ plhControl.Controls.Add(GetDivider());
+
+ HtmlAnchor lnkItemDetails = new HtmlAnchor();
+
+ lnkItemDetails.InnerText = new ProductManager().GetProduct(productId).Name;
+ lnkItemDetails.HRef = string.Format("~/Items.aspx?categoryId={0}&productId={1}", categoryId, productId);
+
+ plhControl.Controls.Add(lnkItemDetails);
+ }
+ }
+ else
+ {
+ int len = Request.Url.Segments.Length;
+
+ if (len >= 2 && Request.Url.Segments[len-2].TrimEnd('/', '\\').ToLower() == "admin")
+ {
+ ProcessHomePageLink();
+
+ HtmlAnchor a = new HtmlAnchor();
+
+ a.InnerText = Request.Url.Segments[len - 1].Split('.')[0];
+ a.HRef = Request.Url.PathAndQuery;
+
+ plhControl.Controls.Add(a);
+ }
+ }
+ }
+
+ private void ProcessHomePageLink()
+ {
+ HtmlAnchor lnkHome = new HtmlAnchor();
+
+ lnkHome.InnerText = "Home";
+ lnkHome.HRef = "~/Default.aspx";
+
+ plhControl.Controls.Add(lnkHome);
+ plhControl.Controls.Add(GetDivider());
+ }
+
+ ///
+ /// Create a breadcrumb nodes divider
+ ///
+ /// Literal control containing formatted divider
+ private Literal GetDivider()
+ {
+ Literal ltlDivider = new Literal();
+
+ ltlDivider.Text = " > ";
+
+ return ltlDivider;
+ }
+ }
+}
\ No newline at end of file
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Controls/CartList.ascx
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Asp.Net/Web/Controls/CartList.ascx Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,12 @@
+<%@ Control Language="C#" AutoEventWireup="true" CodeFile="CartList.ascx.cs" Inherits="PetShop.Web.CartList" %>
+
+
+
+ Name | Qty |
+
+
+ <%# Eval("Name") + " " + Eval("Type")%> |
+ <%# Eval("Quantity") %> |
+
+
+
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Controls/CartList.ascx.cs
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Asp.Net/Web/Controls/CartList.ascx.cs Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,20 @@
+using System;
+using System.Collections.Generic;
+using System.Web.UI;
+
+using PetShop.ObjectModel;
+
+namespace PetShop.Web
+{
+ public partial class CartList : UserControl
+ {
+ public void Bind(ICollection cart)
+ {
+ if (cart != null)
+ {
+ repOrdered.DataSource = cart;
+ repOrdered.DataBind();
+ }
+ }
+ }
+}
\ No newline at end of file
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Controls/CreditCardForm.ascx
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Asp.Net/Web/Controls/CreditCardForm.ascx Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,75 @@
+<%@ Control AutoEventWireup="true" CodeFile="CreditCardForm.ascx.cs" Inherits="PetShop.Web.CreditCardForm" Language="C#" %>
+
+
+
+
+ |
+
+
+ Credit Card Type
+
+ Visa
+ Master Card
+ American Express
+ Discovery
+
+
+
+ |
+
+
+ Card Number
+
+
+ *
+
+
+
+
+ |
+
+
+ Expiration Date (MM/YYYY)
+
+
+ *
+
+
+
+
+
+ |
+
+
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Controls/CreditCardForm.ascx.cs
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Asp.Net/Web/Controls/CreditCardForm.ascx.cs Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,50 @@
+using System;
+using System.Web.UI.WebControls;
+
+using PetShop.ObjectModel;
+
+namespace PetShop.Web
+{
+ public partial class CreditCardForm : System.Web.UI.UserControl
+ {
+ ///
+ /// Custom validator to check the expiration date
+ ///
+ protected void ServerValidate(object source, ServerValidateEventArgs value)
+ {
+ DateTime dt;
+
+ if (DateTime.TryParse(value.Value, out dt))
+ value.IsValid = dt > DateTime.Now;
+ else
+ value.IsValid = false;
+ }
+
+ ///
+ /// Property to set/get credit card info
+ ///
+ public CreditCard CreditCard
+ {
+ get
+ {
+ CreditCard cc = new CreditCard();
+
+ cc.Type = WebUtility.InputText(listCctype.SelectedValue, 40);
+ cc.Expiration = WebUtility.InputText(txtExpdate. Text, 7);
+ cc.Number = WebUtility.InputText(txtCcnumber.Text, 20);
+
+ return cc;
+ }
+
+ set
+ {
+ if (value != null)
+ {
+ if (!string.IsNullOrEmpty(value.Number)) txtCcnumber.Text = value.Number;
+ if (!string.IsNullOrEmpty(value.Expiration)) txtExpdate. Text = value.Expiration;
+ if (!string.IsNullOrEmpty(value.Type)) listCctype.Items.FindByValue(value.Type).Selected = true;
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Controls/ItemsControl.ascx
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Asp.Net/Web/Controls/ItemsControl.ascx Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,46 @@
+<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ItemsControl.ascx.cs" Inherits="PetShop.Web.ItemsControl" %>
+<%@ Register TagPrefix="PetShopControl" Namespace="PetShop.Web" %>
+
+
+
+
+
+
+
+
+
+
+
+  %>) |
+ |
+
+
+
+ Name: |
+ <%# string.Format("{0} {1}", Eval("ProductName"), Eval("Name")) %> |
+
+
+ Quantity: |
+ <%# Eval("Quantity") %> |
+
+
+ Price: |
+ <%# Eval("Price", "{0:c}") %> |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+
+ |
+
+
+
+
+
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Controls/ItemsControl.ascx.cs
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Asp.Net/Web/Controls/ItemsControl.ascx.cs Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,21 @@
+using System;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+using PetShop.BusinessLogic;
+
+namespace PetShop.Web
+{
+ public partial class ItemsControl : UserControl
+ {
+ protected void PageChanged(object sender, DataGridPageChangedEventArgs e)
+ {
+ itemsGrid.CurrentPageIndex = e.NewPageIndex;
+
+ string id = Request.QueryString["productId"];
+
+ itemsGrid.DataSource = new ProductManager().GetItemListByProductID(id);
+ itemsGrid.DataBind();
+ }
+ }
+}
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Controls/NavigationControl.ascx
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Asp.Net/Web/Controls/NavigationControl.ascx Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,16 @@
+<%@ Control Language="C#" AutoEventWireup="true" CodeFile="NavigationControl.ascx.cs" Inherits="PetShop.Web.NavigationControl" %>
+<%@ OutputCache Duration="100000" VaryByParam="*" %>
+
+
+
+
+
+
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Controls/NavigationControl.ascx.cs
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Asp.Net/Web/Controls/NavigationControl.ascx.cs Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,69 @@
+using System;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+using PetShop.BusinessLogic;
+
+namespace PetShop.Web
+{
+ public partial class NavigationControl : UserControl
+ {
+ // Control layout property.
+ //
+ private string _controlStyle;
+ protected string ControlStyle
+ {
+ get { return _controlStyle; }
+ }
+
+ // Get properties based on control consumer.
+ //
+ protected void GetControlStyle()
+ {
+ if (Request.ServerVariables["SCRIPT_NAME"].ToLower().IndexOf("default.aspx") > 0)
+ _controlStyle = "navigationLinks";
+ else
+ _controlStyle = "mainNavigation";
+ }
+
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ GetControlStyle();
+ BindCategories();
+
+ // Select current category.
+ //
+ string categoryId = Request.QueryString["categoryId"];
+
+ if (!string.IsNullOrEmpty(categoryId))
+ SelectCategory(categoryId);
+ }
+
+ // Select current category.
+ //
+ private void SelectCategory(string categoryId)
+ {
+ foreach (RepeaterItem item in repCategories.Items)
+ {
+ HiddenField hidCategoryId = (HiddenField)item.FindControl("hidCategoryId");
+
+ if (hidCategoryId.Value.ToLower() == categoryId.ToLower())
+ {
+ HyperLink lnkCategory = (HyperLink)item.FindControl("lnkCategory");
+
+ lnkCategory.ForeColor = System.Drawing.Color.FromArgb(199, 116, 3);
+
+ break;
+ }
+ }
+ }
+
+ // Bind categories.
+ //
+ private void BindCategories()
+ {
+ repCategories.DataSource = new ProductManager().GetCategoryList();
+ repCategories.DataBind();
+ }
+ }
+}
\ No newline at end of file
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Controls/ProductsControl.ascx
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Asp.Net/Web/Controls/ProductsControl.ascx Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,18 @@
+<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ProductsControl.ascx.cs" Inherits="PetShop.Web.ProductsControl" EnableViewState="false" %>
+<%@ Register TagPrefix="PetShopControl" Namespace="PetShop.Web" %>
+<%@ OutputCache Duration="100000" VaryByParam="page;categoryId" %>
+
+
\ No newline at end of file
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Controls/ProductsControl.ascx.cs
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Asp.Net/Web/Controls/ProductsControl.ascx.cs Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,21 @@
+using System;
+using System.Web;
+using System.Web.UI.WebControls;
+
+using PetShop.BusinessLogic;
+
+namespace PetShop.Web
+{
+ public partial class ProductsControl : System.Web.UI.UserControl
+ {
+ protected void PageChanged(object sender, DataGridPageChangedEventArgs e)
+ {
+ productsList.CurrentPageIndex = e.NewPageIndex;
+
+ string id = Request.QueryString["categoryId"];
+
+ productsList.DataSource = new ProductManager().GetProductListByCategoryID(id);
+ productsList.DataBind();
+ }
+ }
+}
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Controls/SearchControl.ascx
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Asp.Net/Web/Controls/SearchControl.ascx Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,19 @@
+<%@ Control Language="C#" AutoEventWireup="true" CodeFile="SearchControl.ascx.cs" Inherits="PetShop.Web.SearchControl" %>
+<%@ OutputCache Duration="100000" VaryByParam="page;keywords" Shared="true" %>
+<%@ Register TagPrefix="PetShopControl" Namespace="PetShop.Web" %>
+
+
+ Search results for <%= Request.QueryString["keywords"] %>:
+
+
+
+
+
+
+
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Controls/SearchControl.ascx.cs
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Asp.Net/Web/Controls/SearchControl.ascx.cs Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,21 @@
+using System;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+using PetShop.BusinessLogic;
+
+namespace PetShop.Web
+{
+ public partial class SearchControl : UserControl
+ {
+ protected void PageChanged(object sender, DataGridPageChangedEventArgs e)
+ {
+ searchList.CurrentPageIndex = e.NewPageIndex;
+
+ string keywordKey = Request.QueryString["keywords"];
+
+ searchList.DataSource = new ProductManager().SearchProducts(keywordKey.Split());
+ searchList.DataBind();
+ }
+ }
+}
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Controls/ShoppingCartControl.ascx
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Asp.Net/Web/Controls/ShoppingCartControl.ascx Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,55 @@
+<%@ Control AutoEventWireup="true" CodeFile="ShoppingCartControl.ascx.cs" Inherits="PetShop.Web.ShoppingCartControl" Language="C#" %>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ |
+
+
+ Total |
+ |
+
+ | |
+
+
+
+
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Controls/ShoppingCartControl.ascx.cs
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Asp.Net/Web/Controls/ShoppingCartControl.ascx.cs Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,98 @@
+using System;
+using System.Collections.Generic;
+using System.Web.UI.WebControls;
+
+using PetShop.ObjectModel;
+
+namespace PetShop.Web
+{
+ public partial class ShoppingCartControl : System.Web.UI.UserControl
+ {
+ protected void Page_PreRender(object sender, EventArgs e)
+ {
+ if (!IsPostBack)
+ BindCart();
+ }
+
+ ///
+ /// Bind repeater to Cart object in Profile
+ ///
+ private void BindCart()
+ {
+ ICollection cart = Profile.ShoppingCart.Items;
+
+ if (cart.Count > 0)
+ {
+ repShoppingCart.DataSource = cart;
+ repShoppingCart.DataBind();
+
+ PrintTotal();
+
+ plhTotal.Visible = true;
+ }
+ else
+ {
+ repShoppingCart.Visible = false;
+ plhTotal. Visible = false;
+ lblMsg. Text = "Your cart is empty.";
+ }
+ }
+
+ ///
+ /// Recalculate the total
+ ///
+ private void PrintTotal()
+ {
+ if (Profile.ShoppingCart.Items.Count > 0)
+ ltlTotal.Text = Profile.ShoppingCart.Total.ToString("c");
+ }
+
+ ///
+ /// Calculate total
+ ///
+ protected void BtnTotal_Click(object sender, System.Web.UI.ImageClickEventArgs e)
+ {
+ TextBox txtQuantity;
+ ImageButton btnDelete;
+ int qty = 0;
+
+ foreach (RepeaterItem row in repShoppingCart.Items)
+ {
+ txtQuantity = (TextBox) row.FindControl("txtQuantity");
+ btnDelete = (ImageButton)row.FindControl("btnDelete");
+
+ if (int.TryParse(WebUtility.InputText(txtQuantity.Text, 10), out qty))
+ {
+ if (qty > 0)
+ Profile.ShoppingCart.SetQuantity(btnDelete.CommandArgument, qty);
+ else if (qty == 0)
+ Profile.ShoppingCart.Remove(btnDelete.CommandArgument);
+ }
+ }
+
+ Profile.Save();
+ BindCart();
+ }
+
+ ///
+ /// Handler for Delete/Move buttons
+ ///
+ protected void CartItem_Command(object sender, CommandEventArgs e)
+ {
+ switch (e.CommandName.ToString())
+ {
+ case "Del":
+ Profile.ShoppingCart.Remove(e.CommandArgument.ToString());
+ break;
+
+ case "Move":
+ Profile.ShoppingCart.Remove(e.CommandArgument.ToString());
+ Profile.WishList.Add(e.CommandArgument.ToString());
+ break;
+ }
+
+ Profile.Save();
+ BindCart();
+ }
+ }
+}
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Controls/WishListControl.ascx
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Asp.Net/Web/Controls/WishListControl.ascx Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,35 @@
+<%@ Control Language="C#" AutoEventWireup="true" CodeFile="WishListControl.ascx.cs" Inherits="PetShop.Web.WishListControl"%>
+
+
+
+
+
+
+
+
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Controls/WishListControl.ascx.cs
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Asp.Net/Web/Controls/WishListControl.ascx.cs Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,60 @@
+using System;
+using System.Collections.Generic;
+using System.Web.UI.WebControls;
+
+using PetShop.ObjectModel;
+
+namespace PetShop.Web
+{
+ public partial class WishListControl : System.Web.UI.UserControl
+ {
+ ///
+ /// Handle Page load event
+ ///
+ protected void Page_PreRender(object sender, EventArgs e)
+ {
+ if (!IsPostBack)
+ BindCart();
+ }
+
+ ///
+ /// Bind repeater to Cart object in Profile
+ ///
+ private void BindCart()
+ {
+ ICollection wishList = Profile.WishList.Items;
+
+ if (wishList.Count > 0)
+ {
+ repWishList.DataSource = wishList;
+ repWishList.DataBind();
+ }
+ else
+ {
+ repWishList.Visible = false;
+ lblMsg.Text = "Your wish list is empty.";
+ }
+ }
+
+ ///
+ /// Handler for Delete/Move buttons
+ ///
+ protected void CartItem_Command(object sender, CommandEventArgs e)
+ {
+ switch (e.CommandName.ToString())
+ {
+ case "Del":
+ Profile.WishList.Remove(e.CommandArgument.ToString());
+ break;
+
+ case "Move":
+ Profile.WishList.Remove(e.CommandArgument.ToString());
+ Profile.ShoppingCart.Add(e.CommandArgument.ToString());
+ break;
+ }
+
+ Profile.Save();
+ BindCart();
+ }
+ }
+}
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Default.aspx
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Asp.Net/Web/Default.aspx Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,90 @@
+<%@ Page AutoEventWireup="true" CodeFile="~/Default.aspx.cs" EnableViewState="false" Inherits="PetShop.Web.Default" Language="C#" %>
+<%@ Register Src="Controls/NavigationControl.ascx" TagName="NavigationControl" TagPrefix="PetShopControl" %>
+
+
+
+
+
+ Welcome to .NET Pet Shop
+
+
+
+
+
+
+
+
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Default.aspx.cs
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Asp.Net/Web/Default.aspx.cs Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,16 @@
+using System;
+using System.Web.UI;
+
+namespace PetShop.Web
+{
+ public partial class Default : Page
+ {
+ ///
+ /// Redirect to Search page
+ ///
+ protected void btnSearch_Click(object sender, EventArgs e)
+ {
+ WebUtility.SearchRedirect(txtSearch.Text);
+ }
+ }
+}
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Error.aspx
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Asp.Net/Web/Error.aspx Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,21 @@
+<%@ Page AutoEventWireup="true" Language="C#" MasterPageFile="~/MasterPage.master" Title="Error" %>
+
+
+
+
+ An error occurred! |
+
+
+
+
+ The system administrator will be checking the web server's event log for details.
+
+ If you have any concerns about a pending transactions please contact the Microsoft
+ .NET Pet Shop on (555) 555-1234.
+
+
+ |
+
+
+
+
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Global.asax
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Asp.Net/Web/Global.asax Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,45 @@
+<%@ Application Language="C#" %>
+<%@ Import Namespace="System.Diagnostics" %>
+<%@ Import Namespace="System.Web" %>
+<%@ Import Namespace="PetShop.ObjectModel" %>
+
+
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Items.aspx
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Asp.Net/Web/Items.aspx Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,6 @@
+<%@ Page AutoEventWireup="true" CodeFile="Items.aspx.cs" Inherits="PetShop.Web.Items" Language="C#" MasterPageFile="~/MasterPage.master" Title="Items" %>
+<%@ Register Src="Controls/ItemsControl.ascx" TagName="ItemsControl" TagPrefix="PetShopControl" %>
+
+
+
+
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Items.aspx.cs
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Asp.Net/Web/Items.aspx.cs Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,15 @@
+using System;
+using System.Web.UI;
+
+using PetShop.BusinessLogic;
+
+namespace PetShop.Web
+{
+ public partial class Items : PageBase
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ Page.Title = new ProductManager().GetProduct(Request.QueryString["productId"]).Name;
+ }
+ }
+}
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/MasterPage.master
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Asp.Net/Web/MasterPage.master Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,133 @@
+<%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="PetShop.Web.MasterPage" %>
+<%@ Register Src="Controls/BreadCrumbControl.ascx" TagName="BreadCrumbControl" TagPrefix="PetShopControl" %>
+<%@ Register Src="Controls/NavigationControl.ascx" TagName="NavigationControl" TagPrefix="PetShopControl" %>
+
+
+
+
+
+ The .NET Pet Shop
+
+
+
+
+
+
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/MasterPage.master.cs
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Asp.Net/Web/MasterPage.master.cs Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,20 @@
+using System;
+using System.Web;
+using System.Web.UI.WebControls;
+
+namespace PetShop.Web
+{
+ public partial class MasterPage : System.Web.UI.MasterPage
+ {
+ protected void Page_PreRender(object sender, EventArgs e)
+ {
+ ltlHeader.Text = Page.Header.Title;
+ Page.Header.Title = string.Format(".NET Pet Shop :: {0}", Page.Header.Title);
+ }
+
+ protected void btnSearch_Click(object sender, EventArgs e)
+ {
+ WebUtility.SearchRedirect(txtSearch.Text);
+ }
+ }
+}
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/NewUser.aspx
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Asp.Net/Web/NewUser.aspx Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,91 @@
+<%@ Page AutoEventWireup="true" Language="C#" MasterPageFile="~/MasterPage.master" Title="New User" %>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ |
+
+ *
+ |
+
+
+
+ |
+
+ *
+ |
+
+
+
+ |
+
+ *
+ |
+
+
+
+
+
+ |
+
+
+
+
+ |
+
+
+
+
+
+
+
+
+ Thank you for signing up.
+ Your account has been created. Now you can:
+ Continue shopping
+ Check out
+ Update your profile
+
+
+
+
+
+
+
+
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Backyard/icon-cat.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Backyard/icon-cat.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Backyard/icon-crab.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Backyard/icon-crab.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Backyard/icon-goose.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Backyard/icon-goose.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Backyard/icon-raccoon.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Backyard/icon-raccoon.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Backyard/icon-sheep.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Backyard/icon-sheep.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Backyard/icon-skunk.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Backyard/icon-skunk.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Backyard/icon-zebra.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Backyard/icon-zebra.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Backyard/item-cat-patterned.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Backyard/item-cat-patterned.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Backyard/item-cat-transparent.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Backyard/item-cat-transparent.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Backyard/item-cat-uncolored.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Backyard/item-cat-uncolored.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Backyard/item-crab-dotted.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Backyard/item-crab-dotted.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Backyard/item-crab-orange.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Backyard/item-crab-orange.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Backyard/item-crab-red.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Backyard/item-crab-red.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Backyard/item-goose-feathered.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Backyard/item-goose-feathered.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Backyard/item-goose-plucked.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Backyard/item-goose-plucked.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Backyard/item-raccoon-hairy-tongue.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Backyard/item-raccoon-hairy-tongue.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Backyard/item-raccoon-long-tongue.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Backyard/item-raccoon-long-tongue.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Backyard/item-raccoon-rough-tongue.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Backyard/item-raccoon-rough-tongue.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Backyard/item-sheep-fuzzy.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Backyard/item-sheep-fuzzy.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Backyard/item-sheep-ironed.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Backyard/item-sheep-ironed.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Backyard/item-skunk-bad-smell.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Backyard/item-skunk-bad-smell.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Backyard/item-skunk-really-bad-smell.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Backyard/item-skunk-really-bad-smell.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Backyard/item-skunk-worst-smell.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Backyard/item-skunk-worst-smell.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Backyard/item-zebra-large.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Backyard/item-zebra-large.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Backyard/item-zebra-medium.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Backyard/item-zebra-medium.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Backyard/item-zebra-small.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Backyard/item-zebra-small.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Backyard/item-zebra-tiny.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Backyard/item-zebra-tiny.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Birds/icon-Duck.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Birds/icon-Duck.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Birds/icon-Owl.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Birds/icon-Owl.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Birds/icon-Pelican.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Birds/icon-Pelican.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Birds/icon-Penguin.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Birds/icon-Penguin.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Birds/icon-Pteranodon.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Birds/icon-Pteranodon.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Birds/item-duck-domestic.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Birds/item-duck-domestic.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Birds/item-duck-wild.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Birds/item-duck-wild.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Birds/item-owl-day.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Birds/item-owl-day.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Birds/item-owl-night.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Birds/item-owl-night.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Birds/item-pelican-flowerloving.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Birds/item-pelican-flowerloving.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Birds/item-pelican-grassloving.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Birds/item-pelican-grassloving.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Birds/item-penguine-adventurous.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Birds/item-penguine-adventurous.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Birds/item-penguine-homey.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Birds/item-penguine-homey.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Birds/item-pteranodon-ancient.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Birds/item-pteranodon-ancient.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Birds/item-pteranodon-old.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Birds/item-pteranodon-old.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Bugs/icon-ant.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Bugs/icon-ant.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Bugs/icon-butterfly.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Bugs/icon-butterfly.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Bugs/icon-dragonfly.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Bugs/icon-dragonfly.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Bugs/icon-frog.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Bugs/icon-frog.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Bugs/icon-slug.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Bugs/icon-slug.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Bugs/icon-spider.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Bugs/icon-spider.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Bugs/item-ant-queen.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Bugs/item-ant-queen.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Bugs/item-ant-soldier.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Bugs/item-ant-soldier.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Bugs/item-ant-worker.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Bugs/item-ant-worker.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Bugs/item-butterfly-adult.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Bugs/item-butterfly-adult.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Bugs/item-butterfly-larva.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Bugs/item-butterfly-larva.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Bugs/item-butterfly-pupa.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Bugs/item-butterfly-pupa.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Bugs/item-dragonfly-omnivore.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Bugs/item-dragonfly-omnivore.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Bugs/item-dragonfly-vegan.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Bugs/item-dragonfly-vegan.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Bugs/item-dragonfly-vegetarian.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Bugs/item-dragonfly-vegetarian.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Bugs/item-frog-false.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Bugs/item-frog-false.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Bugs/item-frog-true.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Bugs/item-frog-true.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Bugs/item-slug-habitat.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Bugs/item-slug-habitat.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Bugs/item-slug-naked.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Bugs/item-slug-naked.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Bugs/item-spider-Aranielladisplicata.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Bugs/item-spider-Aranielladisplicata.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Bugs/item-spider-Dysderacrocata.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Bugs/item-spider-Dysderacrocata.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Endangered/icon-dino.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Endangered/icon-dino.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Endangered/icon-fish.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Endangered/icon-fish.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Endangered/icon-panda.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Endangered/icon-panda.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Endangered/icon-pet.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Endangered/icon-pet.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Endangered/icon-skeleton.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Endangered/icon-skeleton.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Endangered/item-dino-pointy.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Endangered/item-dino-pointy.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Endangered/item-dino-shaved.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Endangered/item-dino-shaved.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Endangered/item-dino-spiky.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Endangered/item-dino-spiky.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Endangered/item-fish-caught.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Endangered/item-fish-caught.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Endangered/item-fish-drunk.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Endangered/item-fish-drunk.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Endangered/item-fish-lost.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Endangered/item-fish-lost.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Endangered/item-panda-exclusive.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Endangered/item-panda-exclusive.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Endangered/item-pet-kitty.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Endangered/item-pet-kitty.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Endangered/item-pet-rover.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Endangered/item-pet-rover.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Endangered/item-pet-thumper.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Endangered/item-pet-thumper.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Endangered/item-skeleton-aphrodite.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Endangered/item-skeleton-aphrodite.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Endangered/item-skeleton-female.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Endangered/item-skeleton-female.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Endangered/item-skeleton-hermaphrodite.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Endangered/item-skeleton-hermaphrodite.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Endangered/item-skeleton-male.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Endangered/item-skeleton-male.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Fish/icon-Ballonfish.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Fish/icon-Ballonfish.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Fish/icon-Blindfish.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Fish/icon-Blindfish.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Fish/icon-crabfish.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Fish/icon-crabfish.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Fish/icon-eucalyptus.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Fish/icon-eucalyptus.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Fish/icon-meno.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Fish/icon-meno.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Fish/icon-misterno.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Fish/icon-misterno.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Fish/icon-nosyfish.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Fish/icon-nosyfish.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Fish/icon-toothferry.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Fish/icon-toothferry.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Fish/item-MisterNo-black.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Fish/item-MisterNo-black.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Fish/item-MisterNo-sable.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Fish/item-MisterNo-sable.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Fish/item-MisterNo-sepia.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Fish/item-MisterNo-sepia.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Fish/item-balloon-extra-stretch.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Fish/item-balloon-extra-stretch.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Fish/item-balloon-flammable.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Fish/item-balloon-flammable.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Fish/item-balloon-natural.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Fish/item-balloon-natural.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Fish/item-blindfish-blind.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Fish/item-blindfish-blind.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Fish/item-blindfish-farsighted.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Fish/item-blindfish-farsighted.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Fish/item-blindfish-shortsighted.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Fish/item-blindfish-shortsighted.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Fish/item-crabfish-ballet.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Fish/item-crabfish-ballet.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Fish/item-crabfish-ballroom.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Fish/item-crabfish-ballroom.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Fish/item-crabfish-tabdance.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Fish/item-crabfish-tabdance.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Fish/item-eucalyptus-longarms.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Fish/item-eucalyptus-longarms.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Fish/item-eucalyptus-shortarms.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Fish/item-eucalyptus-shortarms.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Fish/item-meno-camouflage.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Fish/item-meno-camouflage.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Fish/item-meno-happy.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Fish/item-meno-happy.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Fish/item-meno-worried.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Fish/item-meno-worried.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Fish/item-nosyfish-beastly.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Fish/item-nosyfish-beastly.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Fish/item-nosyfish-invidious.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Fish/item-nosyfish-invidious.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Fish/item-nosyfish-mean.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Fish/item-nosyfish-mean.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Fish/item-nosyfish-sneaky.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Fish/item-nosyfish-sneaky.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Fish/item-toothferry-toothless.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Fish/item-toothferry-toothless.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Prod_Images/Fish/item-toothferry-withteeth.gif
Binary file Demo/Asp.Net/Web/Prod_Images/Fish/item-toothferry-withteeth.gif has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Products.aspx
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Asp.Net/Web/Products.aspx Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,6 @@
+<%@ Page AutoEventWireup="true" Language="C#" MasterPageFile="~/MasterPage.master" Title="Products" Inherits="PetShop.Web.Products" CodeFile="~/Products.aspx.cs" %>
+<%@ Register Src="Controls/ProductsControl.ascx" TagName="ProductsControl" TagPrefix="PetShopControl" %>
+
+
+
+
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Products.aspx.cs
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Asp.Net/Web/Products.aspx.cs Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,15 @@
+using System;
+using System.Web.UI;
+
+using PetShop.BusinessLogic;
+
+namespace PetShop.Web
+{
+ public partial class Products : Page
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ Page.Title = new ProductManager().GetCategory(Request.QueryString["categoryId"]).Name;
+ }
+ }
+}
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Search.aspx
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Asp.Net/Web/Search.aspx Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,7 @@
+<%@ Page AutoEventWireup="true" Language="C#" MasterPageFile="~/MasterPage.master" Title="Search" %>
+<%@ Register Src="Controls/SearchControl.ascx" TagName="SearchControl" TagPrefix="uc1" %>
+<%@ Register TagPrefix="PetShopControl" Namespace="PetShop.Web" %>
+
+
+
+
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/ShoppingCart.aspx
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Asp.Net/Web/ShoppingCart.aspx Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,21 @@
+<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="ShoppingCart.aspx.cs" Inherits="ShoppingCart" Title="Shopping Cart" %>
+<%@ Register Src="Controls/ShoppingCartControl.ascx" TagName="ShoppingCartControl" TagPrefix="PetShopControl" %>
+
+
+
+
+
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/ShoppingCart.aspx.cs
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Asp.Net/Web/ShoppingCart.aspx.cs Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,22 @@
+using System;
+
+public partial class ShoppingCart : System.Web.UI.Page
+{
+ protected void Page_PreInit(object sender, EventArgs e)
+ {
+ if (!IsPostBack)
+ {
+ string itemId = Request.QueryString["addItem"];
+
+ if (!string.IsNullOrEmpty(itemId))
+ {
+ Profile.ShoppingCart.Add(itemId);
+ Profile.Save();
+
+ // Redirect to prevent duplictations in the cart if user hits "Refresh"
+ //
+ Response.Redirect("~/ShoppingCart.aspx", true);
+ }
+ }
+ }
+}
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/SignIn.aspx
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Asp.Net/Web/SignIn.aspx Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,61 @@
+<%@ Page AutoEventWireup="true" Language="C#" MasterPageFile="~/MasterPage.master" Title="Sign In" %>
+
+
+
+
+
+
+
+
+
+
+
+
+ User Name: |
+
+
+ *
+ |
+
+
+
+ Password: |
+
+
+ *
+ |
+
+
+
+
+ |
+
+
+
+
+ |
+
+
+
+
+ |
+
+
+
+ Not registered yet?
+ |
+
+
+
+ |
+
+
+
+
+
+
+
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/UserProfile.aspx
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Asp.Net/Web/UserProfile.aspx Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,26 @@
+<%@ Page AutoEventWireup="true" CodeFile="UserProfile.aspx.cs" Inherits="PetShop.Web.UserProfile" Language="C#" MasterPageFile="~/MasterPage.master" Title="User Profile" %>
+<%@ Register Src="Controls/AddressForm.ascx" TagName="AddressForm" TagPrefix="PetShopControl" %>
+
+
+
+
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/UserProfile.aspx.cs
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Asp.Net/Web/UserProfile.aspx.cs Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,26 @@
+using System;
+
+namespace PetShop.Web
+{
+ public partial class UserProfile : System.Web.UI.Page
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ if (!IsPostBack)
+ BindUser();
+ }
+
+ protected void btnSubmit_Click(object sender, EventArgs e)
+ {
+ Profile.AccountInfo = AddressForm.Address;
+ Profile.Save();
+
+ lblMessage.Text = "Your profile information has been successfully updated. ";
+ }
+
+ private void BindUser()
+ {
+ AddressForm.Address = Profile.AccountInfo;
+ }
+ }
+}
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/Web.config
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Asp.Net/Web/Web.config Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,73 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/WishList.aspx
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Asp.Net/Web/WishList.aspx Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,21 @@
+<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="WishList.aspx.cs" Inherits="WishList" Title="Wish List" %>
+
+<%@ Register Src="Controls/WishListControl.ascx" TagName="WishListControl" TagPrefix="PetShopControl" %>
+
+
+
+
diff -r 000000000000 -r f990fcb411a9 Demo/Asp.Net/Web/WishList.aspx.cs
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Asp.Net/Web/WishList.aspx.cs Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,22 @@
+using System;
+
+public partial class WishList : System.Web.UI.Page
+{
+ protected void Page_PreInit(object sender, EventArgs e)
+ {
+ if (!IsPostBack)
+ {
+ string itemId = Request.QueryString["addItem"];
+
+ if (!string.IsNullOrEmpty(itemId))
+ {
+ Profile.WishList.Add(itemId);
+ Profile.Save();
+
+ // Redirect to prevent duplictations in the wish list if user hits "Refresh"
+ //
+ Response.Redirect("~/WishList.aspx", true);
+ }
+ }
+ }
+}
\ No newline at end of file
diff -r 000000000000 -r f990fcb411a9 Demo/Linq/Demo/App.config
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Linq/Demo/App.config Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
diff -r 000000000000 -r f990fcb411a9 Demo/Linq/Demo/BLToolkit/BLToolkit.3.dll
Binary file Demo/Linq/Demo/BLToolkit/BLToolkit.3.dll has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Linq/Demo/DataModel/BLToolkit.ttinclude
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Linq/Demo/DataModel/BLToolkit.ttinclude Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,495 @@
+<#@ assembly name="System.Core" #>
+<#@ assembly name="System.Data" #>
+<#@ import namespace="System.Collections.Generic" #>
+<#@ import namespace="System.Data" #>
+<#@ import namespace="System.Linq" #>
+<#
+ AppDomain.CurrentDomain.AssemblyResolve += (_,args) =>
+ {
+ if (DataProviderAssembly != null)
+ return System.Reflection.Assembly.LoadFile(DataProviderAssembly);
+ else
+ return null;
+ };
+#><#+
+
+static Action WriteComment = (tt,s) => tt.WriteLine("//{0}", s);
+static Action WriteUsing = (tt,s) => tt.WriteLine("using {0};", s);
+static Action WriteBeginNamespace = (tt,s) => { tt.WriteLine("namespace {0}", s); tt.WriteLine("{"); };
+static Action WriteEndNamespace = tt => tt.WriteLine("}");
+static Action WriteBeginClass = (tt,cl,bc) =>
+{
+ tt.Write("public partial class {0}", cl);
+ if (!string.IsNullOrEmpty(bc))
+ tt.Write(" : {0}", bc);
+ tt.WriteLine("");
+ tt.WriteLine("{");
+};
+static Action WriteEndClass = tt => tt.WriteLine("}");
+static Func MakeGenericType = (c,t) => string.Format("{0}<{1}>", c, t);
+static Func MakeType = t => t;
+static Action WriteTableProperty = (tt,name,maxlen) =>
+{
+ tt.WriteLine("public Table<{0}>{1} {0}{1} {{ get {{ return GetTable<{0}>();{1} }} }}", name, tt.LenDiff(maxlen, name));
+};
+static Action WriteAttribute = (tt,a) => tt.Write("[{0}]", a);
+static Action WriteAttributeLine = tt => tt.WriteLine("");
+
+string ConnectionString;
+string ConnectionType;
+string DataProviderAssembly = null;
+
+string DatabaseName = null;
+string DataContextName = "DataContext";
+string Namespace = "DataModel";
+string BaseDataContextClass = "DbManager";
+string BaseEntityClass = null;
+string OneToManyAssociationType = "IEnumerable<{0}>";
+
+bool RenderField = false;
+
+bool IsMetadataLoaded;
+
+int MaxColumnTypeLen;
+int MaxColumnMemberLen;
+
+static Action RenderColumn = (tt,c,maxLens,attrs) =>
+{
+ if (maxLens.Sum() > 0)
+ {
+ if (attrs.Any(_ => _ != null))
+ {
+ tt.Write("[");
+
+ for (var i = 0; i < attrs.Length; i++)
+ {
+ if (attrs[i] != null)
+ {
+ tt.Write(attrs[i]);
+ tt.WriteSpace(maxLens[i] - attrs[i].Length);
+
+ if (attrs.Skip(i + 1).Any(_ => _ != null))
+ tt.Write(", ");
+ else if (maxLens.Skip(i + 1).Any(_ => _ > 0))
+ tt.WriteSpace(2);
+ }
+ else if (maxLens[i] > 0)
+ {
+ tt.WriteSpace(maxLens[i]);
+
+ if (maxLens.Skip(i + 1).Any(_ => _ > 0))
+ tt.WriteSpace(2);
+ }
+ }
+
+ tt.Write("] ");
+ }
+ else
+ {
+ tt.WriteSpace(maxLens.Sum() + (maxLens.Where(_ => _ > 0).Count() - 1) * 2 + 3);
+ }
+ }
+
+ tt.Write("public {0}{1} {2}", c.Type, tt.LenDiff(tt.MaxColumnTypeLen, c.Type), c.MemberName);
+
+ if (tt.RenderField)
+ tt.WriteLine(";");
+ else
+ tt.WriteLine("{0} {{ get; set; }}", tt.LenDiff(tt.MaxColumnMemberLen, c.MemberName));
+};
+
+static Action RenderForeignKey = (tt,key) =>
+{
+ WriteComment(tt, " " + key.KeyName);
+ tt.WriteLine("[Association(ThisKey=\"{0}\", OtherKey=\"{1}\")]",
+ string.Join(", ", (from c in key.ThisColumns select c.MemberName).ToArray()),
+ string.Join(", ", (from c in key.OtherColumns select c.MemberName).ToArray()));
+
+ tt.Write("public ");
+
+ if (key.AssociationType == AssociationType.OneToMany)
+ tt.Write(tt.OneToManyAssociationType, key.OtherTable.ClassName);
+ else
+ tt.Write(key.OtherTable.ClassName);
+
+ tt.Write(" ");
+ tt.Write(key.MemberName);
+
+ if (tt.RenderField)
+ tt.WriteLine(";");
+ else
+ tt.WriteLine(" { get; set; }");
+};
+
+static Action RenderTable = (tt,t) =>
+{
+ RenderTableAttributes(tt, t);
+
+ WriteBeginClass(tt, t.ClassName, t.BaseClassName);
+
+ tt.PushIndent("\t");
+
+ tt.MaxColumnTypeLen = t.Columns.Values.Max(_ => _.Type.Length);
+ tt.MaxColumnMemberLen = t.Columns.Values.Max(_ => _.MemberName.Length);
+
+ var maxLens = new int[]
+ {
+ t.Columns.Values.Max(_ => _.MemberName == _.ColumnName ? 0 : "MapField('')".Length + _.ColumnName.Length),
+ t.Columns.Values.Max(_ => _.IsNullable ? "Nullable".Length : _.IsIdentity ? "Identity".Length : 0),
+ t.Columns.Values.Max(_ => _.IsIdentity && _.IsNullable ? "Identity".Length : 0),
+ t.Columns.Values.Max(_ => _.IsPrimaryKey ? string.Format("PrimaryKey({0})", _.PKIndex).Length : 0),
+ t.Columns.Values.Max(_ => _.Attributes.Count == 0 ? 0 : string.Join(", ", _.Attributes.Distinct().ToArray()).Length),
+ };
+
+ foreach (var c in from c in t.Columns.Values orderby c.ID select c)
+ {
+ var attrs = new string[]
+ {
+ c.MemberName == c.ColumnName ? null : string.Format("MapField(\"{0}\")", c.ColumnName),
+ c.IsNullable ? "Nullable" : c.IsIdentity ? "Identity" : null,
+ c.IsIdentity && c.IsNullable ? "Identity" : null,
+ c.IsPrimaryKey ? string.Format("PrimaryKey({0})", c.PKIndex) : null,
+ c.Attributes.Count == 0 ? null : string.Join(", ", c.Attributes.Distinct().ToArray()),
+ };
+
+ RenderColumn(tt, c, maxLens, attrs);
+ }
+
+ if (t.ForeignKeys.Count > 0)
+ {
+ foreach (var key in t.ForeignKeys.Values)
+ {
+ tt.WriteLine("");
+ RenderForeignKey(tt, key);
+ }
+ }
+
+ tt.PopIndent();
+ WriteEndClass(tt);
+};
+
+static Action RenderTableAttributes = (tt,t) =>
+{
+ if (t.Attributes.Count > 0)
+ {
+ WriteAttribute(tt, string.Join(", ", t.Attributes.Distinct().ToArray()));
+ WriteAttributeLine(tt);
+ }
+
+ string tbl = "TableName(";
+
+ if (!string.IsNullOrEmpty(tt.DatabaseName))
+ tbl += string.Format("Database=\"{0}\", ", tt.DatabaseName);
+
+ if (!string.IsNullOrEmpty(t.Owner))
+ tbl += string.Format("Owner=\"{0}\", ", t.Owner);
+
+ tbl += string.Format("Name=\"{0}\")", t.TableName);
+
+ WriteAttribute(tt, tbl);
+ WriteAttributeLine(tt);
+};
+
+List Usings = new List()
+{
+ "System",
+ "BLToolkit.Data",
+ "BLToolkit.Data.Linq",
+ "BLToolkit.DataAccess",
+ "BLToolkit.Mapping",
+};
+
+static Action RenderUsing = tt =>
+{
+ var q =
+ from ns in tt.Usings.Distinct()
+ group ns by ns.Split('.')[0];
+
+ var groups =
+ (from ns in q where ns.Key == "System" select ns).Concat
+ (from ns in q where ns.Key != "System" orderby ns.Key select ns);
+
+ foreach (var gr in groups)
+ {
+ foreach (var ns in from s in gr orderby s select s)
+ WriteUsing(tt, ns);
+
+ tt.WriteLine("");
+ }
+};
+
+Action BeforeGenerateModel = _ => {};
+Action AfterGenerateModel = _ => {};
+
+void GenerateModel()
+{
+ BeforeGenerateModel(this);
+
+ if (ConnectionString != null) ConnectionString = ConnectionString.Trim();
+ if (DataContextName != null) DataContextName = DataContextName. Trim();
+
+ if (string.IsNullOrEmpty(ConnectionString)) { Error("ConnectionString cannot be empty."); return; }
+ if (string.IsNullOrEmpty(DataContextName)) { Error("DataContextName cannot be empty."); return; }
+
+ LoadMetadata();
+
+ WriteComment(this, "---------------------------------------------------------------------------------------------------");
+ WriteComment(this, " ");
+ WriteComment(this, " This code was generated by BLToolkit template for T4.");
+ WriteComment(this, " Changes to this file may cause incorrect behavior and will be lost if the code is regenerated.");
+ WriteComment(this, " ");
+ WriteComment(this, "---------------------------------------------------------------------------------------------------");
+
+ RenderUsing(this);
+
+ WriteBeginNamespace(this, Namespace);
+ PushIndent("\t");
+
+ WriteBeginClass(this, DataContextName, BaseDataContextClass);
+
+ var tlist = (from t in Tables.Values orderby t.TableName select t).ToList();
+ var maxlen = tlist.Max(_ => _.ClassName.Length);
+
+ PushIndent("\t");
+
+ foreach (var t in tlist)
+ WriteTableProperty(this, t.ClassName, maxlen);
+
+ PopIndent();
+
+ WriteEndClass(this);
+
+ foreach (var t in tlist)
+ {
+ WriteLine("");
+ RenderTable(this, t);
+ }
+
+ PopIndent();
+ WriteEndNamespace(this);
+
+ AfterGenerateModel(this);
+}
+
+string LenDiff(int max, string str)
+{
+ var s = "";
+
+ while (max-- > str.Length)
+ s += " ";
+
+ return s;
+}
+
+void WriteSpace(int len)
+{
+ while (len-- > 0)
+ Write(" ");
+}
+
+List CreateList(T item)
+{
+ return new List();
+}
+
+System.Data.IDbConnection GetConnection()
+{
+ Type connType = null;
+
+ if (DataProviderAssembly != null)
+ {
+ try
+ {
+ var assembly = System.Reflection.Assembly.LoadFile(DataProviderAssembly);
+ connType = assembly.GetType(ConnectionType);
+ }
+ catch
+ {
+ }
+ }
+
+ if (connType == null)
+ connType = Type.GetType(ConnectionType);
+
+ var conn = (System.Data.IDbConnection)Activator.CreateInstance(connType);
+
+ conn.ConnectionString = ConnectionString;
+ conn.Open();
+
+ return conn;
+}
+
+void LoadMetadata()
+{
+ if (IsMetadataLoaded)
+ return;
+
+ IsMetadataLoaded = true;
+
+ BeforeLoadMetadata(this);
+ LoadServerMetadata();
+
+ foreach (var t in Tables.Values)
+ {
+ if (t.ClassName.Contains(" "))
+ {
+ var ss = t.ClassName.Split(' ').Where(_ => _.Trim().Length > 0).Select(_ => char.ToUpper(_[0]) + _.Substring(1));
+ t.ClassName = string.Join("", ss.ToArray());
+ }
+ }
+
+ foreach (var t in Tables.Values)
+ foreach (var key in t.ForeignKeys.Values.ToList())
+ if (!key.KeyName.EndsWith("_BackReference"))
+ key.OtherTable.ForeignKeys.Add(key.KeyName + "_BackReference", key.BackReference = new ForeignKey
+ {
+ KeyName = key.KeyName + "_BackReference",
+ MemberName = key.MemberName + "_BackReference",
+ AssociationType = AssociationType.Auto,
+ OtherTable = t,
+ ThisColumns = key.OtherColumns,
+ OtherColumns = key.ThisColumns
+ });
+
+ foreach (var t in Tables.Values)
+ {
+ foreach (var key in t.ForeignKeys.Values)
+ {
+ if (key.BackReference != null && key.AssociationType == AssociationType.Auto)
+ {
+ if (key.ThisColumns.All(_ => _.IsPrimaryKey))
+ {
+ if (t.Columns.Values.Count(_ => _.IsPrimaryKey) == key.ThisColumns.Count)
+ key.AssociationType = AssociationType.OneToOne;
+ else
+ key.AssociationType = AssociationType.ManyToOne;
+ }
+ else
+ key.AssociationType = AssociationType.ManyToOne;
+ }
+ }
+ }
+
+ foreach (var t in Tables.Values)
+ {
+ foreach (var key in t.ForeignKeys.Values)
+ {
+ var name = key.MemberName;
+
+ if (key.BackReference != null && key.ThisColumns.Count == 1 && key.ThisColumns[0].MemberName.ToLower().EndsWith("id"))
+ {
+ name = key.ThisColumns[0].MemberName;
+ name = name.Substring(0, name.Length - "id".Length);
+
+ if (!t.ForeignKeys.Values.Select(_ => _.MemberName).Concat(
+ t.Columns. Values.Select(_ => _.MemberName)).Concat(
+ new[] { t.ClassName }).Any(_ => _ == name))
+ {
+ name = key.MemberName;;
+ }
+ }
+
+ if (name == key.MemberName)
+ {
+ if (name.StartsWith("FK_"))
+ name = name.Substring(3);
+
+ if (name.EndsWith("_BackReference"))
+ name = name.Substring(0, name.Length - "_BackReference".Length);
+
+ name = string.Join("", name.Split('_').Where(_ => _.Length > 0 && _ != t.TableName).ToArray());
+
+ if (key.AssociationType == AssociationType.OneToMany)
+ name += "s";
+ }
+
+ if (name.Length != 0 &&
+ !t.ForeignKeys.Values.Select(_ => _.MemberName).Concat(
+ t.Columns. Values.Select(_ => _.MemberName)).Concat(
+ new[] { t.ClassName }).Any(_ => _ == name))
+ {
+ key.MemberName = name;
+ }
+ }
+ }
+
+ if (Tables.Values.SelectMany(_ => _.ForeignKeys.Values).Any(_ => _.AssociationType == AssociationType.OneToMany))
+ Usings.Add("System.Collections.Generic");
+
+ AfterLoadMetadata(this);
+}
+
+Action BeforeLoadMetadata = _ => {};
+Action AfterLoadMetadata = _ => {};
+
+Dictionary Tables = new Dictionary();
+
+partial class Table
+{
+ public string Owner;
+ public string TableName;
+ public string ClassName;
+ public string BaseClassName;
+ public bool IsView;
+ public List Attributes = new List();
+
+ public Dictionary Columns = new Dictionary();
+ public Dictionary ForeignKeys = new Dictionary();
+}
+
+partial class Column
+{
+ public int ID;
+ public string ColumnName;
+ public string MemberName;
+ public bool IsNullable;
+ public bool IsIdentity;
+ public string Type;
+ public bool IsClass;
+ public DbType DbType;
+ public SqlDbType SqlDbType;
+ public int PKIndex = -1;
+ public List Attributes = new List();
+
+ public bool IsPrimaryKey { get { return PKIndex >= 0; } }
+}
+
+enum AssociationType
+{
+ Auto,
+ OneToOne,
+ OneToMany,
+ ManyToOne,
+}
+
+partial class ForeignKey
+{
+ public string KeyName;
+ public string MemberName;
+ public Table OtherTable;
+ public List ThisColumns = new List();
+ public List OtherColumns = new List();
+ public ForeignKey BackReference;
+
+ private AssociationType _associationType = AssociationType.Auto;
+ public AssociationType AssociationType
+ {
+ get { return _associationType; }
+ set
+ {
+ _associationType = value;
+
+ if (BackReference != null)
+ {
+ switch (value)
+ {
+ case AssociationType.Auto : BackReference.AssociationType = AssociationType.Auto; break;
+ case AssociationType.OneToOne : BackReference.AssociationType = AssociationType.OneToOne; break;
+ case AssociationType.OneToMany : BackReference.AssociationType = AssociationType.ManyToOne; break;
+ case AssociationType.ManyToOne : BackReference.AssociationType = AssociationType.OneToMany; break;
+ }
+ }
+ }
+ }
+}
+#>
diff -r 000000000000 -r f990fcb411a9 Demo/Linq/Demo/DataModel/MSSQL.ttinclude
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Linq/Demo/DataModel/MSSQL.ttinclude Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,252 @@
+<#
+ ConnectionType = typeof(System.Data.SqlClient.SqlConnection).AssemblyQualifiedName;
+#><#+
+private void LoadServerMetadata()
+{
+ var tables = CreateList(new { ID = "", Table = new Table() });
+ var columns = CreateList(new { ID = "", Column = new Column() });
+
+ using (var conn = GetConnection())
+ using (var cmd = conn.CreateCommand())
+ {
+ // Load tables & vies.
+ //
+ cmd.CommandText = @"
+ SELECT
+ TABLE_CATALOG + '.' + TABLE_SCHEMA + '.' + TABLE_NAME,
+ TABLE_SCHEMA,
+ TABLE_NAME,
+ TABLE_TYPE
+ FROM
+ INFORMATION_SCHEMA.TABLES s
+ LEFT JOIN sys.tables t ON OBJECT_ID(TABLE_CATALOG + '.' + TABLE_SCHEMA + '.' + TABLE_NAME) = t.object_id
+ WHERE
+ t.object_id IS NULL OR
+ t.is_ms_shipped <> 1 AND
+ (
+ SELECT
+ major_id
+ FROM
+ sys.extended_properties
+ WHERE
+ major_id = t.object_id and
+ minor_id = 0 and
+ class = 1 and
+ name = N'microsoft_database_tools_support'
+ ) IS NULL";
+
+ using (var rd = cmd.ExecuteReader())
+ {
+ while (rd.Read())
+ {
+ var t = new
+ {
+ ID = Convert.ToString(rd[0]),
+ Table = new Table
+ {
+ Owner = rd[1].ToString(),
+ TableName = rd[2].ToString(),
+ ClassName = rd[2].ToString(),
+ IsView = rd[3].ToString() == "VIEW",
+ BaseClassName = BaseEntityClass,
+ }
+ };
+
+ tables.Add(t);
+ }
+ }
+
+ // Load columns.
+ //
+ cmd.CommandText = @"
+ SELECT
+ (TABLE_CATALOG + '.' + TABLE_SCHEMA + '.' + TABLE_NAME) as id,
+ CASE WHEN IS_NULLABLE = 'YES' THEN 1 ELSE 0 END as isNullable,
+ ORDINAL_POSITION as colid,
+ COLUMN_NAME as name,
+ c.DATA_TYPE as dataType,
+ CHARACTER_MAXIMUM_LENGTH as length,
+ ISNULL(NUMERIC_PRECISION, DATETIME_PRECISION) AS prec,
+ NUMERIC_SCALE as scale,
+ COLUMNPROPERTY(object_id('[' + TABLE_SCHEMA + '].[' + TABLE_NAME + ']'), COLUMN_NAME, 'IsIdentity') as isIdentity
+ FROM
+ INFORMATION_SCHEMA.COLUMNS c";
+
+ using (var rd = cmd.ExecuteReader())
+ {
+ while (rd.Read())
+ {
+ var col = new
+ {
+ ID = Convert.ToString(rd["id"]),
+ Column = new Column
+ {
+ ID = Convert.ToInt16 (rd["colid"]),
+ ColumnName = Convert.ToString (rd["name"]),
+ MemberName = Convert.ToString (rd["name"]),
+ IsNullable = Convert.ToBoolean(rd["isNullable"]),
+ IsIdentity = Convert.ToBoolean(rd["isIdentity"]),
+ }
+ };
+
+ var c = col.Column;
+
+ switch (Convert.ToString(rd["dataType"]))
+ {
+ case "image" : c.Type = "byte[]"; c.DbType = DbType.Binary; c.SqlDbType = SqlDbType.Image; break;
+ case "text" : c.Type = "string"; c.DbType = DbType.String; c.SqlDbType = SqlDbType.Text; break;
+ case "binary" : c.Type = "byte[]"; c.DbType = DbType.Binary; c.SqlDbType = SqlDbType.Binary; break;
+ case "tinyint" : c.Type = "byte"; c.DbType = DbType.Byte; c.SqlDbType = SqlDbType.TinyInt; break;
+ case "date" : c.Type = "DateTime"; c.DbType = DbType.Date; c.SqlDbType = SqlDbType.Date; break;
+ case "time" : c.Type = "DateTime"; c.DbType = DbType.Time; c.SqlDbType = SqlDbType.Time; break;
+ case "bit" : c.Type = "bool"; c.DbType = DbType.Boolean; c.SqlDbType = SqlDbType.Bit; break;
+ case "smallint" : c.Type = "short"; c.DbType = DbType.Int16; c.SqlDbType = SqlDbType.SmallInt; break;
+ case "decimal" : c.Type = "decimal"; c.DbType = DbType.Decimal; c.SqlDbType = SqlDbType.Decimal; break;
+ case "int" : c.Type = "int"; c.DbType = DbType.Int32; c.SqlDbType = SqlDbType.Int; break;
+ case "smalldatetime" : c.Type = "DateTime"; c.DbType = DbType.DateTime; c.SqlDbType = SqlDbType.SmallDateTime; break;
+ case "real" : c.Type = "float"; c.DbType = DbType.Single; c.SqlDbType = SqlDbType.Real; break;
+ case "money" : c.Type = "decimal"; c.DbType = DbType.Currency; c.SqlDbType = SqlDbType.Money; break;
+ case "datetime" : c.Type = "DateTime"; c.DbType = DbType.DateTime; c.SqlDbType = SqlDbType.DateTime; break;
+ case "float" : c.Type = "double"; c.DbType = DbType.Double; c.SqlDbType = SqlDbType.Float; break;
+ case "numeric" : c.Type = "decimal"; c.DbType = DbType.Decimal; c.SqlDbType = SqlDbType.Decimal; break;
+ case "smallmoney" : c.Type = "decimal"; c.DbType = DbType.Currency; c.SqlDbType = SqlDbType.SmallMoney; break;
+ case "datetime2" : c.Type = "DateTime"; c.DbType = DbType.DateTime2; c.SqlDbType = SqlDbType.DateTime2; break;
+ case "bigint" : c.Type = "long"; c.DbType = DbType.Int64; c.SqlDbType = SqlDbType.BigInt; break;
+ case "varbinary" : c.Type = "byte[]"; c.DbType = DbType.Binary; c.SqlDbType = SqlDbType.VarBinary; break;
+ case "timestamp" : c.Type = "byte[]"; c.DbType = DbType.Binary; c.SqlDbType = SqlDbType.Timestamp; break;
+ case "sysname" : c.Type = "string"; c.DbType = DbType.String; c.SqlDbType = SqlDbType.NVarChar; break;
+ case "nvarchar" : c.Type = "string"; c.DbType = DbType.String; c.SqlDbType = SqlDbType.NVarChar; break;
+ case "varchar" : c.Type = "string"; c.DbType = DbType.AnsiString; c.SqlDbType = SqlDbType.VarChar; break;
+ case "ntext" : c.Type = "string"; c.DbType = DbType.String; c.SqlDbType = SqlDbType.NText; break;
+ case "uniqueidentifier" : c.Type = "Guid"; c.DbType = DbType.Binary; c.SqlDbType = SqlDbType.UniqueIdentifier; break;
+ case "datetimeoffset" : c.Type = "DateTimeOffset"; c.DbType = DbType.DateTimeOffset; c.SqlDbType = SqlDbType.DateTimeOffset; break;
+ case "sql_variant" : c.Type = "object"; c.DbType = DbType.Binary; c.SqlDbType = SqlDbType.Variant; break;
+ case "xml" : c.Type = "string"; c.DbType = DbType.Xml; c.SqlDbType = SqlDbType.Xml; break;
+
+//hierarchyid
+//geometry
+//geography
+
+ case "char" :
+ c.Type = Convert.ToInt32 (rd["length"]) == 1 ? "char" : "string";
+ c.DbType = DbType.AnsiStringFixedLength;
+ c.SqlDbType = SqlDbType.Char;
+ break;
+
+ case "nchar" :
+ c.Type = Convert.ToInt32 (rd["length"]) == 1 ? "char" : "string";
+ c.DbType = DbType.StringFixedLength;
+ c.SqlDbType = SqlDbType.NChar;
+ break;
+ }
+
+ switch (c.Type)
+ {
+ case "string" :
+ case "byte[]" : c.IsClass = true; break;
+ }
+
+ if (c.IsNullable && !c.IsClass)
+ c.Type += "?";
+
+ columns.Add(col);
+ }
+ }
+
+ // Load PKs.
+ //
+ cmd.CommandText = @"
+ SELECT
+ (k.TABLE_CATALOG + '.' + k.TABLE_SCHEMA + '.' + k.TABLE_NAME) as id,
+ k.CONSTRAINT_NAME as name,
+ k.COLUMN_NAME as colname,
+ k.ORDINAL_POSITION as colid
+ FROM
+ INFORMATION_SCHEMA.KEY_COLUMN_USAGE k
+ JOIN INFORMATION_SCHEMA.TABLE_CONSTRAINTS c ON k.CONSTRAINT_NAME = c.CONSTRAINT_NAME
+ WHERE
+ c.CONSTRAINT_TYPE='PRIMARY KEY'";
+
+ using (var rd = cmd.ExecuteReader())
+ {
+ while (rd.Read())
+ {
+ var id = Convert.ToString(rd["id"]);
+ var colid = Convert.ToInt32 (rd["colid"]);
+ var colname = Convert.ToString(rd["colname"]);
+
+ columns.Single(_ => _.ID == id && _.Column.ColumnName == colname).Column.PKIndex = colid;
+ }
+ }
+
+ // Load FKs.
+ //
+ cmd.CommandText = @"
+ SELECT
+ rc.CONSTRAINT_NAME as Name,
+ fk.TABLE_CATALOG + '.' + fk.TABLE_SCHEMA + '.' + fk.TABLE_NAME as ThisTable,
+ fk.COLUMN_NAME as ThisColumn,
+ pk.TABLE_CATALOG + '.' + pk.TABLE_SCHEMA + '.' + pk.TABLE_NAME as OtherTable,
+ pk.COLUMN_NAME as OtherColumn,
+ cu.ORDINAL_POSITION as Ordinal
+ FROM
+ INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS rc
+ JOIN INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE fk
+ ON
+ rc.CONSTRAINT_CATALOG = fk.CONSTRAINT_CATALOG AND
+ rc.CONSTRAINT_NAME = fk.CONSTRAINT_NAME
+ JOIN INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE pk
+ ON
+ rc.UNIQUE_CONSTRAINT_CATALOG = pk.CONSTRAINT_CATALOG AND
+ rc.UNIQUE_CONSTRAINT_NAME = pk.CONSTRAINT_NAME
+ JOIN INFORMATION_SCHEMA.KEY_COLUMN_USAGE cu
+ ON
+ rc.CONSTRAINT_NAME = cu.CONSTRAINT_NAME
+ ORDER BY
+ ThisTable,
+ Ordinal";
+
+ using (var rd = cmd.ExecuteReader())
+ {
+ while (rd.Read())
+ {
+ var name = Convert.ToString(rd["Name"]);
+ var thisTableID = Convert.ToString(rd["ThisTable"]);
+ var otherTableID = Convert.ToString(rd["OtherTable"]);
+ var thisColumnName = Convert.ToString(rd["ThisColumn"]);
+ var otherColumnName = Convert.ToString(rd["OtherColumn"]);
+
+ var thisTable = (from t in tables where t.ID == thisTableID select t.Table).Single();
+ var otherTable = (from t in tables where t.ID == otherTableID select t.Table).Single();
+ var thisColumn = (from c in columns where c.ID == thisTableID && c.Column.ColumnName == thisColumnName select c.Column).Single();
+ var otherColumn = (from c in columns where c.ID == otherTableID && c.Column.ColumnName == otherColumnName select c.Column).Single();
+
+ if (thisTable.ForeignKeys.ContainsKey(name) == false)
+ thisTable.ForeignKeys.Add(name, new ForeignKey { KeyName = name, MemberName = name, OtherTable = otherTable });
+
+ var key = thisTable.ForeignKeys[name];
+
+ key.ThisColumns. Add(thisColumn);
+ key.OtherColumns.Add(otherColumn);
+ }
+ }
+ }
+
+ var qc =
+ from c in columns
+ group c by c.ID into gr
+ join t in tables on gr.Key equals t.ID
+ select new { t.Table, gr };
+
+ foreach (var c in qc)
+ {
+ foreach (var col in from col in c.gr orderby col.Column.ID select col.Column)
+ c.Table.Columns.Add(col.ColumnName, col);
+
+ if (c.Table.Owner == "dbo")
+ c.Table.Owner = null;
+
+ Tables.Add(c.Table.TableName, c.Table);
+ }
+}
+#>
\ No newline at end of file
diff -r 000000000000 -r f990fcb411a9 Demo/Linq/Demo/DataModel/Northwind.sql
Binary file Demo/Linq/Demo/DataModel/Northwind.sql has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Linq/Demo/DataModel/NorthwindDB.cs
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Linq/Demo/DataModel/NorthwindDB.cs Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,21 @@
+using System;
+using BLToolkit.Data.Linq;
+using BLToolkit.Mapping;
+
+namespace Linq.Demo.DataModel
+{
+ partial class NorthwindDB
+ {
+ public Table DiscontinuedProduct { get { return GetTable(); } }
+ public Table ActiveProduct { get { return GetTable(); } }
+ }
+
+ [InheritanceMapping(Code="True", Type=typeof(DiscontinuedProduct))]
+ [InheritanceMapping(Code="False", Type=typeof(ActiveProduct))]
+ abstract partial class Product
+ {
+ }
+
+ public class ActiveProduct : Product {}
+ public class DiscontinuedProduct : Product {}
+}
diff -r 000000000000 -r f990fcb411a9 Demo/Linq/Demo/DataModel/NorthwindDB.generated.cs
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Linq/Demo/DataModel/NorthwindDB.generated.cs Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,488 @@
+//---------------------------------------------------------------------------------------------------
+//
+// This code was generated by BLToolkit template for T4.
+// Changes to this file may cause incorrect behavior and will be lost if the code is regenerated.
+//
+//---------------------------------------------------------------------------------------------------
+using System;
+using System.Collections.Generic;
+
+using BLToolkit.Data;
+using BLToolkit.Data.Linq;
+using BLToolkit.DataAccess;
+using BLToolkit.Mapping;
+
+namespace Linq.Demo.DataModel
+{
+ public partial class NorthwindDB : DbManager
+ {
+ public Table AlphabeticalListOfProduct { get { return GetTable(); } }
+ public Table Category { get { return GetTable(); } }
+ public Table CategorySalesFor1997 { get { return GetTable(); } }
+ public Table CurrentProductList { get { return GetTable(); } }
+ public Table CustomerAndSuppliersByCity { get { return GetTable(); } }
+ public Table CustomerCustomerDemo { get { return GetTable(); } }
+ public Table CustomerDemographic { get { return GetTable(); } }
+ public Table Customer { get { return GetTable(); } }
+ public Table Employee { get { return GetTable(); } }
+ public Table EmployeeTerritory { get { return GetTable(); } }
+ public Table Invoice { get { return GetTable(); } }
+ public Table OrderDetail { get { return GetTable(); } }
+ public Table OrderDetailsExtended { get { return GetTable(); } }
+ public Table OrderSubtotal { get { return GetTable(); } }
+ public Table Order { get { return GetTable(); } }
+ public Table OrdersQry { get { return GetTable(); } }
+ public Table ProductSalesFor1997 { get { return GetTable(); } }
+ public Table Product { get { return GetTable(); } }
+ public Table ProductsAboveAveragePrice { get { return GetTable(); } }
+ public Table ProductsByCategory { get { return GetTable(); } }
+ public Table QuarterlyOrder { get { return GetTable(); } }
+ public Table Region { get { return GetTable(); } }
+ public Table SalesByCategory { get { return GetTable(); } }
+ public Table SalesTotalsByAmount { get { return GetTable(); } }
+ public Table Shipper { get { return GetTable(); } }
+ public Table SummaryOfSalesByQuarter { get { return GetTable(); } }
+ public Table SummaryOfSalesByYear { get { return GetTable(); } }
+ public Table Supplier { get { return GetTable(); } }
+ public Table Territory { get { return GetTable(); } }
+ }
+
+ [TableName(Name="Alphabetical list of products")]
+ public partial class AlphabeticalListOfProduct
+ {
+ public int ProductID { get; set; }
+ public string ProductName { get; set; }
+ [Nullable] public int? SupplierID { get; set; }
+ [Nullable] public int? CategoryID { get; set; }
+ [Nullable] public string QuantityPerUnit { get; set; }
+ [Nullable] public decimal? UnitPrice { get; set; }
+ [Nullable] public short? UnitsInStock { get; set; }
+ [Nullable] public short? UnitsOnOrder { get; set; }
+ [Nullable] public short? ReorderLevel { get; set; }
+ public bool Discontinued { get; set; }
+ public string CategoryName { get; set; }
+ }
+
+ [TableName(Name="Categories")]
+ public partial class Category
+ {
+ [Identity, PrimaryKey(1)] public int CategoryID { get; set; }
+ public string CategoryName { get; set; }
+ [Nullable ] public string Description { get; set; }
+ [Nullable ] public byte[] Picture { get; set; }
+
+ // FK_Products_Categories_BackReference
+ [Association(ThisKey="CategoryID", OtherKey="CategoryID")]
+ public List Products { get; set; }
+ }
+
+ [TableName(Name="Category Sales for 1997")]
+ public partial class CategorySalesFor1997
+ {
+ public string CategoryName { get; set; }
+ [Nullable] public decimal? CategorySales { get; set; }
+ }
+
+ [TableName(Name="Current Product List")]
+ public partial class CurrentProductList
+ {
+ [Identity] public int ProductID { get; set; }
+ public string ProductName { get; set; }
+ }
+
+ [TableName(Name="Customer and Suppliers by City")]
+ public partial class CustomerAndSuppliersByCity
+ {
+ [Nullable] public string City { get; set; }
+ public string CompanyName { get; set; }
+ [Nullable] public string ContactName { get; set; }
+ public string Relationship { get; set; }
+ }
+
+ [TableName(Name="CustomerCustomerDemo")]
+ public partial class CustomerCustomerDemo
+ {
+ [PrimaryKey(1)] public string CustomerID { get; set; }
+ [PrimaryKey(2)] public string CustomerTypeID { get; set; }
+
+ // FK_CustomerCustomerDemo
+ [Association(ThisKey="CustomerTypeID", OtherKey="CustomerTypeID")]
+ public CustomerDemographic FK_CustomerCustomerDemo { get; set; }
+
+ // FK_CustomerCustomerDemo_Customers
+ [Association(ThisKey="CustomerID", OtherKey="CustomerID")]
+ public Customer Customer { get; set; }
+ }
+
+ [TableName(Name="CustomerDemographics")]
+ public partial class CustomerDemographic
+ {
+ [ PrimaryKey(1)] public string CustomerTypeID { get; set; }
+ [Nullable ] public string CustomerDesc { get; set; }
+
+ // FK_CustomerCustomerDemo_BackReference
+ [Association(ThisKey="CustomerTypeID", OtherKey="CustomerTypeID")]
+ public List CustomerCustomerDemo { get; set; }
+ }
+
+ [TableName(Name="Customers")]
+ public partial class Customer
+ {
+ [ PrimaryKey(1)] public string CustomerID { get; set; }
+ public string CompanyName { get; set; }
+ [Nullable ] public string ContactName { get; set; }
+ [Nullable ] public string ContactTitle { get; set; }
+ [Nullable ] public string Address { get; set; }
+ [Nullable ] public string City { get; set; }
+ [Nullable ] public string Region { get; set; }
+ [Nullable ] public string PostalCode { get; set; }
+ [Nullable ] public string Country { get; set; }
+ [Nullable ] public string Phone { get; set; }
+ [Nullable ] public string Fax { get; set; }
+
+ // FK_Orders_Customers_BackReference
+ [Association(ThisKey="CustomerID", OtherKey="CustomerID")]
+ public List Orders { get; set; }
+
+ // FK_CustomerCustomerDemo_Customers_BackReference
+ [Association(ThisKey="CustomerID", OtherKey="CustomerID")]
+ public List CustomerCustomerDemo { get; set; }
+ }
+
+ [TableName(Name="Employees")]
+ public partial class Employee
+ {
+ [Identity, PrimaryKey(1)] public int EmployeeID { get; set; }
+ public string LastName { get; set; }
+ public string FirstName { get; set; }
+ [Nullable ] public string Title { get; set; }
+ [Nullable ] public string TitleOfCourtesy { get; set; }
+ [Nullable ] public DateTime? BirthDate { get; set; }
+ [Nullable ] public DateTime? HireDate { get; set; }
+ [Nullable ] public string Address { get; set; }
+ [Nullable ] public string City { get; set; }
+ [Nullable ] public string Region { get; set; }
+ [Nullable ] public string PostalCode { get; set; }
+ [Nullable ] public string Country { get; set; }
+ [Nullable ] public string HomePhone { get; set; }
+ [Nullable ] public string Extension { get; set; }
+ [Nullable ] public byte[] Photo { get; set; }
+ [Nullable ] public string Notes { get; set; }
+ [Nullable ] public int? ReportsTo { get; set; }
+ [Nullable ] public string PhotoPath { get; set; }
+
+ // FK_Employees_Employees
+ [Association(ThisKey="ReportsTo", OtherKey="EmployeeID")]
+ public Employee ReportsToEmployee { get; set; }
+
+ // FK_Orders_Employees_BackReference
+ [Association(ThisKey="EmployeeID", OtherKey="EmployeeID")]
+ public List Orders { get; set; }
+
+ // FK_EmployeeTerritories_Employees_BackReference
+ [Association(ThisKey="EmployeeID", OtherKey="EmployeeID")]
+ public List EmployeeTerritories { get; set; }
+
+ // FK_Employees_Employees_BackReference
+ [Association(ThisKey="EmployeeID", OtherKey="ReportsTo")]
+ public List Reporters { get; set; }
+ }
+
+ [TableName(Name="EmployeeTerritories")]
+ public partial class EmployeeTerritory
+ {
+ [PrimaryKey(1)] public int EmployeeID { get; set; }
+ [PrimaryKey(2)] public string TerritoryID { get; set; }
+
+ // FK_EmployeeTerritories_Employees
+ [Association(ThisKey="EmployeeID", OtherKey="EmployeeID")]
+ public Employee Employee { get; set; }
+
+ // FK_EmployeeTerritories_Territories
+ [Association(ThisKey="TerritoryID", OtherKey="TerritoryID")]
+ public Territory Territory { get; set; }
+ }
+
+ [TableName(Name="Invoices")]
+ public partial class Invoice
+ {
+ [Nullable] public string ShipName { get; set; }
+ [Nullable] public string ShipAddress { get; set; }
+ [Nullable] public string ShipCity { get; set; }
+ [Nullable] public string ShipRegion { get; set; }
+ [Nullable] public string ShipPostalCode { get; set; }
+ [Nullable] public string ShipCountry { get; set; }
+ [Nullable] public string CustomerID { get; set; }
+ public string CustomerName { get; set; }
+ [Nullable] public string Address { get; set; }
+ [Nullable] public string City { get; set; }
+ [Nullable] public string Region { get; set; }
+ [Nullable] public string PostalCode { get; set; }
+ [Nullable] public string Country { get; set; }
+ public string Salesperson { get; set; }
+ public int OrderID { get; set; }
+ [Nullable] public DateTime? OrderDate { get; set; }
+ [Nullable] public DateTime? RequiredDate { get; set; }
+ [Nullable] public DateTime? ShippedDate { get; set; }
+ public string ShipperName { get; set; }
+ public int ProductID { get; set; }
+ public string ProductName { get; set; }
+ public decimal UnitPrice { get; set; }
+ public short Quantity { get; set; }
+ public float Discount { get; set; }
+ [Nullable] public decimal? ExtendedPrice { get; set; }
+ [Nullable] public decimal? Freight { get; set; }
+ }
+
+ [TableName(Name="Order Details")]
+ public partial class OrderDetail
+ {
+ [PrimaryKey(1)] public int OrderID { get; set; }
+ [PrimaryKey(2)] public int ProductID { get; set; }
+ public decimal UnitPrice { get; set; }
+ public short Quantity { get; set; }
+ public float Discount { get; set; }
+
+ // FK_Order_Details_Orders
+ [Association(ThisKey="OrderID", OtherKey="OrderID")]
+ public Order Order { get; set; }
+
+ // FK_Order_Details_Products
+ [Association(ThisKey="ProductID", OtherKey="ProductID")]
+ public Product Product { get; set; }
+ }
+
+ [TableName(Name="Order Details Extended")]
+ public partial class OrderDetailsExtended
+ {
+ public int OrderID { get; set; }
+ public int ProductID { get; set; }
+ public string ProductName { get; set; }
+ public decimal UnitPrice { get; set; }
+ public short Quantity { get; set; }
+ public float Discount { get; set; }
+ [Nullable] public decimal? ExtendedPrice { get; set; }
+ }
+
+ [TableName(Name="Order Subtotals")]
+ public partial class OrderSubtotal
+ {
+ public int OrderID { get; set; }
+ [Nullable] public decimal? Subtotal { get; set; }
+ }
+
+ [TableName(Name="Orders")]
+ public partial class Order
+ {
+ [Identity, PrimaryKey(1)] public int OrderID { get; set; }
+ [Nullable ] public string CustomerID { get; set; }
+ [Nullable ] public int? EmployeeID { get; set; }
+ [Nullable ] public DateTime? OrderDate { get; set; }
+ [Nullable ] public DateTime? RequiredDate { get; set; }
+ [Nullable ] public DateTime? ShippedDate { get; set; }
+ [Nullable ] public int? ShipVia { get; set; }
+ [Nullable ] public decimal? Freight { get; set; }
+ [Nullable ] public string ShipName { get; set; }
+ [Nullable ] public string ShipAddress { get; set; }
+ [Nullable ] public string ShipCity { get; set; }
+ [Nullable ] public string ShipRegion { get; set; }
+ [Nullable ] public string ShipPostalCode { get; set; }
+ [Nullable ] public string ShipCountry { get; set; }
+
+ // FK_Orders_Customers
+ [Association(ThisKey="CustomerID", OtherKey="CustomerID")]
+ public Customer Customer { get; set; }
+
+ // FK_Orders_Employees
+ [Association(ThisKey="EmployeeID", OtherKey="EmployeeID")]
+ public Employee Employee { get; set; }
+
+ // FK_Orders_Shippers
+ [Association(ThisKey="ShipVia", OtherKey="ShipperID")]
+ public Shipper Shipper { get; set; }
+
+ // FK_Order_Details_Orders_BackReference
+ [Association(ThisKey="OrderID", OtherKey="OrderID")]
+ public List OrderDetails { get; set; }
+ }
+
+ [TableName(Name="Orders Qry")]
+ public partial class OrdersQry
+ {
+ public int OrderID { get; set; }
+ [Nullable] public string CustomerID { get; set; }
+ [Nullable] public int? EmployeeID { get; set; }
+ [Nullable] public DateTime? OrderDate { get; set; }
+ [Nullable] public DateTime? RequiredDate { get; set; }
+ [Nullable] public DateTime? ShippedDate { get; set; }
+ [Nullable] public int? ShipVia { get; set; }
+ [Nullable] public decimal? Freight { get; set; }
+ [Nullable] public string ShipName { get; set; }
+ [Nullable] public string ShipAddress { get; set; }
+ [Nullable] public string ShipCity { get; set; }
+ [Nullable] public string ShipRegion { get; set; }
+ [Nullable] public string ShipPostalCode { get; set; }
+ [Nullable] public string ShipCountry { get; set; }
+ public string CompanyName { get; set; }
+ [Nullable] public string Address { get; set; }
+ [Nullable] public string City { get; set; }
+ [Nullable] public string Region { get; set; }
+ [Nullable] public string PostalCode { get; set; }
+ [Nullable] public string Country { get; set; }
+ }
+
+ [TableName(Name="Product Sales for 1997")]
+ public partial class ProductSalesFor1997
+ {
+ public string CategoryName { get; set; }
+ public string ProductName { get; set; }
+ [Nullable] public decimal? ProductSales { get; set; }
+ }
+
+ [TableName(Name="Products")]
+ public partial class Product
+ {
+ [Identity, PrimaryKey(1) ] public int ProductID { get; set; }
+ public string ProductName { get; set; }
+ [Nullable ] public int? SupplierID { get; set; }
+ [Nullable ] public int? CategoryID { get; set; }
+ [Nullable ] public string QuantityPerUnit { get; set; }
+ [Nullable ] public decimal? UnitPrice { get; set; }
+ [Nullable ] public short? UnitsInStock { get; set; }
+ [Nullable ] public short? UnitsOnOrder { get; set; }
+ [Nullable ] public short? ReorderLevel { get; set; }
+ [ MapField(IsInheritanceDiscriminator=true)] public bool Discontinued { get; set; }
+
+ // FK_Products_Categories
+ [Association(ThisKey="CategoryID", OtherKey="CategoryID")]
+ public Category Category { get; set; }
+
+ // FK_Products_Suppliers
+ [Association(ThisKey="SupplierID", OtherKey="SupplierID")]
+ public Supplier Supplier { get; set; }
+
+ // FK_Order_Details_Products_BackReference
+ [Association(ThisKey="ProductID", OtherKey="ProductID")]
+ public List OrderDetails { get; set; }
+ }
+
+ [TableName(Name="Products Above Average Price")]
+ public partial class ProductsAboveAveragePrice
+ {
+ public string ProductName { get; set; }
+ [Nullable] public decimal? UnitPrice { get; set; }
+ }
+
+ [TableName(Name="Products by Category")]
+ public partial class ProductsByCategory
+ {
+ public string CategoryName { get; set; }
+ public string ProductName { get; set; }
+ [Nullable] public string QuantityPerUnit { get; set; }
+ [Nullable] public short? UnitsInStock { get; set; }
+ public bool Discontinued { get; set; }
+ }
+
+ [TableName(Name="Quarterly Orders")]
+ public partial class QuarterlyOrder
+ {
+ [Nullable] public string CustomerID { get; set; }
+ [Nullable] public string CompanyName { get; set; }
+ [Nullable] public string City { get; set; }
+ [Nullable] public string Country { get; set; }
+ }
+
+ [TableName(Name="Region")]
+ public partial class Region
+ {
+ [PrimaryKey(1)] public int RegionID { get; set; }
+ public string RegionDescription { get; set; }
+
+ // FK_Territories_Region_BackReference
+ [Association(ThisKey="RegionID", OtherKey="RegionID")]
+ public List Territories { get; set; }
+ }
+
+ [TableName(Name="Sales by Category")]
+ public partial class SalesByCategory
+ {
+ public int CategoryID { get; set; }
+ public string CategoryName { get; set; }
+ public string ProductName { get; set; }
+ [Nullable] public decimal? ProductSales { get; set; }
+ }
+
+ [TableName(Name="Sales Totals by Amount")]
+ public partial class SalesTotalsByAmount
+ {
+ [Nullable] public decimal? SaleAmount { get; set; }
+ public int OrderID { get; set; }
+ public string CompanyName { get; set; }
+ [Nullable] public DateTime? ShippedDate { get; set; }
+ }
+
+ [TableName(Name="Shippers")]
+ public partial class Shipper
+ {
+ [Identity, PrimaryKey(1)] public int ShipperID { get; set; }
+ public string CompanyName { get; set; }
+ [Nullable ] public string Phone { get; set; }
+
+ // FK_Orders_Shippers_BackReference
+ [Association(ThisKey="ShipperID", OtherKey="ShipVia")]
+ public List Orders { get; set; }
+ }
+
+ [TableName(Name="Summary of Sales by Quarter")]
+ public partial class SummaryOfSalesByQuarter
+ {
+ [Nullable] public DateTime? ShippedDate { get; set; }
+ public int OrderID { get; set; }
+ [Nullable] public decimal? Subtotal { get; set; }
+ }
+
+ [TableName(Name="Summary of Sales by Year")]
+ public partial class SummaryOfSalesByYear
+ {
+ [Nullable] public DateTime? ShippedDate { get; set; }
+ public int OrderID { get; set; }
+ [Nullable] public decimal? Subtotal { get; set; }
+ }
+
+ [TableName(Name="Suppliers")]
+ public partial class Supplier
+ {
+ [Identity, PrimaryKey(1)] public int SupplierID { get; set; }
+ public string CompanyName { get; set; }
+ [Nullable ] public string ContactName { get; set; }
+ [Nullable ] public string ContactTitle { get; set; }
+ [Nullable ] public string Address { get; set; }
+ [Nullable ] public string City { get; set; }
+ [Nullable ] public string Region { get; set; }
+ [Nullable ] public string PostalCode { get; set; }
+ [Nullable ] public string Country { get; set; }
+ [Nullable ] public string Phone { get; set; }
+ [Nullable ] public string Fax { get; set; }
+ [Nullable ] public string HomePage { get; set; }
+
+ // FK_Products_Suppliers_BackReference
+ [Association(ThisKey="SupplierID", OtherKey="SupplierID")]
+ public List Products { get; set; }
+ }
+
+ [TableName(Name="Territories")]
+ public partial class Territory
+ {
+ [PrimaryKey(1)] public string TerritoryID { get; set; }
+ public string TerritoryDescription { get; set; }
+ public int RegionID { get; set; }
+
+ // FK_Territories_Region
+ [Association(ThisKey="RegionID", OtherKey="RegionID")]
+ public Region Region { get; set; }
+
+ // FK_EmployeeTerritories_Territories_BackReference
+ [Association(ThisKey="TerritoryID", OtherKey="TerritoryID")]
+ public List EmployeeTerritories { get; set; }
+ }
+}
diff -r 000000000000 -r f990fcb411a9 Demo/Linq/Demo/DataModel/NorthwindDB.tt
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Linq/Demo/DataModel/NorthwindDB.tt Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,38 @@
+<#@ template language="C#v3.5" debug="True" #>
+<#@ output extension=".generated.cs" #>
+<#@ include file="BLToolkit.ttinclude" #>
+<#@ include file="MSSQL.ttinclude" #>
+<#
+ ConnectionString = "Data Source=.;Database=Northwind;Integrated Security=SSPI";
+ Namespace = "Linq.Demo.DataModel";
+ DataContextName = "NorthwindDB";
+
+ OneToManyAssociationType = "List<{0}>";
+
+ LoadMetadata();
+
+ foreach (var t in Tables.Values)
+ {
+ if (t.ClassName.EndsWith("ies"))
+ t.ClassName = t.ClassName.Substring(0, t.ClassName.Length - 3) + "y";
+ else if (t.ClassName.EndsWith("s"))
+ t.ClassName = t.ClassName.Substring(0, t.ClassName.Length - 1);
+
+ foreach (var a in t.ForeignKeys.Values)
+ {
+ if (a.MemberName.EndsWith("ies"))
+ a.MemberName = a.MemberName.Substring(0, a.MemberName.Length - 3) + "y";
+ else if (a.MemberName.EndsWith("s"))
+ a.MemberName = a.MemberName.Substring(0, a.MemberName.Length - 1);
+ }
+ }
+
+ Tables["Employees"]. ForeignKeys["FK_Employees_Employees"]. MemberName = "ReportsToEmployee";
+ Tables["Employees"]. ForeignKeys["FK_Employees_Employees_BackReference"].MemberName = "Reporters";
+ Tables["Order Details"].ForeignKeys["FK_Order_Details_Orders"]. MemberName = "Order";
+ Tables["Order Details"].ForeignKeys["FK_Order_Details_Products"]. MemberName = "Product";
+
+ Tables["Products"].Columns["Discontinued"].Attributes.Add("MapField(IsInheritanceDiscriminator=true)");
+
+ GenerateModel();
+#>
diff -r 000000000000 -r f990fcb411a9 Demo/Linq/Demo/Linq.Demo.2008.csproj
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Linq/Demo/Linq.Demo.2008.csproj Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,85 @@
+
+
+
+ Debug
+ AnyCPU
+ 9.0.30729
+ 2.0
+ {57CE5505-44CB-42E4-A346-3471F68A5B60}
+ Exe
+ Properties
+ Linq.Demo
+ Linq.Demo
+ v3.5
+ 512
+
+
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+ False
+ BLToolkit\BLToolkit.3.dll
+
+
+
+ 3.5
+
+
+ 3.5
+
+
+ 3.5
+
+
+ 3.5
+
+
+
+
+
+
+
+ True
+ True
+ NorthwindDB.tt
+
+
+
+
+
+
+
+
+ TextTemplatingFileGenerator
+ NorthwindDB.generated.cs
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff -r 000000000000 -r f990fcb411a9 Demo/Linq/Demo/Linq.Demo.2008.sln
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Linq/Demo/Linq.Demo.2008.sln Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,20 @@
+
+Microsoft Visual Studio Solution File, Format Version 10.00
+# Visual Studio 2008
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Linq.Demo.2008", "Linq.Demo.2008.csproj", "{57CE5505-44CB-42E4-A346-3471F68A5B60}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {57CE5505-44CB-42E4-A346-3471F68A5B60}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {57CE5505-44CB-42E4-A346-3471F68A5B60}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {57CE5505-44CB-42E4-A346-3471F68A5B60}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {57CE5505-44CB-42E4-A346-3471F68A5B60}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff -r 000000000000 -r f990fcb411a9 Demo/Linq/Demo/Linq.Demo.2010.csproj
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Linq/Demo/Linq.Demo.2010.csproj Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,160 @@
+
+
+
+ Debug
+ AnyCPU
+ 9.0.30729
+ 2.0
+ {57CE5505-44CB-42E4-A346-3471F68A5B60}
+ Exe
+ Properties
+ Linq.Demo
+ Linq.Demo
+ v4.0
+ 512
+
+
+ 3.5
+
+ publish\
+ true
+ Disk
+ false
+ Foreground
+ 7
+ Days
+ false
+ false
+ true
+ 0
+ 1.0.0.%2a
+ false
+ false
+ true
+
+
+
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+ AllRules.ruleset
+
+
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+ AllRules.ruleset
+
+
+ true
+ bin\DebugMono\
+ DEBUG;TRACE
+ full
+ AnyCPU
+ bin\Debug\Linq.Demo.exe.CodeAnalysisLog.xml
+ true
+ GlobalSuppressions.cs
+ prompt
+ AllRules.ruleset
+ ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets
+ false
+ ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules
+ false
+
+
+ bin\ReleaseMono\
+ TRACE
+ true
+ pdbonly
+ AnyCPU
+ bin\Release\Linq.Demo.exe.CodeAnalysisLog.xml
+ true
+ GlobalSuppressions.cs
+ prompt
+ AllRules.ruleset
+ ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets
+ false
+ ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules
+ false
+
+
+
+
+ 3.5
+
+
+ 3.5
+
+
+ 3.5
+
+
+ 3.5
+
+
+
+
+
+
+ Component
+
+
+ True
+ True
+ NorthwindDB.tt
+ Component
+
+
+
+
+
+
+
+
+
+ TextTemplatingFileGenerator
+ NorthwindDB.generated.cs
+
+
+
+
+ False
+ .NET Framework 3.5 SP1 Client Profile
+ false
+
+
+ False
+ .NET Framework 3.5 SP1
+ true
+
+
+ False
+ Windows Installer 3.1
+ true
+
+
+
+
+ {0C325F5D-E50E-4340-8724-D29896CCC583}
+ BLToolkit.4
+
+
+
+
+
+
+
+
\ No newline at end of file
diff -r 000000000000 -r f990fcb411a9 Demo/Linq/Demo/Linq.Demo.2010.sln
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Linq/Demo/Linq.Demo.2010.sln Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,26 @@
+
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2010
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Linq.Demo.2010", "Linq.Demo.2010.csproj", "{57CE5505-44CB-42E4-A346-3471F68A5B60}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BLToolkit.4", "..\..\..\Source\BLToolkit.4.csproj", "{0C325F5D-E50E-4340-8724-D29896CCC583}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {57CE5505-44CB-42E4-A346-3471F68A5B60}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {57CE5505-44CB-42E4-A346-3471F68A5B60}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {57CE5505-44CB-42E4-A346-3471F68A5B60}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {57CE5505-44CB-42E4-A346-3471F68A5B60}.Release|Any CPU.Build.0 = Release|Any CPU
+ {0C325F5D-E50E-4340-8724-D29896CCC583}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {0C325F5D-E50E-4340-8724-D29896CCC583}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {0C325F5D-E50E-4340-8724-D29896CCC583}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {0C325F5D-E50E-4340-8724-D29896CCC583}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff -r 000000000000 -r f990fcb411a9 Demo/Linq/Demo/Program.cs
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Linq/Demo/Program.cs Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,740 @@
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Linq;
+using System.Linq.Expressions;
+
+using BLToolkit.Data;
+using BLToolkit.Data.Linq;
+
+namespace Linq.Demo
+{
+ using DataModel;
+
+ static class Program
+ {
+ static void Main()
+ {
+ DbManager.TraceSwitch = new TraceSwitch("DbManager", "DbManager trace switch", "Info");
+
+ FirstTest();
+ CountTest();
+ SingleTableTest();
+ SelectManyTest();
+ InnerJoinTest();
+ LeftJoinTest();
+ AssociationInnerJoinTest();
+ AssociationCountTest();
+ AssociationObjectTest();
+ MultiLevelAssociationTest();
+ CompareAssociationTest();
+ GroupByAssociationTest();
+ InheritanceTest1();
+ InheritanceTest2();
+ StringLengthTest();
+ StringCompareTest();
+ MathRoundCompare1Test();
+ MathRoundCompare2Test();
+ MathRoundCompare3Test();
+ SimpleSelectTest();
+ InsertTest1();
+ InsertTest2();
+ MultipleInsertTest1();
+ MultipleInsertTest2();
+ InsertWithIdentityTest1();
+ InsertWithIdentityTest2();
+ UpdateTest1();
+ UpdateTest2();
+ UpdateTest3();
+ SelfUpdateTest();
+ DeleteTest1();
+ DeleteTest2();
+ SqlLengthTest();
+ SqlRoundCompare1Test();
+ SqlSelectLengthTest();
+ SqlSelectLengthAsSqlTest();
+ RoundToEvenTest();
+ MethodExpressionTest();
+ CompiledQueryTest();
+ }
+
+ static void FirstTest()
+ {
+ using (var db = new NorthwindDB())
+ {
+ var query = db.Employee;
+
+ foreach (var employee in query)
+ {
+ Console.WriteLine("{0} {1}", employee.EmployeeID, employee.FirstName);
+ }
+ }
+ }
+
+ static void CountTest()
+ {
+ using (var db = new NorthwindDB())
+ {
+ int count = db.Employee.Count();
+
+ Console.WriteLine(count);
+ }
+ }
+
+ static void SingleTableTest()
+ {
+ using (var db = new NorthwindDB())
+ {
+ var query =
+ from e in db.Employee
+ where e.EmployeeID > 5
+ orderby e.LastName, e.FirstName
+ select e;
+
+ foreach (var employee in query)
+ {
+ Console.WriteLine("{0} {1}, {2}", employee.EmployeeID, employee.LastName, employee.FirstName);
+ }
+ }
+ }
+
+ static void SelectManyTest()
+ {
+ using (var db = new NorthwindDB())
+ {
+ var query =
+ from c in db.Category
+ from p in db.Product
+ where p.CategoryID == c.CategoryID
+ select new
+ {
+ c.CategoryName,
+ p.ProductName
+ };
+
+ foreach (var item in query)
+ {
+ Console.WriteLine(item);
+ }
+ }
+ }
+
+ static void InnerJoinTest()
+ {
+ using (var db = new NorthwindDB())
+ {
+ var query =
+ from p in db.Product
+ join c in db.Category on p.CategoryID equals c.CategoryID
+ select new
+ {
+ c.CategoryName,
+ p.ProductName
+ };
+
+ foreach (var item in query)
+ {
+ Console.WriteLine(item);
+ }
+ }
+ }
+
+ static void LeftJoinTest()
+ {
+ using (var db = new NorthwindDB())
+ {
+ var query =
+ from p in db.Product
+ join c in db.Category on p.CategoryID equals c.CategoryID into g
+ from c in g.DefaultIfEmpty()
+ select new
+ {
+ c.CategoryName,
+ p.ProductName
+ };
+
+ foreach (var item in query)
+ {
+ Console.WriteLine(item);
+ }
+ }
+ }
+
+ static void AssociationInnerJoinTest()
+ {
+ using (var db = new NorthwindDB())
+ {
+ var query =
+ from p in db.Product
+ select new
+ {
+ p.Category.CategoryName,
+ p.ProductName
+ };
+
+ foreach (var item in query)
+ {
+ Console.WriteLine(item);
+ }
+ }
+ }
+
+ static void AssociationCountTest()
+ {
+ using (var db = new NorthwindDB())
+ {
+ var query =
+ from p in db.Product
+ select new
+ {
+ p.OrderDetails.Count,
+ p.ProductName
+ };
+
+ foreach (var item in query)
+ {
+ Console.WriteLine(item);
+ }
+ }
+ }
+
+ static void AssociationObjectTest()
+ {
+ using (var db = new NorthwindDB())
+ {
+ var query =
+ from o in db.Order
+ select new Order
+ {
+ OrderID = o.OrderID,
+ Customer = o.Customer
+ };
+
+ foreach (var item in query)
+ {
+ Console.WriteLine(item);
+ }
+ }
+ }
+
+ static void MultiLevelAssociationTest()
+ {
+ using (var db = new NorthwindDB())
+ {
+ var query =
+ from o in db.OrderDetail
+ select new
+ {
+ o.Product.ProductName,
+ o.Order.OrderID,
+ o.Order.Employee.ReportsToEmployee.Region
+ };
+
+ foreach (var item in query)
+ {
+ Console.WriteLine(item);
+ }
+ }
+ }
+
+ static void CompareAssociationTest()
+ {
+ using (var db = new NorthwindDB())
+ {
+ var query =
+ from o in db.Order
+ from t in db.EmployeeTerritory
+ where o.Employee == t.Employee
+ select new
+ {
+ o.OrderID,
+ o.EmployeeID,
+ t.TerritoryID
+ };
+
+ foreach (var item in query)
+ {
+ Console.WriteLine(item);
+ }
+ }
+ }
+
+ static void GroupByAssociationTest()
+ {
+ using (var db = new NorthwindDB())
+ {
+ var query =
+ from p in db.Product
+ group p by p.Category into g
+ where g.Count() == 12
+ select g.Key.CategoryName;
+
+ foreach (var item in query)
+ {
+ Console.WriteLine(item);
+ }
+ }
+ }
+
+ static void InheritanceTest1()
+ {
+ using (var db = new NorthwindDB())
+ {
+ var query = from p in db.DiscontinuedProduct select p;
+
+ foreach (var item in query)
+ {
+ Console.WriteLine(item);
+ }
+ }
+ }
+
+ static void InheritanceTest2()
+ {
+ using (var db = new NorthwindDB())
+ {
+ var query =
+ from p in db.Product
+ where p is DiscontinuedProduct
+ select p;
+
+ foreach (var item in query)
+ {
+ Console.WriteLine(item);
+ }
+ }
+ }
+
+ static void StringLengthTest()
+ {
+ using (var db = new NorthwindDB())
+ {
+ var query =
+ from c in db.Customer
+ where c.ContactName.Length > 5
+ select c.ContactName;
+
+ foreach (var item in query)
+ {
+ Console.WriteLine(item);
+ }
+ }
+ }
+
+ static void StringCompareTest()
+ {
+ using (var db = new NorthwindDB())
+ {
+ var query =
+ from c in db.Customer
+ where c.ContactName.CompareTo("John") > 0
+ select c.ContactName;
+
+ foreach (var item in query)
+ {
+ Console.WriteLine(item);
+ }
+ }
+ }
+
+ static void MathRoundCompare1Test()
+ {
+ using (var db = new NorthwindDB())
+ {
+ var query =
+ from o in db.Order
+ where Math.Round(o.Freight.Value) >= 10
+ select o.Freight;
+
+ foreach (var item in query)
+ {
+ Console.WriteLine(item);
+ }
+ }
+ }
+
+ static void MathRoundCompare2Test()
+ {
+ using (var db = new NorthwindDB())
+ {
+ var query =
+ from o in db.Order
+ where Math.Round(o.OrderDetails.Sum(d => d.Quantity * d.UnitPrice)) >= 10
+ select o.Freight;
+
+ foreach (var item in query)
+ {
+ Console.WriteLine(item);
+ }
+ }
+ }
+
+ static void MathRoundCompare3Test()
+ {
+ using (var db = new NorthwindDB())
+ {
+ var query =
+ from o in db.Order
+ let sum = o.OrderDetails.Sum(d => d.Quantity * d.UnitPrice)
+ where Math.Round(sum) >= 10
+ select o.Freight;
+
+ foreach (var item in query)
+ {
+ Console.WriteLine(item);
+ }
+ }
+ }
+
+ static void SimpleSelectTest()
+ {
+ using (var db = new NorthwindDB())
+ {
+ var value = db.Select(() => Sql.CurrentTimestamp);
+
+ Console.WriteLine(value);
+ }
+ }
+
+ static void InsertTest1()
+ {
+ using (var db = new NorthwindDB())
+ {
+ var value = db.Employee.Insert(() => new Employee
+ {
+ FirstName = "John",
+ LastName = "Shepard",
+ Title = "Spectre",
+ HireDate = Sql.CurrentTimestamp
+ });
+
+ Console.WriteLine(value);
+
+ db.Employee.Delete(e => e.LastName == "Shepard");
+ }
+ }
+
+ static void InsertTest2()
+ {
+ using (var db = new NorthwindDB())
+ {
+ var value =
+ db
+ .Into(db.Employee)
+ .Value(e => e.FirstName, "John")
+ .Value(e => e.LastName, "Shepard")
+ .Value(e => e.Title, "Spectre")
+ .Value(e => e.HireDate, () => Sql.CurrentTimestamp)
+ .Insert();
+
+ Console.WriteLine(value);
+
+ db.Employee.Delete(e => e.LastName == "Shepard");
+ }
+ }
+
+ static void MultipleInsertTest1()
+ {
+ using (var db = new NorthwindDB())
+ {
+ var value =
+ db.Region
+ .Where(r => r.RegionID > 2)
+ .Insert(db.Region, r => new Region()
+ {
+ RegionID = r.RegionID + 100,
+ RegionDescription = "Copy Of " + r.RegionDescription
+ });
+
+ Console.WriteLine(value);
+
+ db.Region.Delete(r => r.RegionDescription.StartsWith("Copy Of "));
+ }
+ }
+
+ static void MultipleInsertTest2()
+ {
+ using (var db = new NorthwindDB())
+ {
+ var value =
+ db.Region
+ .Where(r => r.RegionID > 2)
+ .Into(db.Region)
+ .Value(r => r.RegionID, r => r.RegionID + 100)
+ .Value(r => r.RegionDescription, r => "Copy Of " + r.RegionDescription)
+ .Insert();
+
+ Console.WriteLine(value);
+
+ db.Region.Delete(r => r.RegionDescription.StartsWith("Copy Of "));
+ }
+ }
+
+ static void InsertWithIdentityTest1()
+ {
+ using (var db = new NorthwindDB())
+ {
+ var value = db.Employee.InsertWithIdentity(() => new Employee
+ {
+ FirstName = "John",
+ LastName = "Shepard",
+ Title = "Spectre",
+ HireDate = Sql.CurrentTimestamp
+ });
+
+ Console.WriteLine(value);
+
+ db.Employee.Delete(e => e.EmployeeID == Convert.ToInt32(value));
+ }
+ }
+
+ static void InsertWithIdentityTest2()
+ {
+ using (var db = new NorthwindDB())
+ {
+ var value =
+ db
+ .Into(db.Employee)
+ .Value(e => e.FirstName, "John")
+ .Value(e => e.LastName, "Shepard")
+ .Value(e => e.Title, () => "Spectre")
+ .Value(e => e.HireDate, () => Sql.CurrentTimestamp)
+ .InsertWithIdentity();
+
+ Console.WriteLine(value);
+
+ db.Employee.Delete(e => e.EmployeeID == Convert.ToInt32(value));
+ }
+ }
+
+ static void UpdateTest1()
+ {
+ using (var db = new NorthwindDB())
+ {
+ var value =
+ db.Employee
+ .Update(
+ e => e.Title == "Spectre",
+ e => new Employee
+ {
+ Title = "Commander"
+ });
+
+ Console.WriteLine(value);
+ }
+ }
+
+ static void UpdateTest2()
+ {
+ using (var db = new NorthwindDB())
+ {
+ var value =
+ db.Employee
+ .Where(e => e.Title == "Spectre")
+ .Update(e => new Employee
+ {
+ Title = "Commander"
+ });
+
+ Console.WriteLine(value);
+ }
+ }
+
+ static void UpdateTest3()
+ {
+ using (var db = new NorthwindDB())
+ {
+ var value =
+ db.Employee
+ .Where(e => e.Title == "Spectre")
+ .Set(e => e.Title, "Commander")
+ .Update();
+
+ Console.WriteLine(value);
+ }
+ }
+
+ static void SelfUpdateTest()
+ {
+ using (var db = new NorthwindDB())
+ {
+ var value =
+ db.Employee
+ .Where(e => e.Title == "Spectre")
+ .Set(e => e.HireDate, e => e.HireDate.Value.AddDays(10))
+ .Update();
+
+ Console.WriteLine(value);
+ }
+ }
+
+ static void DeleteTest1()
+ {
+ using (var db = new NorthwindDB())
+ {
+ var value = db.Employee.Delete(e => e.Title == "Spectre");
+
+ Console.WriteLine(value);
+ }
+ }
+
+ static void DeleteTest2()
+ {
+ using (var db = new NorthwindDB())
+ {
+ var value =
+ db.Employee
+ .Where(e => e.Title == "Spectre")
+ .Delete();
+
+ Console.WriteLine(value);
+ }
+ }
+
+ static void SqlLengthTest()
+ {
+ using (var db = new NorthwindDB())
+ {
+ var query =
+ from c in db.Customer
+ where Sql.Length(c.ContactName) > 5
+ select c.ContactName;
+
+ foreach (var item in query)
+ {
+ Console.WriteLine(item);
+ }
+ }
+ }
+
+ static void SqlRoundCompare1Test()
+ {
+ using (var db = new NorthwindDB())
+ {
+ var query =
+ from o in db.Order
+ where Sql.Round(o.Freight) >= 10
+ select o.Freight;
+
+ foreach (var item in query)
+ {
+ Console.WriteLine(item);
+ }
+ }
+ }
+
+ static void SqlSelectLengthTest()
+ {
+ using (var db = new NorthwindDB())
+ {
+ var query =
+ from c in db.Customer
+ select Sql.Length(c.ContactName);
+
+ foreach (var item in query)
+ {
+ Console.WriteLine(item);
+ }
+ }
+ }
+
+ static void SqlSelectLengthAsSqlTest()
+ {
+ using (var db = new NorthwindDB())
+ {
+ var query =
+ from c in db.Customer
+ select Sql.AsSql(Sql.Length(c.ContactName));
+
+ foreach (var item in query)
+ {
+ Console.WriteLine(item);
+ }
+ }
+ }
+
+ static decimal? RoundToEven(decimal? value)
+ {
+ return
+ value - Sql.Floor(value) == 0.5m && Sql.Floor(value) % 2 == 0?
+ Sql.Floor(value) :
+ Sql.Round(value);
+ }
+
+ static void RoundToEvenTest()
+ {
+ Expressions.MapMember(
+ value => RoundToEven(value),
+ value =>
+ value - Sql.Floor(value) == 0.5m && Sql.Floor(value) % 2 == 0?
+ Sql.Floor(value) :
+ Sql.Round(value));
+
+ using (var db = new NorthwindDB())
+ {
+ var query =
+ from o in db.Order
+ let sum = o.OrderDetails.Sum(d => d.Quantity * d.UnitPrice)
+ where RoundToEven(sum) >= 10
+ select o.Freight;
+
+ foreach (var item in query)
+ {
+ Console.WriteLine(item);
+ }
+ }
+ }
+
+ [MethodExpression("OrderCountExpression")]
+ static int OrderCount(Customer customer, string region)
+ {
+ throw new InvalidOperationException();
+ }
+
+ static Expression> OrderCountExpression()
+ {
+ return (customer, region) => customer.Orders.Count(o => o.ShipRegion == region);
+ }
+
+ static void MethodExpressionTest()
+ {
+ using (var db = new NorthwindDB())
+ {
+ var query =
+ from c in db.Customer
+ select new
+ {
+ sum1 = OrderCount(c, "SP"),
+ sum2 = OrderCount(c, "NM")
+ };
+
+ foreach (var item in query)
+ {
+ Console.WriteLine(item);
+ }
+ }
+ }
+
+ static Func> _query =
+ CompiledQuery.Compile>((db, n) =>
+ from e in db.Employee
+ where e.EmployeeID > n
+ orderby e.LastName, e.FirstName
+ select e
+ );
+
+ static void CompiledQueryTest()
+ {
+ using (var db = new NorthwindDB())
+ {
+ var query = _query(db, 5);
+
+ foreach (var item in query)
+ {
+ Console.WriteLine(item);
+ }
+ }
+ }
+ }
+}
+
diff -r 000000000000 -r f990fcb411a9 Demo/Linq/Demo/Properties/AssemblyInfo.cs
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Linq/Demo/Properties/AssemblyInfo.cs Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("Linq.Demo")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Microsoft")]
+[assembly: AssemblyProduct("Linq.Demo")]
+[assembly: AssemblyCopyright("Copyright © Microsoft 2012")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("db69ad10-383d-486e-8c3d-bff41f384a1c")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff -r 000000000000 -r f990fcb411a9 Demo/Linq/OverWCF/App.config
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Linq/OverWCF/App.config Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff -r 000000000000 -r f990fcb411a9 Demo/Linq/OverWCF/Client.cs
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Linq/OverWCF/Client.cs Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,25 @@
+using System;
+using System.Collections.Generic;
+using System.ServiceModel;
+
+namespace Linq.OverWCF
+{
+ class Client : ClientBase, IDemoService
+ {
+ public Client() : base(
+ new NetTcpBinding(SecurityMode.None)
+ {
+ MaxReceivedMessageSize = 10000000,
+ MaxBufferPoolSize = 10000000,
+ MaxBufferSize = 10000000,
+ },
+ new EndpointAddress("net.tcp://localhost:1234/LinqOverWCF"))
+ {
+ }
+
+ public IEnumerable DemoMethod(string str)
+ {
+ return Channel.DemoMethod(str);
+ }
+ }
+}
diff -r 000000000000 -r f990fcb411a9 Demo/Linq/OverWCF/DataModel.generated.cs
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Linq/OverWCF/DataModel.generated.cs Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,261 @@
+//---------------------------------------------------------------------------------------------------
+//
+// This code was generated by BLToolkit template for T4.
+// Changes to this file may cause incorrect behavior and will be lost if the code is regenerated.
+//
+//---------------------------------------------------------------------------------------------------
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Linq.Expressions;
+using System.Reflection;
+using System.ServiceModel;
+using System.Text;
+
+using BLToolkit.Data;
+using BLToolkit.Data.DataProvider;
+using BLToolkit.Data.Linq;
+using BLToolkit.Data.Sql;
+using BLToolkit.Data.Sql.SqlProvider;
+using BLToolkit.DataAccess;
+using BLToolkit.Mapping;
+using BLToolkit.ServiceModel;
+
+namespace Linq.OverWCF
+{
+ public partial class DataModel : ServiceModelDataContext
+ {
+ public Table BinaryData { get { return this.GetTable(); } }
+ public Table Child { get { return this.GetTable(); } }
+ public Table DataTypes { get { return this.GetTable(); } }
+ public Table DataTypeTest { get { return this.GetTable(); } }
+ public Table Doctor { get { return this.GetTable(); } }
+ public Table GrandChild { get { return this.GetTable(); } }
+ public Table LinqDataTypes { get { return this.GetTable(); } }
+ public Table Parent { get { return this.GetTable(); } }
+ public Table Patient { get { return this.GetTable(); } }
+ public Table Person { get { return this.GetTable(); } }
+
+ #region FreeTextTable
+
+ public class FreeTextKey
+ {
+ public T Key;
+ public int Rank;
+ }
+
+ class FreeTextTableExpressionAttribute : TableExpressionAttribute
+ {
+ public FreeTextTableExpressionAttribute()
+ : base("")
+ {
+ }
+
+ public override void SetTable(SqlTable table, MemberInfo member, IEnumerable expArgs, IEnumerable sqlArgs)
+ {
+ var aargs = sqlArgs.ToArray();
+ var arr = ConvertArgs(member, aargs).ToList();
+ var method = (MethodInfo)member;
+ var sp = new MsSql2008SqlProvider();
+
+ {
+ var ttype = method.GetGenericArguments()[0];
+ var tbl = new SqlTable(ttype);
+
+ var database = tbl.Database == null ? null : sp.Convert(tbl.Database, ConvertType.NameToDatabase). ToString();
+ var owner = tbl.Owner == null ? null : sp.Convert(tbl.Owner, ConvertType.NameToOwner). ToString();
+ var physicalName = tbl.PhysicalName == null ? null : sp.Convert(tbl.PhysicalName, ConvertType.NameToQueryTable).ToString();
+
+ var name = sp.BuildTableName(new StringBuilder(), database, owner, physicalName);
+
+ arr.Add(new SqlExpression(name.ToString(), Precedence.Primary));
+ }
+
+ {
+ var field = ((ConstantExpression)expArgs.First()).Value;
+
+ if (field is string)
+ {
+ arr[0] = new SqlExpression(field.ToString(), Precedence.Primary);
+ }
+ else if (field is LambdaExpression)
+ {
+ var body = ((LambdaExpression)field).Body;
+
+ if (body is MemberExpression)
+ {
+ var name = ((MemberExpression)body).Member.Name;
+
+ name = sp.Convert(name, ConvertType.NameToQueryField).ToString();
+
+ arr[0] = new SqlExpression(name, Precedence.Primary);
+ }
+ }
+ }
+
+ table.SqlTableType = SqlTableType.Expression;
+ table.Name = "FREETEXTTABLE({6}, {2}, {3}) {1}";
+ table.TableArguments = arr.ToArray();
+ }
+ }
+
+ [FreeTextTableExpressionAttribute]
+ public Table> FreeTextTable(string field, string text)
+ {
+ return this.GetTable>(
+ this,
+ ((MethodInfo)(MethodBase.GetCurrentMethod())).MakeGenericMethod(typeof(TTable), typeof(TKey)),
+ field,
+ text);
+ }
+
+ [FreeTextTableExpressionAttribute]
+ public Table> FreeTextTable(Expression> fieldSelector, string text)
+ {
+ return this.GetTable>(
+ this,
+ ((MethodInfo)(MethodBase.GetCurrentMethod())).MakeGenericMethod(typeof(TTable), typeof(TKey)),
+ fieldSelector,
+ text);
+ }
+
+ #endregion
+ }
+
+ [TableName(Name="BinaryData")]
+ public partial class BinaryData
+ {
+ [Identity, PrimaryKey(1)] public int BinaryDataID { get; set; } // int(10)
+ public byte[] Stamp { get; set; } // timestamp
+ public byte[] Data { get; set; } // varbinary(1024)
+ }
+
+ [TableName(Name="Child")]
+ public partial class Child
+ {
+ [Nullable] public int? ParentID { get; set; } // int(10)
+ [Nullable] public int? ChildID { get; set; } // int(10)
+ }
+
+ [TableName(Name="DataTypes")]
+ public partial class DataTypes
+ {
+ [Nullable] public int? ID { get; set; } // int(10)
+ [Nullable] public decimal? MoneyValue { get; set; } // decimal(10,4)
+ }
+
+ [TableName(Name="DataTypeTest")]
+ public partial class DataTypeTest
+ {
+ [Identity, PrimaryKey(1)] public int DataTypeID { get; set; } // int(10)
+ [Nullable ] public byte[] Binary_ { get; set; } // binary(50)
+ [Nullable ] public bool? Boolean_ { get; set; } // bit
+ [Nullable ] public byte? Byte_ { get; set; } // tinyint(3)
+ [Nullable ] public byte[] Bytes_ { get; set; } // varbinary(50)
+ [Nullable ] public char? Char_ { get; set; } // char(1)
+ [Nullable ] public DateTime? DateTime_ { get; set; } // datetime(3)
+ [Nullable ] public decimal? Decimal_ { get; set; } // decimal(20,2)
+ [Nullable ] public double? Double_ { get; set; } // float(53)
+ [Nullable ] public Guid? Guid_ { get; set; } // uniqueidentifier
+ [Nullable ] public short? Int16_ { get; set; } // smallint(5)
+ [Nullable ] public int? Int32_ { get; set; } // int(10)
+ [Nullable ] public long? Int64_ { get; set; } // bigint(19)
+ [Nullable ] public decimal? Money_ { get; set; } // money(19,4)
+ [Nullable ] public byte? SByte_ { get; set; } // tinyint(3)
+ [Nullable ] public float? Single_ { get; set; } // real(24)
+ [Nullable ] public byte[] Stream_ { get; set; } // varbinary(50)
+ [Nullable ] public string String_ { get; set; } // nvarchar(50)
+ [Nullable ] public short? UInt16_ { get; set; } // smallint(5)
+ [Nullable ] public int? UInt32_ { get; set; } // int(10)
+ [Nullable ] public long? UInt64_ { get; set; } // bigint(19)
+ [Nullable ] public string Xml_ { get; set; } // xml(-1)
+ }
+
+ [TableName(Name="Doctor")]
+ public partial class Doctor
+ {
+ [PrimaryKey(1)] public int PersonID { get; set; } // int(10)
+ public string Taxonomy { get; set; } // nvarchar(50)
+
+ // FK_Doctor_Person
+ [Association(ThisKey="PersonID", OtherKey="PersonID", CanBeNull=false)]
+ public Person Person { get; set; }
+ }
+
+ [TableName(Name="GrandChild")]
+ public partial class GrandChild
+ {
+ [Nullable] public int? ParentID { get; set; } // int(10)
+ [Nullable] public int? ChildID { get; set; } // int(10)
+ [Nullable] public int? GrandChildID { get; set; } // int(10)
+ }
+
+ [TableName(Name="LinqDataTypes")]
+ public partial class LinqDataTypes
+ {
+ [Nullable] public int? ID { get; set; } // int(10)
+ [Nullable] public decimal? MoneyValue { get; set; } // decimal(10,4)
+ [Nullable] public DateTime? DateTimeValue { get; set; } // datetime(3)
+ [Nullable] public bool? BoolValue { get; set; } // bit
+ [Nullable] public Guid? GuidValue { get; set; } // uniqueidentifier
+ [Nullable] public byte[] BinaryValue { get; set; } // varbinary(5000)
+ [Nullable] public short? SmallIntValue { get; set; } // smallint(5)
+ }
+
+ [TableName(Name="Parent")]
+ public partial class Parent
+ {
+ [Nullable] public int? ParentID { get; set; } // int(10)
+ [Nullable] public int? Value1 { get; set; } // int(10)
+ }
+
+ [TableName(Name="Patient")]
+ public partial class Patient
+ {
+ [PrimaryKey(1)] public int PersonID { get; set; } // int(10)
+ public string Diagnosis { get; set; } // nvarchar(256)
+
+ // FK_Patient_Person
+ [Association(ThisKey="PersonID", OtherKey="PersonID", CanBeNull=false)]
+ public Person Person { get; set; }
+ }
+
+ [TableName(Name="Person")]
+ public partial class Person
+ {
+ [Identity, PrimaryKey(1)] public int PersonID { get; set; } // int(10)
+ public string FirstName { get; set; } // nvarchar(50)
+ public string LastName { get; set; } // nvarchar(50)
+ [Nullable ] public string MiddleName { get; set; } // nvarchar(50)
+ public char Gender { get; set; } // char(1)
+
+ // FK_Doctor_Person_BackReference
+ [Association(ThisKey="PersonID", OtherKey="PersonID", CanBeNull=true)]
+ public Doctor Doctor { get; set; }
+
+ // FK_Patient_Person_BackReference
+ [Association(ThisKey="PersonID", OtherKey="PersonID", CanBeNull=true)]
+ public Patient Patient { get; set; }
+ }
+}
+
+namespace Linq.OverWCF
+{
+ public partial class DataModel
+ {
+ public DataModel() : base(
+ new NetTcpBinding(SecurityMode.None)
+ {
+ MaxReceivedMessageSize = 10000000,
+ MaxBufferPoolSize = 10000000,
+ MaxBufferSize = 10000000,
+ CloseTimeout = new TimeSpan(00, 01, 00),
+ OpenTimeout = new TimeSpan(00, 01, 00),
+ ReceiveTimeout = new TimeSpan(00, 10, 00),
+ SendTimeout = new TimeSpan(00, 10, 00),
+ },
+ new EndpointAddress("net.tcp://localhost:1234/LinqOverWCF"))
+ {
+ }
+ }
+}
diff -r 000000000000 -r f990fcb411a9 Demo/Linq/OverWCF/DataModel.tt
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Linq/OverWCF/DataModel.tt Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,36 @@
+<#@ template language="C#" debug="True" hostspecific="True" #>
+<#@ output extension=".generated.cs" #>
+<#@ include file="$(SolutionDir)\Source\Templates\BLToolkit.ttinclude" #>
+<#@ include file="$(SolutionDir)\Source\Templates\BLT4Toolkit.ttinclude" #>
+<#@ include file="$(SolutionDir)\Source\Templates\MSSQL.ttinclude" #>
+<#
+ ConnectionString = "Server=.;Database=BLToolkitData;Integrated Security=SSPI";
+
+ BaseDataContextClass = "ServiceModelDataContext";
+
+ Usings.Add("BLToolkit.ServiceModel");
+ Usings.Add("System.ServiceModel");
+
+ GenerateModel();
+#>
+
+namespace Linq.OverWCF
+{
+ public partial class DataModel
+ {
+ public DataModel() : base(
+ new NetTcpBinding(SecurityMode.None)
+ {
+ MaxReceivedMessageSize = 10000000,
+ MaxBufferPoolSize = 10000000,
+ MaxBufferSize = 10000000,
+ CloseTimeout = new TimeSpan(00, 01, 00),
+ OpenTimeout = new TimeSpan(00, 01, 00),
+ ReceiveTimeout = new TimeSpan(00, 10, 00),
+ SendTimeout = new TimeSpan(00, 10, 00),
+ },
+ new EndpointAddress("net.tcp://localhost:1234/LinqOverWCF"))
+ {
+ }
+ }
+}
diff -r 000000000000 -r f990fcb411a9 Demo/Linq/OverWCF/DemoService.cs
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Linq/OverWCF/DemoService.cs Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,18 @@
+using System;
+using System.Collections.Generic;
+using System.ServiceModel;
+
+namespace Linq.OverWCF
+{
+ [ServiceBehavior(InstanceContextMode = InstanceContextMode.Single, ConcurrencyMode = ConcurrencyMode.Multiple)]
+ public class DemoService : IDemoService
+ {
+ public IEnumerable DemoMethod(string str)
+ {
+ foreach (var ch in str)
+ {
+ yield return ch.ToString();
+ }
+ }
+ }
+}
diff -r 000000000000 -r f990fcb411a9 Demo/Linq/OverWCF/IDemoService.cs
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Linq/OverWCF/IDemoService.cs Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,13 @@
+using System;
+using System.Collections.Generic;
+using System.ServiceModel;
+
+namespace Linq.OverWCF
+{
+ [ServiceContract]
+ public interface IDemoService
+ {
+ [OperationContract]
+ IEnumerable DemoMethod(string str);
+ }
+}
diff -r 000000000000 -r f990fcb411a9 Demo/Linq/OverWCF/Linq.OverWCF.csproj
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Linq/OverWCF/Linq.OverWCF.csproj Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,163 @@
+
+
+
+ Debug
+ AnyCPU
+ 9.0.30729
+ 2.0
+ {7ED3B518-7CEA-4991-98BD-9752E5F32F58}
+ Exe
+ Properties
+ Linq.OverWCF
+ Linq.OverWCF
+ v4.0
+ 512
+
+
+ 3.5
+
+
+ publish\
+ true
+ Disk
+ false
+ Foreground
+ 7
+ Days
+ false
+ false
+ true
+ 0
+ 1.0.0.%2a
+ false
+ false
+ true
+
+
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+ AllRules.ruleset
+
+
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+ AllRules.ruleset
+
+
+ true
+ bin\DebugMono\
+ DEBUG;TRACE
+ full
+ AnyCPU
+ bin\Debug\Linq.OverWCF.exe.CodeAnalysisLog.xml
+ true
+ GlobalSuppressions.cs
+ prompt
+ AllRules.ruleset
+ ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets
+ false
+ ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules
+ false
+ false
+
+
+ bin\ReleaseMono\
+ TRACE
+ true
+ pdbonly
+ AnyCPU
+ bin\Release\Linq.OverWCF.exe.CodeAnalysisLog.xml
+ true
+ GlobalSuppressions.cs
+ prompt
+ AllRules.ruleset
+ ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets
+ false
+ ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules
+ false
+ false
+
+
+
+
+ 3.5
+
+
+ 3.0
+
+
+ 3.0
+
+
+ 3.5
+
+
+ 3.5
+
+
+
+
+
+
+
+ True
+ True
+ DataModel.tt
+
+
+
+
+
+
+
+
+
+ TextTemplatingFileGenerator
+ DataModel.generated.cs
+
+
+
+
+
+
+
+
+ False
+ .NET Framework 3.5 SP1 Client Profile
+ false
+
+
+ False
+ .NET Framework 3.5 SP1
+ true
+
+
+ False
+ Windows Installer 3.1
+ true
+
+
+
+
+ {0C325F5D-E50E-4340-8724-D29896CCC583}
+ BLToolkit.4
+
+
+
+
+
\ No newline at end of file
diff -r 000000000000 -r f990fcb411a9 Demo/Linq/OverWCF/Program.cs
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Linq/OverWCF/Program.cs Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,60 @@
+using System;
+using System.Linq;
+using System.ServiceModel;
+using System.ServiceModel.Description;
+
+using BLToolkit.Data;
+using BLToolkit.ServiceModel;
+
+namespace Linq.OverWCF
+{
+ class Program
+ {
+ static void Main()
+ {
+ DbManager.TurnTraceSwitchOn();
+
+ using (var host = new ServiceHost(new LinqService("Sql2008"), new Uri("net.tcp://localhost:1234")))
+ {
+ host.Description.Behaviors.Add(new ServiceMetadataBehavior());
+ host.Description.Behaviors.Find().IncludeExceptionDetailInFaults = true;
+ host.AddServiceEndpoint(typeof(IMetadataExchange), MetadataExchangeBindings.CreateMexTcpBinding(), "mex");
+ host.AddServiceEndpoint(
+ typeof(ILinqService),
+ new NetTcpBinding(SecurityMode.None)
+ {
+ MaxReceivedMessageSize = 10000000,
+ MaxBufferPoolSize = 10000000,
+ MaxBufferSize = 10000000,
+ CloseTimeout = new TimeSpan(00, 01, 00),
+ OpenTimeout = new TimeSpan(00, 01, 00),
+ ReceiveTimeout = new TimeSpan(00, 10, 00),
+ SendTimeout = new TimeSpan(00, 10, 00),
+ },
+ "LinqOverWCF");
+
+ host.Open();
+
+ var client = new DataModel();
+
+ var q =
+ from p in client.Person
+ select new
+ {
+ p.PersonID,
+ p.FirstName,
+ p.MiddleName,
+ p.LastName,
+ p.Gender
+ };
+
+ foreach (var p in q)
+ Console.WriteLine(p);
+
+ Console.ReadLine();
+
+ host.Close();
+ }
+ }
+ }
+}
diff -r 000000000000 -r f990fcb411a9 Demo/Linq/OverWCF/Properties/AssemblyInfo.cs
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Linq/OverWCF/Properties/AssemblyInfo.cs Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("Linq.OverWCF")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Microsoft")]
+[assembly: AssemblyProduct("Linq.OverWCF")]
+[assembly: AssemblyCopyright("Copyright © Microsoft 2012")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("e2dbeea8-fc86-40b1-b63d-0abad6ffafb4")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff -r 000000000000 -r f990fcb411a9 Demo/Partial.Trust/Asp.Net/Default.aspx
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Partial.Trust/Asp.Net/Default.aspx Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,81 @@
+<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Partial.Trust.Asp.Net._Default" %>
+
+
+
+
+
+ Partial Trust Demo
+
+
+
+
+
diff -r 000000000000 -r f990fcb411a9 Demo/Partial.Trust/Asp.Net/Default.aspx.cs
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Partial.Trust/Asp.Net/Default.aspx.cs Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,38 @@
+using System;
+using System.Linq;
+using System.Web.UI;
+
+using BLToolkit.Data;
+using BLToolkit.Data.Linq;
+
+namespace Partial.Trust.Asp.Net
+{
+ using Components;
+
+ public partial class _Default : Page
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ var da = PersonDataAccessor.CreateInstance();
+ var list = da.GetPersonList();
+
+ Label1.Text = list[0].ContactName;
+
+ var q =
+ from c in new Table()
+ where c.CustomerID == list[0].CustomerID
+ select c.ContactName;
+
+ Label2.Text = q.First();
+
+ using (var db = new DbManager())
+ Label3.Text = _compiledQuery(db, list[0].CustomerID).ToList().First();
+ }
+
+ static readonly Func> _compiledQuery =
+ CompiledQuery.Compile((DbManager db, string id) =>
+ from c in db.GetTable()
+ where c.CustomerID == id
+ select c.ContactName);
+ }
+}
diff -r 000000000000 -r f990fcb411a9 Demo/Partial.Trust/Asp.Net/Default.aspx.designer.cs
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Partial.Trust/Asp.Net/Default.aspx.designer.cs Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,51 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace Partial.Trust.Asp.Net {
+
+
+ public partial class _Default {
+
+ ///
+ /// form1 control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.HtmlControls.HtmlForm form1;
+
+ ///
+ /// Label1 control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Label Label1;
+
+ ///
+ /// Label2 control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Label Label2;
+
+ ///
+ /// Label3 control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Label Label3;
+ }
+}
diff -r 000000000000 -r f990fcb411a9 Demo/Partial.Trust/Asp.Net/Partial.Trust.Asp.Net.2008.csproj
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Partial.Trust/Asp.Net/Partial.Trust.Asp.Net.2008.csproj Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,110 @@
+
+
+ Debug
+ AnyCPU
+ 9.0.30729
+ 2.0
+ {16272F10-9E3D-4C24-8761-8A43E9FB525F}
+ {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}
+ Library
+ Properties
+ Partial.Trust.Asp.Net
+ Partial.Trust.Asp.Net
+ v3.5
+
+
+ true
+ full
+ false
+ bin\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ pdbonly
+ true
+ bin\
+ TRACE
+ prompt
+ 4
+
+
+
+
+
+ 3.5
+
+
+ 3.5
+
+
+ 3.5
+
+
+ 3.5
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ASPXCodeBehind
+ Default.aspx
+
+
+ Default.aspx
+
+
+
+
+
+ {0C325F5D-E50E-4340-8724-D29896CCC583}
+ BLToolkit.3
+
+
+ {3BCB17AC-9941-4460-858B-2B7BC3BEDDE7}
+ Partial.Trust.Components.2008
+
+
+
+
+
+
+
+
+
+
+
+
+ False
+ True
+ 61649
+ /
+
+
+ False
+ False
+
+
+ False
+
+
+
+
+
\ No newline at end of file
diff -r 000000000000 -r f990fcb411a9 Demo/Partial.Trust/Asp.Net/Partial.Trust.Asp.Net.csproj
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Partial.Trust/Asp.Net/Partial.Trust.Asp.Net.csproj Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,153 @@
+
+
+
+
+ Debug
+ AnyCPU
+ 9.0.30729
+ 2.0
+ {16272F10-9E3D-4C24-8761-8A43E9FB525F}
+ {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}
+ Library
+ Properties
+ Partial.Trust.Asp.Net
+ Partial.Trust.Asp.Net
+ v4.0
+
+
+ 4.0
+
+
+ false
+
+
+ true
+ full
+ false
+ bin\
+ DEBUG;TRACE
+ prompt
+ 4
+ AllRules.ruleset
+
+
+ pdbonly
+ true
+ bin\
+ TRACE
+ prompt
+ 4
+ AllRules.ruleset
+
+
+ true
+ bin\
+ DEBUG;TRACE
+ full
+ AnyCPU
+ bin\Partial.Trust.Asp.Net.dll.CodeAnalysisLog.xml
+ true
+ GlobalSuppressions.cs
+ prompt
+ AllRules.ruleset
+ ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets
+ ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules
+ false
+ false
+
+
+ bin\
+ TRACE
+ true
+ pdbonly
+ AnyCPU
+ bin\Partial.Trust.Asp.Net.dll.CodeAnalysisLog.xml
+ true
+ GlobalSuppressions.cs
+ prompt
+ AllRules.ruleset
+ ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets
+ ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules
+ false
+ false
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Designer
+
+
+
+
+ ASPXCodeBehind
+ Default.aspx
+
+
+ Default.aspx
+
+
+
+
+
+
+
+
+ {0C325F5D-E50E-4340-8724-D29896CCC583}
+ BLToolkit.4
+
+
+ {3BCB17AC-9941-4460-858B-2B7BC3BEDDE7}
+ Partial.Trust.Components
+
+
+
+ 10.0
+ $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)
+
+
+
+
+
+
+
+
+
+ False
+ True
+ 59174
+ /
+
+
+ False
+ False
+
+
+ False
+
+
+
+
+
\ No newline at end of file
diff -r 000000000000 -r f990fcb411a9 Demo/Partial.Trust/Asp.Net/Properties/AssemblyInfo.cs
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Partial.Trust/Asp.Net/Properties/AssemblyInfo.cs Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,30 @@
+using System.Reflection;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("Partial.Trust.Asp.Net")]
+[assembly: AssemblyProduct("Partial.Trust.Asp.Net")]
+[assembly: AssemblyCopyright("\xA9 2002-2012 www.bltoolkit.net")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("3d5900ae-111a-45be-96b3-d9e4606ca793")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers
+// by using the '*' as shown below:
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff -r 000000000000 -r f990fcb411a9 Demo/Partial.Trust/Asp.Net/Web.config
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Partial.Trust/Asp.Net/Web.config Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff -r 000000000000 -r f990fcb411a9 Demo/Partial.Trust/Components/Customer.cs
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Partial.Trust/Components/Customer.cs Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,19 @@
+using System;
+
+namespace Partial.Trust.Components
+{
+ public class Customers
+ {
+ public string CustomerID;
+ public string CompanyName;
+ public string ContactName;
+ public string ContactTitle;
+ public string Address;
+ public string City;
+ public string Region;
+ public string PostalCode;
+ public string Country;
+ public string Phone;
+ public string Fax;
+ }
+}
diff -r 000000000000 -r f990fcb411a9 Demo/Partial.Trust/Components/Partial.Trust.Components.2008.csproj
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Partial.Trust/Components/Partial.Trust.Components.2008.csproj Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,75 @@
+
+
+
+ Debug
+ AnyCPU
+ 9.0.30729
+ 2.0
+ {3BCB17AC-9941-4460-858B-2B7BC3BEDDE7}
+ Library
+ Properties
+ Partial.Trust.Components
+ Partial.Trust.Components
+ v3.5
+ 512
+ true
+ Partial.Trust.snk
+ OnOutputUpdated
+
+
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+
+ 3.5
+
+
+ 3.5
+
+
+ 3.5
+
+
+
+
+
+
+
+
+
+
+
+ {0C325F5D-E50E-4340-8724-D29896CCC583}
+ BLToolkit.3
+
+
+
+
+
+
+
+
+ $(ProjectDir)..\..\..\Tools\BLTgen\bin\$(ConfigurationName)\BLTgen.exe $(TargetPath) /O:$(ProjectDir)..\Asp.Net\bin /K:$(ProjectDir)Partial.Trust.snk /D
+
+
\ No newline at end of file
diff -r 000000000000 -r f990fcb411a9 Demo/Partial.Trust/Components/Partial.Trust.Components.csproj
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Partial.Trust/Components/Partial.Trust.Components.csproj Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,148 @@
+
+
+
+ Debug
+ AnyCPU
+ 9.0.30729
+ 2.0
+ {3BCB17AC-9941-4460-858B-2B7BC3BEDDE7}
+ Library
+ Properties
+ Partial.Trust.Components
+ Partial.Trust.Components
+ v4.0
+ 512
+ true
+ Partial.Trust.snk
+ OnOutputUpdated
+
+
+ 3.5
+
+
+ publish\
+ true
+ Disk
+ false
+ Foreground
+ 7
+ Days
+ false
+ false
+ true
+ 0
+ 1.0.0.%2a
+ false
+ false
+ true
+
+
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+ AllRules.ruleset
+
+
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+ AllRules.ruleset
+
+
+ true
+ bin\DebugMono\
+ DEBUG;TRACE
+ full
+ AnyCPU
+ bin\Debug\Partial.Trust.Components.dll.CodeAnalysisLog.xml
+ true
+ GlobalSuppressions.cs
+ prompt
+ AllRules.ruleset
+ ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets
+ false
+ ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules
+ false
+ false
+
+
+ bin\ReleaseMono\
+ TRACE
+ true
+ pdbonly
+ AnyCPU
+ bin\Release\Partial.Trust.Components.dll.CodeAnalysisLog.xml
+ true
+ GlobalSuppressions.cs
+ prompt
+ AllRules.ruleset
+ ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets
+ false
+ ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules
+ false
+ false
+
+
+
+
+ 3.5
+
+
+ 3.5
+
+
+ 3.5
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {0C325F5D-E50E-4340-8724-D29896CCC583}
+ BLToolkit.4
+
+
+
+
+ False
+ .NET Framework 3.5 SP1 Client Profile
+ false
+
+
+ False
+ .NET Framework 3.5 SP1
+ true
+
+
+ False
+ Windows Installer 3.1
+ true
+
+
+
+
+
+ $(ProjectDir)..\..\..\Tools\BLTgen\bin\$(ConfigurationName)\BLTgen.4.exe $(TargetPath) /O:$(ProjectDir)..\Asp.Net\bin /K:$(ProjectDir)Partial.Trust.snk /D
+
+
\ No newline at end of file
diff -r 000000000000 -r f990fcb411a9 Demo/Partial.Trust/Components/Partial.Trust.snk
Binary file Demo/Partial.Trust/Components/Partial.Trust.snk has changed
diff -r 000000000000 -r f990fcb411a9 Demo/Partial.Trust/Components/PersonDataAccessor.cs
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Partial.Trust/Components/PersonDataAccessor.cs Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,18 @@
+using System;
+using System.Collections.Generic;
+
+using BLToolkit.DataAccess;
+
+namespace Partial.Trust.Components
+{
+ public abstract class PersonDataAccessor : DataAccessor
+ {
+ [SqlQuery("SELECT * FROM Customers")]
+ public abstract List GetPersonList();
+
+ public static PersonDataAccessor CreateInstance()
+ {
+ return CreateInstance();
+ }
+ }
+}
diff -r 000000000000 -r f990fcb411a9 Demo/Partial.Trust/Components/Properties/AssemblyInfo.cs
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Partial.Trust/Components/Properties/AssemblyInfo.cs Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,35 @@
+using System;
+using System.Reflection;
+using System.Runtime.InteropServices;
+using System.Security;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("Partial.Trust.Components")]
+[assembly: AssemblyProduct("Partial.Trust.Components")]
+[assembly: AssemblyCopyright("\xA9 2002-2012 www.bltoolkit.net")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("c9109767-494e-4994-ac1a-2458efc3765c")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
+
+[assembly: AllowPartiallyTrustedCallers]
diff -r 000000000000 -r f990fcb411a9 Demo/Partial.Trust/ReadMe.txt
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Partial.Trust/ReadMe.txt Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,36 @@
+To use BLToolkit in Partial Trust Environment you should perform the following steps:
+
+ For all assemblies containing classes for which BLToolkit generates
+ new types such as Partial.Trust.Components.dll in this demo:
+
+ - Sign the assembly.
+
+ - Add the AllowPartiallyTrustedCallers attribute:
+
+ [assembly: AllowPartiallyTrustedCallers]
+
+ - Use BLTgen.exe to generate BLToolkit extensions at the post-build step.
+ For example:
+
+ $(ProjectDir)..\..\..\Tools\BLTgen\bin\$(ConfigurationName)\BLTgen.exe $(TargetPath) /O:$(ProjectDir)..\Asp.Net\bin /K:$(ProjectDir)Partial.Trust.snk /D
+
+ Extension assembly must be signed as well (use /K flag).
+
+ Turn the TypeFactory.LoadTypes flag on.
+
+ Add the following section in the Web.config file:
+
+
+
+
+
+
+
+
+ - or
+
+ set
+
+ TypeFactory.LoadTypes = true;
+
+ somewhere before the first use of BLToolkit (Global.asax for Web applications).
diff -r 000000000000 -r f990fcb411a9 Demo/Silverlight/Client.Web/Client.Web.csproj
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Silverlight/Client.Web/Client.Web.csproj Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,175 @@
+
+
+
+
+ Debug
+ AnyCPU
+
+
+ 2.0
+ {E796EF23-D63D-4EBD-A34D-5F243834933B}
+ {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}
+ Library
+ Properties
+ Client.Web
+ Client.Web
+ v4.0
+ {28693777-369C-4C0D-B076-38F7C0E5D06C}|..\Client\Client.csproj|ClientBin|False
+ false
+
+
+ 4.0
+
+
+
+
+
+
+
+ true
+ full
+ false
+ bin\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ pdbonly
+ true
+ bin\
+ TRACE
+ prompt
+ 4
+
+
+ true
+ bin\
+ DEBUG;TRACE
+ full
+ AnyCPU
+ bin\Client.Web.dll.CodeAnalysisLog.xml
+ true
+ GlobalSuppressions.cs
+ prompt
+ MinimumRecommendedRules.ruleset
+ ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets
+ true
+ ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules
+ true
+
+
+ bin\
+ TRACE
+ true
+ pdbonly
+ AnyCPU
+ bin\Client.Web.dll.CodeAnalysisLog.xml
+ true
+ GlobalSuppressions.cs
+ prompt
+ MinimumRecommendedRules.ruleset
+ ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets
+ true
+ ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Web.config
+
+
+ Web.config
+
+
+
+
+ DataModel.tt
+ True
+ True
+ Component
+
+
+
+ LinqWebService.asmx
+
+
+
+
+ {0C325F5D-E50E-4340-8724-D29896CCC583}
+ BLToolkit.4
+
+
+
+
+ TextTemplatingFileGenerator
+ DataModel.generated.cs
+
+
+
+
+
+
+ 10.0
+ $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)
+
+
+
+
+
+
+
+
+ False
+ False
+ 31020
+ /
+
+
+ False
+ False
+
+
+ False
+
+
+
+
+
+
\ No newline at end of file
diff -r 000000000000 -r f990fcb411a9 Demo/Silverlight/Client.Web/ClientTestPage.aspx
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Silverlight/Client.Web/ClientTestPage.aspx Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,74 @@
+<%@ Page Language="C#" AutoEventWireup="true" %>
+
+
+
+
+ Client
+
+
+
+
+
+
+
+
diff -r 000000000000 -r f990fcb411a9 Demo/Silverlight/Client.Web/ClientTestPage.html
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Silverlight/Client.Web/ClientTestPage.html Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,73 @@
+
+
+
+
+ Client
+
+
+
+
+
+
+
+
diff -r 000000000000 -r f990fcb411a9 Demo/Silverlight/Client.Web/DataModel.generated.cs
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Demo/Silverlight/Client.Web/DataModel.generated.cs Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,619 @@
+//---------------------------------------------------------------------------------------------------
+//
+// This code was generated by BLToolkit template for T4.
+// Changes to this file may cause incorrect behavior and will be lost if the code is regenerated.
+//
+//---------------------------------------------------------------------------------------------------
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Linq.Expressions;
+using System.Reflection;
+using System.ServiceModel;
+using System.Text;
+
+using BLToolkit.Data;
+using BLToolkit.Data.DataProvider;
+using BLToolkit.Data.Linq;
+using BLToolkit.Data.Sql;
+using BLToolkit.Data.Sql.SqlProvider;
+using BLToolkit.DataAccess;
+using BLToolkit.Mapping;
+using BLToolkit.ServiceModel;
+
+namespace Client
+{
+ public partial class DataModel : DbManager
+ {
+ public Table AlphabeticalListOfProducts { get { return this.GetTable(); } }
+ ///
+ /// Description for Categories table.
+ ///
+ public Table Categories { get { return this.GetTable(); } }
+ public Table CategorySalesFor1997 { get { return this.GetTable(); } }
+ public Table CurrentProductList { get { return this.GetTable(); } }
+ public Table CustomerAndSuppliersByCity { get { return this.GetTable(); } }
+ public Table CustomerCustomerDemo { get { return this.GetTable(); } }
+ public Table CustomerDemographics { get { return this.GetTable(); } }
+ ///
+ /// Description of Customers table.
+ ///
+ public Table Customers { get { return this.GetTable(); } }
+ public Table Employees { get { return this.GetTable(); } }
+ public Table EmployeeTerritories { get { return this.GetTable(); } }
+ public Table Invoices { get { return this.GetTable(); } }
+ public Table OrderDetails { get { return this.GetTable(); } }
+ public Table OrderDetailsExtended { get { return this.GetTable(); } }
+ public Table OrderSubtotals { get { return this.GetTable(); } }
+ public Table Orders { get { return this.GetTable(); } }
+ public Table OrdersQry { get { return this.GetTable(); } }
+ public Table ProductSalesFor1997 { get { return this.GetTable(); } }
+ public Table Products { get { return this.GetTable(); } }
+ public Table ProductsAboveAveragePrice { get { return this.GetTable(); } }
+ public Table ProductsByCategory { get { return this.GetTable(); } }
+ public Table QuarterlyOrders { get { return this.GetTable(); } }
+ public Table Region { get { return this.GetTable(); } }
+ public Table SalesByCategory { get { return this.GetTable(); } }
+ public Table |