diff --git a/snippets/common/VS_Snippets_WebNet/system.web.ui.clientidmode/common/predictable.aspx b/snippets/common/VS_Snippets_WebNet/system.web.ui.clientidmode/common/predictable.aspx
deleted file mode 100644
index c24a178c79e..00000000000
--- a/snippets/common/VS_Snippets_WebNet/system.web.ui.clientidmode/common/predictable.aspx
+++ /dev/null
@@ -1,55 +0,0 @@
-<%@ Page AutoEventWireup="true" %>
-
-
-
-
-
-
-
-
-
-
-
diff --git a/snippets/common/VS_Snippets_WebNet/system.web.ui.clientidmode/common/productlist.aspx b/snippets/common/VS_Snippets_WebNet/system.web.ui.clientidmode/common/productlist.aspx
deleted file mode 100644
index 10f4964bce1..00000000000
--- a/snippets/common/VS_Snippets_WebNet/system.web.ui.clientidmode/common/productlist.aspx
+++ /dev/null
@@ -1,83 +0,0 @@
-<%@ Page AutoEventWireup="true" %>
-
-
-
-
-
-
- <%----%>
-
- <%----%>
-
-<%----%>
-
- <%----%>
-
-
-
diff --git a/snippets/common/VS_Snippets_WebNet/system.web.ui.clientidmode/common/seasons.aspx b/snippets/common/VS_Snippets_WebNet/system.web.ui.clientidmode/common/seasons.aspx
deleted file mode 100644
index 58e2fb43f80..00000000000
--- a/snippets/common/VS_Snippets_WebNet/system.web.ui.clientidmode/common/seasons.aspx
+++ /dev/null
@@ -1,8 +0,0 @@
-<%@ Page Title="" MasterPageFile="~/Seasons.master" AutoEventWireup="true" %>
-
-<%@ Register Src="Seasons.ascx" TagName="Seasons" TagPrefix="uc1" %>
-
-
-
-
-
diff --git a/snippets/csharp/Microsoft.SqlServer.Server/SqlFunctionAttribute/Function.csproj b/snippets/csharp/Microsoft.SqlServer.Server/SqlFunctionAttribute/Function.csproj
deleted file mode 100644
index a95719c4b0c..00000000000
--- a/snippets/csharp/Microsoft.SqlServer.Server/SqlFunctionAttribute/Function.csproj
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
- Library
- net6.0
- enable
-
-
-
-
-
-
-
diff --git a/snippets/csharp/Microsoft.SqlServer.Server/SqlFunctionAttribute/Function1.cs b/snippets/csharp/Microsoft.SqlServer.Server/SqlFunctionAttribute/Function1.cs
deleted file mode 100644
index 7317b1917b1..00000000000
--- a/snippets/csharp/Microsoft.SqlServer.Server/SqlFunctionAttribute/Function1.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-using System.Collections;
-//-----------------------------------------------------------------------------
-//
-using System.Data.SqlTypes;
-using Microsoft.SqlServer.Server;
-
-public partial class UserDefinedFunctions
-{
- public const double SALES_TAX = .086;
-
- [SqlFunction()]
- public static SqlDouble addTax(SqlDouble originalAmount)
- {
- SqlDouble taxAmount = originalAmount * SALES_TAX;
-
- return originalAmount + taxAmount;
- }
-}
-//
-
-//-----------------------------------------------------------------------------
-//
-public partial class UserDefinedFunctions
-{
- [SqlFunction(Name="sp_scalarFunc")]
- public static SqlString SampleScalarFunction(SqlString s)
- {
- //...
- return "";
- }
-}
-//
-
-//-----------------------------------------------------------------------------
-//
-public partial class UserDefinedFunctions
-{
- [SqlFunction(Name="sp_tableFunc", TableDefinition="letter nchar(1)")]
- public static IEnumerable SampleTableFunction(SqlString s)
- {
- //...
- return new ArrayList(new char[3] {'a', 'b', 'c'});
- }
-}
-//
diff --git a/snippets/csharp/Microsoft.SqlServer.Server/SqlFunctionAttribute/Test.sql b/snippets/csharp/Microsoft.SqlServer.Server/SqlFunctionAttribute/Test.sql
deleted file mode 100644
index f5014962c7a..00000000000
--- a/snippets/csharp/Microsoft.SqlServer.Server/SqlFunctionAttribute/Test.sql
+++ /dev/null
@@ -1,45 +0,0 @@
--------------------------------------------------------------------------------
--- Stored Procedure
--------------------------------------------------------------------------------
-EXEC InsertCurrency 'AAA', 'Currency Test'
-SELECT * from Sales.Currency where CurrencyCode = 'AAA'
-
-
--------------------------------------------------------------------------------
--- Aggregate
--------------------------------------------------------------------------------
-SELECT LastName, COUNT(LastName) AS CountOfLastName, dbo.CountVowels(LastName) AS CountOfVowels
-FROM Person.Contact
-GROUP BY LastName
-ORDER BY LastName
-
-
--------------------------------------------------------------------------------
--- Trigger
--------------------------------------------------------------------------------
--- Insert one user name that is not an email address and one that is
-INSERT INTO Users(UserName, Pass) VALUES(N'someone', N'cnffjbeq')
-INSERT INTO Users(UserName, Pass) VALUES(N'someone@example.com', N'cnffjbeq')
-
--- check the Users and UsersAudit tables to see the results of the trigger
-select * from Users
-select * from UsersAudit
-
-
--------------------------------------------------------------------------------
--- Function
--------------------------------------------------------------------------------
-SELECT dbo.addTax(10)
-
-
--------------------------------------------------------------------------------
--- Type
--------------------------------------------------------------------------------
-CREATE TABLE test_table (column1 Point)
-go
-
-INSERT INTO test_table (column1) VALUES ('1:2')
-INSERT INTO test_table (column1) VALUES ('-2:3')
-INSERT INTO test_table (column1) VALUES ('-3:-4')
-
-select column1.Quadrant() from test_table
diff --git a/snippets/csharp/Microsoft.SqlServer.Server/SqlProcedureAttribute/InsertCurrency.cs b/snippets/csharp/Microsoft.SqlServer.Server/SqlProcedureAttribute/InsertCurrency.cs
deleted file mode 100644
index 92140e10a58..00000000000
--- a/snippets/csharp/Microsoft.SqlServer.Server/SqlProcedureAttribute/InsertCurrency.cs
+++ /dev/null
@@ -1,51 +0,0 @@
-//-----------------------------------------------------------------------------
-//
-using System;
-using System.Data;
-using System.Data.SqlClient;
-using System.Data.SqlTypes;
-using Microsoft.SqlServer.Server;
-
-public partial class StoredProcedures
-{
- [SqlProcedure()]
- public static void InsertCurrency_CS(
- SqlString currencyCode, SqlString name)
- {
- using (SqlConnection conn = new SqlConnection("context connection=true"))
- {
- SqlCommand InsertCurrencyCommand = new SqlCommand();
- SqlParameter currencyCodeParam = new SqlParameter("@CurrencyCode", SqlDbType.NVarChar);
- SqlParameter nameParam = new SqlParameter("@Name", SqlDbType.NVarChar);
-
- currencyCodeParam.Value = currencyCode;
- nameParam.Value = name;
-
- InsertCurrencyCommand.Parameters.Add(currencyCodeParam);
- InsertCurrencyCommand.Parameters.Add(nameParam);
-
- InsertCurrencyCommand.CommandText =
- "INSERT Sales.Currency (CurrencyCode, Name, ModifiedDate)" +
- " VALUES(@CurrencyCode, @Name, GetDate())";
-
- InsertCurrencyCommand.Connection = conn;
-
- conn.Open();
- InsertCurrencyCommand.ExecuteNonQuery();
- conn.Close();
- }
- }
-}
-//
-
-//-----------------------------------------------------------------------------
-//
-public partial class StoredProcedures
-{
- [SqlProcedure(Name="sp_sqlName")]
- public static void SampleProcedure(SqlString s)
- {
- //...
- }
-}
-//
diff --git a/snippets/csharp/Microsoft.SqlServer.Server/SqlProcedureAttribute/Procedure.csproj b/snippets/csharp/Microsoft.SqlServer.Server/SqlProcedureAttribute/Procedure.csproj
deleted file mode 100644
index 33af96be4c7..00000000000
--- a/snippets/csharp/Microsoft.SqlServer.Server/SqlProcedureAttribute/Procedure.csproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net472
-
-
-
diff --git a/snippets/csharp/Microsoft.SqlServer.Server/SqlProcedureAttribute/Test.sql b/snippets/csharp/Microsoft.SqlServer.Server/SqlProcedureAttribute/Test.sql
deleted file mode 100644
index f5014962c7a..00000000000
--- a/snippets/csharp/Microsoft.SqlServer.Server/SqlProcedureAttribute/Test.sql
+++ /dev/null
@@ -1,45 +0,0 @@
--------------------------------------------------------------------------------
--- Stored Procedure
--------------------------------------------------------------------------------
-EXEC InsertCurrency 'AAA', 'Currency Test'
-SELECT * from Sales.Currency where CurrencyCode = 'AAA'
-
-
--------------------------------------------------------------------------------
--- Aggregate
--------------------------------------------------------------------------------
-SELECT LastName, COUNT(LastName) AS CountOfLastName, dbo.CountVowels(LastName) AS CountOfVowels
-FROM Person.Contact
-GROUP BY LastName
-ORDER BY LastName
-
-
--------------------------------------------------------------------------------
--- Trigger
--------------------------------------------------------------------------------
--- Insert one user name that is not an email address and one that is
-INSERT INTO Users(UserName, Pass) VALUES(N'someone', N'cnffjbeq')
-INSERT INTO Users(UserName, Pass) VALUES(N'someone@example.com', N'cnffjbeq')
-
--- check the Users and UsersAudit tables to see the results of the trigger
-select * from Users
-select * from UsersAudit
-
-
--------------------------------------------------------------------------------
--- Function
--------------------------------------------------------------------------------
-SELECT dbo.addTax(10)
-
-
--------------------------------------------------------------------------------
--- Type
--------------------------------------------------------------------------------
-CREATE TABLE test_table (column1 Point)
-go
-
-INSERT INTO test_table (column1) VALUES ('1:2')
-INSERT INTO test_table (column1) VALUES ('-2:3')
-INSERT INTO test_table (column1) VALUES ('-3:-4')
-
-select column1.Quadrant() from test_table
diff --git a/snippets/csharp/Microsoft.SqlServer.Server/SqlTriggerAttribute/Test.sql b/snippets/csharp/Microsoft.SqlServer.Server/SqlTriggerAttribute/Test.sql
deleted file mode 100644
index f5014962c7a..00000000000
--- a/snippets/csharp/Microsoft.SqlServer.Server/SqlTriggerAttribute/Test.sql
+++ /dev/null
@@ -1,45 +0,0 @@
--------------------------------------------------------------------------------
--- Stored Procedure
--------------------------------------------------------------------------------
-EXEC InsertCurrency 'AAA', 'Currency Test'
-SELECT * from Sales.Currency where CurrencyCode = 'AAA'
-
-
--------------------------------------------------------------------------------
--- Aggregate
--------------------------------------------------------------------------------
-SELECT LastName, COUNT(LastName) AS CountOfLastName, dbo.CountVowels(LastName) AS CountOfVowels
-FROM Person.Contact
-GROUP BY LastName
-ORDER BY LastName
-
-
--------------------------------------------------------------------------------
--- Trigger
--------------------------------------------------------------------------------
--- Insert one user name that is not an email address and one that is
-INSERT INTO Users(UserName, Pass) VALUES(N'someone', N'cnffjbeq')
-INSERT INTO Users(UserName, Pass) VALUES(N'someone@example.com', N'cnffjbeq')
-
--- check the Users and UsersAudit tables to see the results of the trigger
-select * from Users
-select * from UsersAudit
-
-
--------------------------------------------------------------------------------
--- Function
--------------------------------------------------------------------------------
-SELECT dbo.addTax(10)
-
-
--------------------------------------------------------------------------------
--- Type
--------------------------------------------------------------------------------
-CREATE TABLE test_table (column1 Point)
-go
-
-INSERT INTO test_table (column1) VALUES ('1:2')
-INSERT INTO test_table (column1) VALUES ('-2:3')
-INSERT INTO test_table (column1) VALUES ('-3:-4')
-
-select column1.Quadrant() from test_table
diff --git a/snippets/csharp/Microsoft.SqlServer.Server/SqlTriggerAttribute/Trigger.csproj b/snippets/csharp/Microsoft.SqlServer.Server/SqlTriggerAttribute/Trigger.csproj
deleted file mode 100644
index 33af96be4c7..00000000000
--- a/snippets/csharp/Microsoft.SqlServer.Server/SqlTriggerAttribute/Trigger.csproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Library
- net472
-
-
-
diff --git a/snippets/csharp/Microsoft.SqlServer.Server/SqlTriggerAttribute/Trigger1.cs b/snippets/csharp/Microsoft.SqlServer.Server/SqlTriggerAttribute/Trigger1.cs
deleted file mode 100644
index 6195fb15314..00000000000
--- a/snippets/csharp/Microsoft.SqlServer.Server/SqlTriggerAttribute/Trigger1.cs
+++ /dev/null
@@ -1,67 +0,0 @@
-//-----------------------------------------------------------------------------
-//
-using System.Data.SqlClient;
-using System.Text.RegularExpressions;
-using Microsoft.SqlServer.Server;
-
-public partial class Triggers
-{
- [SqlTrigger(Name="UserNameAudit", Target="Users", Event="FOR INSERT")]
- public static void UserNameAudit()
- {
- SqlTriggerContext triggContext = SqlContext.TriggerContext;
- SqlParameter userName = new SqlParameter("@username", System.Data.SqlDbType.NVarChar);
-
- if (triggContext.TriggerAction == TriggerAction.Insert)
- {
- using (SqlConnection conn = new SqlConnection("context connection=true"))
- {
- conn.Open();
- SqlCommand sqlComm = new SqlCommand();
- SqlPipe sqlP = SqlContext.Pipe;
-
- sqlComm.Connection = conn;
- sqlComm.CommandText = "SELECT UserName from INSERTED";
-
- userName.Value = sqlComm.ExecuteScalar().ToString();
-
- if (IsEMailAddress(userName.ToString()))
- {
- sqlComm.CommandText = "INSERT UsersAudit(UserName) VALUES(userName)";
- sqlP.Send(sqlComm.CommandText);
- sqlP.ExecuteAndSend(sqlComm);
- }
- }
- }
- }
-
- public static bool IsEMailAddress(string s)
- {
- return Regex.IsMatch(s, "^([\\w-]+\\.)*?[\\w-]+@[\\w-]+\\.([\\w-]+\\.)*?[\\w]+$");
- }
-}
-//
-
-//-----------------------------------------------------------------------------
-//
-public partial class Triggers
-{
- [SqlTrigger(Target="authors", Event="FOR UPDATE")]
- public static void AuthorsUpdateTrigger()
- {
- //...
- }
-}
-//
-
-//-----------------------------------------------------------------------------
-//
-public partial class Triggers
-{
- [SqlTrigger(Name="trig_onpubinsert", Target="publishers", Event="FOR INSERT")]
- public static void PublishersInsertTrigger()
- {
- //...
- }
-}
-//
diff --git a/snippets/csharp/Microsoft.SqlServer.Server/SqlUserDefinedAggregateAttribute/Aggregate.csproj b/snippets/csharp/Microsoft.SqlServer.Server/SqlUserDefinedAggregateAttribute/Aggregate.csproj
deleted file mode 100644
index a95719c4b0c..00000000000
--- a/snippets/csharp/Microsoft.SqlServer.Server/SqlUserDefinedAggregateAttribute/Aggregate.csproj
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
- Library
- net6.0
- enable
-
-
-
-
-
-
-
diff --git a/snippets/csharp/Microsoft.SqlServer.Server/SqlUserDefinedAggregateAttribute/Aggregate1.cs b/snippets/csharp/Microsoft.SqlServer.Server/SqlUserDefinedAggregateAttribute/Aggregate1.cs
deleted file mode 100644
index edf119d940d..00000000000
--- a/snippets/csharp/Microsoft.SqlServer.Server/SqlUserDefinedAggregateAttribute/Aggregate1.cs
+++ /dev/null
@@ -1,59 +0,0 @@
-//-----------------------------------------------------------------------------
-//
-using System;
-using System.Data.SqlTypes;
-using Microsoft.SqlServer.Server;
-
-[Serializable]
-[SqlUserDefinedAggregate(Format.Native)]
-public struct CountVowels
-{
- // count only the vowels in the passed-in strings
- private SqlInt32 countOfVowels;
-
- public void Init()
- {
- countOfVowels = 0;
- }
-
- public void Accumulate(SqlString value)
- {
- // list of vowels to look for
- string vowels = "aeiou";
-
- // for each character in the given parameter
- for (int i=0; i < value.ToString().Length; i++)
- {
- // for each character in the vowels string
- for (int j=0; j < vowels.Length; j++)
- {
- // convert parameter character to lowercase and compare to vowel
- if (value.Value.Substring(i,1).ToLower() == vowels.Substring(j,1))
- {
- // it is a vowel, increment the count
- countOfVowels+=1;
- }
- }
- }
- }
-
- public void Merge(CountVowels value)
- {
- Accumulate(value.Terminate());
- }
-
- public SqlString Terminate()
- {
- return countOfVowels.ToString();
- }
-}
-//
-
-//-----------------------------------------------------------------------------
-//
-[SqlUserDefinedAggregate(Format.Native)]
-public class SampleAggregate
-{
- //...
-}
-//
diff --git a/snippets/csharp/Microsoft.SqlServer.Server/SqlUserDefinedAggregateAttribute/Test.sql b/snippets/csharp/Microsoft.SqlServer.Server/SqlUserDefinedAggregateAttribute/Test.sql
deleted file mode 100644
index f5014962c7a..00000000000
--- a/snippets/csharp/Microsoft.SqlServer.Server/SqlUserDefinedAggregateAttribute/Test.sql
+++ /dev/null
@@ -1,45 +0,0 @@
--------------------------------------------------------------------------------
--- Stored Procedure
--------------------------------------------------------------------------------
-EXEC InsertCurrency 'AAA', 'Currency Test'
-SELECT * from Sales.Currency where CurrencyCode = 'AAA'
-
-
--------------------------------------------------------------------------------
--- Aggregate
--------------------------------------------------------------------------------
-SELECT LastName, COUNT(LastName) AS CountOfLastName, dbo.CountVowels(LastName) AS CountOfVowels
-FROM Person.Contact
-GROUP BY LastName
-ORDER BY LastName
-
-
--------------------------------------------------------------------------------
--- Trigger
--------------------------------------------------------------------------------
--- Insert one user name that is not an email address and one that is
-INSERT INTO Users(UserName, Pass) VALUES(N'someone', N'cnffjbeq')
-INSERT INTO Users(UserName, Pass) VALUES(N'someone@example.com', N'cnffjbeq')
-
--- check the Users and UsersAudit tables to see the results of the trigger
-select * from Users
-select * from UsersAudit
-
-
--------------------------------------------------------------------------------
--- Function
--------------------------------------------------------------------------------
-SELECT dbo.addTax(10)
-
-
--------------------------------------------------------------------------------
--- Type
--------------------------------------------------------------------------------
-CREATE TABLE test_table (column1 Point)
-go
-
-INSERT INTO test_table (column1) VALUES ('1:2')
-INSERT INTO test_table (column1) VALUES ('-2:3')
-INSERT INTO test_table (column1) VALUES ('-3:-4')
-
-select column1.Quadrant() from test_table
diff --git a/snippets/csharp/Microsoft.SqlServer.Server/SqlUserDefinedTypeAttribute/Test.sql b/snippets/csharp/Microsoft.SqlServer.Server/SqlUserDefinedTypeAttribute/Test.sql
deleted file mode 100644
index f5014962c7a..00000000000
--- a/snippets/csharp/Microsoft.SqlServer.Server/SqlUserDefinedTypeAttribute/Test.sql
+++ /dev/null
@@ -1,45 +0,0 @@
--------------------------------------------------------------------------------
--- Stored Procedure
--------------------------------------------------------------------------------
-EXEC InsertCurrency 'AAA', 'Currency Test'
-SELECT * from Sales.Currency where CurrencyCode = 'AAA'
-
-
--------------------------------------------------------------------------------
--- Aggregate
--------------------------------------------------------------------------------
-SELECT LastName, COUNT(LastName) AS CountOfLastName, dbo.CountVowels(LastName) AS CountOfVowels
-FROM Person.Contact
-GROUP BY LastName
-ORDER BY LastName
-
-
--------------------------------------------------------------------------------
--- Trigger
--------------------------------------------------------------------------------
--- Insert one user name that is not an email address and one that is
-INSERT INTO Users(UserName, Pass) VALUES(N'someone', N'cnffjbeq')
-INSERT INTO Users(UserName, Pass) VALUES(N'someone@example.com', N'cnffjbeq')
-
--- check the Users and UsersAudit tables to see the results of the trigger
-select * from Users
-select * from UsersAudit
-
-
--------------------------------------------------------------------------------
--- Function
--------------------------------------------------------------------------------
-SELECT dbo.addTax(10)
-
-
--------------------------------------------------------------------------------
--- Type
--------------------------------------------------------------------------------
-CREATE TABLE test_table (column1 Point)
-go
-
-INSERT INTO test_table (column1) VALUES ('1:2')
-INSERT INTO test_table (column1) VALUES ('-2:3')
-INSERT INTO test_table (column1) VALUES ('-3:-4')
-
-select column1.Quadrant() from test_table
diff --git a/snippets/csharp/Microsoft.SqlServer.Server/SqlUserDefinedTypeAttribute/Type.csproj b/snippets/csharp/Microsoft.SqlServer.Server/SqlUserDefinedTypeAttribute/Type.csproj
deleted file mode 100644
index a95719c4b0c..00000000000
--- a/snippets/csharp/Microsoft.SqlServer.Server/SqlUserDefinedTypeAttribute/Type.csproj
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
- Library
- net6.0
- enable
-
-
-
-
-
-
-
diff --git a/snippets/csharp/Microsoft.SqlServer.Server/SqlUserDefinedTypeAttribute/Type1.cs b/snippets/csharp/Microsoft.SqlServer.Server/SqlUserDefinedTypeAttribute/Type1.cs
deleted file mode 100644
index 52279ee862e..00000000000
--- a/snippets/csharp/Microsoft.SqlServer.Server/SqlUserDefinedTypeAttribute/Type1.cs
+++ /dev/null
@@ -1,130 +0,0 @@
-//-----------------------------------------------------------------------------
-//
-using System;
-using System.Data.SqlTypes;
-using Microsoft.SqlServer.Server;
-
-[Serializable()]
-[SqlUserDefinedType(Format.Native)]
-public struct Point : INullable
-{
- private Int32 m_x;
- private Int32 m_y;
- private bool is_Null;
-
- public Int32 X
- {
- get
- {
- return (this.m_x);
- }
- set
- {
- m_x = value;
- }
- }
-
- public Int32 Y
- {
- get
- {
- return (this.m_y);
- }
- set
- {
- m_y = value;
- }
- }
-
- public bool IsNull => is_Null;
-
- public static Point Null
- {
- get
- {
- Point pt = new Point();
- pt.is_Null = true;
- return (pt);
- }
- }
-
- public override string ToString()
- {
- if (this.IsNull)
- {
- return "NULL";
- }
- else
- {
- return this.m_x + ":" + this.m_y;
- }
- }
-
- public static Point Parse(SqlString s)
- {
- if (s.IsNull)
- {
- return Null;
- }
-
- // Parse input string here to separate out coordinates
- string? str = Convert.ToString(s);
- string[]? xy = str?.Split(':');
-
- Point pt = new Point();
- if (xy is not null)
- {
- pt.X = Convert.ToInt32(xy[0]);
- pt.Y = Convert.ToInt32(xy[1]);
- }
- return (pt);
- }
-
- public SqlString Quadrant()
- {
- if (m_x == 0 && m_y == 0)
- {
- return "centered";
- }
-
- SqlString stringReturn = "";
-
- if (m_x == 0)
- {
- stringReturn = "center";
- }
- else if (m_x > 0)
- {
- stringReturn = "right";
- }
- else if (m_x < 0)
- {
- stringReturn = "left";
- }
-
- if (m_y == 0)
- {
- stringReturn = stringReturn + " center";
- }
- else if (m_y > 0)
- {
- stringReturn = stringReturn + " top";
- }
- else if (m_y < 0)
- {
- stringReturn = stringReturn + " bottom";
- }
-
- return stringReturn;
- }
-}
-//
-
-//-----------------------------------------------------------------------------
-//
-[SqlUserDefinedType(Format.Native, MaxByteSize = 8000)]
-public class SampleType
-{
- //...
-}
-//
diff --git a/snippets/csharp/System.AddIn.Hosting/AddInController/Overview/P3Host.cs b/snippets/csharp/System.AddIn.Hosting/AddInController/Overview/P3Host.cs
deleted file mode 100644
index 4f24b4f3a17..00000000000
--- a/snippets/csharp/System.AddIn.Hosting/AddInController/Overview/P3Host.cs
+++ /dev/null
@@ -1,269 +0,0 @@
-//
-using System;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.Text;
-using System.AddIn.Hosting;
-using CalcHVAs;
-
-namespace MathHost
-{
- class Program
- {
- static void Main()
- {
-
- //
- // Get path for the pipeline root.
- // Assumes that the current directory is the
- // pipeline directory structure root directory.
- String pipeRoot = Environment.CurrentDirectory;
-
- //
- // Update the cache files of the
- // pipeline segments and add-ins.
- string[] warnings = AddInStore.Update(pipeRoot);
-
- foreach (string warning in warnings)
- {
- Console.WriteLine(warning);
- }
- //
-
- //
- // Search for add-ins of type Calculator (the host view of the add-in)
- // specifying the host's application base, instead of a path,
- // for the FindAddIns method.
-
- Collection tokens =
- AddInStore.FindAddIns(typeof(Calculator), PipelineStoreLocation.ApplicationBase);
- //
- //
-
- //
- //Ask the user which add-in they would like to use.
- AddInToken selectedToken = ChooseAddIn(tokens);
-
- //Activate the selected AddInToken in a new
- //application domain with the Internet trust level.
- Calculator CalcAddIn = selectedToken.Activate(AddInSecurityLevel.Internet);
-
- //Run the add-in using a custom method.
- RunCalculator(CalcAddIn);
- //
-
- //
- // Find a specific add-in.
-
- // Construct the path to the add-in.
- string addInFilePath = pipeRoot + @"\AddIns\P3AddIn2\P3AddIn2.dll";
-
- // The fourth parameter, addinTypeName, takes the full name
- // of the type qualified by its namespace. Same as AddInToken.AddInFullName.
- Collection tokenColl = AddInStore.FindAddIn(typeof(Calculator),
- pipeRoot, addInFilePath, "CalcAddIns.P3AddIn2");
- Console.WriteLine("Found {0}", tokenColl[0].Name);
- //
-
- //
- // Get the AddInController of a
- // currently actived add-in (CalcAddIn).
- AddInController aiController = AddInController.GetAddInController(CalcAddIn);
-
- // Select another token.
- AddInToken selectedToken2 = ChooseAddIn(tokens);
-
- // Activate a second add-in, CalcAddIn2, in the same
- // appliation domain and process as the first add-in by passing
- // the first add-in's AddInEnvironment object to the Activate method.
- AddInEnvironment aiEnvironment = aiController.AddInEnvironment;
- Calculator CalcAddIn2 =
- selectedToken2.Activate(aiEnvironment);
-
- // Get the AddInController for the second add-in to compare environments.
- AddInController aiController2 = AddInController.GetAddInController(CalcAddIn2);
- Console.WriteLine("Add-ins in same application domain: {0}", aiController.AppDomain.Equals(aiController2.AppDomain));
- Console.WriteLine("Add-ins in same process: {0}", aiEnvironment.Process.Equals(aiController2.AddInEnvironment.Process));
- //
-
- //
- // Get the application domain
- // of an existing add-in (CalcAddIn).
- AddInController aiCtrl = AddInController.GetAddInController(CalcAddIn);
- AppDomain AddInAppDom = aiCtrl.AppDomain;
-
- // Activate another add-in in the same application domain.
- Calculator CalcAddIn3 =
- selectedToken2.Activate(AddInAppDom);
-
- // Show that CalcAddIn3 was loaded
- // into CalcAddIn's application domain.
- AddInController aic = AddInController.GetAddInController(CalcAddIn3);
- Console.WriteLine("Add-in loaded into existing application domain: {0}",
- aic.AppDomain.Equals(AddInAppDom));
- //
-
- //
- // Create an external process.
- AddInProcess pExternal = new AddInProcess();
-
- // Activate an add-in in the external process
- // with a full trust security level.
- Calculator CalcAddIn4 =
- selectedToken.Activate(pExternal,
- AddInSecurityLevel.FullTrust);
-
- // Show that the add-in is an external process
- // by verifying that it is not in the current (host's) process.
- AddInController AddinCtl = AddInController.GetAddInController(CalcAddIn4);
- Console.WriteLine("Add-in in host's process: {0}",
- AddinCtl.AddInEnvironment.Process.IsCurrentProcess);
- //
- //
- // Use qualification data to control
- // how an add-in should be activated.
-
- if (selectedToken.QualificationData[AddInSegmentType.AddIn]["Isolation"].Equals("NewProcess"))
- {
- // Create an external process.
- AddInProcess external = new AddInProcess();
-
- // Activate an add-in in the new process
- // with the full trust security level.
- Calculator CalcAddIn5 =
- selectedToken.Activate(external,
- AddInSecurityLevel.FullTrust);
- Console.WriteLine("Add-in activated per qualification data.");
- }
- else
- {
- Console.WriteLine("This add-in is not designated to be activated in a new process.");
- }
- //
-
- //
- // Show the qualification data for each
- // token in an AddInToken collection.
- foreach (AddInToken token in tokens)
- {
- foreach (QualificationDataItem qdi in token)
- {
- Console.WriteLine("{0} {1}\n\t QD Name: {2}, QD Value: {3}",
- token.Name,
- qdi.Segment,
- qdi.Name,
- qdi.Value);
- }
- }
-
- //
- }
-
- //
- // Method to select a token by
- // enumeratng the AddInToken collection.
- private static AddInToken ChooseAddIn(Collection tokens)
- {
- if (tokens.Count == 0)
- {
- Console.WriteLine("No add-ins are available");
- return null;
- }
-
- Console.WriteLine("Available add-ins: ");
-
- //
- // Show the token properties for each token
- // in the AddInToken collection (tokens),
- // preceded by the add-in number in [] brackets.
- int tokNumber = 1;
- foreach (AddInToken tok in tokens)
- {
- Console.WriteLine(String.Format("\t[{0}]: {1} - {2}\n\t{3}\n\t\t {4}\n\t\t {5} - {6}",
- tokNumber.ToString(),
- tok.Name,
- tok.AddInFullName,
- tok.AssemblyName,
- tok.Description,
- tok.Version,
- tok.Publisher));
- tokNumber++;
- }
- //
-
- Console.WriteLine("Which calculator do you want to use?");
- String line = Console.ReadLine();
- int selection;
- if (Int32.TryParse(line, out selection))
- {
- if (selection <= tokens.Count)
- {
- return tokens[selection - 1];
- }
- }
- Console.WriteLine("Invalid selection: {0}. Please choose again.", line);
- return ChooseAddIn(tokens);
- }
- //
-
- private static void RunCalculator(Calculator calc)
- {
-
- if (calc == null)
- {
- //No calculators were found, read a line and exit.
- Console.ReadLine();
- }
- Console.WriteLine("Available operations: " + calc.Operations);
- Console.WriteLine("Type \"exit\" to exit");
- String line = Console.ReadLine();
- while (!line.Equals("exit"))
- {
- // The Parser class parses the user's input.
- try
- {
- Parser c = new Parser(line);
- Console.WriteLine(calc.Operate(c.Action, c.A, c.B));
- }
- catch
- {
- Console.WriteLine("Invalid command: {0}. Commands must be formated: [number] [operation] [number]", line);
- Console.WriteLine("Available operations: " + calc.Operations);
- }
-
- line = Console.ReadLine();
- }
- }
- }
-
- internal class Parser
- {
- internal Parser(String line)
- {
- String[] parts = line.Trim().Split(' ');
- a = Double.Parse(parts[0]);
- action = parts[1];
- b = Double.Parse(parts[2]);
- }
-
- double a;
-
- public double A
- {
- get { return a; }
- }
- double b;
-
- public double B
- {
- get { return b; }
- }
- String action;
-
- public String Action
- {
- get { return action; }
- }
- }
-}
-//
diff --git a/snippets/csharp/System.AddIn.Hosting/AddInController/Shutdown/Program.cs b/snippets/csharp/System.AddIn.Hosting/AddInController/Shutdown/Program.cs
deleted file mode 100644
index b53a7bb6236..00000000000
--- a/snippets/csharp/System.AddIn.Hosting/AddInController/Shutdown/Program.cs
+++ /dev/null
@@ -1,228 +0,0 @@
-//
-using System;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.Text;
-using LibraryContractsHAV;
-using System.AddIn.Hosting;
-using System.Xml;
-
-namespace ListAdaptersHost
-{
- class Program
- {
- static void Main(string[] args)
- {
-
- //
- // In this example, the pipeline root is the current directory.
- String pipeRoot = Environment.CurrentDirectory;
-
- // Rebuild the cache of pipeline and add-in information.
- string[] warnings = AddInStore.Update(pipeRoot);
- if (warnings.Length > 0)
- {
- foreach (string one in warnings)
- {
- Console.WriteLine(one);
- }
- }
- //
-
- //
- // Find add-ins of type LibraryManager under the specified pipeline root directory.
- Collection tokens = AddInStore.FindAddIns(typeof(LibraryManager), pipeRoot);
- //
- // Determine which add-in to use.
- AddInToken selectedToken = ChooseAddIn(tokens);
-
- //
- // Activate the selected AddInToken in a new
- // application domain with a specified security trust level.
- LibraryManager manager = selectedToken.Activate(AddInSecurityLevel.FullTrust);
- //
-
- // Create a collection of books.
- IList books = CreateBooks();
-
- // Show the collection count.
- Console.WriteLine("Number of books: {0}", books.Count.ToString());
-
- // Have the add-in process the books.
- // The add-in will discount computer books by $20
- // and list their before and after prices. It
- // will also remove all horror books.
- manager.ProcessBooks(books);
-
- // List the genre of each book. There
- // should be no horror books.
- foreach (BookInfo bk in books)
- {
- Console.WriteLine(bk.Genre());
- }
-
- Console.WriteLine("Number of books: {0}", books.Count.ToString());
-
- Console.WriteLine();
- // Have the add-in pass a BookInfo object
- // of the best selling book.
- BookInfo bestBook = manager.GetBestSeller();
- Console.WriteLine("Best seller is {0} by {1}", bestBook.Title(), bestBook.Author());
-
- // Have the add-in show the sales tax rate.
- manager.Data("sales tax");
-
- //
- AddInController ctrl = AddInController.GetAddInController(manager);
- ctrl.Shutdown();
- //
- Console.WriteLine("Press any key to exit.");
- Console.ReadLine();
- }
-
- private static AddInToken ChooseAddIn(Collection tokens)
- {
- if (tokens.Count == 0)
- {
- Console.WriteLine("No add-ins of this type are available");
- return null;
- }
- Console.WriteLine("{0} Available add-in(s):", tokens.Count.ToString());
- //
- for (int i = 0; i < tokens.Count; i++)
- {
- // Show AddInToken properties.
- Console.WriteLine("[{0}] - {1}, Publisher: {2}, Version: {3}, Description: {4}",
- (i + 1).ToString(), tokens[i].Name, tokens[i].Publisher,
- tokens[i].Version, tokens[i].Description);
- }
- //
- Console.WriteLine("Select add-in by number:");
- String line = Console.ReadLine();
- int selection;
- if (Int32.TryParse(line, out selection))
- {
- if (selection <= tokens.Count)
- {
- return tokens[selection - 1];
- }
- }
- Console.WriteLine("Invalid selection: {0}. Please choose again.", line);
- return ChooseAddIn(tokens);
- }
-
- internal static IList CreateBooks()
- {
- List books = new List();
-
- string ParamId = "";
- string ParamAuthor = "";
- string ParamTitle = "";
- string ParamGenre = "";
- string ParamPrice = "";
- string ParamPublish_Date = "";
- string ParamDescription = "";
-
- XmlDocument xDoc = new XmlDocument();
- xDoc.Load(@"c:\Books.xml");
-
- XmlNode xRoot = xDoc.DocumentElement;
- if (xRoot.Name == "catalog")
- {
- XmlNodeList bklist = xRoot.ChildNodes;
- foreach (XmlNode bk in bklist)
- {
- ParamId = bk.Attributes[0].Value;
- XmlNodeList dataItems = bk.ChildNodes;
- int items = dataItems.Count;
- foreach (XmlNode di in dataItems)
- {
- switch (di.Name)
- {
- case "author":
- ParamAuthor = di.InnerText;
- break;
- case "title":
- ParamTitle = di.InnerText;
- break;
- case "genre":
- ParamGenre = di.InnerText;
- break;
- case "price":
- ParamPrice = di.InnerText;
- break;
- case "publish_date":
- ParamAuthor = di.InnerText;
- break;
- case "description":
- ParamDescription = di.InnerText;
- break;
- default:
- break;
- }
- }
- books.Add(new MyBookInfo(ParamId, ParamAuthor, ParamTitle, ParamGenre,
- ParamPrice, ParamPublish_Date, ParamDescription));
- }
- }
- return books;
- }
- }
-
- class MyBookInfo : BookInfo
- {
- private string _id;
- private string _author;
- private string _title;
- private string _genre;
- private string _price;
- private string _publish_date;
- private string _description;
-
- public MyBookInfo(string id, string author, string title,
- string genre, string price,
- string publish_date, string description)
- {
- _id = id;
- _author = author;
- _title = title;
- _genre = genre;
- _price = price;
- _publish_date = publish_date;
- _description = description;
- }
-
- public override string ID()
- {
- return _id;
- }
-
- public override string Title()
- {
- return _title;
- }
-
- public override string Author()
- {
- return _author;
- }
-
- public override string Genre()
- {
- return _genre;
- }
- public override string Price()
- {
- return _price;
- }
- public override string Publish_Date()
- {
- return _publish_date;
- }
- public override string Description()
- {
- return _description;
- }
- }
-}
-//
diff --git a/snippets/csharp/System.AddIn.Pipeline/AddInAdapterAttribute/Overview/Calc1ViewToContractAddInSideAdapter.cs b/snippets/csharp/System.AddIn.Pipeline/AddInAdapterAttribute/Overview/Calc1ViewToContractAddInSideAdapter.cs
deleted file mode 100644
index 91c7bb94ec9..00000000000
--- a/snippets/csharp/System.AddIn.Pipeline/AddInAdapterAttribute/Overview/Calc1ViewToContractAddInSideAdapter.cs
+++ /dev/null
@@ -1,44 +0,0 @@
-//
-using System.AddIn.Pipeline;
-using CalcAddInViews;
-using CalculatorContracts;
-
-namespace CalcAddInSideAdapters
-{
- //
- // The AddInAdapterAttribute identifies this class as the add-in-side adapter
- // pipeline segment.
- [AddInAdapter()]
- public class CalculatorViewToContractAddInSideAdapter :
- ContractBase, ICalc1Contract
- {
- //
- private ICalculator _view;
-
- public CalculatorViewToContractAddInSideAdapter(ICalculator view)
- {
- _view = view;
- }
-
- public virtual double Add(double a, double b)
- {
- return _view.Add(a, b);
- }
-
- public virtual double Subtract(double a, double b)
- {
- return _view.Subtract(a, b);
- }
-
- public virtual double Multiply(double a, double b)
- {
- return _view.Multiply(a, b);
- }
-
- public virtual double Divide(double a, double b)
- {
- return _view.Divide(a, b);
- }
- }
-}
-//
diff --git a/snippets/csharp/System.AddIn.Pipeline/AddInBaseAttribute/Overview/Calc1AddInView.cs b/snippets/csharp/System.AddIn.Pipeline/AddInBaseAttribute/Overview/Calc1AddInView.cs
deleted file mode 100644
index 12719abbba4..00000000000
--- a/snippets/csharp/System.AddIn.Pipeline/AddInBaseAttribute/Overview/Calc1AddInView.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-//
-using System.AddIn.Pipeline;
-
-namespace CalcAddInViews
-{
- //
- // The AddInBaseAttribute identifies this interface as the basis for
- // the add-in view pipeline segment.
- [AddInBase()]
- public interface ICalculator
- {
- //
- double Add(double a, double b);
- double Subtract(double a, double b);
- double Multiply(double a, double b);
- double Divide(double a, double b);
- }
-}
-//
diff --git a/snippets/csharp/System.AddIn.Pipeline/AddInBaseAttribute/Overview/Calc1AddInView.csproj b/snippets/csharp/System.AddIn.Pipeline/AddInBaseAttribute/Overview/Calc1AddInView.csproj
deleted file mode 100644
index 44dcd699478..00000000000
--- a/snippets/csharp/System.AddIn.Pipeline/AddInBaseAttribute/Overview/Calc1AddInView.csproj
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
- Debug
- AnyCPU
- 9.0.20706
- 2.0
- {E401FCC5-080E-476E-BBE6-079F8C10E96F}
- Library
- Properties
- Template
- Calc1AddInView
-
-
- 3.5
-
-
- v4.8
-
-
-
- true
- full
- false
- c:\sd\parsnip\orcas\clr\%40pipeline\addinviews\
- DEBUG;TRACE
- prompt
- 4
- false
-
-
- pdbonly
- true
- c:\sd\parsnip\orcas\clr\%40pipeline\addinviews\
- TRACE
- prompt
- 4
- false
-
-
-
-
- False
- ..\..\..\Orcas\Assemblies\System.AddIn.dll
- 3.5
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/snippets/csharp/System.AddIn.Pipeline/AddInBaseAttribute/Overview/Properties/assemblyinfo.cs b/snippets/csharp/System.AddIn.Pipeline/AddInBaseAttribute/Overview/Properties/assemblyinfo.cs
deleted file mode 100644
index c771a433d8a..00000000000
--- a/snippets/csharp/System.AddIn.Pipeline/AddInBaseAttribute/Overview/Properties/assemblyinfo.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-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("Template")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Microsoft")]
-[assembly: AssemblyProduct("Template")]
-[assembly: AssemblyCopyright("Copyright © Microsoft 2006")]
-[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("87156a8e-cd27-4db3-89e8-7e8c794b8a68")]
-
-// 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 --git a/snippets/csharp/System.AddIn.Pipeline/AddInContractAttribute/Overview/Calc1Contract.csproj b/snippets/csharp/System.AddIn.Pipeline/AddInContractAttribute/Overview/Calc1Contract.csproj
deleted file mode 100644
index 51c6812a356..00000000000
--- a/snippets/csharp/System.AddIn.Pipeline/AddInContractAttribute/Overview/Calc1Contract.csproj
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
- Debug
- AnyCPU
- 9.0.20706
- 2.0
- {F5AC5AB9-589E-44C7-A85D-A4055D485C1F}
- Library
- Properties
- CalculatorContracts
- ICalc1Contract
-
-
- 3.5
-
-
- v4.8
-
-
-
- true
- full
- false
- c:\sd\parsnip\orcas\clr\%40pipeline\contracts\
- DEBUG;TRACE
- prompt
- 4
- false
-
-
- pdbonly
- true
- c:\sd\parsnip\orcas\clr\%40pipeline\contracts\
- TRACE
- prompt
- 4
- false
-
-
-
-
- False
- ..\..\..\Orcas\Assemblies\System.AddIn.dll
- 3.5
-
-
- False
- ..\..\..\Orcas\Assemblies\System.AddIn.Contract.dll
- 3.5
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/snippets/csharp/System.AddIn.Pipeline/AddInContractAttribute/Overview/ICalc1Contract.cs b/snippets/csharp/System.AddIn.Pipeline/AddInContractAttribute/Overview/ICalc1Contract.cs
deleted file mode 100644
index afd7e8c3be4..00000000000
--- a/snippets/csharp/System.AddIn.Pipeline/AddInContractAttribute/Overview/ICalc1Contract.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-using System.AddIn.Contract;
-using System.AddIn.Pipeline;
-
-namespace CalculatorContracts
-{
- //
- // The AddInContractAttribute identifies this pipeline segment as a
- // contract.
- [AddInContract]
- public interface ICalc1Contract : IContract
- {
- //
- double Add(double a, double b);
- double Subtract(double a, double b);
- double Multiply(double a, double b);
- double Divide(double a, double b);
- }
-}
-//
diff --git a/snippets/csharp/System.AddIn.Pipeline/AddInContractAttribute/Overview/Properties/assemblyinfo.cs b/snippets/csharp/System.AddIn.Pipeline/AddInContractAttribute/Overview/Properties/assemblyinfo.cs
deleted file mode 100644
index 6bb19419cb9..00000000000
--- a/snippets/csharp/System.AddIn.Pipeline/AddInContractAttribute/Overview/Properties/assemblyinfo.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-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("CalculatorContracts")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Microsoft")]
-[assembly: AssemblyProduct("CalculatorContracts")]
-[assembly: AssemblyCopyright("Copyright © Microsoft 2006")]
-[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("4e36de57-4f2d-474e-98aa-f149f382e508")]
-
-// 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 --git a/snippets/csharp/System.AddIn.Pipeline/CollectionAdapters/ToIListContractT/LibraryManagerContractToViewHostAdapter.cs b/snippets/csharp/System.AddIn.Pipeline/CollectionAdapters/ToIListContractT/LibraryManagerContractToViewHostAdapter.cs
deleted file mode 100644
index ba7dd605e89..00000000000
--- a/snippets/csharp/System.AddIn.Pipeline/CollectionAdapters/ToIListContractT/LibraryManagerContractToViewHostAdapter.cs
+++ /dev/null
@@ -1,48 +0,0 @@
-//
-using System.Collections.Generic;
-using System.AddIn.Pipeline;
-namespace LibraryContractsHostAdapters
-{
-//
-[HostAdapterAttribute()]
-public class LibraryManagerContractToViewHostAdapter : LibraryContractsHAV.LibraryManager
-{
-//
-
- //
- private Library.ILibraryManagerContract _contract;
- private System.AddIn.Pipeline.ContractHandle _handle;
-
- public LibraryManagerContractToViewHostAdapter(Library.ILibraryManagerContract contract)
- {
- _contract = contract;
- _handle = new System.AddIn.Pipeline.ContractHandle(contract);
- }
- //
-
- //
- public override void ProcessBooks(IList books) {
- _contract.ProcessBooks(CollectionAdapters.ToIListContract(books,
- LibraryContractsHostAdapters.BookInfoHostAdapter.ViewToContractAdapter,
- LibraryContractsHostAdapters.BookInfoHostAdapter.ContractToViewAdapter));
- }
- //
-
- public override LibraryContractsHAV.BookInfo GetBestSeller()
- {
- return BookInfoHostAdapter.ContractToViewAdapter(_contract.GetBestSeller());
- }
-
- internal Library.ILibraryManagerContract GetSourceContract()
- {
- return _contract;
- }
- public override string Data(string txt)
- {
- string rtxt = _contract.Data(txt);
- return rtxt;
- }
-}
-}
-//
diff --git a/snippets/csharp/System.AddIn.Pipeline/CollectionAdapters/ToIListT/LibraryManagerViewToContractAddInAdapter.cs b/snippets/csharp/System.AddIn.Pipeline/CollectionAdapters/ToIListT/LibraryManagerViewToContractAddInAdapter.cs
deleted file mode 100644
index d0ec5a02321..00000000000
--- a/snippets/csharp/System.AddIn.Pipeline/CollectionAdapters/ToIListT/LibraryManagerViewToContractAddInAdapter.cs
+++ /dev/null
@@ -1,48 +0,0 @@
-//
-using System.IO;
-using System.AddIn.Pipeline;
-using System.AddIn.Contract;
-using System.Collections.Generic;
-namespace LibraryContractsAddInAdapters
-{
-//
-// The AddInAdapterAttribute
-// identifes this pipeline
-// segment as an add-in-side adapter.
-[AddInAdapter]
-public class LibraryManagerViewToContractAddInAdapter :
-System.AddIn.Pipeline.ContractBase, Library.ILibraryManagerContract
-{
-//
- private LibraryContractsBase.LibraryManager _view;
- public LibraryManagerViewToContractAddInAdapter(LibraryContractsBase.LibraryManager view)
- {
- _view = view;
- }
- //
- public virtual void ProcessBooks(IListContract books)
- {
- _view.ProcessBooks(CollectionAdapters.ToIList(books,
- LibraryContractsAddInAdapters.BookInfoAddInAdapter.ContractToViewAdapter,
- LibraryContractsAddInAdapters.BookInfoAddInAdapter.ViewToContractAdapter));
- }
- //
- public virtual Library.IBookInfoContract GetBestSeller()
- {
- return BookInfoAddInAdapter.ViewToContractAdapter(_view.GetBestSeller());
- }
-
- public virtual string Data(string txt)
- {
- string rtxt = _view.Data(txt);
- return rtxt;
- }
-
- internal LibraryContractsBase.LibraryManager GetSourceView()
- {
- return _view;
- }
-}
-}
-//
\ No newline at end of file
diff --git a/snippets/csharp/System.AddIn.Pipeline/ContractHandle/Overview/Calc2ContractToViewHostSideAdapter.cs b/snippets/csharp/System.AddIn.Pipeline/ContractHandle/Overview/Calc2ContractToViewHostSideAdapter.cs
deleted file mode 100644
index e7390cef710..00000000000
--- a/snippets/csharp/System.AddIn.Pipeline/ContractHandle/Overview/Calc2ContractToViewHostSideAdapter.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-//
-using System.AddIn.Pipeline;
-using CalcHVAs;
-using CalculatorContracts;
-
-namespace CalcHostSideAdapters {
-
-[HostAdapter]
-public class CalculatorContractToViewHostAdapter : Calculator {
-
-//
- private CalculatorContracts.ICalc2Contract _contract;
-
- private System.AddIn.Pipeline.ContractHandle _handle;
-
- public CalculatorContractToViewHostAdapter(ICalc2Contract contract) {
- _contract = contract;
- _handle = new System.AddIn.Pipeline.ContractHandle(contract);
- }
-//
-
- public override string Operations
- {
- get
- {
- return _contract.GetAvailableOperations();
- }
- }
-
- public override double Operate(string operation, double a, double b)
- {
- return _contract.Operate(operation, a, b);
- }
- }
-}
-//
\ No newline at end of file
diff --git a/snippets/csharp/System.AddIn.Pipeline/HostAdapterAttribute/Overview/Calc1ContractToViewHostSideAdapter.cs b/snippets/csharp/System.AddIn.Pipeline/HostAdapterAttribute/Overview/Calc1ContractToViewHostSideAdapter.cs
deleted file mode 100644
index d43685b2624..00000000000
--- a/snippets/csharp/System.AddIn.Pipeline/HostAdapterAttribute/Overview/Calc1ContractToViewHostSideAdapter.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-//
-using System.AddIn.Pipeline;
-using CalcHVAs;
-using CalculatorContracts;
-
-namespace CalcHostSideAdapters
-{
- //
- // The HostAdapterAttribute identifies this class as the host-side adapter
- // pipeline segment.
- [HostAdapterAttribute()]
- public class CalculatorContractToViewHostSideAdapter : ICalculator
- {
- //
- private ICalc1Contract _contract;
- private System.AddIn.Pipeline.ContractHandle _handle;
-
- public CalculatorContractToViewHostSideAdapter(ICalc1Contract contract)
- {
- _contract = contract;
- _handle = new ContractHandle(contract);
- }
-
- public double Add(double a, double b)
- {
- return _contract.Add(a, b);
- }
-
- public double Subtract(double a, double b)
- {
- return _contract.Subtract(a, b);
- }
-
- public double Multiply(double a, double b)
- {
- return _contract.Multiply(a, b);
- }
-
- public double Divide(double a, double b)
- {
- return _contract.Divide(a, b);
- }
- }
-}
-//
diff --git a/snippets/csharp/System.AddIn/AddInAttribute/Overview/addincalcv2.cs b/snippets/csharp/System.AddIn/AddInAttribute/Overview/addincalcv2.cs
deleted file mode 100644
index a76a448b304..00000000000
--- a/snippets/csharp/System.AddIn/AddInAttribute/Overview/addincalcv2.cs
+++ /dev/null
@@ -1,53 +0,0 @@
-//
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.AddIn;
-using System.AddIn.Pipeline;
-using CalcAddInViews;
-namespace CalcAddIns
-{
-//
-// This pipeline segment has
-// two attributes:
-// 1 - An AddInAttribute to identify
-// this segment as an add-in.
-//
-// 2 - A QualificationDataAttribute to
-// indicate that the add-in should
-// be loaded into a new application domain.
-
- [AddIn("Calculator Add-in",Version="2.0.0.0")]
- [QualificationData("Isolation", "NewAppDomain")]
- public class SampleV2AddIn : Calculator2
- {
-//
- public override string Operations
- {
- get
- {
- return "+, -, *, /, **";
- }
- }
-
- public override double Operate(string operation, double a, double b)
- {
- switch (operation)
- {
- case "+":
- return a + b;
- case "-":
- return a - b;
- case "*":
- return a * b;
- case "/":
- return a / b;
- case "**":
- return Math.Pow(a, b);
- default:
- throw new InvalidOperationException("This add-in does not support: " + operation);
- }
- }
- }
-}
-//
\ No newline at end of file
diff --git a/snippets/csharp/System.Configuration.Install/AssemblyInstaller/.ctor/assemblyinstaller_install.cs b/snippets/csharp/System.Configuration.Install/AssemblyInstaller/.ctor/assemblyinstaller_install.cs
deleted file mode 100644
index 294a81ad0f5..00000000000
--- a/snippets/csharp/System.Configuration.Install/AssemblyInstaller/.ctor/assemblyinstaller_install.cs
+++ /dev/null
@@ -1,57 +0,0 @@
-// System.Configuration.Install.AssemblyInstaller.AssemblyInstaller()
-// System.Configuration.Install.AssemblyInstaller.Install
-// System.Configuration.Install.AssemblyInstaller.Commit
-
-/* The following example demonstrates the 'AssemblyInstaller()' constructor and
- the 'Install' and 'Commit' methods of the 'AssemblyInstaller' class.
- An object of the AssemblyInstaller class is created by invoking the constructor.
- The properties of this object are set and the install and commit methods are
- called to install the 'MyAssembly_Install.exe' assembly.
-*/
-//
-//
-using System;
-using System.Configuration.Install;
-using System.Collections;
-using System.Collections.Specialized;
-
-class MyInstallClass
-{
- static void Main()
- {
- IDictionary mySavedState = new Hashtable();
-
- Console.WriteLine( "" );
-
- try
- {
- // Set the commandline argument array for 'logfile'.
- string[] myString = new string[ 1 ];
- myString[ 0 ] = "/logFile=example.log";
-
-//
- // Create an object of the 'AssemblyInstaller' class.
- AssemblyInstaller myAssemblyInstaller = new AssemblyInstaller();
-//
-
- // Set the properties to install the required assembly.
- myAssemblyInstaller.Path = "MyAssembly_Install.exe";
- myAssemblyInstaller.CommandLine = myString;
- myAssemblyInstaller.UseNewContext = true;
-
- // Clear the 'IDictionary' object.
- mySavedState.Clear();
-
- // Install the 'MyAssembly_Install' assembly.
- myAssemblyInstaller.Install( mySavedState );
-
- // Commit the 'MyAssembly_Install' assembly.
- myAssemblyInstaller.Commit( mySavedState );
- }
- catch( Exception )
- {
- }
- }
-}
-//
-//
\ No newline at end of file
diff --git a/snippets/csharp/System.Configuration.Install/AssemblyInstaller/.ctor/assemblyinstaller_uninstall.cs b/snippets/csharp/System.Configuration.Install/AssemblyInstaller/.ctor/assemblyinstaller_uninstall.cs
deleted file mode 100644
index 1c58ccbd282..00000000000
--- a/snippets/csharp/System.Configuration.Install/AssemblyInstaller/.ctor/assemblyinstaller_uninstall.cs
+++ /dev/null
@@ -1,60 +0,0 @@
-// System.Configuration.Install.AssemblyInstaller.AssemblyInstaller( string, string[] )
-// System.Configuration.Install.AssemblyInstaller.Uninstall
-
-/* The following example demonstrates the 'AssemblyInstaller( string, string[] )'
- constructor and the 'Uninstall' method of the 'AssemblyInstaller' class.
- An object of the AssemblyInstaller class is created by invoking the constructor
- with the assembly to install and the commandline argument array as
- parameters. The uninstall method is called after installing and committing
- the assembly passed as the parameter to the constructor.
-*/
-
-using System;
-using System.Configuration.Install;
-using System.Collections;
-using System.Collections.Specialized;
-
-class MyInstallClass
-{
- static void Main()
- {
- IDictionary mySavedState = new Hashtable();
-
- Console.WriteLine( "" );
-
- try
- {
- //
- string[] myStringArray = new string[ 1 ];
- string myString;
-
- // Set the commandline argument array for 'logfile'.
- myStringArray[ 0 ] = "/logFile=example.log";
-
- // Set the name of the assembly to install.
- myString = "MyAssembly_Uninstall.exe";
-
- // Create an object of the 'AssemblyInstaller' class.
- AssemblyInstaller myAssemblyInstaller = new
- AssemblyInstaller( myString , myStringArray );
-//
-
- // Install and commit the 'MyAssembly_Uninstall' assembly.
- mySavedState.Clear();
- myAssemblyInstaller.Install( mySavedState );
- myAssemblyInstaller.Commit( mySavedState );
-
-//
- // Uninstall the 'MyAssembly_Uninstall' assembly.
- myAssemblyInstaller.Uninstall( mySavedState );
-//
- }
- catch( ArgumentException )
- {
- }
- catch( Exception myException )
- {
- Console.WriteLine( myException.Message );
- }
- }
-}
diff --git a/snippets/csharp/System.Configuration.Install/AssemblyInstaller/CheckIfInstallable/MyAssembly_CheckIfInstallable.cs b/snippets/csharp/System.Configuration.Install/AssemblyInstaller/CheckIfInstallable/MyAssembly_CheckIfInstallable.cs
deleted file mode 100644
index 8db49e05961..00000000000
--- a/snippets/csharp/System.Configuration.Install/AssemblyInstaller/CheckIfInstallable/MyAssembly_CheckIfInstallable.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-/* The following example creates an assembly which is used to demonstrate
- the methods, properties and constructors of the 'AssemblyInstaller' class.
-*/
-
-using System;
-using System.ComponentModel;
-using System.Configuration.Install;
-using System.Collections;
-
-namespace MyAssembly
-{
- [RunInstallerAttribute(true)]
- public class MyProjectInstaller : Installer
- {
- static void Main()
- {
- Console.WriteLine( "Hello World" );
- }
- }
-}
diff --git a/snippets/csharp/System.Configuration.Install/AssemblyInstaller/CheckIfInstallable/Project.csproj b/snippets/csharp/System.Configuration.Install/AssemblyInstaller/CheckIfInstallable/Project.csproj
deleted file mode 100644
index 22bd4a76398..00000000000
--- a/snippets/csharp/System.Configuration.Install/AssemblyInstaller/CheckIfInstallable/Project.csproj
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
- Library
- net48
- true
-
-
-
-
-
-
-
diff --git a/snippets/csharp/System.Configuration.Install/AssemblyInstaller/CheckIfInstallable/assemblyinstaller_checkifinstallable.cs b/snippets/csharp/System.Configuration.Install/AssemblyInstaller/CheckIfInstallable/assemblyinstaller_checkifinstallable.cs
deleted file mode 100644
index cb48bcb822a..00000000000
--- a/snippets/csharp/System.Configuration.Install/AssemblyInstaller/CheckIfInstallable/assemblyinstaller_checkifinstallable.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-// System.Configuration.Install.AssemblyInstaller.CheckIfInstallable
-
-/* The following example demonstrates the 'CheckIfInstallable' method
- of the 'AssemblyInstaller' class.
- The 'CheckIfInstallable' method is applied to an existent and
- nonexistent assembly and the results of the call are displayed
- onto the console.
-*/
-//
-using System;
-using System.Configuration.Install;
-
-class MyCheckIfInstallableClass:Installer
-{
- static void Main()
- {
-
- try
- {
- // Determine whether the assembly 'MyAssembly' is installable.
- AssemblyInstaller.CheckIfInstallable( "MyAssembly_CheckIfInstallable.exe" );
-
- Console.WriteLine( "The assembly 'MyAssembly_CheckIfInstallable' is installable" );
-
- // Determine whether the assembly 'NonExistant' is installable.
- AssemblyInstaller.CheckIfInstallable( "NonExistant" );
- }
- catch( Exception )
- {
- }
- }
-}
-//
\ No newline at end of file
diff --git a/snippets/csharp/System.Configuration.Install/AssemblyInstaller/CommandLine/MyAssembly_Rollback.cs b/snippets/csharp/System.Configuration.Install/AssemblyInstaller/CommandLine/MyAssembly_Rollback.cs
deleted file mode 100644
index d9fca9db0b4..00000000000
--- a/snippets/csharp/System.Configuration.Install/AssemblyInstaller/CommandLine/MyAssembly_Rollback.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-/* The following example creates an assembly which is used to demonstrate
- the methods, properties and constructors of the 'AssemblyInstaller' class.
-*/
-
-using System;
-using System.ComponentModel;
-using System.Configuration.Install;
-using System.Collections;
-
-namespace MyAssembly
-{
- [RunInstallerAttribute(true)]
- public class MyProjectInstaller : Installer
- {
- static void Main()
- {
- Console.WriteLine( "Hello World" );
- }
- }
-}
diff --git a/snippets/csharp/System.Configuration.Install/AssemblyInstaller/CommandLine/Project.csproj b/snippets/csharp/System.Configuration.Install/AssemblyInstaller/CommandLine/Project.csproj
deleted file mode 100644
index 22bd4a76398..00000000000
--- a/snippets/csharp/System.Configuration.Install/AssemblyInstaller/CommandLine/Project.csproj
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
- Library
- net48
- true
-
-
-
-
-
-
-
diff --git a/snippets/csharp/System.Configuration.Install/AssemblyInstaller/CommandLine/assemblyinstaller_rollback.cs b/snippets/csharp/System.Configuration.Install/AssemblyInstaller/CommandLine/assemblyinstaller_rollback.cs
deleted file mode 100644
index da7abc9d8db..00000000000
--- a/snippets/csharp/System.Configuration.Install/AssemblyInstaller/CommandLine/assemblyinstaller_rollback.cs
+++ /dev/null
@@ -1,61 +0,0 @@
-// System.Configuration.Install.AssemblyInstaller.Rollback
-// System.Configuration.Install.AssemblyInstaller.Path
-// System.Configuration.Install.AssemblyInstaller.CommandLine
-
-/* The following example demonstrates the 'Rollback' method and the
- 'Path' and 'CommandLine' properties of the 'AssemblyInstaller' class.
- An object of the AssemblyInstaller class is created by invoking the constructor.
- The properties of this object are set and the install method is invoked on the
- 'MyAssembly.exe' assembly. The 'Rollback' method is called to undo the
- install process on the specified assembly.
-*/
-
-using System;
-using System.Configuration.Install;
-using System.Collections;
-using System.Collections.Specialized;
-
-class AssemblyInstaller_Example
-{
- static void Main()
- {
- IDictionary mySavedState = new Hashtable();
-
- Console.WriteLine( "" );
-
- try
- {
-//
- // Create an object of the 'AssemblyInstaller' class.
- AssemblyInstaller myAssemblyInstaller = new AssemblyInstaller();
-
- // Set the path property of the AssemblyInstaller object.
- myAssemblyInstaller.Path = "MyAssembly_Rollback.exe";
-//
-
-//
- // Set the logfile name in the commandline argument array.
- string[] commandLineOptions = new string[ 1 ] {"/LogFile=example.log"};
- myAssemblyInstaller.CommandLine = commandLineOptions;
-//
-
- // Set the 'UseNewContext' property to true.
- myAssemblyInstaller.UseNewContext = true;
-
- // Install the 'MyAssembly_Rollback' assembly.
- myAssemblyInstaller.Install( mySavedState );
-
-//
- // 'Rollback' the installation process.
- myAssemblyInstaller.Rollback( mySavedState );
-//
- }
- catch( ArgumentException )
- {
- }
- catch( Exception e )
- {
- Console.WriteLine( e.Message );
- }
- }
-}
diff --git a/snippets/csharp/System.Configuration.Install/AssemblyInstaller/HelpText/MyAssembly_HelpText.cs b/snippets/csharp/System.Configuration.Install/AssemblyInstaller/HelpText/MyAssembly_HelpText.cs
deleted file mode 100644
index d9fca9db0b4..00000000000
--- a/snippets/csharp/System.Configuration.Install/AssemblyInstaller/HelpText/MyAssembly_HelpText.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-/* The following example creates an assembly which is used to demonstrate
- the methods, properties and constructors of the 'AssemblyInstaller' class.
-*/
-
-using System;
-using System.ComponentModel;
-using System.Configuration.Install;
-using System.Collections;
-
-namespace MyAssembly
-{
- [RunInstallerAttribute(true)]
- public class MyProjectInstaller : Installer
- {
- static void Main()
- {
- Console.WriteLine( "Hello World" );
- }
- }
-}
diff --git a/snippets/csharp/System.Configuration.Install/AssemblyInstaller/HelpText/Project.csproj b/snippets/csharp/System.Configuration.Install/AssemblyInstaller/HelpText/Project.csproj
deleted file mode 100644
index 22bd4a76398..00000000000
--- a/snippets/csharp/System.Configuration.Install/AssemblyInstaller/HelpText/Project.csproj
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
- Library
- net48
- true
-
-
-
-
-
-
-
diff --git a/snippets/csharp/System.Configuration.Install/AssemblyInstaller/HelpText/assemblyinstaller_helptext.cs b/snippets/csharp/System.Configuration.Install/AssemblyInstaller/HelpText/assemblyinstaller_helptext.cs
deleted file mode 100644
index 4dd1686ccb0..00000000000
--- a/snippets/csharp/System.Configuration.Install/AssemblyInstaller/HelpText/assemblyinstaller_helptext.cs
+++ /dev/null
@@ -1,56 +0,0 @@
-// System.Configuration.Install.AssemblyInstaller.UseNewContext
-// System.Configuration.Install.AssemblyInstaller.HelpText
-
-/* The following example demonstrates the 'UseNewContext' and the
- 'HelpText' properties of the 'AssemblyInstaller' class.
- An object of the AssemblyInstaller class is created by invoking the constructor.
- The 'UseNewContext' property of this object is set to true and the install
- method is invoked on the 'MyAssembly_HelpText.exe' assembly. Due
- to this the log messages are displayed on the console. The 'HelpText'
- property for the object is displayed on the console.
-*/
-
-using System;
-using System.Configuration.Install;
-using System.Collections;
-using System.Collections.Specialized;
-
-class AssemblyInstaller_Example
-{
- static void Main()
- {
- IDictionary mySavedState = new Hashtable();
-
- Console.WriteLine( "" );
-
- try
- {
- string[] commandLineOptions = new string[ 1 ] {"/LogFile=example.log"};
-
-//
- // Create an object of the 'AssemblyInstaller' class.
- AssemblyInstaller myAssemblyInstaller = new
- AssemblyInstaller( "MyAssembly_HelpText.exe", commandLineOptions );
-
- // Set the 'UseNewContext' property to true.
- myAssemblyInstaller.UseNewContext = true;
-//
-
- // Install the 'MyAssembly_HelpText' assembly.
- myAssemblyInstaller.Install( mySavedState );
-
-//
- Console.WriteLine( "The 'HelpText' is-" );
- // Display the 'HelpText' of this AssemblyInstaller object.
- Console.WriteLine( myAssemblyInstaller.HelpText );
-//
- }
- catch( ArgumentException )
- {
- }
- catch( Exception e )
- {
- Console.WriteLine( e.Message );
- }
- }
-}
diff --git a/snippets/csharp/System.Configuration.Install/AssemblyInstaller/Overview/MyAssembly.cs b/snippets/csharp/System.Configuration.Install/AssemblyInstaller/Overview/MyAssembly.cs
deleted file mode 100644
index d9fca9db0b4..00000000000
--- a/snippets/csharp/System.Configuration.Install/AssemblyInstaller/Overview/MyAssembly.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-/* The following example creates an assembly which is used to demonstrate
- the methods, properties and constructors of the 'AssemblyInstaller' class.
-*/
-
-using System;
-using System.ComponentModel;
-using System.Configuration.Install;
-using System.Collections;
-
-namespace MyAssembly
-{
- [RunInstallerAttribute(true)]
- public class MyProjectInstaller : Installer
- {
- static void Main()
- {
- Console.WriteLine( "Hello World" );
- }
- }
-}
diff --git a/snippets/csharp/System.Configuration.Install/AssemblyInstaller/Overview/Project.csproj b/snippets/csharp/System.Configuration.Install/AssemblyInstaller/Overview/Project.csproj
deleted file mode 100644
index 22bd4a76398..00000000000
--- a/snippets/csharp/System.Configuration.Install/AssemblyInstaller/Overview/Project.csproj
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
- Library
- net48
- true
-
-
-
-
-
-
-
diff --git a/snippets/csharp/System.Configuration.Install/AssemblyInstaller/Overview/assemblyinstaller.cs b/snippets/csharp/System.Configuration.Install/AssemblyInstaller/Overview/assemblyinstaller.cs
deleted file mode 100644
index f1483d64b89..00000000000
--- a/snippets/csharp/System.Configuration.Install/AssemblyInstaller/Overview/assemblyinstaller.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-// System.Configuration.Install.AssemblyInstaller
-
-/* The following example demonstrates the 'AssemblyInstaller' class.
- An object of the AssemblyInstaller class is created by invoking the constructor.
- The properties of this object are set and the install and commit methods are
- called to install the 'MyAssembly.exe' assembly.
-*/
-
-//
-using System;
-using System.Configuration.Install;
-using System.Collections;
-using System.Collections.Specialized;
-
-class AssemblyInstaller_Example
-{
- static void Main()
- {
- IDictionary mySavedState = new Hashtable();
-
- Console.WriteLine( "" );
-
- try
- {
- // Set the commandline argument array for 'logfile'.
- string[] commandLineOptions = new string[ 1 ] {"/LogFile=example.log"};
-
- // Create an object of the 'AssemblyInstaller' class.
- AssemblyInstaller myAssemblyInstaller = new
- AssemblyInstaller( "MyAssembly.exe" , commandLineOptions );
-
- myAssemblyInstaller.UseNewContext = true;
-
- // Install the 'MyAssembly' assembly.
- myAssemblyInstaller.Install( mySavedState );
-
- // Commit the 'MyAssembly' assembly.
- myAssemblyInstaller.Commit( mySavedState );
- }
- catch (Exception e)
- {
- Console.WriteLine( e.Message );
- }
- }
-}
-//
diff --git a/snippets/csharp/System.Configuration.Install/ComponentInstaller/CopyFromComponent/componentinstaller_copyfromcomponent.cs b/snippets/csharp/System.Configuration.Install/ComponentInstaller/CopyFromComponent/componentinstaller_copyfromcomponent.cs
deleted file mode 100644
index 8ba355b485f..00000000000
--- a/snippets/csharp/System.Configuration.Install/ComponentInstaller/CopyFromComponent/componentinstaller_copyfromcomponent.cs
+++ /dev/null
@@ -1,50 +0,0 @@
-// System.Configuration.Install.ComponentInstaller.CopyFromComponent
-// System.Configuration.Install.ComponentInstaller.IsEquivalentInstaller
-
-/* The following example demonstrates the 'CopyFromComponent' and
- the 'IsEquivalentInstaller' methods of the 'ComponentInstaller' class.
- It defines a class MyInstallClass, which creates the event log and copies
- the properties of the event log component to the 'EventLogInstaller' object.
- It also checks whether 'ServiceInstaller' object can handle the same kind of
- installation as 'EventLogInstaller' object.
-*/
-
-using System;
-using System.Diagnostics;
-using System.ServiceProcess;
-
- public class ComponentInstaller_Example
- {
- static void Main()
- {
-//
- EventLogInstaller myEventLogInstaller = new EventLogInstaller();
- // Create a source for the specified event log, on local computer.
- EventLog.CreateEventSource("MyEventSource","MyEventLog", ".");
- // Create an event log instance and associate it with the log .
- EventLog myEventLog = new EventLog("MyEventLog", ".", "MyEventSource");
- // Copy the properties that are required at install time from
- // the event log component to the installer.
- myEventLogInstaller.CopyFromComponent(myEventLog);
-//
- Console.WriteLine("The properties of the event log component : ");
- Console.WriteLine(myEventLogInstaller.Log);
- Console.WriteLine(myEventLogInstaller.Source);
-//
- ServiceInstaller myServiceInstaller = new ServiceInstaller();
- // Check whether 'ServiceInstaller' object can handle the same
- // kind of installation as 'EventLogInstaller' object.
- if(myEventLogInstaller.IsEquivalentInstaller(myServiceInstaller))
- {
- Console.WriteLine("'ServiceInstaller' can handle the same kind"
- +" of installation as EventLogInstaller");
- }
- else
- {
- Console.WriteLine("'ServiceInstaller' can't handle the same"
- +" kind of installation as 'EventLogInstaller'");
- }
-//
- EventLog.Delete("MyEventLog",".");
- }
- }
diff --git a/snippets/csharp/System.Configuration.Install/InstallContext/Overview/Project.csproj b/snippets/csharp/System.Configuration.Install/InstallContext/Overview/Project.csproj
deleted file mode 100644
index 22bd4a76398..00000000000
--- a/snippets/csharp/System.Configuration.Install/InstallContext/Overview/Project.csproj
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
- Library
- net48
- true
-
-
-
-
-
-
-
diff --git a/snippets/csharp/System.Configuration.Install/InstallContext/Overview/installcontext_installcontext.cs b/snippets/csharp/System.Configuration.Install/InstallContext/Overview/installcontext_installcontext.cs
deleted file mode 100644
index 35e5f071b56..00000000000
--- a/snippets/csharp/System.Configuration.Install/InstallContext/Overview/installcontext_installcontext.cs
+++ /dev/null
@@ -1,144 +0,0 @@
-// System.Configuration.Install.InstallContext
-// System.Configuration.Install.InstallContext.InstallContext()
-// System.Configuration.Install.InstallContext.InstallContext(string, string[])
-// System.Configuration.Install.InstallContext.IsParameterTrue
-// System.Configuration.Install.InstallContext.LogMessage
-// System.Configuration.Install.InstallContext.Parameters
-
-/* The following example demonstrates the 'InstallContext()' and
- InstallContext(string, string[]) constructors, the 'Parameters' property
- and the 'LogMessage' and 'IsParameterTrue' methods of the
- 'InstallContext' class.
- When the program is invoked without any arguments an empty InstallContext
- object is created and when the '/LogFile' and '/LogtoConsole' are
- specified the InstallContext object is created by passing the respective
- arguments to InstallContext(string, string[]). When the install method of the
- installer is called, it checks for parameters from the command line and
- depending on that it displays the progress messages onto the console and
- also saves it to the specified log file.
-*/
-
-//
-using System;
-using System.ComponentModel;
-using System.Configuration.Install;
-using System.Collections;
-using System.Collections.Specialized;
-
-namespace MyInstallContextNamespace
-{
- [RunInstallerAttribute(true)]
- class InstallContext_Example : Installer
- {
- public InstallContext myInstallContext;
-
- public override void Install( IDictionary mySavedState )
- {
- base.Install( mySavedState );
-//
- StringDictionary myStringDictionary = myInstallContext.Parameters;
- if( myStringDictionary.Count == 0 )
- {
- Console.WriteLine( "No parameters have been entered in the command line "
- +"hence, the install will take place in the silent mode" );
- }
- else
- {
-//
-//
- // Check whether the "LogtoConsole" parameter has been set.
- if ( myInstallContext.IsParameterTrue( "LogtoConsole" ))
- {
- // Display the message to the console and add it to the logfile.
- myInstallContext.LogMessage( "The 'Install' method has been called" );
- }
-//
-//
- }
-//
-
- // The 'Install procedure should be added here.
- }
-
- public override void Uninstall( IDictionary mySavedState )
- {
- base.Uninstall( mySavedState );
- // The 'Uninstall' procedure should be added here.
- }
-
- public override void Rollback( IDictionary mySavedState )
- {
- base.Rollback( mySavedState );
- if ( myInstallContext.IsParameterTrue( "LogtoConsole" ))
- {
- myInstallContext.LogMessage( "The 'Rollback' method has been called" );
- }
-
- // The 'Rollback' procedure should be added here.
- }
-
- public override void Commit( IDictionary mySavedState )
- {
- base.Commit( mySavedState );
- if ( myInstallContext.IsParameterTrue( "LogtoConsole" ))
- {
- myInstallContext.LogMessage( "The 'Commit' method has been called" );
- }
-
- // The 'Commit' procedure should be added here.
- }
-
- static void Main( string[] args )
- {
- InstallContext_Example myInstallObject = new InstallContext_Example();
-
- IDictionary mySavedState = new Hashtable();
-
- if( args.Length < 1 )
- {
-//
- // There are no command line arguments, create an empty 'InstallContext'.
- myInstallObject.myInstallContext = new InstallContext();
-//
- }
-
- else if( ( args.Length == 1 ) && ( args[ 0 ] == "/?" ) )
- {
- // Display the 'Help' for this utility.
- Console.WriteLine( "Specify the '/Logfile' and '/LogtoConsole' parameters" );
- Console.WriteLine( "Example: " );
- Console.WriteLine( "InstallContext_InstallContext.exe /LogFile=example.log"
- +" /LogtoConsole=true" );
- return;
- }
-
- else
- {
-//
- // Create an InstallContext object with the given parameters.
- String[] commandLine = new string[ args.Length ];
- for( int i = 0; i < args.Length; i++ )
- {
- commandLine[ i ] = args[ i ];
- }
- myInstallObject.myInstallContext = new InstallContext( args[ 0 ], commandLine);
-//
- }
-
- try
- {
- // Call the 'Install' method.
- myInstallObject.Install( mySavedState );
-
- // Call the 'Commit' method.
- myInstallObject.Commit( mySavedState );
- }
- catch( Exception )
- {
- // Call the 'Rollback' method.
- myInstallObject.Rollback( mySavedState );
- }
- }
- }
-}
-//
diff --git a/snippets/csharp/System.Configuration.Install/InstallEventArgs/Overview/Project.csproj b/snippets/csharp/System.Configuration.Install/InstallEventArgs/Overview/Project.csproj
deleted file mode 100644
index 22bd4a76398..00000000000
--- a/snippets/csharp/System.Configuration.Install/InstallEventArgs/Overview/Project.csproj
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
- Library
- net48
- true
-
-
-
-
-
-
-
diff --git a/snippets/csharp/System.Configuration.Install/InstallEventArgs/Overview/installeventargs.cs b/snippets/csharp/System.Configuration.Install/InstallEventArgs/Overview/installeventargs.cs
deleted file mode 100644
index 3365f3c80de..00000000000
--- a/snippets/csharp/System.Configuration.Install/InstallEventArgs/Overview/installeventargs.cs
+++ /dev/null
@@ -1,122 +0,0 @@
-// System.Configuration.Install.InstallEventArgs
-// System.Configuration.Install.InstallEventArgs.InstallEventArgs()
-// System.Configuration.Install.InstallEventArgs.InstallEventArgs(IDictionary)
-// System.Configuration.Install.InstallEventArgs.SavedState
-
-/*
- The following example demonstrates the 'InstallEventArgs()' and
- 'InstallEventArgs(IDictionary)' constructors and the 'SavedState'
- property of the 'InstallEventArgs' property. There are two new
- events called 'BeforeCommit' and 'AfterCommit'. The handlers of
- these events are invoked from the protected methods named 'OnBeforeCommit'
- and 'OnAfterCommit' respectively. These events are raised when the
- 'Commit' method is called.
-
- Note :
- a) The two events named 'BeforeCommit' and 'AfterCommit' are added
- only for example purposes, since there are already
- events named 'Committing' and 'Committed' which perform the same
- function. This example can be made a basis for a new stage being
- added to the already existing four stages namely 'Install', 'Commit',
- 'Rollback' and 'Uninstall'.
-
- b) Run the example with the help of InstallUtil.exe
- InstallUtil InstallEventArgs.exe
-*/
-
-//
-
-using System;
-using System.ComponentModel;
-using System.Collections;
-using System.Configuration.Install;
-using System.IO;
-
-[RunInstaller(true)]
-public class MyInstaller : Installer
-{
- // Simple events to handle before and after commit handlers.
- public event InstallEventHandler BeforeCommit;
- public event InstallEventHandler AfterCommit;
-
- public MyInstaller()
- {
- // Add handlers to the events.
- BeforeCommit += new InstallEventHandler(BeforeCommitHandler);
- AfterCommit += new InstallEventHandler(AfterCommitHandler);
- }
-
- public override void Install(IDictionary savedState)
- {
- base.Install(savedState);
- Console.WriteLine("Install ...\n");
- }
-
- public override void Commit(IDictionary savedState)
- {
- Console.WriteLine("Before Committing ...\n");
- // Call the 'OnBeforeCommit' protected method.
- OnBeforeCommit(savedState);
- base.Commit(savedState);
- Console.WriteLine("Committing ...\n");
- // Call the 'OnAfterCommit' protected method.
- OnAfterCommit(savedState);
- Console.WriteLine("After Committing ...\n");
- }
-
- public override void Rollback(IDictionary savedState)
- {
- base.Rollback(savedState);
- Console.WriteLine("RollBack ...\n");
- }
-
- public override void Uninstall(IDictionary savedState)
- {
- base.Uninstall(savedState);
- Console.WriteLine("UnInstall ...\n");
- }
-
-//
- // Protected method that invoke the handlers associated with the 'BeforeCommit' event.
- protected virtual void OnBeforeCommit(IDictionary savedState)
- {
- if(BeforeCommit != null)
- BeforeCommit(this, new InstallEventArgs(savedState));
- }
-//
-
-//
- // Protected method that invoke the handlers associated with the 'AfterCommit' event.
- protected virtual void OnAfterCommit(IDictionary savedState)
- {
- if(AfterCommit != null)
- AfterCommit(this, new InstallEventArgs());
- }
-//
-
-//
- // A simple event handler to exemplify the example.
- private void BeforeCommitHandler(Object sender, InstallEventArgs e)
- {
- Console.WriteLine("BeforeCommitHandler event handler has been called\n");
- Console.WriteLine("The count of saved state objects are : {0}\n",
- e.SavedState.Count);
- }
-//
-
- // A simple event handler to exemplify the example.
- private void AfterCommitHandler(Object sender, InstallEventArgs e)
- {
- Console.WriteLine("AfterCommitHandler event handler has been called\n");
- }
-}
-//
-
-// An Assembly that has its own installer.
-public class MyAssembly1
-{
- public static void Main()
- {
- Console.WriteLine("This assembly is just an example for the Installer\n");
- }
-}
diff --git a/snippets/csharp/System.Configuration.Install/InstallException/Overview/Project.csproj b/snippets/csharp/System.Configuration.Install/InstallException/Overview/Project.csproj
deleted file mode 100644
index 22bd4a76398..00000000000
--- a/snippets/csharp/System.Configuration.Install/InstallException/Overview/Project.csproj
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
- Library
- net48
- true
-
-
-
-
-
-
-
diff --git a/snippets/csharp/System.Configuration.Install/InstallException/Overview/installexception.cs b/snippets/csharp/System.Configuration.Install/InstallException/Overview/installexception.cs
deleted file mode 100644
index 141183ce840..00000000000
--- a/snippets/csharp/System.Configuration.Install/InstallException/Overview/installexception.cs
+++ /dev/null
@@ -1,103 +0,0 @@
-// System.Configuration.Install.InstallException
-// System.Configuration.Install.InstallException.InstallException()
-// System.Configuration.Install.InstallException.InstallException(String, Exception)
-// System.Configuration.Install.InstallException.InstallException(String)
-
-/*
- The following example demonstrates the 'InstallException()', 'InstallException(String)'
- and 'InstallException(String, Exception)' constructors for 'InstallException' class.
- This example shows an assembly having its own installer named 'MyInstaller'
- which has an attribute 'RunInstallerAttribute', indicating that this installer
- will be invoked by InstallUtil.exe. InstallUtil.exe calls the 'Install', 'Commit',
- 'Rollback' and 'Uninstall' methods. The code in 'Commit' method presumes that
- a file named 'FileDoesNotExist.txt' exists before the installation of the
- assembly can be committed. If the file 'FileDoesNotExist.txt' does not exist
- 'Commit' raises a 'InstallException'. Same is the case with 'Uninstall',
- uninstalltion will only progress if the file named 'FileDoesNotExist.txt'
- exists else it raises an 'InstallException'. In 'Rollback' some piece of
- code is executed which may raise an exception. If the exception is raised then
- it is caught and an 'InstallException' is raised with that exception being passed
- to it.
-
- Note : Run this example with the help of 'InstallUtil.exe'
- InstallUtil InstallException.exe
- InstallUtil /u InstallException.exe
- */
-
-//
-using System;
-using System.ComponentModel;
-using System.Collections;
-using System.Configuration.Install;
-using System.IO;
-
-[RunInstaller(true)]
-public class MyInstaller : Installer
-{
- public override void Install(IDictionary savedState)
- {
- base.Install(savedState);
- Console.WriteLine("Install ...");
-
- // Commit is called when install goes through successfully.
- // Rollback is called if there is any error during Install.
-
- // Uncommenting the code below will lead to 'RollBack' being called,
- // currently 'Commit' shall be called.
-
- // throw new IOException();
- }
-
-//
- public override void Commit(IDictionary savedState)
- {
- base.Commit(savedState);
- Console.WriteLine("Commit ...");
- // Throw an error if a particular file doesn't exist.
- if(!File.Exists("FileDoesNotExist.txt"))
- throw new InstallException();
- // Perform the final installation if the file exists.
- }
-//
-
-//
- public override void Rollback(IDictionary savedState)
- {
- base.Rollback(savedState);
- Console.WriteLine("RollBack ...");
- try
- {
- // Performing some activity during rollback that raises an 'IOException'.
- throw new IOException();
- }
- catch(Exception e)
- {
- throw new InstallException("IOException raised", e);
- }
- // Perform the remaining rollback activites if no exception raised.
- }
-//
-
-//
- public override void Uninstall(IDictionary savedState)
- {
- base.Uninstall(savedState);
- Console.WriteLine("UnInstall ...");
- // Throw an error if a particular file doesn't exist.
- if(!File.Exists("FileDoesNotExist.txt"))
- throw new InstallException("The file 'FileDoesNotExist'" +
- " does not exist");
- // Perform the uninstall activites if the file exists.
- }
-//
-}
-
-// An Assembly that has its own installer.
-public class MyAssembly1
-{
- public static void Main()
- {
- Console.WriteLine("This assembly is just an example for the Installer");
- }
-}
-//
\ No newline at end of file
diff --git a/snippets/csharp/System.Configuration.Install/Installer/AfterInstall/Project.csproj b/snippets/csharp/System.Configuration.Install/Installer/AfterInstall/Project.csproj
deleted file mode 100644
index 22bd4a76398..00000000000
--- a/snippets/csharp/System.Configuration.Install/Installer/AfterInstall/Project.csproj
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
- Library
- net48
- true
-
-
-
-
-
-
-
diff --git a/snippets/csharp/System.Configuration.Install/Installer/AfterInstall/installer_afterinstall.cs b/snippets/csharp/System.Configuration.Install/Installer/AfterInstall/installer_afterinstall.cs
deleted file mode 100644
index 2fb595f379a..00000000000
--- a/snippets/csharp/System.Configuration.Install/Installer/AfterInstall/installer_afterinstall.cs
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- System.Configuration.Install.Installer.AfterInstall
-
- The following example demonstrates the event 'AfterInstall' of the
- 'Installer' class. The event 'AfterInstall' is raised by the method
- 'OnAfterInstall'.
-
- Use the installer process 'InstallUtil' to run the assembly
- 'Installer_AfterInstall.exe'.
-
-*/
-
-using System;
-using System.Collections;
-using System.ComponentModel;
-using System.Configuration.Install;
-
-[RunInstaller(true)]
-public class MyInstaller: Installer
-{
-//
- // MyInstaller is derived from the class 'Installer'.
- MyInstaller() : base()
- {
- AfterInstall += new InstallEventHandler(AfterInstallEventHandler);
- }
- private void AfterInstallEventHandler(object sender, InstallEventArgs e)
- {
- // Add steps to perform any actions after the install process.
- Console.WriteLine("Code for AfterInstallEventHandler");
- }
-//
-
- // Override the 'Install' method.
- public override void Install(IDictionary savedState)
- {
- base.Install(savedState);
- Console.WriteLine("");
- Console.WriteLine("Install method of MyInstaller called");
- Console.WriteLine("");
- }
-
- // Override the 'Commit' method.
- public override void Commit(IDictionary savedState)
- {
- base.Commit(savedState);
- }
-
- // Override the 'Rollback' method.
- public override void Rollback(IDictionary savedState)
- {
- base.Rollback(savedState);
- }
-
- // Override the 'Uninstall' method.
- public override void Uninstall(IDictionary savedState)
- {
- base.Uninstall(savedState);
- }
-
- // Override the 'OnBeforeInstall' method.
- protected override void OnBeforeInstall(IDictionary savedState)
- {
- base.OnBeforeInstall(savedState);
- Console.WriteLine("");
- Console.WriteLine("OnBeforeInstall method of MyInstaller called");
- Console.WriteLine("");
- }
-
- // Override the 'OnAfterInstall' method.
- protected override void OnAfterInstall(IDictionary savedState)
- {
- base.OnAfterInstall(savedState);
- }
-}
-
-public class MyAssembly
-{
- public static void Main()
- {
- Console.WriteLine("Use installutil.exe to run the assembly Installer_AfterInstall.exe");
- }
-}
diff --git a/snippets/csharp/System.Configuration.Install/Installer/AfterRollback/Project.csproj b/snippets/csharp/System.Configuration.Install/Installer/AfterRollback/Project.csproj
deleted file mode 100644
index 22bd4a76398..00000000000
--- a/snippets/csharp/System.Configuration.Install/Installer/AfterRollback/Project.csproj
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
- Library
- net48
- true
-
-
-
-
-
-
-
diff --git a/snippets/csharp/System.Configuration.Install/Installer/AfterRollback/installer_afterrollback.cs b/snippets/csharp/System.Configuration.Install/Installer/AfterRollback/installer_afterrollback.cs
deleted file mode 100644
index fa0d7eb1753..00000000000
--- a/snippets/csharp/System.Configuration.Install/Installer/AfterRollback/installer_afterrollback.cs
+++ /dev/null
@@ -1,54 +0,0 @@
-// System.Configuration.Install.Installer.AfterRollback
-
-/* The following program demonstrates the 'AfterRollback' event of the
- 'Installer' class. It overrides the Install method, explicitly throws
- arguement exception so that 'Rollback' method is called. When the
- 'RollBack' is complete, 'AfterRollback' event occurs and a message is
- displayed when the event occurs.
-*/
-
-//
-using System;
-using System.Collections;
-using System.ComponentModel;
-using System.Configuration.Install;
-
-// Set 'RunInstaller' attribute to true.
-[RunInstaller(true)]
-public class MyInstallerClass: Installer
-{
-
- public MyInstallerClass() :base()
- {
- // Attach the 'AfterRollback' event.
- this.AfterRollback += new InstallEventHandler(MyInstaller_AfterRollBack);
- }
- // Event handler for 'AfterRollback' event.
- private void MyInstaller_AfterRollBack(object sender, InstallEventArgs e)
- {
- Console.WriteLine("AfterRollBack Event occurred.");
- }
-
- // Override the 'Install' method.
- public override void Install(IDictionary savedState)
- {
- base.Install(savedState);
- // Explicitly throw an exception so that roll back is called.
- throw new ArgumentException("Arg Exception");
- }
- // Override the 'Commit' method.
- public override void Commit(IDictionary savedState)
- {
- base.Commit(savedState);
- }
- // Override the 'Rollback' method.
- public override void Rollback(IDictionary savedState)
- {
- base.Rollback(savedState);
- }
- public static void Main()
- {
- Console.WriteLine("Usage : installutil.exe Installer_AfterRollback.exe ");
- }
-}
-//
diff --git a/snippets/csharp/System.Configuration.Install/Installer/AfterUninstall/Project.csproj b/snippets/csharp/System.Configuration.Install/Installer/AfterUninstall/Project.csproj
deleted file mode 100644
index 22bd4a76398..00000000000
--- a/snippets/csharp/System.Configuration.Install/Installer/AfterUninstall/Project.csproj
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
- Library
- net48
- true
-
-
-
-
-
-
-
diff --git a/snippets/csharp/System.Configuration.Install/Installer/AfterUninstall/installer_afteruninstall.cs b/snippets/csharp/System.Configuration.Install/Installer/AfterUninstall/installer_afteruninstall.cs
deleted file mode 100644
index 81ed6e5f6df..00000000000
--- a/snippets/csharp/System.Configuration.Install/Installer/AfterUninstall/installer_afteruninstall.cs
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- System.Configuration.Install.Installer.AfterUninstall
-
- The following example demonstrates the event 'AfterUninstall' of the
- 'Installer' class. This event is raised by the method 'OnAfterUninstall'.
-
- Use the installer process 'InstallUtil -u' to run the assembly
- 'Installer_AfterUninstall.exe'.
-
-*/
-
-using System;
-using System.Collections;
-using System.ComponentModel;
-using System.Configuration.Install;
-
-[RunInstaller(true)]
-public class MyInstaller: Installer
-{
-//
- // MyInstaller is derived from the class 'Installer'.
- MyInstaller() : base()
- {
- AfterUninstall += new InstallEventHandler(AfterUninstallEventHandler);
- }
- private void AfterUninstallEventHandler(object sender, InstallEventArgs e)
- {
- // Add steps to perform any actions before the Uninstall process.
- Console.WriteLine("Code for AfterUninstallEventHandler");
- }
-//
-
- // Override the 'Install' method.
- public override void Install(IDictionary savedState)
- {
- base.Install(savedState);
- }
-
- // Override the 'Commit' method.
- public override void Commit(IDictionary savedState)
- {
- base.Commit(savedState);
- }
-
- // Override the 'Rollback' method.
- public override void Rollback(IDictionary savedState)
- {
- base.Rollback(savedState);
- }
-
- // Override the 'Uninstall' method.
- public override void Uninstall(IDictionary savedState)
- {
- base.Uninstall(savedState);
- Console.WriteLine("");
- Console.WriteLine("Uninstall method of MyInstaller called");
- Console.WriteLine("");
- }
-
- // Override the 'OnBeforeUninstall' method.
- protected override void OnBeforeUninstall(IDictionary savedState)
- {
- base.OnBeforeUninstall(savedState);
- Console.WriteLine("");
- Console.WriteLine("OnBeforeUninstall method of MyInstaller called");
- Console.WriteLine("");
- }
-
- // Override the 'OnAfterUninstall' method.
- protected override void OnAfterUninstall(IDictionary savedState)
- {
- base.OnAfterUninstall(savedState);
- Console.WriteLine("");
- Console.WriteLine("OnAfterUninstall method of MyInstaller called");
- Console.WriteLine("");
- }
-}
-
-public class MyAssembly
-{
- public static void Main()
- {
- Console.WriteLine("Use 'installutil.exe -u' to run the assembly Installer_AfterUninstall.exe");
- }
-}
diff --git a/snippets/csharp/System.Configuration.Install/Installer/BeforeInstall/Project.csproj b/snippets/csharp/System.Configuration.Install/Installer/BeforeInstall/Project.csproj
deleted file mode 100644
index 22bd4a76398..00000000000
--- a/snippets/csharp/System.Configuration.Install/Installer/BeforeInstall/Project.csproj
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
- Library
- net48
- true
-
-
-
-
-
-
-
diff --git a/snippets/csharp/System.Configuration.Install/Installer/BeforeInstall/installer_beforeinstall.cs b/snippets/csharp/System.Configuration.Install/Installer/BeforeInstall/installer_beforeinstall.cs
deleted file mode 100644
index 541c0e1b96e..00000000000
--- a/snippets/csharp/System.Configuration.Install/Installer/BeforeInstall/installer_beforeinstall.cs
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- System.Configuration.Install.Installer.BeforeInstall
-
- The following example demonstrates the event 'BeforeInstall' of the
- 'Installer' class. The event 'BeforeInstall' is raised by the method
- 'OnBeforeInstall'.
-
- Use the installer process 'InstallUtil' to run the assembly
- Installer_BeforeInstall.exe.
-
-*/
-
-using System;
-using System.Collections;
-using System.ComponentModel;
-using System.Configuration.Install;
-
-[RunInstaller(true)]
-public class MyInstaller: Installer
-{
-//
- // MyInstaller is derived from the class 'Installer'.
- MyInstaller() : base()
- {
- BeforeInstall += new InstallEventHandler(BeforeInstallEventHandler);
- }
- private void BeforeInstallEventHandler(object sender, InstallEventArgs e)
- {
- // Add steps to perform any actions before the install process.
- Console.WriteLine("Code for BeforeInstallEventHandler");
- }
-//
-
- // Override the 'Install' method.
- public override void Install(IDictionary savedState)
- {
- base.Install(savedState);
- Console.WriteLine("");
- Console.WriteLine("Install method of MyInstaller called");
- Console.WriteLine("");
- }
-
- // Override the 'Commit' method.
- public override void Commit(IDictionary savedState)
- {
- base.Commit(savedState);
- }
-
- // Override the 'Rollback' method.
- public override void Rollback(IDictionary savedState)
- {
- base.Rollback(savedState);
- }
-
- // Override the 'Uninstall' method.
- public override void Uninstall(IDictionary savedState)
- {
- base.Uninstall(savedState);
- }
-
- // Override the 'OnBeforeInstall' method.
- protected override void OnBeforeInstall(IDictionary savedState)
- {
- base.OnBeforeInstall(savedState);
- Console.WriteLine("");
- Console.WriteLine("OnBeforeInstall method of MyInstaller called");
- Console.WriteLine("");
- }
-
- // Override the 'OnAfterInstall' method.
- protected override void OnAfterInstall(IDictionary savedState)
- {
- base.OnAfterInstall(savedState);
- Console.WriteLine("");
- Console.WriteLine("OnAfterInstall method of MyInstaller called");
- Console.WriteLine("");
- }
-}
-
-public class MyAssembly
-{
- public static void Main()
- {
- Console.WriteLine("Use installutil.exe to run the assembly Installer_BeforeInstall.exe");
- }
-}
diff --git a/snippets/csharp/System.Configuration.Install/Installer/BeforeRollback/Project.csproj b/snippets/csharp/System.Configuration.Install/Installer/BeforeRollback/Project.csproj
deleted file mode 100644
index 22bd4a76398..00000000000
--- a/snippets/csharp/System.Configuration.Install/Installer/BeforeRollback/Project.csproj
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
- Library
- net48
- true
-
-
-
-
-
-
-
diff --git a/snippets/csharp/System.Configuration.Install/Installer/BeforeRollback/installer_beforerollback.cs b/snippets/csharp/System.Configuration.Install/Installer/BeforeRollback/installer_beforerollback.cs
deleted file mode 100644
index 1ee91b7920c..00000000000
--- a/snippets/csharp/System.Configuration.Install/Installer/BeforeRollback/installer_beforerollback.cs
+++ /dev/null
@@ -1,63 +0,0 @@
-// System.Configuration.Install.Installer.BeforeRollback
-
-/* The following program demonstrates the 'BeforeRollback' event of the
- 'Installer' class. It overrides the Install method, explicitly throws
- arguement exception so that 'Rollback' method is called. When the
- 'RollBack' is about to complete, 'BeforeRollback' event occurs and
- a message is displayed when the event occurs.
-*/
-
-//
-using System;
-using System.Collections;
-using System.ComponentModel;
-using System.Configuration.Install;
-
-// Set 'RunInstaller' attribute to true.
-[RunInstaller(true)]
-public class MyInstallerClass: Installer
-{
- public MyInstallerClass() :base()
- {
- // Attach the 'BeforeRollback' event.
- this.BeforeRollback += new InstallEventHandler(MyInstaller_BeforeRollBack);
- // Attach the 'AfterRollback' event.
- this.AfterRollback += new InstallEventHandler(MyInstaller_AfterRollback);
- }
- // Event handler for 'BeforeRollback' event.
- private void MyInstaller_BeforeRollBack(object sender, InstallEventArgs e)
- {
- Console.WriteLine("");
- Console.WriteLine("BeforeRollback Event occurred.");
- Console.WriteLine("");
- }
- // Event handler for 'AfterRollback' event.
- private void MyInstaller_AfterRollback(object sender, InstallEventArgs e)
- {
- Console.WriteLine("");
- Console.WriteLine("AfterRollback Event occurred.");
- Console.WriteLine("");
- }
- // Override the 'Install' method.
- public override void Install(IDictionary savedState)
- {
- base.Install(savedState);
- // Explicitly throw an exception so that roll back is called.
- throw new ArgumentException("Arg Exception");
- }
- // Override the 'Commit' method.
- public override void Commit(IDictionary savedState)
- {
- base.Commit(savedState);
- }
- // Override the 'Rollback' method.
- public override void Rollback(IDictionary savedState)
- {
- base.Rollback(savedState);
- }
- public static void Main()
- {
- Console.WriteLine("Usage : installutil.exe Installer_BeforeRollback.exe ");
- }
-}
-//
diff --git a/snippets/csharp/System.Configuration.Install/Installer/BeforeUninstall/Project.csproj b/snippets/csharp/System.Configuration.Install/Installer/BeforeUninstall/Project.csproj
deleted file mode 100644
index 22bd4a76398..00000000000
--- a/snippets/csharp/System.Configuration.Install/Installer/BeforeUninstall/Project.csproj
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
- Library
- net48
- true
-
-
-
-
-
-
-
diff --git a/snippets/csharp/System.Configuration.Install/Installer/BeforeUninstall/installer_beforeuninstall.cs b/snippets/csharp/System.Configuration.Install/Installer/BeforeUninstall/installer_beforeuninstall.cs
deleted file mode 100644
index ade64bc32bc..00000000000
--- a/snippets/csharp/System.Configuration.Install/Installer/BeforeUninstall/installer_beforeuninstall.cs
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- System.Configuration.Install.Installer.BeforeUninstall
-
- The following example demonstrates the event 'BeforeUninstall' of the
- 'Installer' class. This event is raised by the method 'OnBeforeUninstall'.
-
- Use the installer process 'InstallUtil -u' to run the assembly
- 'Installer_BeforeUninstall.exe'.
-
-*/
-
-using System;
-using System.Collections;
-using System.ComponentModel;
-using System.Configuration.Install;
-
-[RunInstaller(true)]
-public class MyInstaller: Installer
-{
-//
- // MyInstaller is derived from the class 'Installer'.
- MyInstaller() : base()
- {
- BeforeUninstall += new InstallEventHandler(BeforeUninstallEventHandler);
- }
- private void BeforeUninstallEventHandler(object sender, InstallEventArgs e)
- {
- // Add steps to perform any actions before the Uninstall process.
- Console.WriteLine("Code for BeforeUninstallEventHandler");
- }
-//
-
- // Override the 'Install' method.
- public override void Install(IDictionary savedState)
- {
- base.Install(savedState);
- }
-
- // Override the 'Commit' method.
- public override void Commit(IDictionary savedState)
- {
- base.Commit(savedState);
- }
-
- // Override the 'Rollback' method.
- public override void Rollback(IDictionary savedState)
- {
- base.Rollback(savedState);
- }
-
- // Override the 'Uninstall' method.
- public override void Uninstall(IDictionary savedState)
- {
- base.Uninstall(savedState);
- Console.WriteLine("");
- Console.WriteLine("Uninstall method of MyInstaller called");
- Console.WriteLine("");
- }
-
- // Override the 'OnBeforeUninstall' method.
- protected override void OnBeforeUninstall(IDictionary savedState)
- {
- base.OnBeforeUninstall(savedState);
- Console.WriteLine("");
- Console.WriteLine("OnBeforeUninstall method of MyInstaller called");
- Console.WriteLine("");
- }
-
- // Override the 'OnAfterUninstall' method.
- protected override void OnAfterUninstall(IDictionary savedState)
- {
- base.OnAfterUninstall(savedState);
- Console.WriteLine("");
- Console.WriteLine("OnAfterUninstall method of MyInstaller called");
- Console.WriteLine("");
- }
-}
-
-public class MyAssembly
-{
- public static void Main()
- {
- Console.WriteLine("Use 'installutil.exe -u' to run the assembly Installer_BeforeUninstall.exe");
- }
-}
diff --git a/snippets/csharp/System.Configuration.Install/Installer/Commit/Project.csproj b/snippets/csharp/System.Configuration.Install/Installer/Commit/Project.csproj
deleted file mode 100644
index 22bd4a76398..00000000000
--- a/snippets/csharp/System.Configuration.Install/Installer/Commit/Project.csproj
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
- Library
- net48
- true
-
-
-
-
-
-
-
diff --git a/snippets/csharp/System.Configuration.Install/Installer/Commit/installer_install.cs b/snippets/csharp/System.Configuration.Install/Installer/Commit/installer_install.cs
deleted file mode 100644
index e1ff50441d0..00000000000
--- a/snippets/csharp/System.Configuration.Install/Installer/Commit/installer_install.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- System.Configuration.Install.Installer.Install
- System.Configuration.Install.Installer.Commit
-
- The following example demonstrates the 'Install' and 'Commit' methods
- of the 'Installer' class.
- A class is derived from the 'Installer' base class and the Install
- and Commit methods are overridden.
-*/
-
-using System;
-using System.ComponentModel;
-using System.Configuration.Install;
-using System.Collections;
-
-namespace MyAssembly
-{
-[RunInstaller(true)]
- public class MyInstallerSample : Installer
- {
-
-//
- // Override the 'Install' method of the Installer class.
- public override void Install( IDictionary mySavedState )
- {
- base.Install( mySavedState );
- // Code maybe written for installation of an application.
- Console.WriteLine( "The Install method of 'MyInstallerSample' has been called" );
- }
-//
-//
- // Override the 'Commit' method of the Installer class.
- public override void Commit( IDictionary mySavedState )
- {
- base.Commit( mySavedState );
- Console.WriteLine( "The Commit method of 'MyInstallerSample'"
- + "has been called" );
- }
-//
- static void Main()
- {
- Console.WriteLine("Use installutil.exe to run the assembly"
- + " Installer_Install.exe");
- }
- }
-}
diff --git a/snippets/csharp/System.Configuration.Install/Installer/Committed/Project.csproj b/snippets/csharp/System.Configuration.Install/Installer/Committed/Project.csproj
deleted file mode 100644
index 22bd4a76398..00000000000
--- a/snippets/csharp/System.Configuration.Install/Installer/Committed/Project.csproj
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
- Library
- net48
- true
-
-
-
-
-
-
-
diff --git a/snippets/csharp/System.Configuration.Install/Installer/Committed/installer_committed.cs b/snippets/csharp/System.Configuration.Install/Installer/Committed/installer_committed.cs
deleted file mode 100644
index 1145b656d06..00000000000
--- a/snippets/csharp/System.Configuration.Install/Installer/Committed/installer_committed.cs
+++ /dev/null
@@ -1,49 +0,0 @@
-// System.Configuration.Install.Installer.Committed
-
-/* The following program demonstrates the 'Committed' event of the
- 'Installer' class. When the 'Commit' is complete, 'Committed' event
- is fired and a message is displayed.
-*/
-
-using System;
-using System.Collections;
-using System.ComponentModel;
-using System.Configuration.Install;
-
-// Set 'RunInstaller' attribute to true.
-[RunInstaller(true)]
-public class MyInstallerClass: Installer
-{
-//
- public MyInstallerClass() :base()
- {
- // Attach the 'Committed' event.
- this.Committed += new InstallEventHandler(MyInstaller_Committed);
- }
-
- // Event handler for 'Committed' event.
- private void MyInstaller_Committed(object sender, InstallEventArgs e)
- {
- Console.WriteLine("Committed Event occurred.");
- }
-//
- // Override the 'Install' method.
- public override void Install(IDictionary savedState)
- {
- base.Install(savedState);
- }
- // Override the 'Commit' method.
- public override void Commit(IDictionary savedState)
- {
- base.Commit(savedState);
- }
- // Override the 'Rollback' method.
- public override void Rollback(IDictionary savedState)
- {
- base.Rollback(savedState);
- }
- public static void Main()
- {
- Console.WriteLine("Usage : installutil.exe Installer_Committed.exe ");
- }
-}
diff --git a/snippets/csharp/System.Configuration.Install/Installer/Committing/Project.csproj b/snippets/csharp/System.Configuration.Install/Installer/Committing/Project.csproj
deleted file mode 100644
index 22bd4a76398..00000000000
--- a/snippets/csharp/System.Configuration.Install/Installer/Committing/Project.csproj
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
- Library
- net48
- true
-
-
-
-
-
-
-
diff --git a/snippets/csharp/System.Configuration.Install/Installer/Committing/installer_committing.cs b/snippets/csharp/System.Configuration.Install/Installer/Committing/installer_committing.cs
deleted file mode 100644
index e6a0316073d..00000000000
--- a/snippets/csharp/System.Configuration.Install/Installer/Committing/installer_committing.cs
+++ /dev/null
@@ -1,48 +0,0 @@
-// System.Configuration.Install.Installer.Committing
-
-/* The following program demonstrates the 'Committing' event of the
- 'Installer' class. When the 'Commit' is about to complete,
- 'Committing' event is fired and a message is displayed.
-*/
-
-using System;
-using System.Collections;
-using System.ComponentModel;
-using System.Configuration.Install;
-
-// Set 'RunInstaller' attribute to true.
-[RunInstaller(true)]
-public class MyInstallerClass: Installer
-{
-//
- public MyInstallerClass() :base()
- {
- // Attach the 'Committing' event.
- this.Committing += new InstallEventHandler(MyInstaller_Committing);
- }
- // Event handler for 'Committing' event.
- private void MyInstaller_Committing(object sender, InstallEventArgs e)
- {
- Console.WriteLine("Committing Event occurred.");
- }
-//
- // Override the 'Install' method.
- public override void Install(IDictionary savedState)
- {
- base.Install(savedState);
- }
- // Override the 'Commit' method.
- public override void Commit(IDictionary savedState)
- {
- base.Commit(savedState);
- }
- // Override the 'Rollback' method.
- public override void Rollback(IDictionary savedState)
- {
- base.Rollback(savedState);
- }
- public static void Main()
- {
- Console.WriteLine("Usage : installutil.exe Installer_Committing.exe ");
- }
-}
diff --git a/snippets/csharp/System.Configuration.Install/Installer/Context/Project.csproj b/snippets/csharp/System.Configuration.Install/Installer/Context/Project.csproj
deleted file mode 100644
index 22bd4a76398..00000000000
--- a/snippets/csharp/System.Configuration.Install/Installer/Context/Project.csproj
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
- Library
- net48
- true
-
-
-
-
-
-
-
diff --git a/snippets/csharp/System.Configuration.Install/Installer/Context/installer_context.cs b/snippets/csharp/System.Configuration.Install/Installer/Context/installer_context.cs
deleted file mode 100644
index 2eea3c6ea9b..00000000000
--- a/snippets/csharp/System.Configuration.Install/Installer/Context/installer_context.cs
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- System.Configuration.Install.Installer.Context
-
- The following example demonstrates the 'Context' property of
- the 'Installer' class. The contents of the 'Context' property
- like information about the location of the log file for the
- installation, the location of the file to save information
- required by the Uninstall method, and the command line that
- was entered when the installation executable was run is
- displayed on the console.
-
- Use 'installutil' to run the assembly Installer_Context.exe
-*/
-
-using System;
-using System.Collections;
-using System.ComponentModel;
-using System.Configuration.Install;
-using System.Collections.Specialized;
-
-[RunInstaller(true)]
-public class MyInstaller : Installer
-{
- // Override the 'Install' method.
- public override void Install( IDictionary mySavedState )
- {
- base.Install(mySavedState);
- Console.WriteLine( "" );
-//
- StringDictionary myStringDictionary = Context.Parameters;
- if ( Context.Parameters.Count > 0 )
- {
- Console.WriteLine("Context Property : " );
- foreach( string myString in Context.Parameters.Keys)
- {
- Console.WriteLine( Context.Parameters[ myString ] );
- }
- }
-//
- Console.WriteLine( "" );
- }
-
- // Override the 'Commit' method.
- public override void Commit(IDictionary savedState)
- {
- base.Commit(savedState);
- }
-
- // Override the 'Rollback' method.
- public override void Rollback(IDictionary savedState)
- {
- base.Rollback(savedState);
- }
-
- // Override the 'Uninstall' method.
- public override void Uninstall(IDictionary savedState)
- {
- base.Uninstall(savedState);
- }
-}
-
-public class MyAssembly
-{
- public static void Main()
- {
- Console.WriteLine("Run the assembly Installer_Context.exe using the" +
- " installer process 'installutil'");
- }
-}
diff --git a/snippets/csharp/System.Configuration.Install/Installer/HelpText/Project.csproj b/snippets/csharp/System.Configuration.Install/Installer/HelpText/Project.csproj
deleted file mode 100644
index 22bd4a76398..00000000000
--- a/snippets/csharp/System.Configuration.Install/Installer/HelpText/Project.csproj
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
- Library
- net48
- true
-
-
-
-
-
-
-
diff --git a/snippets/csharp/System.Configuration.Install/Installer/HelpText/installer_helptext.cs b/snippets/csharp/System.Configuration.Install/Installer/HelpText/installer_helptext.cs
deleted file mode 100644
index dd702162633..00000000000
--- a/snippets/csharp/System.Configuration.Install/Installer/HelpText/installer_helptext.cs
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- System.Configuration.Install.Installer.HelpText
-
- The following example demonstrates the property 'HelpText'. The
- 'HelpText' property is defined in the 'Installer', which when called
- returns the description of the 'Installer' and the command line
- options for the installation executable, such as the InstallUtil.exe utility,
- that can be passed to and understood by the 'Installer'.
-
- Use 'installutil' to run the assembly Installer_HelpText.exe.
-*/
-using System;
-using System.Collections;
-using System.ComponentModel;
-using System.Configuration.Install;
-
-[RunInstaller(true)]
-public class MyInstaller: Installer
-{
- // Override the 'Install' method.
- public override void Install(IDictionary savedState)
- {
- base.Install(savedState);
- string myHelpText = HelpText;
- Console.WriteLine("Help Text : ");
- Console.WriteLine(myHelpText);
- }
-
- // Override the 'Commit' method.
- public override void Commit(IDictionary savedState)
- {
- base.Commit(savedState);
- }
-
- // Override the 'Rollback' method.
- public override void Rollback(IDictionary savedState)
- {
- base.Rollback(savedState);
- }
-
- // Override the 'Uninstall' method.
- public override void Uninstall(IDictionary savedState)
- {
- base.Uninstall(savedState);
- }
-//
- // Override the property 'HelpText'.
- public override string HelpText
- {
- get
- {
- return "Installer Description : This is a sample Installer\n"
- + "HelpText is used to provide useful information about the "
- + "installer.";
- }
- }
-//
-}
-
-public class MyAssembly
-{
- public static void Main()
- {
- Console.WriteLine("Use installutil.exe to run the assembly Installer_HelpText.exe");
- }
-}
diff --git a/snippets/csharp/System.Configuration.Install/Installer/Installers/installer_installers.cs b/snippets/csharp/System.Configuration.Install/Installer/Installers/installer_installers.cs
deleted file mode 100644
index b7c706aaaf2..00000000000
--- a/snippets/csharp/System.Configuration.Install/Installer/Installers/installer_installers.cs
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- System.Configuration.Install.Installer.Installers
- System.Configuration.Install.Installer.Parent
-
- The following example demonstrates the properties 'Installers' and
- 'Parent'. The Installers property shows the InstallerCollection
- associated with an Installer and the Parent property gets the
- installer containing the collection that this installer belongs to.
-*/
-
-using System;
-using System.Collections;
-using System.ServiceProcess;
-using System.Diagnostics;
-using System.Configuration.Install;
-
-public class Installer_Installers
-{
- public static void Main()
- {
-//
- AssemblyInstaller myAssemblyInstaller = new AssemblyInstaller();
- ServiceInstaller myServiceInstaller = new ServiceInstaller();
- EventLogInstaller myEventLogInstaller = new EventLogInstaller();
-
- InstallerCollection myInstallerCollection = myAssemblyInstaller.Installers;
-
- // Add Installers to the InstallerCollection of 'myAssemblyInstaller'.
- myInstallerCollection.Add(myServiceInstaller);
- myInstallerCollection.Add(myEventLogInstaller);
-
- Installer[] myInstaller = new Installer[2];
- myInstallerCollection.CopyTo(myInstaller,0);
- // Show the contents of the InstallerCollection of 'myAssemblyInstaller'.
- Console.WriteLine("Installers in the InstallerCollection : ");
- for (int iIndex=0; iIndex < myInstaller.Length; iIndex++)
- Console.WriteLine(myInstaller[iIndex].ToString());
-//
- Console.WriteLine("");
-//
- AssemblyInstaller myAssemblyInstaller1 = new AssemblyInstaller();
- InstallerCollection myInstallerCollection1 = myAssemblyInstaller1.Installers;
- // 'myAssemblyInstaller' is an installer of type 'AssemblyInstaller'.
- myInstallerCollection1.Add(myAssemblyInstaller);
-
- Installer myInstaller1 = myAssemblyInstaller.Parent;
- Console.WriteLine("Parent of myAssembly : {0}", myInstaller1.ToString());
-//
- }
-}
diff --git a/snippets/csharp/System.Configuration.Install/Installer/OnAfterInstall/Project.csproj b/snippets/csharp/System.Configuration.Install/Installer/OnAfterInstall/Project.csproj
deleted file mode 100644
index 22bd4a76398..00000000000
--- a/snippets/csharp/System.Configuration.Install/Installer/OnAfterInstall/Project.csproj
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
- Library
- net48
- true
-
-
-
-
-
-
-
diff --git a/snippets/csharp/System.Configuration.Install/Installer/OnAfterInstall/installer_oninstall.cs b/snippets/csharp/System.Configuration.Install/Installer/OnAfterInstall/installer_oninstall.cs
deleted file mode 100644
index 8e3d9a7346a..00000000000
--- a/snippets/csharp/System.Configuration.Install/Installer/OnAfterInstall/installer_oninstall.cs
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- System.Configuration.Install.Installer.OnBeforeInstall(IDictionary savedState)
- System.Configuration.Install.Installer.OnAfterInstall(IDictionary savedState)
-
- The following example demonstrates the methods 'OnBeforeInstall' and
- 'OnAfterInstall' of the 'Installer' class. The methods 'OnBeforeInstall'
- and 'OnAfterInstall' are overridden in the derived class. Space is provided
- to add steps to be done before the installation in 'OnBeforeInstall' method
- and after the installation in 'OnAfterInstall' method.
-
- Use the installer process 'InstallUtil' to run the assembly
- Installer_OnInstall.exe.
-
-*/
-
-using System;
-using System.Collections;
-using System.ComponentModel;
-using System.Configuration.Install;
-
-[RunInstaller(true)]
-public class MyInstaller: Installer
-{
- // Override the 'Install' method.
- public override void Install(IDictionary savedState)
- {
- base.Install(savedState);
- }
-
- // Override the 'Commit' method.
- public override void Commit(IDictionary savedState)
- {
- base.Commit(savedState);
- }
-
- // Override the 'Rollback' method.
- public override void Rollback(IDictionary savedState)
- {
- base.Rollback(savedState);
- }
-
- // Override the 'Uninstall' method.
- public override void Uninstall(IDictionary savedState)
- {
- base.Uninstall(savedState);
- }
-//
- // Override the 'OnBeforeInstall' method.
- protected override void OnBeforeInstall(IDictionary savedState)
- {
- base.OnBeforeInstall(savedState);
- // Add steps to be done before the installation starts.
- Console.WriteLine("OnBeforeInstall method of MyInstaller called");
- }
-//
-//
- // Override the 'OnAfterInstall' method.
- protected override void OnAfterInstall(IDictionary savedState)
- {
- base.OnAfterInstall(savedState);
- // Add steps to be done after the installation is over.
- Console.WriteLine("OnAfterInstall method of MyInstaller called");
- }
-//
-}
-
-public class MyAssembly
-{
- public static void Main()
- {
- Console.WriteLine("Use installutil.exe to run the assembly Installer_OnInstall.exe");
- }
-}
diff --git a/snippets/csharp/System.Configuration.Install/Installer/OnCommitted/Project.csproj b/snippets/csharp/System.Configuration.Install/Installer/OnCommitted/Project.csproj
deleted file mode 100644
index 22bd4a76398..00000000000
--- a/snippets/csharp/System.Configuration.Install/Installer/OnCommitted/Project.csproj
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
- Library
- net48
- true
-
-
-
-
-
-
-
diff --git a/snippets/csharp/System.Configuration.Install/Installer/OnCommitted/installer_committed.cs b/snippets/csharp/System.Configuration.Install/Installer/OnCommitted/installer_committed.cs
deleted file mode 100644
index 956d0c13e70..00000000000
--- a/snippets/csharp/System.Configuration.Install/Installer/OnCommitted/installer_committed.cs
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- System.Configuration.Install.Installer.OnCommitting(Idictionary savedState)
- System.Configuration.Install.Installer.OnCommitted(Idictionary savedState)
-
- The following example demonstrates the methods 'OnCommitting' and
- 'OnCommitted' of the 'Installer' class. The methods 'OnCommitting' and
- 'OnCommitted' are overridden in the derived class. Space is provided
- for the user to add the steps to be performed before committing and
- after committing.
-
- 'Installer_Committed.exe' needs to be run using the installer process
- 'installutil'.
-*/
-using System;
-using System.Collections;
-using System.ComponentModel;
-using System.Configuration.Install;
-
-[RunInstaller(true)]
-public class MyInstaller: Installer
-{
- // Override the 'Install' method.
- public override void Install(IDictionary savedState)
- {
- base.Install(savedState);
- Console.WriteLine("");
- Console.WriteLine("Install method of MyInstaller called");
- Console.WriteLine("");
- }
-
- // Override the 'Commit' method.
- public override void Commit(IDictionary savedState)
- {
- base.Commit(savedState);
- }
-
- // Override the 'Rollback' method.
- public override void Rollback(IDictionary savedState)
- {
- base.Rollback(savedState);
- }
-
- // Override the 'Uninstall' method.
- public override void Uninstall(IDictionary savedState)
- {
- base.Uninstall(savedState);
- }
-//
- // Override the 'OnCommitting' method.
- protected override void OnCommitting(IDictionary savedState)
- {
- base.OnCommitting(savedState);
- // Add steps to be done before committing an application.
- Console.WriteLine("The OnCommitting method of MyInstaller called");
- }
-//
-//
- // Override the 'OnCommitted' method.
- protected override void OnCommitted(IDictionary savedState)
- {
- base.OnCommitted(savedState);
- // Add steps to be done after committing an application.
- Console.WriteLine("The OnCommitted method of MyInstaller called");
- }
-//
-}
-
-public class MyAssembly
-{
- public static void Main()
- {
- Console.WriteLine("Use installutil.exe to run the assembly Installer_Committed.exe");
- }
-}
diff --git a/snippets/csharp/System.Configuration.Install/Installer/Overview/Project.csproj b/snippets/csharp/System.Configuration.Install/Installer/Overview/Project.csproj
deleted file mode 100644
index 22bd4a76398..00000000000
--- a/snippets/csharp/System.Configuration.Install/Installer/Overview/Project.csproj
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
- Library
- net48
- true
-
-
-
-
-
-
-
diff --git a/snippets/csharp/System.Configuration.Install/Installer/Overview/installer.cs b/snippets/csharp/System.Configuration.Install/Installer/Overview/installer.cs
deleted file mode 100644
index feb5e8a94e3..00000000000
--- a/snippets/csharp/System.Configuration.Install/Installer/Overview/installer.cs
+++ /dev/null
@@ -1,60 +0,0 @@
-// System.Configuration.Install.Installer
-
-/* The following program demonstrates the use of the 'Installer'
- class. It creates a class which inherits from 'Installer'.
- When the 'Commit' is about to complete, 'Committing' event
- occurs and a message is displayed when the event occurs.
-*/
-
-//
-using System;
-using System.Collections;
-using System.ComponentModel;
-using System.Configuration.Install;
-
-// Set 'RunInstaller' attribute to true.
-[RunInstaller(true)]
-public class MyInstallerClass: Installer
-{
- public MyInstallerClass() :base()
- {
- // Attach the 'Committed' event.
- this.Committed += new InstallEventHandler(MyInstaller_Committed);
- // Attach the 'Committing' event.
- this.Committing += new InstallEventHandler(MyInstaller_Committing);
- }
- // Event handler for 'Committing' event.
- private void MyInstaller_Committing(object sender, InstallEventArgs e)
- {
- Console.WriteLine("");
- Console.WriteLine("Committing Event occurred.");
- Console.WriteLine("");
- }
- // Event handler for 'Committed' event.
- private void MyInstaller_Committed(object sender, InstallEventArgs e)
- {
- Console.WriteLine("");
- Console.WriteLine("Committed Event occurred.");
- Console.WriteLine("");
- }
- // Override the 'Install' method.
- public override void Install(IDictionary savedState)
- {
- base.Install(savedState);
- }
- // Override the 'Commit' method.
- public override void Commit(IDictionary savedState)
- {
- base.Commit(savedState);
- }
- // Override the 'Rollback' method.
- public override void Rollback(IDictionary savedState)
- {
- base.Rollback(savedState);
- }
- public static void Main()
- {
- Console.WriteLine("Usage : installutil.exe Installer.exe ");
- }
-}
-//
diff --git a/snippets/csharp/System.Configuration.Install/Installer/Rollback/Project.csproj b/snippets/csharp/System.Configuration.Install/Installer/Rollback/Project.csproj
deleted file mode 100644
index 22bd4a76398..00000000000
--- a/snippets/csharp/System.Configuration.Install/Installer/Rollback/Project.csproj
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
- Library
- net48
- true
-
-
-
-
-
-
-
diff --git a/snippets/csharp/System.Configuration.Install/Installer/Rollback/installer_rollback.cs b/snippets/csharp/System.Configuration.Install/Installer/Rollback/installer_rollback.cs
deleted file mode 100644
index c06b0cbb194..00000000000
--- a/snippets/csharp/System.Configuration.Install/Installer/Rollback/installer_rollback.cs
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- System.Configuration.Install.Installer.Rollback
-
- The following example demonstrates the Rollback method
- of the class 'installer'. The Rollback method is overridden
- in a derived class of 'installer'.An exception is generated to
- force an installation rollback.
-*/
-
-using System;
-using System.ComponentModel;
-using System.Configuration.Install;
-using System.Collections;
-
-namespace MyAssembly
-{
- [RunInstaller(true)]
- public class MyInstallerSample : Installer
- {
- // Override 'Install' method of Installer class.
- public override void Install( IDictionary mySavedState )
- {
- base.Install( mySavedState );
- Console.WriteLine( "" );
- // Include code to install an application.
- Console.WriteLine( "The Install method of 'MyInstallerSample'" +
- " has been called" );
- Console.WriteLine( "" );
-
- // Exception generated to call Rollback method.
- Exception myException = new Exception();
- Console.WriteLine("Exception thrown during Installation");
- throw myException;
- }
-//
- // Override 'Rollback' method of Installer class.
- public override void Rollback( IDictionary mySavedState )
- {
- base.Rollback( mySavedState );
- Console.WriteLine( "The Rollback method of 'MyInstallerSample'" +
- " has been called" );
- }
-//
- static void Main()
- {
- Console.WriteLine("Use installutil.exe to run the assembly"
- + " Installer_Rollback.exe");
- }
- }
-}
diff --git a/snippets/csharp/System.Configuration.Install/Installer/Uninstall/Project.csproj b/snippets/csharp/System.Configuration.Install/Installer/Uninstall/Project.csproj
deleted file mode 100644
index 22bd4a76398..00000000000
--- a/snippets/csharp/System.Configuration.Install/Installer/Uninstall/Project.csproj
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
- Library
- net48
- true
-
-
-
-
-
-
-
diff --git a/snippets/csharp/System.Configuration.Install/Installer/Uninstall/installer_uninstall.cs b/snippets/csharp/System.Configuration.Install/Installer/Uninstall/installer_uninstall.cs
deleted file mode 100644
index cd425d98a8a..00000000000
--- a/snippets/csharp/System.Configuration.Install/Installer/Uninstall/installer_uninstall.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- System.Configuration.Install.Installer.Uninstall
-
- The following example demonstrates the Uninstall method
- of the class 'installer'. The method Uninstall is overridden
- in the derived class of 'installer'.
-*/
-
-using System;
-using System.ComponentModel;
-using System.Configuration.Install;
-using System.Collections;
-
-namespace MyAssembly
-{
- [RunInstaller(true)]
- public class MyInstallerSample : Installer
- {
-//
- // Override 'Uninstall' method of Installer class.
- public override void Uninstall( IDictionary mySavedState )
- {
- if (mySavedState == null)
- {
- Console.WriteLine("Uninstallation Error !");
- }
- else
- {
- base.Uninstall( mySavedState );
- Console.WriteLine( "The Uninstall method of 'MyInstallerSample' has been called" );
- }
- }
-//
-
- static void Main()
- {
- Console.WriteLine("Use 'installutil.exe -u' to run the assembly"
- + " Installer_Uninstall.exe");
- }
- }
-}
diff --git a/snippets/csharp/System.Configuration.Install/InstallerCollection/AddRange/installercollection_addrange1.cs b/snippets/csharp/System.Configuration.Install/InstallerCollection/AddRange/installercollection_addrange1.cs
deleted file mode 100644
index dd6d1cde9b3..00000000000
--- a/snippets/csharp/System.Configuration.Install/InstallerCollection/AddRange/installercollection_addrange1.cs
+++ /dev/null
@@ -1,60 +0,0 @@
-// System.Configuration.Install.InstallerCollection.AddRange(Installer[])
-
-/*
- The following example demonstrates the 'AddRange(Installer[])'
- method of the 'InstallerCollection' class. It Creates 'AssemblyInstaller'
- instances for 'MyAssembly1.exe' and for 'MyAssembly2.exe'. These
- instances are added to an instance of 'TransactedInstaller'. The installation
- process installs both 'MyAssembly1.exe' and 'MyAssembly2.exe'.
-*/
-
-using System;
-using System.ComponentModel;
-using System.Collections;
-using System.Configuration.Install;
-using System.IO;
-
-public class InstallerCollection_AddRange1
-{
- public static void Main()
- {
- try
- {
-//
- ArrayList myInstallers =new ArrayList();
- TransactedInstaller myTransactedInstaller = new TransactedInstaller();
- AssemblyInstaller myAssemblyInstaller;
- InstallContext myInstallContext;
-
- // Create a instance of 'AssemblyInstaller' that installs 'MyAssembly1.exe'.
- myAssemblyInstaller =
- new AssemblyInstaller("MyAssembly1.exe", null);
-
- // Add the instance of 'AssemblyInstaller' to the list of installers.
- myInstallers.Add(myAssemblyInstaller);
-
- // Create a instance of 'AssemblyInstaller' that installs 'MyAssembly2.exe'.
- myAssemblyInstaller =
- new AssemblyInstaller("MyAssembly2.exe", null);
-
- // Add the instance of 'AssemblyInstaller' to the list of installers.
- myInstallers.Add(myAssemblyInstaller);
-
- // Add the installers to the 'TransactedInstaller' instance.
- myTransactedInstaller.Installers.AddRange((Installer[])myInstallers.ToArray(typeof(Installer)));
-//
-
- // Create a instance of 'InstallContext' with log file named 'Install.log'.
- myInstallContext =
- new InstallContext("Install.log", null);
- myTransactedInstaller.Context = myInstallContext;
-
- // Install an assembly.
- myTransactedInstaller.Install(new Hashtable());
- }
- catch(Exception e)
- {
- Console.WriteLine("Exception raised : {0}", e.Message);
- }
- }
-}
\ No newline at end of file
diff --git a/snippets/csharp/System.Configuration.Install/InstallerCollection/AddRange/installercollection_insert.cs b/snippets/csharp/System.Configuration.Install/InstallerCollection/AddRange/installercollection_insert.cs
deleted file mode 100644
index 0c7135b008b..00000000000
--- a/snippets/csharp/System.Configuration.Install/InstallerCollection/AddRange/installercollection_insert.cs
+++ /dev/null
@@ -1,61 +0,0 @@
-// System.Configuration.Install.InstallerCollection.Insert(Int32, Installer)
-// System.Configuration.Install.InstallerCollection.AddRange(InstallerCollection)
-
-/*
- The following example demonstrates the 'Insert(Int32, Installer)' and
- 'AddRange(InstallerCollection)' methods of the 'InstallerCollection'
- class. It Creates 'AssemblyInstaller' instances for 'MyAssembly1.exe'
- and 'MyAssembly2.exe'. These instances of 'AssemblyInstaller' are
- added to an instance of 'TransactedInstaller' named 'myTransactedInstaller1'.
- The installers in the 'myTransactedInstaller1' are copied to another
- instance of 'TransactedInstaller' named 'myTransactedInstaller2'.The
- installation process installs both 'MyAssembly1.exe' and 'MyAssembly2.exe'.
-*/
-
-using System;
-using System.Reflection;
-using System.ComponentModel;
-using System.Collections;
-using System.Configuration.Install;
-using System.IO;
-
-public class InstallerCollection_Insert
-{
- public static void Main()
- {
-//
-//
- TransactedInstaller myTransactedInstaller1 = new TransactedInstaller();
- TransactedInstaller myTransactedInstaller2 = new TransactedInstaller();
- AssemblyInstaller myAssemblyInstaller = new AssemblyInstaller();
- InstallContext myInstallContext;
-
- // Create a instance of 'AssemblyInstaller' that installs 'MyAssembly1.exe'.
- myAssemblyInstaller =
- new AssemblyInstaller("MyAssembly1.exe", null);
-
- // Add the instance of 'AssemblyInstaller' to the 'TransactedInstaller'.
- myTransactedInstaller1.Installers.Insert(0, myAssemblyInstaller);
-
- // Create a instance of 'AssemblyInstaller' that installs 'MyAssembly2.exe'.
- myAssemblyInstaller =
- new AssemblyInstaller("MyAssembly2.exe", null);
-
- // Add the instance of 'AssemblyInstaller' to the 'TransactedInstaller'.
- myTransactedInstaller1.Installers.Insert(1, myAssemblyInstaller);
-
- // Copy the installers of 'myTransactedInstaller1' to 'myTransactedInstaller2'.
- myTransactedInstaller2.Installers.AddRange(myTransactedInstaller1.Installers);
-
-//
-//
-
- // Create a instance of 'InstallContext' with log file named 'Install.log'.
- myInstallContext =
- new InstallContext("Install.log", null);
- myTransactedInstaller2.Context = myInstallContext;
-
- // Install an assembly.
- myTransactedInstaller2.Install(new Hashtable());
- }
-}
\ No newline at end of file
diff --git a/snippets/csharp/System.Configuration.Install/InstallerCollection/Contains/installercollection_remove.cs b/snippets/csharp/System.Configuration.Install/InstallerCollection/Contains/installercollection_remove.cs
deleted file mode 100644
index 41a65d6038c..00000000000
--- a/snippets/csharp/System.Configuration.Install/InstallerCollection/Contains/installercollection_remove.cs
+++ /dev/null
@@ -1,86 +0,0 @@
-// System.Configuration.Install.InstallerCollection.Remove(Installer)
-// System.Configuration.Install.InstallerCollection.Contains(Installer)
-// System.Configuration.Install.InstallerCollection.IndexOf(Installer)
-
-/*
- The following example demonstrates the 'Remove(Installer)',
- 'Contains(Installer)' and 'IndexOf(Installer)' methods of the
- 'InstallerCollection' class. Create's 'AssemblyInstaller' instances
- for 'MyAssembly1.exe' and for 'MyAssembly2.exe'. These instances
- of 'AssemblyInstaller' are added to an instance of 'TransactedInstaller'.
- The 'AssemblyIntaller' instance for 'MyAssembly2.exe' is removed
- from the installers collection of the 'TransactedInstaller' instance.
- The installation process is started which installs only 'MyAssembly1.exe'.
-*/
-
-using System;
-using System.Reflection;
-using System.ComponentModel;
-using System.Collections;
-using System.Configuration.Install;
-using System.IO;
-
-public class InstallerCollection_Remove
-{
- public static void Main()
- {
- try
- {
-//
-//
-//
- TransactedInstaller myTransactedInstaller = new TransactedInstaller();
- AssemblyInstaller myAssemblyInstaller1;
- AssemblyInstaller myAssemblyInstaller2;
- InstallContext myInstallContext;
-
- // Create a instance of 'AssemblyInstaller' that installs 'MyAssembly1.exe'.
- myAssemblyInstaller1 =
- new AssemblyInstaller("MyAssembly1.exe", null);
-
- // Add the instance of 'AssemblyInstaller' to the 'TransactedInstaller'.
- myTransactedInstaller.Installers.Insert(0, myAssemblyInstaller1);
-
- // Create a instance of 'AssemblyInstaller' that installs 'MyAssembly2.exe'.
- myAssemblyInstaller2 =
- new AssemblyInstaller("MyAssembly2.exe", null);
-
- // Add the instance of 'AssemblyInstaller' to the 'TransactedInstaller'.
- myTransactedInstaller.Installers.Insert(1, myAssemblyInstaller2);
-
- // Remove the 'myAssemblyInstaller2' from the 'Installers' collection.
- if(myTransactedInstaller.Installers.Contains(myAssemblyInstaller2))
- {
- Console.WriteLine("\nInstaller at index : {0} is being removed",
- myTransactedInstaller.Installers.IndexOf(myAssemblyInstaller2));
- myTransactedInstaller.Installers.Remove(myAssemblyInstaller2);
- }
-//
-//
-//
- //Print the installers to be installed.
- InstallerCollection myInstallers = myTransactedInstaller.Installers;
- Console.WriteLine("\nPrinting all installers to be installed\n");
- for(int i = 0; i < myInstallers.Count; i++)
- {
- if((myInstallers[i].GetType()).Equals(typeof(AssemblyInstaller)))
- {
- Console.WriteLine("{0} {1}", i + 1,
- ((AssemblyInstaller)myInstallers[i]).Path);
- }
- }
-
- // Create a instance of 'InstallContext' with log file named 'Install.log'.
- myInstallContext =
- new InstallContext("Install.log", null);
- myTransactedInstaller.Context = myInstallContext;
-
- // Install an assembly.
- myTransactedInstaller.Install(new Hashtable());
- }
- catch(Exception e)
- {
- Console.WriteLine("Exception raised : {0}", e.Message);
- }
- }
-}
diff --git a/snippets/csharp/System.Configuration.Install/InstallerCollection/CopyTo/installercollection_copyto.cs b/snippets/csharp/System.Configuration.Install/InstallerCollection/CopyTo/installercollection_copyto.cs
deleted file mode 100644
index e4c91a68894..00000000000
--- a/snippets/csharp/System.Configuration.Install/InstallerCollection/CopyTo/installercollection_copyto.cs
+++ /dev/null
@@ -1,65 +0,0 @@
-// System.Configuration.Install.InstallerCollection.CopyTo(Installer[], Int32)
-
-/*
- The following example demonstrates the 'CopyTo(Installer[], Int32)' method
- of the 'InstallerCollection' class. It Creates 'AssemblyInstaller' instances
- for 'MyAssembly1.exe' and 'MyAssembly2.exe'. These instances of
- 'AssemblyInstaller' are added to an instance of 'TransactedInstaller'
- instance. The names of the assemblies to be installed
- are displayed on the console. The installation process then installs
- both 'MyAssembly1.exe' and 'MyAssembly2.exe'.
-*/
-
-using System;
-using System.ComponentModel;
-using System.Collections;
-using System.Configuration.Install;
-using System.IO;
-
-public class InstallerCollection_CopyTo
-{
- public static void Main()
- {
-//
- TransactedInstaller myTransactedInstaller = new TransactedInstaller();
- AssemblyInstaller myAssemblyInstaller;
- InstallContext myInstallContext;
-
- // Create an instance of 'AssemblyInstaller' that installs 'MyAssembly1.exe'.
- myAssemblyInstaller =
- new AssemblyInstaller("MyAssembly1.exe", null);
-
- // Add the instance of 'AssemblyInstaller' to the 'TransactedInstaller'.
- myTransactedInstaller.Installers.Add(myAssemblyInstaller);
-
- // Create an instance of 'AssemblyInstaller' that installs 'MyAssembly2.exe'.
- myAssemblyInstaller =
- new AssemblyInstaller("MyAssembly2.exe", null);
-
- // Add the instance of 'AssemblyInstaller' to the 'TransactedInstaller'.
- myTransactedInstaller.Installers.Add(myAssemblyInstaller);
-
- Installer[] myInstallers =
- new Installer[myTransactedInstaller.Installers.Count];
-
- myTransactedInstaller.Installers.CopyTo(myInstallers, 0);
- // Print the assemblies to be installed.
- Console.WriteLine("Printing all assemblies to be installed -");
- for(int i = 0; i < myInstallers.Length; i++)
- {
- if((myInstallers[i].GetType()).Equals(typeof(AssemblyInstaller)))
- {
- Console.WriteLine("{0} {1}", i + 1,
- ((AssemblyInstaller)myInstallers[i]).Path);
- }
- }
-//
- // Create a instance of 'InstallContext' with log file named 'Install.log'.
- myInstallContext =
- new InstallContext("Install.log", null);
- myTransactedInstaller.Context = myInstallContext;
-
- // Install an assembly.
- myTransactedInstaller.Install(new Hashtable());
- }
-}
\ No newline at end of file
diff --git a/snippets/csharp/System.Configuration.Install/InstallerCollection/Item/installercollection_item.cs b/snippets/csharp/System.Configuration.Install/InstallerCollection/Item/installercollection_item.cs
deleted file mode 100644
index f7b2dead3fe..00000000000
--- a/snippets/csharp/System.Configuration.Install/InstallerCollection/Item/installercollection_item.cs
+++ /dev/null
@@ -1,68 +0,0 @@
-// System.Configuration.Install.InstallerCollection.Item(Int32)
-
-/*
- The following example demonstrates the 'Item(Int32)' method of the
- 'InstallerCollection' class. It creates 'AssemblyInstaller' instances
- for 'MyAssembly1.exe' and 'MyAssembly2.exe'. These instances are added
- to an instance of 'TransactedInstaller'. The names of all the assemblies
- that are to be installed are displayed to the console. The installation
- process installs both 'MyAssembly1.exe' and 'MyAssembly2.exe'.
-*/
-
-using System;
-using System.ComponentModel;
-using System.Collections;
-using System.Configuration.Install;
-using System.IO;
-
-public class InstallerCollection_Item
-{
- public static void Main()
- {
- try
- {
-//
- TransactedInstaller myTransactedInstaller = new TransactedInstaller();
- AssemblyInstaller myAssemblyInstaller;
- InstallContext myInstallContext;
-
- // Create a instance of 'AssemblyInstaller' that installs 'MyAssembly1.exe'.
- myAssemblyInstaller =
- new AssemblyInstaller("MyAssembly1.exe", null);
-
- // Add the instance of 'AssemblyInstaller' to the 'TransactedInstaller'.
- myTransactedInstaller.Installers.Add(myAssemblyInstaller);
-
- // Create a instance of 'AssemblyInstaller' that installs 'MyAssembly2.exe'.
- myAssemblyInstaller =
- new AssemblyInstaller("MyAssembly2.exe", null);
-
- // Add the instance of 'AssemblyInstaller' to the 'TransactedInstaller'.
- myTransactedInstaller.Installers.Add(myAssemblyInstaller);
-
- //Print the assemblies to be installed.
- InstallerCollection myInstallers = myTransactedInstaller.Installers;
- Console.WriteLine("\nPrinting all assemblies to be installed");
- for(int i = 0; i < myInstallers.Count; i++)
- {
- if((myInstallers[i].GetType()).Equals(typeof(AssemblyInstaller)))
- {
- Console.WriteLine("{0} {1}", i + 1,
- ((AssemblyInstaller)myInstallers[i]).Path);
- }
- }
-//
- // Create a instance of 'InstallContext' with log file named 'Install.log'.
- myInstallContext =
- new InstallContext("Install.log", null);
- myTransactedInstaller.Context = myInstallContext;
-
- // Install an assembly .
- myTransactedInstaller.Install(new Hashtable());
- }
- catch(Exception e)
- {
- Console.WriteLine("Exception raised : {0}", e.Message);
- }
- }
-}
\ No newline at end of file
diff --git a/snippets/csharp/System.Configuration.Install/InstallerCollection/Overview/installercollection_add.cs b/snippets/csharp/System.Configuration.Install/InstallerCollection/Overview/installercollection_add.cs
deleted file mode 100644
index 485dfb03eee..00000000000
--- a/snippets/csharp/System.Configuration.Install/InstallerCollection/Overview/installercollection_add.cs
+++ /dev/null
@@ -1,114 +0,0 @@
-// System.Configuration.Install.InstallerCollection
-// System.Configuration.Install.InstallerCollection.Add(Installer)
-
-/*
- The following example demonstrates the Add(Installer)
- method of the 'InstallerCollection' class. This example provides
- an implementation similar to that of 'InstallUtil.exe'. It installs
- assemblies with the options preceding that particular assembly.
- If an option is not specified for an assembly the previous assemblies
- options are taken if there is a previous assembly in the list. If the
- '/u' or '/uninstall' option is specified then the assemblies are uninstalled.
- If the '/?' or '/help' option is provided then the help information is
- displayed to the console.
-*/
-
-//
-using System;
-using System.ComponentModel;
-using System.Collections;
-using System.Configuration.Install;
-using System.IO;
-
-public class InstallerCollection_Add
-{
- public static void Main(String[] args)
- {
- ArrayList options = new ArrayList();
- String myOption;
- bool toUnInstall = false;
- bool toPrintHelp = false;
- TransactedInstaller myTransactedInstaller = new TransactedInstaller();
- AssemblyInstaller myAssemblyInstaller;
- InstallContext myInstallContext;
-
- try
- {
- for(int i = 0; i < args.Length; i++)
- {
- // Process the arguments.
- if(args[i].StartsWith("/") || args[i].StartsWith("-"))
- {
- myOption = args[i].Substring(1);
- // Determine whether the option is to 'uninstall' a assembly.
- if(String.Compare(myOption, "u", true) == 0 ||
- String.Compare(myOption, "uninstall", true) == 0)
- {
- toUnInstall = true;
- continue;
- }
- // Determine whether the option is for printing help information.
- if(String.Compare(myOption, "?", true) == 0 ||
- String.Compare(myOption, "help", true) == 0)
- {
- toPrintHelp = true;
- continue;
- }
- // Add the option encountered to the list of all options
- // encountered for the current assembly.
- options.Add(myOption);
- }
- else
- {
- // Determine whether the assembly file exists.
- if(!File.Exists(args[i]))
- {
- // If assembly file doesn't exist then print error.
- Console.WriteLine(" Error : {0} - Assembly file doesn't exist.", args[i]);
- return;
- }
-//
- // Create an instance of 'AssemblyInstaller' that installs the given assembly.
- myAssemblyInstaller = new AssemblyInstaller(args[i],
- (string[]) options.ToArray(typeof(string)));
- // Add the instance of 'AssemblyInstaller' to the 'TransactedInstaller'.
- myTransactedInstaller.Installers.Add(myAssemblyInstaller);
-//
- }
- }
- // If user requested help or didn't provide any assemblies to install
- // then print help message.
- if(toPrintHelp || myTransactedInstaller.Installers.Count == 0)
- {
- PrintHelpMessage();
- return;
- }
-
- // Create an instance of 'InstallContext' with the options specified.
- myInstallContext =
- new InstallContext("Install.log",
- (string[]) options.ToArray(typeof(string)));
- myTransactedInstaller.Context = myInstallContext;
-
- // Install or Uninstall an assembly depending on the option provided.
- if(!toUnInstall)
- myTransactedInstaller.Install(new Hashtable());
- else
- myTransactedInstaller.Uninstall(null);
- }
- catch(Exception e)
- {
- Console.WriteLine(" Exception raised : {0}", e.Message);
- }
- }
-
- public static void PrintHelpMessage()
- {
- Console.WriteLine("Usage : InstallerCollection_Add [/u | /uninstall] [option [...]] assembly" +
- "[[option [...]] assembly] [...]]");
- Console.WriteLine("InstallerCollection_Add executes the installers in each of" +
- " the given assembly. If /u or /uninstall option" +
- " is given it uninstalls the assemblies.");
- }
-}
-//
\ No newline at end of file
diff --git a/snippets/csharp/System.Configuration.Install/TransactedInstaller/Overview/Project.csproj b/snippets/csharp/System.Configuration.Install/TransactedInstaller/Overview/Project.csproj
deleted file mode 100644
index 22bd4a76398..00000000000
--- a/snippets/csharp/System.Configuration.Install/TransactedInstaller/Overview/Project.csproj
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
- Library
- net48
- true
-
-
-
-
-
-
-
diff --git a/snippets/csharp/System.Configuration.Install/TransactedInstaller/Overview/transactedinstaller.cs b/snippets/csharp/System.Configuration.Install/TransactedInstaller/Overview/transactedinstaller.cs
deleted file mode 100644
index 42e24ad5bf4..00000000000
--- a/snippets/csharp/System.Configuration.Install/TransactedInstaller/Overview/transactedinstaller.cs
+++ /dev/null
@@ -1,118 +0,0 @@
-// System.Configuration.Install.TransactedInstaller
-// System.Configuration.Install.TransactedInstaller.TransactedInstaller()
-// System.Configuration.Install.TransactedInstaller.Install(IDictionary)
-// System.COnfiguration.Install.TransactedInstaller.Uninstall(IDictionary)
-
-/*
- The following example demonstrates the constructor, Install(IDictionary) and
- Uninstall(IDictionary) methods of the 'TransactedInstaller' class.
- This example provides an implementation similar to that of 'InstallUtil.exe'.
- It installs assemblies with the options preceding that particular assembly.
- If an option is not specified for an assembly the previous assemblies options
- are taken if there is a previous assembly in the list. If the '/u' or
- '/uninstall' option is specified then the assemblies are uninstalled.
- If the '/?' or '/help' option is provided then the help information is
- printed to the console.
- */
-
-//
-using System;
-using System.ComponentModel;
-using System.Collections;
-using System.Configuration.Install;
-using System.IO;
-
-public class TransactedInstaller_Example
-{
-//
- public static void Main(String[] args)
- {
- ArrayList myOptions = new ArrayList();
- String myOption;
- bool toUnInstall = false;
- bool toPrintHelp = false;
- TransactedInstaller myTransactedInstaller = new TransactedInstaller();
- AssemblyInstaller myAssemblyInstaller;
- InstallContext myInstallContext;
-
- try
- {
- for(int i = 0; i < args.Length; i++)
- {
- // Process the arguments.
- if(args[i].StartsWith("/") || args[i].StartsWith("-"))
- {
- myOption = args[i].Substring(1);
- // Determine whether the option is to 'uninstall' an assembly.
- if(String.Compare(myOption, "u", true) == 0 ||
- String.Compare(myOption, "uninstall", true) == 0)
- {
- toUnInstall = true;
- continue;
- }
- // Determine whether the option is for printing help information.
- if(String.Compare(myOption, "?", true) == 0 ||
- String.Compare(myOption, "help", true) == 0)
- {
- toPrintHelp = true;
- continue;
- }
- // Add the option encountered to the list of all options
- // encountered for the current assembly.
- myOptions.Add(myOption);
- }
- else
- {
- // Determine whether the assembly file exists.
- if(!File.Exists(args[i]))
- {
- // If assembly file doesn't exist then print error.
- Console.WriteLine("\nError : {0} - Assembly file doesn't exist.",
- args[i]);
- return;
- }
-
- // Create a instance of 'AssemblyInstaller' that installs the given assembly.
- myAssemblyInstaller =
- new AssemblyInstaller(args[i],
- (string[]) myOptions.ToArray(typeof(string)));
- // Add the instance of 'AssemblyInstaller' to the 'TransactedInstaller'.
- myTransactedInstaller.Installers.Add(myAssemblyInstaller);
- }
- }
- // If user requested help or didn't provide any assemblies to install
- // then print help message.
- if(toPrintHelp || myTransactedInstaller.Installers.Count == 0)
- {
- PrintHelpMessage();
- return;
- }
-
- // Create a instance of 'InstallContext' with the options specified.
- myInstallContext =
- new InstallContext("Install.log",
- (string[]) myOptions.ToArray(typeof(string)));
- myTransactedInstaller.Context = myInstallContext;
-
- // Install or Uninstall an assembly depending on the option provided.
- if(!toUnInstall)
- myTransactedInstaller.Install(new Hashtable());
- else
- myTransactedInstaller.Uninstall(null);
- }
- catch(Exception e)
- {
- Console.WriteLine("\nException raised : {0}", e.Message);
- }
- }
-
- public static void PrintHelpMessage()
- {
- Console.WriteLine("Usage : TransactedInstaller [/u | /uninstall] [option [...]] assembly" +
- "[[option [...]] assembly] [...]]");
- Console.WriteLine("TransactedInstaller executes the installers in each of" +
- " the given assembly. If /u or /uninstall option" +
- " is given it uninstalls the assemblies.");
- }
-}
-//
diff --git a/snippets/csharp/System.Configuration.Install/UninstallAction/Overview/Project.csproj b/snippets/csharp/System.Configuration.Install/UninstallAction/Overview/Project.csproj
deleted file mode 100644
index 22bd4a76398..00000000000
--- a/snippets/csharp/System.Configuration.Install/UninstallAction/Overview/Project.csproj
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
- Library
- net48
- true
-
-
-
-
-
-
-
diff --git a/snippets/csharp/System.Configuration.Install/UninstallAction/Overview/uninstallaction_noaction_remove_3.cs b/snippets/csharp/System.Configuration.Install/UninstallAction/Overview/uninstallaction_noaction_remove_3.cs
deleted file mode 100644
index 3b2fb872dd7..00000000000
--- a/snippets/csharp/System.Configuration.Install/UninstallAction/Overview/uninstallaction_noaction_remove_3.cs
+++ /dev/null
@@ -1,77 +0,0 @@
-// System.Configuration.Install.UninstallAction
-// System.Configuration.Install.UninstallAction.NoAction
-// System.Configuration.Install.UninstallAction.Remove
-
-/* The following program demonstrates "NoAction" and "Remove"
- members of "UninstallAction" enumeration. A resource is
- installed and uninstalled using 'installutil.exe' in an event
- log depending on the user input.
-*/
-
-//
-using System;
-using System.Diagnostics;
-using System.Collections;
-using System.ComponentModel;
-using System.Configuration.Install;
-
-[RunInstaller(true)]
-public class MyUninstallActionClass : Installer
-{
- EventLogInstaller myInstaller = new EventLogInstaller();
-
- // Override the 'Install' method.
- public override void Install(IDictionary savedState)
- {
- Console.Write("Enter a new log to create (eg: MyLog ): ");
- myInstaller.Log = Console.ReadLine();
- Console.Write("Enter a source for log (eg: MySource ): ");
- myInstaller.Source = Console.ReadLine();
- Installers.Add( myInstaller );
- base.Install(savedState);
- }
-
- // Override the 'Commit' method.
- public override void Commit(IDictionary savedState)
- {
- base.Commit(savedState);
- }
-
- // Override the 'Rollback' method.
- public override void Rollback(IDictionary savedState)
- {
- base.Rollback(savedState);
- }
-//
-//
- public override void Uninstall(IDictionary savedState)
- {
- Console.Write("Enter a source from log to uninstall(eg: MySource ): ");
- myInstaller.Source = Console.ReadLine();
-
- Console.Write("Do you want to uninstall, press 'y' for 'YES' and 'n' for 'NO':");
- string myUninstall = Console.ReadLine();
-
- if( myUninstall == "n" )
- {
- // No action to be taken on the resource in the event log.
- myInstaller.UninstallAction = System.Configuration.Install.UninstallAction.NoAction;
- }
- else
- {
- // Remove the resource from the event log.
- myInstaller.UninstallAction = System.Configuration.Install.UninstallAction.Remove;
- }
- Installers.Add( myInstaller );
- base.Uninstall(savedState);
- }
-//
-//
- public static void Main()
- {
- Console.WriteLine("Syntax for install: installutil.exe UninstallAction_NoAction_Remove_3.exe ");
- Console.WriteLine("Syntax for uninstall: installutil.exe /u "
- +"UninstallAction_NoAction_Remove_3.exe ");
- }
-}
-//
diff --git a/snippets/csharp/System.Data.EntityClient/EntityConnection/ConnectionString/AdventureWorksModel.Designer.cs b/snippets/csharp/System.Data.EntityClient/EntityConnection/ConnectionString/AdventureWorksModel.Designer.cs
deleted file mode 100644
index c27e5d684a1..00000000000
--- a/snippets/csharp/System.Data.EntityClient/EntityConnection/ConnectionString/AdventureWorksModel.Designer.cs
+++ /dev/null
@@ -1,2759 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// This code was generated from a template.
-//
-// Manual changes to this file may cause unexpected behavior in your application.
-// Manual changes to this file will be overwritten if the code is regenerated.
-//
-//------------------------------------------------------------------------------
-
-using System;
-using System.ComponentModel;
-using System.Data.EntityClient;
-using System.Data.Objects;
-using System.Data.Objects.DataClasses;
-using System.Linq;
-using System.Runtime.Serialization;
-using System.Xml.Serialization;
-
-[assembly: EdmSchemaAttribute()]
-#region EDM Relationship Metadata
-
-[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_SalesOrderHeader_Address_BillToAddressID", "Address", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(eSQLExamplesCS.Address), "SalesOrderHeader", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(eSQLExamplesCS.SalesOrderHeader))]
-[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_SalesOrderHeader_Address_ShipToAddressID", "Address", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(eSQLExamplesCS.Address), "SalesOrderHeader", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(eSQLExamplesCS.SalesOrderHeader))]
-[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_SalesOrderHeader_Contact_ContactID", "Contact", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(eSQLExamplesCS.Contact), "SalesOrderHeader", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(eSQLExamplesCS.SalesOrderHeader))]
-[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_SalesOrderDetail_SalesOrderHeader_SalesOrderID", "SalesOrderHeader", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(eSQLExamplesCS.SalesOrderHeader), "SalesOrderDetail", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(eSQLExamplesCS.SalesOrderDetail), true)]
-
-#endregion
-
-namespace eSQLExamplesCS
-{
- #region Contexts
-
- ///
- /// No Metadata Documentation available.
- ///
- public partial class AdventureWorksEntities : ObjectContext
- {
- #region Constructors
-
- ///
- /// Initializes a new AdventureWorksEntities object using the connection string found in the 'AdventureWorksEntities' section of the application configuration file.
- ///
- public AdventureWorksEntities() : base("name=AdventureWorksEntities", "AdventureWorksEntities")
- {
- OnContextCreated();
- }
-
- ///
- /// Initialize a new AdventureWorksEntities object.
- ///
- public AdventureWorksEntities(string connectionString) : base(connectionString, "AdventureWorksEntities")
- {
- OnContextCreated();
- }
-
- ///
- /// Initialize a new AdventureWorksEntities object.
- ///
- public AdventureWorksEntities(EntityConnection connection) : base(connection, "AdventureWorksEntities")
- {
- OnContextCreated();
- }
-
- #endregion
-
- #region Partial Methods
-
- partial void OnContextCreated();
-
- #endregion
-
- #region ObjectSet Properties
-
- ///
- /// No Metadata Documentation available.
- ///
- public ObjectSet Address
- {
- get
- {
- if ((_Address == null))
- {
- _Address = base.CreateObjectSet("Address");
- }
- return _Address;
- }
- }
- private ObjectSet _Address;
-
- ///
- /// No Metadata Documentation available.
- ///
- public ObjectSet Contact
- {
- get
- {
- if ((_Contact == null))
- {
- _Contact = base.CreateObjectSet("Contact");
- }
- return _Contact;
- }
- }
- private ObjectSet _Contact;
-
- ///
- /// No Metadata Documentation available.
- ///
- public ObjectSet Product
- {
- get
- {
- if ((_Product == null))
- {
- _Product = base.CreateObjectSet("Product");
- }
- return _Product;
- }
- }
- private ObjectSet _Product;
-
- ///
- /// No Metadata Documentation available.
- ///
- public ObjectSet SalesOrderDetail
- {
- get
- {
- if ((_SalesOrderDetail == null))
- {
- _SalesOrderDetail = base.CreateObjectSet("SalesOrderDetail");
- }
- return _SalesOrderDetail;
- }
- }
- private ObjectSet _SalesOrderDetail;
-
- ///
- /// No Metadata Documentation available.
- ///
- public ObjectSet SalesOrderHeader
- {
- get
- {
- if ((_SalesOrderHeader == null))
- {
- _SalesOrderHeader = base.CreateObjectSet("SalesOrderHeader");
- }
- return _SalesOrderHeader;
- }
- }
- private ObjectSet _SalesOrderHeader;
-
- #endregion
-
- #region AddTo Methods
-
- ///
- /// Deprecated Method for adding a new object to the Address EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead.
- ///
- public void AddToAddress(Address address)
- {
- base.AddObject("Address", address);
- }
-
- ///
- /// Deprecated Method for adding a new object to the Contact EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead.
- ///
- public void AddToContact(Contact contact)
- {
- base.AddObject("Contact", contact);
- }
-
- ///
- /// Deprecated Method for adding a new object to the Product EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead.
- ///
- public void AddToProduct(Product product)
- {
- base.AddObject("Product", product);
- }
-
- ///
- /// Deprecated Method for adding a new object to the SalesOrderDetail EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead.
- ///
- public void AddToSalesOrderDetail(SalesOrderDetail salesOrderDetail)
- {
- base.AddObject("SalesOrderDetail", salesOrderDetail);
- }
-
- ///
- /// Deprecated Method for adding a new object to the SalesOrderHeader EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead.
- ///
- public void AddToSalesOrderHeader(SalesOrderHeader salesOrderHeader)
- {
- base.AddObject("SalesOrderHeader", salesOrderHeader);
- }
-
- #endregion
-
- #region Function Imports
-
- ///
- /// No Metadata Documentation available.
- ///
- /// No Metadata Documentation available.
- public ObjectResult GetOrderDetails(Nullable salesOrderHeaderId)
- {
- ObjectParameter salesOrderHeaderIdParameter;
- if (salesOrderHeaderId.HasValue)
- {
- salesOrderHeaderIdParameter = new ObjectParameter("SalesOrderHeaderId", salesOrderHeaderId);
- }
- else
- {
- salesOrderHeaderIdParameter = new ObjectParameter("SalesOrderHeaderId", typeof(global::System.Int32));
- }
-
- return base.ExecuteFunction("GetOrderDetails", salesOrderHeaderIdParameter);
- }
- ///
- /// No Metadata Documentation available.
- ///
- ///
- /// No Metadata Documentation available.
- public ObjectResult GetOrderDetails(Nullable salesOrderHeaderId, MergeOption mergeOption)
- {
- ObjectParameter salesOrderHeaderIdParameter;
- if (salesOrderHeaderId.HasValue)
- {
- salesOrderHeaderIdParameter = new ObjectParameter("SalesOrderHeaderId", salesOrderHeaderId);
- }
- else
- {
- salesOrderHeaderIdParameter = new ObjectParameter("SalesOrderHeaderId", typeof(global::System.Int32));
- }
-
- return base.ExecuteFunction("GetOrderDetails", mergeOption, salesOrderHeaderIdParameter);
- }
-
- #endregion
-
- }
-
- #endregion
-
- #region Entities
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmEntityTypeAttribute(NamespaceName="AdventureWorksModel", Name="Address")]
- [Serializable()]
- [DataContractAttribute(IsReference=true)]
- public partial class Address : EntityObject
- {
- #region Factory Method
-
- ///
- /// Create a new Address object.
- ///
- /// Initial value of the AddressID property.
- /// Initial value of the AddressLine1 property.
- /// Initial value of the City property.
- /// Initial value of the StateProvinceID property.
- /// Initial value of the PostalCode property.
- /// Initial value of the rowguid property.
- /// Initial value of the ModifiedDate property.
- public static Address CreateAddress(global::System.Int32 addressID, global::System.String addressLine1, global::System.String city, global::System.Int32 stateProvinceID, global::System.String postalCode, global::System.Guid rowguid, global::System.DateTime modifiedDate)
- {
- Address address = new Address();
- address.AddressID = addressID;
- address.AddressLine1 = addressLine1;
- address.City = city;
- address.StateProvinceID = stateProvinceID;
- address.PostalCode = postalCode;
- address.rowguid = rowguid;
- address.ModifiedDate = modifiedDate;
- return address;
- }
-
- #endregion
-
- #region Simple Properties
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
- [DataMemberAttribute()]
- public global::System.Int32 AddressID
- {
- get
- {
- return _AddressID;
- }
- set
- {
- if (_AddressID != value)
- {
- OnAddressIDChanging(value);
- ReportPropertyChanging("AddressID");
- _AddressID = StructuralObject.SetValidValue(value, "AddressID");
- ReportPropertyChanged("AddressID");
- OnAddressIDChanged();
- }
- }
- }
- private global::System.Int32 _AddressID;
- partial void OnAddressIDChanging(global::System.Int32 value);
- partial void OnAddressIDChanged();
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
- [DataMemberAttribute()]
- public global::System.String AddressLine1
- {
- get
- {
- return _AddressLine1;
- }
- set
- {
- OnAddressLine1Changing(value);
- ReportPropertyChanging("AddressLine1");
- _AddressLine1 = StructuralObject.SetValidValue(value, false, "AddressLine1");
- ReportPropertyChanged("AddressLine1");
- OnAddressLine1Changed();
- }
- }
- private global::System.String _AddressLine1;
- partial void OnAddressLine1Changing(global::System.String value);
- partial void OnAddressLine1Changed();
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
- [DataMemberAttribute()]
- public global::System.String AddressLine2
- {
- get
- {
- return _AddressLine2;
- }
- set
- {
- OnAddressLine2Changing(value);
- ReportPropertyChanging("AddressLine2");
- _AddressLine2 = StructuralObject.SetValidValue(value, true, "AddressLine2");
- ReportPropertyChanged("AddressLine2");
- OnAddressLine2Changed();
- }
- }
- private global::System.String _AddressLine2;
- partial void OnAddressLine2Changing(global::System.String value);
- partial void OnAddressLine2Changed();
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
- [DataMemberAttribute()]
- public global::System.String City
- {
- get
- {
- return _City;
- }
- set
- {
- OnCityChanging(value);
- ReportPropertyChanging("City");
- _City = StructuralObject.SetValidValue(value, false, "City");
- ReportPropertyChanged("City");
- OnCityChanged();
- }
- }
- private global::System.String _City;
- partial void OnCityChanging(global::System.String value);
- partial void OnCityChanged();
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
- [DataMemberAttribute()]
- public global::System.Int32 StateProvinceID
- {
- get
- {
- return _StateProvinceID;
- }
- set
- {
- OnStateProvinceIDChanging(value);
- ReportPropertyChanging("StateProvinceID");
- _StateProvinceID = StructuralObject.SetValidValue(value, "StateProvinceID");
- ReportPropertyChanged("StateProvinceID");
- OnStateProvinceIDChanged();
- }
- }
- private global::System.Int32 _StateProvinceID;
- partial void OnStateProvinceIDChanging(global::System.Int32 value);
- partial void OnStateProvinceIDChanged();
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
- [DataMemberAttribute()]
- public global::System.String PostalCode
- {
- get
- {
- return _PostalCode;
- }
- set
- {
- OnPostalCodeChanging(value);
- ReportPropertyChanging("PostalCode");
- _PostalCode = StructuralObject.SetValidValue(value, false, "PostalCode");
- ReportPropertyChanged("PostalCode");
- OnPostalCodeChanged();
- }
- }
- private global::System.String _PostalCode;
- partial void OnPostalCodeChanging(global::System.String value);
- partial void OnPostalCodeChanged();
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
- [DataMemberAttribute()]
- public global::System.Guid rowguid
- {
- get
- {
- return _rowguid;
- }
- set
- {
- OnrowguidChanging(value);
- ReportPropertyChanging("rowguid");
- _rowguid = StructuralObject.SetValidValue(value, "rowguid");
- ReportPropertyChanged("rowguid");
- OnrowguidChanged();
- }
- }
- private global::System.Guid _rowguid;
- partial void OnrowguidChanging(global::System.Guid value);
- partial void OnrowguidChanged();
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
- [DataMemberAttribute()]
- public global::System.DateTime ModifiedDate
- {
- get
- {
- return _ModifiedDate;
- }
- set
- {
- OnModifiedDateChanging(value);
- ReportPropertyChanging("ModifiedDate");
- _ModifiedDate = StructuralObject.SetValidValue(value, "ModifiedDate");
- ReportPropertyChanged("ModifiedDate");
- OnModifiedDateChanged();
- }
- }
- private global::System.DateTime _ModifiedDate;
- partial void OnModifiedDateChanging(global::System.DateTime value);
- partial void OnModifiedDateChanged();
-
- #endregion
-
- #region Navigation Properties
-
- ///
- /// No Metadata Documentation available.
- ///
- [XmlIgnoreAttribute()]
- [SoapIgnoreAttribute()]
- [DataMemberAttribute()]
- [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_SalesOrderHeader_Address_BillToAddressID", "SalesOrderHeader")]
- public EntityCollection SalesOrderHeader
- {
- get
- {
- return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_SalesOrderHeader_Address_BillToAddressID", "SalesOrderHeader");
- }
- set
- {
- if ((value != null))
- {
- ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_SalesOrderHeader_Address_BillToAddressID", "SalesOrderHeader", value);
- }
- }
- }
-
- ///
- /// No Metadata Documentation available.
- ///
- [XmlIgnoreAttribute()]
- [SoapIgnoreAttribute()]
- [DataMemberAttribute()]
- [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_SalesOrderHeader_Address_ShipToAddressID", "SalesOrderHeader")]
- public EntityCollection SalesOrderHeader1
- {
- get
- {
- return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_SalesOrderHeader_Address_ShipToAddressID", "SalesOrderHeader");
- }
- set
- {
- if ((value != null))
- {
- ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_SalesOrderHeader_Address_ShipToAddressID", "SalesOrderHeader", value);
- }
- }
- }
-
- #endregion
-
- }
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmEntityTypeAttribute(NamespaceName="AdventureWorksModel", Name="Contact")]
- [Serializable()]
- [DataContractAttribute(IsReference=true)]
- public partial class Contact : EntityObject
- {
- #region Factory Method
-
- ///
- /// Create a new Contact object.
- ///
- /// Initial value of the ContactID property.
- /// Initial value of the NameStyle property.
- /// Initial value of the FirstName property.
- /// Initial value of the LastName property.
- /// Initial value of the EmailPromotion property.
- /// Initial value of the PasswordHash property.
- /// Initial value of the PasswordSalt property.
- /// Initial value of the rowguid property.
- /// Initial value of the ModifiedDate property.
- public static Contact CreateContact(global::System.Int32 contactID, global::System.Boolean nameStyle, global::System.String firstName, global::System.String lastName, global::System.Int32 emailPromotion, global::System.String passwordHash, global::System.String passwordSalt, global::System.Guid rowguid, global::System.DateTime modifiedDate)
- {
- Contact contact = new Contact();
- contact.ContactID = contactID;
- contact.NameStyle = nameStyle;
- contact.FirstName = firstName;
- contact.LastName = lastName;
- contact.EmailPromotion = emailPromotion;
- contact.PasswordHash = passwordHash;
- contact.PasswordSalt = passwordSalt;
- contact.rowguid = rowguid;
- contact.ModifiedDate = modifiedDate;
- return contact;
- }
-
- #endregion
-
- #region Simple Properties
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
- [DataMemberAttribute()]
- public global::System.Int32 ContactID
- {
- get
- {
- return _ContactID;
- }
- set
- {
- if (_ContactID != value)
- {
- OnContactIDChanging(value);
- ReportPropertyChanging("ContactID");
- _ContactID = StructuralObject.SetValidValue(value, "ContactID");
- ReportPropertyChanged("ContactID");
- OnContactIDChanged();
- }
- }
- }
- private global::System.Int32 _ContactID;
- partial void OnContactIDChanging(global::System.Int32 value);
- partial void OnContactIDChanged();
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
- [DataMemberAttribute()]
- public global::System.Boolean NameStyle
- {
- get
- {
- return _NameStyle;
- }
- set
- {
- OnNameStyleChanging(value);
- ReportPropertyChanging("NameStyle");
- _NameStyle = StructuralObject.SetValidValue(value, "NameStyle");
- ReportPropertyChanged("NameStyle");
- OnNameStyleChanged();
- }
- }
- private global::System.Boolean _NameStyle;
- partial void OnNameStyleChanging(global::System.Boolean value);
- partial void OnNameStyleChanged();
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
- [DataMemberAttribute()]
- public global::System.String Title
- {
- get
- {
- return _Title;
- }
- set
- {
- OnTitleChanging(value);
- ReportPropertyChanging("Title");
- _Title = StructuralObject.SetValidValue(value, true, "Title");
- ReportPropertyChanged("Title");
- OnTitleChanged();
- }
- }
- private global::System.String _Title;
- partial void OnTitleChanging(global::System.String value);
- partial void OnTitleChanged();
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
- [DataMemberAttribute()]
- public global::System.String FirstName
- {
- get
- {
- return _FirstName;
- }
- set
- {
- OnFirstNameChanging(value);
- ReportPropertyChanging("FirstName");
- _FirstName = StructuralObject.SetValidValue(value, false, "FirstName");
- ReportPropertyChanged("FirstName");
- OnFirstNameChanged();
- }
- }
- private global::System.String _FirstName;
- partial void OnFirstNameChanging(global::System.String value);
- partial void OnFirstNameChanged();
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
- [DataMemberAttribute()]
- public global::System.String MiddleName
- {
- get
- {
- return _MiddleName;
- }
- set
- {
- OnMiddleNameChanging(value);
- ReportPropertyChanging("MiddleName");
- _MiddleName = StructuralObject.SetValidValue(value, true, "MiddleName");
- ReportPropertyChanged("MiddleName");
- OnMiddleNameChanged();
- }
- }
- private global::System.String _MiddleName;
- partial void OnMiddleNameChanging(global::System.String value);
- partial void OnMiddleNameChanged();
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
- [DataMemberAttribute()]
- public global::System.String LastName
- {
- get
- {
- return _LastName;
- }
- set
- {
- OnLastNameChanging(value);
- ReportPropertyChanging("LastName");
- _LastName = StructuralObject.SetValidValue(value, false, "LastName");
- ReportPropertyChanged("LastName");
- OnLastNameChanged();
- }
- }
- private global::System.String _LastName;
- partial void OnLastNameChanging(global::System.String value);
- partial void OnLastNameChanged();
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
- [DataMemberAttribute()]
- public global::System.String Suffix
- {
- get
- {
- return _Suffix;
- }
- set
- {
- OnSuffixChanging(value);
- ReportPropertyChanging("Suffix");
- _Suffix = StructuralObject.SetValidValue(value, true, "Suffix");
- ReportPropertyChanged("Suffix");
- OnSuffixChanged();
- }
- }
- private global::System.String _Suffix;
- partial void OnSuffixChanging(global::System.String value);
- partial void OnSuffixChanged();
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
- [DataMemberAttribute()]
- public global::System.String EmailAddress
- {
- get
- {
- return _EmailAddress;
- }
- set
- {
- OnEmailAddressChanging(value);
- ReportPropertyChanging("EmailAddress");
- _EmailAddress = StructuralObject.SetValidValue(value, true, "EmailAddress");
- ReportPropertyChanged("EmailAddress");
- OnEmailAddressChanged();
- }
- }
- private global::System.String _EmailAddress;
- partial void OnEmailAddressChanging(global::System.String value);
- partial void OnEmailAddressChanged();
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
- [DataMemberAttribute()]
- public global::System.Int32 EmailPromotion
- {
- get
- {
- return _EmailPromotion;
- }
- set
- {
- OnEmailPromotionChanging(value);
- ReportPropertyChanging("EmailPromotion");
- _EmailPromotion = StructuralObject.SetValidValue(value, "EmailPromotion");
- ReportPropertyChanged("EmailPromotion");
- OnEmailPromotionChanged();
- }
- }
- private global::System.Int32 _EmailPromotion;
- partial void OnEmailPromotionChanging(global::System.Int32 value);
- partial void OnEmailPromotionChanged();
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
- [DataMemberAttribute()]
- public global::System.String Phone
- {
- get
- {
- return _Phone;
- }
- set
- {
- OnPhoneChanging(value);
- ReportPropertyChanging("Phone");
- _Phone = StructuralObject.SetValidValue(value, true, "Phone");
- ReportPropertyChanged("Phone");
- OnPhoneChanged();
- }
- }
- private global::System.String _Phone;
- partial void OnPhoneChanging(global::System.String value);
- partial void OnPhoneChanged();
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
- [DataMemberAttribute()]
- public global::System.String PasswordHash
- {
- get
- {
- return _PasswordHash;
- }
- set
- {
- OnPasswordHashChanging(value);
- ReportPropertyChanging("PasswordHash");
- _PasswordHash = StructuralObject.SetValidValue(value, false, "PasswordHash");
- ReportPropertyChanged("PasswordHash");
- OnPasswordHashChanged();
- }
- }
- private global::System.String _PasswordHash;
- partial void OnPasswordHashChanging(global::System.String value);
- partial void OnPasswordHashChanged();
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
- [DataMemberAttribute()]
- public global::System.String PasswordSalt
- {
- get
- {
- return _PasswordSalt;
- }
- set
- {
- OnPasswordSaltChanging(value);
- ReportPropertyChanging("PasswordSalt");
- _PasswordSalt = StructuralObject.SetValidValue(value, false, "PasswordSalt");
- ReportPropertyChanged("PasswordSalt");
- OnPasswordSaltChanged();
- }
- }
- private global::System.String _PasswordSalt;
- partial void OnPasswordSaltChanging(global::System.String value);
- partial void OnPasswordSaltChanged();
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
- [DataMemberAttribute()]
- public global::System.String AdditionalContactInfo
- {
- get
- {
- return _AdditionalContactInfo;
- }
- set
- {
- OnAdditionalContactInfoChanging(value);
- ReportPropertyChanging("AdditionalContactInfo");
- _AdditionalContactInfo = StructuralObject.SetValidValue(value, true, "AdditionalContactInfo");
- ReportPropertyChanged("AdditionalContactInfo");
- OnAdditionalContactInfoChanged();
- }
- }
- private global::System.String _AdditionalContactInfo;
- partial void OnAdditionalContactInfoChanging(global::System.String value);
- partial void OnAdditionalContactInfoChanged();
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
- [DataMemberAttribute()]
- public global::System.Guid rowguid
- {
- get
- {
- return _rowguid;
- }
- set
- {
- OnrowguidChanging(value);
- ReportPropertyChanging("rowguid");
- _rowguid = StructuralObject.SetValidValue(value, "rowguid");
- ReportPropertyChanged("rowguid");
- OnrowguidChanged();
- }
- }
- private global::System.Guid _rowguid;
- partial void OnrowguidChanging(global::System.Guid value);
- partial void OnrowguidChanged();
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
- [DataMemberAttribute()]
- public global::System.DateTime ModifiedDate
- {
- get
- {
- return _ModifiedDate;
- }
- set
- {
- OnModifiedDateChanging(value);
- ReportPropertyChanging("ModifiedDate");
- _ModifiedDate = StructuralObject.SetValidValue(value, "ModifiedDate");
- ReportPropertyChanged("ModifiedDate");
- OnModifiedDateChanged();
- }
- }
- private global::System.DateTime _ModifiedDate;
- partial void OnModifiedDateChanging(global::System.DateTime value);
- partial void OnModifiedDateChanged();
-
- #endregion
-
- #region Navigation Properties
-
- ///
- /// No Metadata Documentation available.
- ///
- [XmlIgnoreAttribute()]
- [SoapIgnoreAttribute()]
- [DataMemberAttribute()]
- [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_SalesOrderHeader_Contact_ContactID", "SalesOrderHeader")]
- public EntityCollection SalesOrderHeader
- {
- get
- {
- return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_SalesOrderHeader_Contact_ContactID", "SalesOrderHeader");
- }
- set
- {
- if ((value != null))
- {
- ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_SalesOrderHeader_Contact_ContactID", "SalesOrderHeader", value);
- }
- }
- }
-
- #endregion
-
- }
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmEntityTypeAttribute(NamespaceName="AdventureWorksModel", Name="Product")]
- [Serializable()]
- [DataContractAttribute(IsReference=true)]
- public partial class Product : EntityObject
- {
- #region Factory Method
-
- ///
- /// Create a new Product object.
- ///
- /// Initial value of the ProductID property.
- /// Initial value of the Name property.
- /// Initial value of the ProductNumber property.
- /// Initial value of the MakeFlag property.
- /// Initial value of the FinishedGoodsFlag property.
- /// Initial value of the SafetyStockLevel property.
- /// Initial value of the ReorderPoint property.
- /// Initial value of the StandardCost property.
- /// Initial value of the ListPrice property.
- /// Initial value of the DaysToManufacture property.
- /// Initial value of the SellStartDate property.
- /// Initial value of the rowguid property.
- /// Initial value of the ModifiedDate property.
- public static Product CreateProduct(global::System.Int32 productID, global::System.String name, global::System.String productNumber, global::System.Boolean makeFlag, global::System.Boolean finishedGoodsFlag, global::System.Int16 safetyStockLevel, global::System.Int16 reorderPoint, global::System.Decimal standardCost, global::System.Decimal listPrice, global::System.Int32 daysToManufacture, global::System.DateTime sellStartDate, global::System.Guid rowguid, global::System.DateTime modifiedDate)
- {
- Product product = new Product();
- product.ProductID = productID;
- product.Name = name;
- product.ProductNumber = productNumber;
- product.MakeFlag = makeFlag;
- product.FinishedGoodsFlag = finishedGoodsFlag;
- product.SafetyStockLevel = safetyStockLevel;
- product.ReorderPoint = reorderPoint;
- product.StandardCost = standardCost;
- product.ListPrice = listPrice;
- product.DaysToManufacture = daysToManufacture;
- product.SellStartDate = sellStartDate;
- product.rowguid = rowguid;
- product.ModifiedDate = modifiedDate;
- return product;
- }
-
- #endregion
-
- #region Simple Properties
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
- [DataMemberAttribute()]
- public global::System.Int32 ProductID
- {
- get
- {
- return _ProductID;
- }
- set
- {
- if (_ProductID != value)
- {
- OnProductIDChanging(value);
- ReportPropertyChanging("ProductID");
- _ProductID = StructuralObject.SetValidValue(value, "ProductID");
- ReportPropertyChanged("ProductID");
- OnProductIDChanged();
- }
- }
- }
- private global::System.Int32 _ProductID;
- partial void OnProductIDChanging(global::System.Int32 value);
- partial void OnProductIDChanged();
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
- [DataMemberAttribute()]
- public global::System.String Name
- {
- get
- {
- return _Name;
- }
- set
- {
- OnNameChanging(value);
- ReportPropertyChanging("Name");
- _Name = StructuralObject.SetValidValue(value, false, "Name");
- ReportPropertyChanged("Name");
- OnNameChanged();
- }
- }
- private global::System.String _Name;
- partial void OnNameChanging(global::System.String value);
- partial void OnNameChanged();
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
- [DataMemberAttribute()]
- public global::System.String ProductNumber
- {
- get
- {
- return _ProductNumber;
- }
- set
- {
- OnProductNumberChanging(value);
- ReportPropertyChanging("ProductNumber");
- _ProductNumber = StructuralObject.SetValidValue(value, false, "ProductNumber");
- ReportPropertyChanged("ProductNumber");
- OnProductNumberChanged();
- }
- }
- private global::System.String _ProductNumber;
- partial void OnProductNumberChanging(global::System.String value);
- partial void OnProductNumberChanged();
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
- [DataMemberAttribute()]
- public global::System.Boolean MakeFlag
- {
- get
- {
- return _MakeFlag;
- }
- set
- {
- OnMakeFlagChanging(value);
- ReportPropertyChanging("MakeFlag");
- _MakeFlag = StructuralObject.SetValidValue(value, "MakeFlag");
- ReportPropertyChanged("MakeFlag");
- OnMakeFlagChanged();
- }
- }
- private global::System.Boolean _MakeFlag;
- partial void OnMakeFlagChanging(global::System.Boolean value);
- partial void OnMakeFlagChanged();
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
- [DataMemberAttribute()]
- public global::System.Boolean FinishedGoodsFlag
- {
- get
- {
- return _FinishedGoodsFlag;
- }
- set
- {
- OnFinishedGoodsFlagChanging(value);
- ReportPropertyChanging("FinishedGoodsFlag");
- _FinishedGoodsFlag = StructuralObject.SetValidValue(value, "FinishedGoodsFlag");
- ReportPropertyChanged("FinishedGoodsFlag");
- OnFinishedGoodsFlagChanged();
- }
- }
- private global::System.Boolean _FinishedGoodsFlag;
- partial void OnFinishedGoodsFlagChanging(global::System.Boolean value);
- partial void OnFinishedGoodsFlagChanged();
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
- [DataMemberAttribute()]
- public global::System.String Color
- {
- get
- {
- return _Color;
- }
- set
- {
- OnColorChanging(value);
- ReportPropertyChanging("Color");
- _Color = StructuralObject.SetValidValue(value, true, "Color");
- ReportPropertyChanged("Color");
- OnColorChanged();
- }
- }
- private global::System.String _Color;
- partial void OnColorChanging(global::System.String value);
- partial void OnColorChanged();
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
- [DataMemberAttribute()]
- public global::System.Int16 SafetyStockLevel
- {
- get
- {
- return _SafetyStockLevel;
- }
- set
- {
- OnSafetyStockLevelChanging(value);
- ReportPropertyChanging("SafetyStockLevel");
- _SafetyStockLevel = StructuralObject.SetValidValue(value, "SafetyStockLevel");
- ReportPropertyChanged("SafetyStockLevel");
- OnSafetyStockLevelChanged();
- }
- }
- private global::System.Int16 _SafetyStockLevel;
- partial void OnSafetyStockLevelChanging(global::System.Int16 value);
- partial void OnSafetyStockLevelChanged();
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
- [DataMemberAttribute()]
- public global::System.Int16 ReorderPoint
- {
- get
- {
- return _ReorderPoint;
- }
- set
- {
- OnReorderPointChanging(value);
- ReportPropertyChanging("ReorderPoint");
- _ReorderPoint = StructuralObject.SetValidValue(value, "ReorderPoint");
- ReportPropertyChanged("ReorderPoint");
- OnReorderPointChanged();
- }
- }
- private global::System.Int16 _ReorderPoint;
- partial void OnReorderPointChanging(global::System.Int16 value);
- partial void OnReorderPointChanged();
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
- [DataMemberAttribute()]
- public global::System.Decimal StandardCost
- {
- get
- {
- return _StandardCost;
- }
- set
- {
- OnStandardCostChanging(value);
- ReportPropertyChanging("StandardCost");
- _StandardCost = StructuralObject.SetValidValue(value, "StandardCost");
- ReportPropertyChanged("StandardCost");
- OnStandardCostChanged();
- }
- }
- private global::System.Decimal _StandardCost;
- partial void OnStandardCostChanging(global::System.Decimal value);
- partial void OnStandardCostChanged();
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
- [DataMemberAttribute()]
- public global::System.Decimal ListPrice
- {
- get
- {
- return _ListPrice;
- }
- set
- {
- OnListPriceChanging(value);
- ReportPropertyChanging("ListPrice");
- _ListPrice = StructuralObject.SetValidValue(value, "ListPrice");
- ReportPropertyChanged("ListPrice");
- OnListPriceChanged();
- }
- }
- private global::System.Decimal _ListPrice;
- partial void OnListPriceChanging(global::System.Decimal value);
- partial void OnListPriceChanged();
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
- [DataMemberAttribute()]
- public global::System.String Size
- {
- get
- {
- return _Size;
- }
- set
- {
- OnSizeChanging(value);
- ReportPropertyChanging("Size");
- _Size = StructuralObject.SetValidValue(value, true, "Size");
- ReportPropertyChanged("Size");
- OnSizeChanged();
- }
- }
- private global::System.String _Size;
- partial void OnSizeChanging(global::System.String value);
- partial void OnSizeChanged();
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
- [DataMemberAttribute()]
- public global::System.String SizeUnitMeasureCode
- {
- get
- {
- return _SizeUnitMeasureCode;
- }
- set
- {
- OnSizeUnitMeasureCodeChanging(value);
- ReportPropertyChanging("SizeUnitMeasureCode");
- _SizeUnitMeasureCode = StructuralObject.SetValidValue(value, true, "SizeUnitMeasureCode");
- ReportPropertyChanged("SizeUnitMeasureCode");
- OnSizeUnitMeasureCodeChanged();
- }
- }
- private global::System.String _SizeUnitMeasureCode;
- partial void OnSizeUnitMeasureCodeChanging(global::System.String value);
- partial void OnSizeUnitMeasureCodeChanged();
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
- [DataMemberAttribute()]
- public global::System.String WeightUnitMeasureCode
- {
- get
- {
- return _WeightUnitMeasureCode;
- }
- set
- {
- OnWeightUnitMeasureCodeChanging(value);
- ReportPropertyChanging("WeightUnitMeasureCode");
- _WeightUnitMeasureCode = StructuralObject.SetValidValue(value, true, "WeightUnitMeasureCode");
- ReportPropertyChanged("WeightUnitMeasureCode");
- OnWeightUnitMeasureCodeChanged();
- }
- }
- private global::System.String _WeightUnitMeasureCode;
- partial void OnWeightUnitMeasureCodeChanging(global::System.String value);
- partial void OnWeightUnitMeasureCodeChanged();
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
- [DataMemberAttribute()]
- public Nullable Weight
- {
- get
- {
- return _Weight;
- }
- set
- {
- OnWeightChanging(value);
- ReportPropertyChanging("Weight");
- _Weight = StructuralObject.SetValidValue(value, "Weight");
- ReportPropertyChanged("Weight");
- OnWeightChanged();
- }
- }
- private Nullable _Weight;
- partial void OnWeightChanging(Nullable value);
- partial void OnWeightChanged();
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
- [DataMemberAttribute()]
- public global::System.Int32 DaysToManufacture
- {
- get
- {
- return _DaysToManufacture;
- }
- set
- {
- OnDaysToManufactureChanging(value);
- ReportPropertyChanging("DaysToManufacture");
- _DaysToManufacture = StructuralObject.SetValidValue(value, "DaysToManufacture");
- ReportPropertyChanged("DaysToManufacture");
- OnDaysToManufactureChanged();
- }
- }
- private global::System.Int32 _DaysToManufacture;
- partial void OnDaysToManufactureChanging(global::System.Int32 value);
- partial void OnDaysToManufactureChanged();
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
- [DataMemberAttribute()]
- public global::System.String ProductLine
- {
- get
- {
- return _ProductLine;
- }
- set
- {
- OnProductLineChanging(value);
- ReportPropertyChanging("ProductLine");
- _ProductLine = StructuralObject.SetValidValue(value, true, "ProductLine");
- ReportPropertyChanged("ProductLine");
- OnProductLineChanged();
- }
- }
- private global::System.String _ProductLine;
- partial void OnProductLineChanging(global::System.String value);
- partial void OnProductLineChanged();
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
- [DataMemberAttribute()]
- public global::System.String Class
- {
- get
- {
- return _Class;
- }
- set
- {
- OnClassChanging(value);
- ReportPropertyChanging("Class");
- _Class = StructuralObject.SetValidValue(value, true, "Class");
- ReportPropertyChanged("Class");
- OnClassChanged();
- }
- }
- private global::System.String _Class;
- partial void OnClassChanging(global::System.String value);
- partial void OnClassChanged();
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
- [DataMemberAttribute()]
- public global::System.String Style
- {
- get
- {
- return _Style;
- }
- set
- {
- OnStyleChanging(value);
- ReportPropertyChanging("Style");
- _Style = StructuralObject.SetValidValue(value, true, "Style");
- ReportPropertyChanged("Style");
- OnStyleChanged();
- }
- }
- private global::System.String _Style;
- partial void OnStyleChanging(global::System.String value);
- partial void OnStyleChanged();
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
- [DataMemberAttribute()]
- public Nullable ProductSubcategoryID
- {
- get
- {
- return _ProductSubcategoryID;
- }
- set
- {
- OnProductSubcategoryIDChanging(value);
- ReportPropertyChanging("ProductSubcategoryID");
- _ProductSubcategoryID = StructuralObject.SetValidValue(value, "ProductSubcategoryID");
- ReportPropertyChanged("ProductSubcategoryID");
- OnProductSubcategoryIDChanged();
- }
- }
- private Nullable _ProductSubcategoryID;
- partial void OnProductSubcategoryIDChanging(Nullable value);
- partial void OnProductSubcategoryIDChanged();
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
- [DataMemberAttribute()]
- public Nullable ProductModelID
- {
- get
- {
- return _ProductModelID;
- }
- set
- {
- OnProductModelIDChanging(value);
- ReportPropertyChanging("ProductModelID");
- _ProductModelID = StructuralObject.SetValidValue(value, "ProductModelID");
- ReportPropertyChanged("ProductModelID");
- OnProductModelIDChanged();
- }
- }
- private Nullable _ProductModelID;
- partial void OnProductModelIDChanging(Nullable value);
- partial void OnProductModelIDChanged();
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
- [DataMemberAttribute()]
- public global::System.DateTime SellStartDate
- {
- get
- {
- return _SellStartDate;
- }
- set
- {
- OnSellStartDateChanging(value);
- ReportPropertyChanging("SellStartDate");
- _SellStartDate = StructuralObject.SetValidValue(value, "SellStartDate");
- ReportPropertyChanged("SellStartDate");
- OnSellStartDateChanged();
- }
- }
- private global::System.DateTime _SellStartDate;
- partial void OnSellStartDateChanging(global::System.DateTime value);
- partial void OnSellStartDateChanged();
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
- [DataMemberAttribute()]
- public Nullable SellEndDate
- {
- get
- {
- return _SellEndDate;
- }
- set
- {
- OnSellEndDateChanging(value);
- ReportPropertyChanging("SellEndDate");
- _SellEndDate = StructuralObject.SetValidValue(value, "SellEndDate");
- ReportPropertyChanged("SellEndDate");
- OnSellEndDateChanged();
- }
- }
- private Nullable _SellEndDate;
- partial void OnSellEndDateChanging(Nullable value);
- partial void OnSellEndDateChanged();
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
- [DataMemberAttribute()]
- public Nullable DiscontinuedDate
- {
- get
- {
- return _DiscontinuedDate;
- }
- set
- {
- OnDiscontinuedDateChanging(value);
- ReportPropertyChanging("DiscontinuedDate");
- _DiscontinuedDate = StructuralObject.SetValidValue(value, "DiscontinuedDate");
- ReportPropertyChanged("DiscontinuedDate");
- OnDiscontinuedDateChanged();
- }
- }
- private Nullable _DiscontinuedDate;
- partial void OnDiscontinuedDateChanging(Nullable value);
- partial void OnDiscontinuedDateChanged();
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
- [DataMemberAttribute()]
- public global::System.Guid rowguid
- {
- get
- {
- return _rowguid;
- }
- set
- {
- OnrowguidChanging(value);
- ReportPropertyChanging("rowguid");
- _rowguid = StructuralObject.SetValidValue(value, "rowguid");
- ReportPropertyChanged("rowguid");
- OnrowguidChanged();
- }
- }
- private global::System.Guid _rowguid;
- partial void OnrowguidChanging(global::System.Guid value);
- partial void OnrowguidChanged();
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
- [DataMemberAttribute()]
- public global::System.DateTime ModifiedDate
- {
- get
- {
- return _ModifiedDate;
- }
- set
- {
- OnModifiedDateChanging(value);
- ReportPropertyChanging("ModifiedDate");
- _ModifiedDate = StructuralObject.SetValidValue(value, "ModifiedDate");
- ReportPropertyChanged("ModifiedDate");
- OnModifiedDateChanged();
- }
- }
- private global::System.DateTime _ModifiedDate;
- partial void OnModifiedDateChanging(global::System.DateTime value);
- partial void OnModifiedDateChanged();
-
- #endregion
-
- }
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmEntityTypeAttribute(NamespaceName="AdventureWorksModel", Name="SalesOrderDetail")]
- [Serializable()]
- [DataContractAttribute(IsReference=true)]
- public partial class SalesOrderDetail : EntityObject
- {
- #region Factory Method
-
- ///
- /// Create a new SalesOrderDetail object.
- ///
- /// Initial value of the SalesOrderID property.
- /// Initial value of the SalesOrderDetailID property.
- /// Initial value of the OrderQty property.
- /// Initial value of the ProductID property.
- /// Initial value of the SpecialOfferID property.
- /// Initial value of the UnitPrice property.
- /// Initial value of the UnitPriceDiscount property.
- /// Initial value of the LineTotal property.
- /// Initial value of the rowguid property.
- /// Initial value of the ModifiedDate property.
- public static SalesOrderDetail CreateSalesOrderDetail(global::System.Int32 salesOrderID, global::System.Int32 salesOrderDetailID, global::System.Int16 orderQty, global::System.Int32 productID, global::System.Int32 specialOfferID, global::System.Decimal unitPrice, global::System.Decimal unitPriceDiscount, global::System.Decimal lineTotal, global::System.Guid rowguid, global::System.DateTime modifiedDate)
- {
- SalesOrderDetail salesOrderDetail = new SalesOrderDetail();
- salesOrderDetail.SalesOrderID = salesOrderID;
- salesOrderDetail.SalesOrderDetailID = salesOrderDetailID;
- salesOrderDetail.OrderQty = orderQty;
- salesOrderDetail.ProductID = productID;
- salesOrderDetail.SpecialOfferID = specialOfferID;
- salesOrderDetail.UnitPrice = unitPrice;
- salesOrderDetail.UnitPriceDiscount = unitPriceDiscount;
- salesOrderDetail.LineTotal = lineTotal;
- salesOrderDetail.rowguid = rowguid;
- salesOrderDetail.ModifiedDate = modifiedDate;
- return salesOrderDetail;
- }
-
- #endregion
-
- #region Simple Properties
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
- [DataMemberAttribute()]
- public global::System.Int32 SalesOrderID
- {
- get
- {
- return _SalesOrderID;
- }
- set
- {
- if (_SalesOrderID != value)
- {
- OnSalesOrderIDChanging(value);
- ReportPropertyChanging("SalesOrderID");
- _SalesOrderID = StructuralObject.SetValidValue(value, "SalesOrderID");
- ReportPropertyChanged("SalesOrderID");
- OnSalesOrderIDChanged();
- }
- }
- }
- private global::System.Int32 _SalesOrderID;
- partial void OnSalesOrderIDChanging(global::System.Int32 value);
- partial void OnSalesOrderIDChanged();
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
- [DataMemberAttribute()]
- public global::System.Int32 SalesOrderDetailID
- {
- get
- {
- return _SalesOrderDetailID;
- }
- set
- {
- if (_SalesOrderDetailID != value)
- {
- OnSalesOrderDetailIDChanging(value);
- ReportPropertyChanging("SalesOrderDetailID");
- _SalesOrderDetailID = StructuralObject.SetValidValue(value, "SalesOrderDetailID");
- ReportPropertyChanged("SalesOrderDetailID");
- OnSalesOrderDetailIDChanged();
- }
- }
- }
- private global::System.Int32 _SalesOrderDetailID;
- partial void OnSalesOrderDetailIDChanging(global::System.Int32 value);
- partial void OnSalesOrderDetailIDChanged();
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
- [DataMemberAttribute()]
- public global::System.String CarrierTrackingNumber
- {
- get
- {
- return _CarrierTrackingNumber;
- }
- set
- {
- OnCarrierTrackingNumberChanging(value);
- ReportPropertyChanging("CarrierTrackingNumber");
- _CarrierTrackingNumber = StructuralObject.SetValidValue(value, true, "CarrierTrackingNumber");
- ReportPropertyChanged("CarrierTrackingNumber");
- OnCarrierTrackingNumberChanged();
- }
- }
- private global::System.String _CarrierTrackingNumber;
- partial void OnCarrierTrackingNumberChanging(global::System.String value);
- partial void OnCarrierTrackingNumberChanged();
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
- [DataMemberAttribute()]
- public global::System.Int16 OrderQty
- {
- get
- {
- return _OrderQty;
- }
- set
- {
- OnOrderQtyChanging(value);
- ReportPropertyChanging("OrderQty");
- _OrderQty = StructuralObject.SetValidValue(value, "OrderQty");
- ReportPropertyChanged("OrderQty");
- OnOrderQtyChanged();
- }
- }
- private global::System.Int16 _OrderQty;
- partial void OnOrderQtyChanging(global::System.Int16 value);
- partial void OnOrderQtyChanged();
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
- [DataMemberAttribute()]
- public global::System.Int32 ProductID
- {
- get
- {
- return _ProductID;
- }
- set
- {
- OnProductIDChanging(value);
- ReportPropertyChanging("ProductID");
- _ProductID = StructuralObject.SetValidValue(value, "ProductID");
- ReportPropertyChanged("ProductID");
- OnProductIDChanged();
- }
- }
- private global::System.Int32 _ProductID;
- partial void OnProductIDChanging(global::System.Int32 value);
- partial void OnProductIDChanged();
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
- [DataMemberAttribute()]
- public global::System.Int32 SpecialOfferID
- {
- get
- {
- return _SpecialOfferID;
- }
- set
- {
- OnSpecialOfferIDChanging(value);
- ReportPropertyChanging("SpecialOfferID");
- _SpecialOfferID = StructuralObject.SetValidValue(value, "SpecialOfferID");
- ReportPropertyChanged("SpecialOfferID");
- OnSpecialOfferIDChanged();
- }
- }
- private global::System.Int32 _SpecialOfferID;
- partial void OnSpecialOfferIDChanging(global::System.Int32 value);
- partial void OnSpecialOfferIDChanged();
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
- [DataMemberAttribute()]
- public global::System.Decimal UnitPrice
- {
- get
- {
- return _UnitPrice;
- }
- set
- {
- OnUnitPriceChanging(value);
- ReportPropertyChanging("UnitPrice");
- _UnitPrice = StructuralObject.SetValidValue(value, "UnitPrice");
- ReportPropertyChanged("UnitPrice");
- OnUnitPriceChanged();
- }
- }
- private global::System.Decimal _UnitPrice;
- partial void OnUnitPriceChanging(global::System.Decimal value);
- partial void OnUnitPriceChanged();
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
- [DataMemberAttribute()]
- public global::System.Decimal UnitPriceDiscount
- {
- get
- {
- return _UnitPriceDiscount;
- }
- set
- {
- OnUnitPriceDiscountChanging(value);
- ReportPropertyChanging("UnitPriceDiscount");
- _UnitPriceDiscount = StructuralObject.SetValidValue(value, "UnitPriceDiscount");
- ReportPropertyChanged("UnitPriceDiscount");
- OnUnitPriceDiscountChanged();
- }
- }
- private global::System.Decimal _UnitPriceDiscount;
- partial void OnUnitPriceDiscountChanging(global::System.Decimal value);
- partial void OnUnitPriceDiscountChanged();
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
- [DataMemberAttribute()]
- public global::System.Decimal LineTotal
- {
- get
- {
- return _LineTotal;
- }
- set
- {
- OnLineTotalChanging(value);
- ReportPropertyChanging("LineTotal");
- _LineTotal = StructuralObject.SetValidValue(value, "LineTotal");
- ReportPropertyChanged("LineTotal");
- OnLineTotalChanged();
- }
- }
- private global::System.Decimal _LineTotal;
- partial void OnLineTotalChanging(global::System.Decimal value);
- partial void OnLineTotalChanged();
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
- [DataMemberAttribute()]
- public global::System.Guid rowguid
- {
- get
- {
- return _rowguid;
- }
- set
- {
- OnrowguidChanging(value);
- ReportPropertyChanging("rowguid");
- _rowguid = StructuralObject.SetValidValue(value, "rowguid");
- ReportPropertyChanged("rowguid");
- OnrowguidChanged();
- }
- }
- private global::System.Guid _rowguid;
- partial void OnrowguidChanging(global::System.Guid value);
- partial void OnrowguidChanged();
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
- [DataMemberAttribute()]
- public global::System.DateTime ModifiedDate
- {
- get
- {
- return _ModifiedDate;
- }
- set
- {
- OnModifiedDateChanging(value);
- ReportPropertyChanging("ModifiedDate");
- _ModifiedDate = StructuralObject.SetValidValue(value, "ModifiedDate");
- ReportPropertyChanged("ModifiedDate");
- OnModifiedDateChanged();
- }
- }
- private global::System.DateTime _ModifiedDate;
- partial void OnModifiedDateChanging(global::System.DateTime value);
- partial void OnModifiedDateChanged();
-
- #endregion
-
- #region Navigation Properties
-
- ///
- /// No Metadata Documentation available.
- ///
- [XmlIgnoreAttribute()]
- [SoapIgnoreAttribute()]
- [DataMemberAttribute()]
- [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_SalesOrderDetail_SalesOrderHeader_SalesOrderID", "SalesOrderHeader")]
- public SalesOrderHeader SalesOrderHeader
- {
- get
- {
- return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesOrderDetail_SalesOrderHeader_SalesOrderID", "SalesOrderHeader").Value;
- }
- set
- {
- ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesOrderDetail_SalesOrderHeader_SalesOrderID", "SalesOrderHeader").Value = value;
- }
- }
- ///
- /// No Metadata Documentation available.
- ///
- [BrowsableAttribute(false)]
- [DataMemberAttribute()]
- public EntityReference SalesOrderHeaderReference
- {
- get
- {
- return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesOrderDetail_SalesOrderHeader_SalesOrderID", "SalesOrderHeader");
- }
- set
- {
- if ((value != null))
- {
- ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_SalesOrderDetail_SalesOrderHeader_SalesOrderID", "SalesOrderHeader", value);
- }
- }
- }
-
- #endregion
-
- }
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmEntityTypeAttribute(NamespaceName="AdventureWorksModel", Name="SalesOrderHeader")]
- [Serializable()]
- [DataContractAttribute(IsReference=true)]
- public partial class SalesOrderHeader : EntityObject
- {
- #region Factory Method
-
- ///
- /// Create a new SalesOrderHeader object.
- ///
- /// Initial value of the SalesOrderID property.
- /// Initial value of the RevisionNumber property.
- /// Initial value of the OrderDate property.
- /// Initial value of the DueDate property.
- /// Initial value of the Status property.
- /// Initial value of the OnlineOrderFlag property.
- /// Initial value of the SalesOrderNumber property.
- /// Initial value of the CustomerID property.
- /// Initial value of the ShipMethodID property.
- /// Initial value of the SubTotal property.
- /// Initial value of the TaxAmt property.
- /// Initial value of the Freight property.
- /// Initial value of the TotalDue property.
- /// Initial value of the rowguid property.
- /// Initial value of the ModifiedDate property.
- public static SalesOrderHeader CreateSalesOrderHeader(global::System.Int32 salesOrderID, global::System.Byte revisionNumber, global::System.DateTime orderDate, global::System.DateTime dueDate, global::System.Byte status, global::System.Boolean onlineOrderFlag, global::System.String salesOrderNumber, global::System.Int32 customerID, global::System.Int32 shipMethodID, global::System.Decimal subTotal, global::System.Decimal taxAmt, global::System.Decimal freight, global::System.Decimal totalDue, global::System.Guid rowguid, global::System.DateTime modifiedDate)
- {
- SalesOrderHeader salesOrderHeader = new SalesOrderHeader();
- salesOrderHeader.SalesOrderID = salesOrderID;
- salesOrderHeader.RevisionNumber = revisionNumber;
- salesOrderHeader.OrderDate = orderDate;
- salesOrderHeader.DueDate = dueDate;
- salesOrderHeader.Status = status;
- salesOrderHeader.OnlineOrderFlag = onlineOrderFlag;
- salesOrderHeader.SalesOrderNumber = salesOrderNumber;
- salesOrderHeader.CustomerID = customerID;
- salesOrderHeader.ShipMethodID = shipMethodID;
- salesOrderHeader.SubTotal = subTotal;
- salesOrderHeader.TaxAmt = taxAmt;
- salesOrderHeader.Freight = freight;
- salesOrderHeader.TotalDue = totalDue;
- salesOrderHeader.rowguid = rowguid;
- salesOrderHeader.ModifiedDate = modifiedDate;
- return salesOrderHeader;
- }
-
- #endregion
-
- #region Simple Properties
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
- [DataMemberAttribute()]
- public global::System.Int32 SalesOrderID
- {
- get
- {
- return _SalesOrderID;
- }
- set
- {
- if (_SalesOrderID != value)
- {
- OnSalesOrderIDChanging(value);
- ReportPropertyChanging("SalesOrderID");
- _SalesOrderID = StructuralObject.SetValidValue(value, "SalesOrderID");
- ReportPropertyChanged("SalesOrderID");
- OnSalesOrderIDChanged();
- }
- }
- }
- private global::System.Int32 _SalesOrderID;
- partial void OnSalesOrderIDChanging(global::System.Int32 value);
- partial void OnSalesOrderIDChanged();
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
- [DataMemberAttribute()]
- public global::System.Byte RevisionNumber
- {
- get
- {
- return _RevisionNumber;
- }
- set
- {
- OnRevisionNumberChanging(value);
- ReportPropertyChanging("RevisionNumber");
- _RevisionNumber = StructuralObject.SetValidValue(value, "RevisionNumber");
- ReportPropertyChanged("RevisionNumber");
- OnRevisionNumberChanged();
- }
- }
- private global::System.Byte _RevisionNumber;
- partial void OnRevisionNumberChanging(global::System.Byte value);
- partial void OnRevisionNumberChanged();
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
- [DataMemberAttribute()]
- public global::System.DateTime OrderDate
- {
- get
- {
- return _OrderDate;
- }
- set
- {
- OnOrderDateChanging(value);
- ReportPropertyChanging("OrderDate");
- _OrderDate = StructuralObject.SetValidValue(value, "OrderDate");
- ReportPropertyChanged("OrderDate");
- OnOrderDateChanged();
- }
- }
- private global::System.DateTime _OrderDate;
- partial void OnOrderDateChanging(global::System.DateTime value);
- partial void OnOrderDateChanged();
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
- [DataMemberAttribute()]
- public global::System.DateTime DueDate
- {
- get
- {
- return _DueDate;
- }
- set
- {
- OnDueDateChanging(value);
- ReportPropertyChanging("DueDate");
- _DueDate = StructuralObject.SetValidValue(value, "DueDate");
- ReportPropertyChanged("DueDate");
- OnDueDateChanged();
- }
- }
- private global::System.DateTime _DueDate;
- partial void OnDueDateChanging(global::System.DateTime value);
- partial void OnDueDateChanged();
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
- [DataMemberAttribute()]
- public Nullable ShipDate
- {
- get
- {
- return _ShipDate;
- }
- set
- {
- OnShipDateChanging(value);
- ReportPropertyChanging("ShipDate");
- _ShipDate = StructuralObject.SetValidValue(value, "ShipDate");
- ReportPropertyChanged("ShipDate");
- OnShipDateChanged();
- }
- }
- private Nullable _ShipDate;
- partial void OnShipDateChanging(Nullable value);
- partial void OnShipDateChanged();
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
- [DataMemberAttribute()]
- public global::System.Byte Status
- {
- get
- {
- return _Status;
- }
- set
- {
- OnStatusChanging(value);
- ReportPropertyChanging("Status");
- _Status = StructuralObject.SetValidValue(value, "Status");
- ReportPropertyChanged("Status");
- OnStatusChanged();
- }
- }
- private global::System.Byte _Status;
- partial void OnStatusChanging(global::System.Byte value);
- partial void OnStatusChanged();
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
- [DataMemberAttribute()]
- public global::System.Boolean OnlineOrderFlag
- {
- get
- {
- return _OnlineOrderFlag;
- }
- set
- {
- OnOnlineOrderFlagChanging(value);
- ReportPropertyChanging("OnlineOrderFlag");
- _OnlineOrderFlag = StructuralObject.SetValidValue(value, "OnlineOrderFlag");
- ReportPropertyChanged("OnlineOrderFlag");
- OnOnlineOrderFlagChanged();
- }
- }
- private global::System.Boolean _OnlineOrderFlag;
- partial void OnOnlineOrderFlagChanging(global::System.Boolean value);
- partial void OnOnlineOrderFlagChanged();
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
- [DataMemberAttribute()]
- public global::System.String SalesOrderNumber
- {
- get
- {
- return _SalesOrderNumber;
- }
- set
- {
- OnSalesOrderNumberChanging(value);
- ReportPropertyChanging("SalesOrderNumber");
- _SalesOrderNumber = StructuralObject.SetValidValue(value, false, "SalesOrderNumber");
- ReportPropertyChanged("SalesOrderNumber");
- OnSalesOrderNumberChanged();
- }
- }
- private global::System.String _SalesOrderNumber;
- partial void OnSalesOrderNumberChanging(global::System.String value);
- partial void OnSalesOrderNumberChanged();
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
- [DataMemberAttribute()]
- public global::System.String PurchaseOrderNumber
- {
- get
- {
- return _PurchaseOrderNumber;
- }
- set
- {
- OnPurchaseOrderNumberChanging(value);
- ReportPropertyChanging("PurchaseOrderNumber");
- _PurchaseOrderNumber = StructuralObject.SetValidValue(value, true, "PurchaseOrderNumber");
- ReportPropertyChanged("PurchaseOrderNumber");
- OnPurchaseOrderNumberChanged();
- }
- }
- private global::System.String _PurchaseOrderNumber;
- partial void OnPurchaseOrderNumberChanging(global::System.String value);
- partial void OnPurchaseOrderNumberChanged();
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
- [DataMemberAttribute()]
- public global::System.String AccountNumber
- {
- get
- {
- return _AccountNumber;
- }
- set
- {
- OnAccountNumberChanging(value);
- ReportPropertyChanging("AccountNumber");
- _AccountNumber = StructuralObject.SetValidValue(value, true, "AccountNumber");
- ReportPropertyChanged("AccountNumber");
- OnAccountNumberChanged();
- }
- }
- private global::System.String _AccountNumber;
- partial void OnAccountNumberChanging(global::System.String value);
- partial void OnAccountNumberChanged();
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
- [DataMemberAttribute()]
- public global::System.Int32 CustomerID
- {
- get
- {
- return _CustomerID;
- }
- set
- {
- OnCustomerIDChanging(value);
- ReportPropertyChanging("CustomerID");
- _CustomerID = StructuralObject.SetValidValue(value, "CustomerID");
- ReportPropertyChanged("CustomerID");
- OnCustomerIDChanged();
- }
- }
- private global::System.Int32 _CustomerID;
- partial void OnCustomerIDChanging(global::System.Int32 value);
- partial void OnCustomerIDChanged();
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
- [DataMemberAttribute()]
- public Nullable SalesPersonID
- {
- get
- {
- return _SalesPersonID;
- }
- set
- {
- OnSalesPersonIDChanging(value);
- ReportPropertyChanging("SalesPersonID");
- _SalesPersonID = StructuralObject.SetValidValue(value, "SalesPersonID");
- ReportPropertyChanged("SalesPersonID");
- OnSalesPersonIDChanged();
- }
- }
- private Nullable _SalesPersonID;
- partial void OnSalesPersonIDChanging(Nullable value);
- partial void OnSalesPersonIDChanged();
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
- [DataMemberAttribute()]
- public Nullable TerritoryID
- {
- get
- {
- return _TerritoryID;
- }
- set
- {
- OnTerritoryIDChanging(value);
- ReportPropertyChanging("TerritoryID");
- _TerritoryID = StructuralObject.SetValidValue(value, "TerritoryID");
- ReportPropertyChanged("TerritoryID");
- OnTerritoryIDChanged();
- }
- }
- private Nullable _TerritoryID;
- partial void OnTerritoryIDChanging(Nullable value);
- partial void OnTerritoryIDChanged();
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
- [DataMemberAttribute()]
- public global::System.Int32 ShipMethodID
- {
- get
- {
- return _ShipMethodID;
- }
- set
- {
- OnShipMethodIDChanging(value);
- ReportPropertyChanging("ShipMethodID");
- _ShipMethodID = StructuralObject.SetValidValue(value, "ShipMethodID");
- ReportPropertyChanged("ShipMethodID");
- OnShipMethodIDChanged();
- }
- }
- private global::System.Int32 _ShipMethodID;
- partial void OnShipMethodIDChanging(global::System.Int32 value);
- partial void OnShipMethodIDChanged();
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
- [DataMemberAttribute()]
- public Nullable CreditCardID
- {
- get
- {
- return _CreditCardID;
- }
- set
- {
- OnCreditCardIDChanging(value);
- ReportPropertyChanging("CreditCardID");
- _CreditCardID = StructuralObject.SetValidValue(value, "CreditCardID");
- ReportPropertyChanged("CreditCardID");
- OnCreditCardIDChanged();
- }
- }
- private Nullable _CreditCardID;
- partial void OnCreditCardIDChanging(Nullable value);
- partial void OnCreditCardIDChanged();
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
- [DataMemberAttribute()]
- public global::System.String CreditCardApprovalCode
- {
- get
- {
- return _CreditCardApprovalCode;
- }
- set
- {
- OnCreditCardApprovalCodeChanging(value);
- ReportPropertyChanging("CreditCardApprovalCode");
- _CreditCardApprovalCode = StructuralObject.SetValidValue(value, true, "CreditCardApprovalCode");
- ReportPropertyChanged("CreditCardApprovalCode");
- OnCreditCardApprovalCodeChanged();
- }
- }
- private global::System.String _CreditCardApprovalCode;
- partial void OnCreditCardApprovalCodeChanging(global::System.String value);
- partial void OnCreditCardApprovalCodeChanged();
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
- [DataMemberAttribute()]
- public Nullable CurrencyRateID
- {
- get
- {
- return _CurrencyRateID;
- }
- set
- {
- OnCurrencyRateIDChanging(value);
- ReportPropertyChanging("CurrencyRateID");
- _CurrencyRateID = StructuralObject.SetValidValue(value, "CurrencyRateID");
- ReportPropertyChanged("CurrencyRateID");
- OnCurrencyRateIDChanged();
- }
- }
- private Nullable _CurrencyRateID;
- partial void OnCurrencyRateIDChanging(Nullable value);
- partial void OnCurrencyRateIDChanged();
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
- [DataMemberAttribute()]
- public global::System.Decimal SubTotal
- {
- get
- {
- return _SubTotal;
- }
- set
- {
- OnSubTotalChanging(value);
- ReportPropertyChanging("SubTotal");
- _SubTotal = StructuralObject.SetValidValue(value, "SubTotal");
- ReportPropertyChanged("SubTotal");
- OnSubTotalChanged();
- }
- }
- private global::System.Decimal _SubTotal;
- partial void OnSubTotalChanging(global::System.Decimal value);
- partial void OnSubTotalChanged();
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
- [DataMemberAttribute()]
- public global::System.Decimal TaxAmt
- {
- get
- {
- return _TaxAmt;
- }
- set
- {
- OnTaxAmtChanging(value);
- ReportPropertyChanging("TaxAmt");
- _TaxAmt = StructuralObject.SetValidValue(value, "TaxAmt");
- ReportPropertyChanged("TaxAmt");
- OnTaxAmtChanged();
- }
- }
- private global::System.Decimal _TaxAmt;
- partial void OnTaxAmtChanging(global::System.Decimal value);
- partial void OnTaxAmtChanged();
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
- [DataMemberAttribute()]
- public global::System.Decimal Freight
- {
- get
- {
- return _Freight;
- }
- set
- {
- OnFreightChanging(value);
- ReportPropertyChanging("Freight");
- _Freight = StructuralObject.SetValidValue(value, "Freight");
- ReportPropertyChanged("Freight");
- OnFreightChanged();
- }
- }
- private global::System.Decimal _Freight;
- partial void OnFreightChanging(global::System.Decimal value);
- partial void OnFreightChanged();
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
- [DataMemberAttribute()]
- public global::System.Decimal TotalDue
- {
- get
- {
- return _TotalDue;
- }
- set
- {
- OnTotalDueChanging(value);
- ReportPropertyChanging("TotalDue");
- _TotalDue = StructuralObject.SetValidValue(value, "TotalDue");
- ReportPropertyChanged("TotalDue");
- OnTotalDueChanged();
- }
- }
- private global::System.Decimal _TotalDue;
- partial void OnTotalDueChanging(global::System.Decimal value);
- partial void OnTotalDueChanged();
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
- [DataMemberAttribute()]
- public global::System.String Comment
- {
- get
- {
- return _Comment;
- }
- set
- {
- OnCommentChanging(value);
- ReportPropertyChanging("Comment");
- _Comment = StructuralObject.SetValidValue(value, true, "Comment");
- ReportPropertyChanged("Comment");
- OnCommentChanged();
- }
- }
- private global::System.String _Comment;
- partial void OnCommentChanging(global::System.String value);
- partial void OnCommentChanged();
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
- [DataMemberAttribute()]
- public global::System.Guid rowguid
- {
- get
- {
- return _rowguid;
- }
- set
- {
- OnrowguidChanging(value);
- ReportPropertyChanging("rowguid");
- _rowguid = StructuralObject.SetValidValue(value, "rowguid");
- ReportPropertyChanged("rowguid");
- OnrowguidChanged();
- }
- }
- private global::System.Guid _rowguid;
- partial void OnrowguidChanging(global::System.Guid value);
- partial void OnrowguidChanged();
-
- ///
- /// No Metadata Documentation available.
- ///
- [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
- [DataMemberAttribute()]
- public global::System.DateTime ModifiedDate
- {
- get
- {
- return _ModifiedDate;
- }
- set
- {
- OnModifiedDateChanging(value);
- ReportPropertyChanging("ModifiedDate");
- _ModifiedDate = StructuralObject.SetValidValue(value, "ModifiedDate");
- ReportPropertyChanged("ModifiedDate");
- OnModifiedDateChanged();
- }
- }
- private global::System.DateTime _ModifiedDate;
- partial void OnModifiedDateChanging(global::System.DateTime value);
- partial void OnModifiedDateChanged();
-
- #endregion
-
- #region Navigation Properties
-
- ///
- /// No Metadata Documentation available.
- ///
- [XmlIgnoreAttribute()]
- [SoapIgnoreAttribute()]
- [DataMemberAttribute()]
- [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_SalesOrderHeader_Address_BillToAddressID", "Address")]
- public Address Address
- {
- get
- {
- return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesOrderHeader_Address_BillToAddressID", "Address").Value;
- }
- set
- {
- ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesOrderHeader_Address_BillToAddressID", "Address").Value = value;
- }
- }
- ///
- /// No Metadata Documentation available.
- ///
- [BrowsableAttribute(false)]
- [DataMemberAttribute()]
- public EntityReference AddressReference
- {
- get
- {
- return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesOrderHeader_Address_BillToAddressID", "Address");
- }
- set
- {
- if ((value != null))
- {
- ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_SalesOrderHeader_Address_BillToAddressID", "Address", value);
- }
- }
- }
-
- ///
- /// No Metadata Documentation available.
- ///
- [XmlIgnoreAttribute()]
- [SoapIgnoreAttribute()]
- [DataMemberAttribute()]
- [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_SalesOrderHeader_Address_ShipToAddressID", "Address")]
- public Address Address1
- {
- get
- {
- return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesOrderHeader_Address_ShipToAddressID", "Address").Value;
- }
- set
- {
- ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesOrderHeader_Address_ShipToAddressID", "Address").Value = value;
- }
- }
- ///
- /// No Metadata Documentation available.
- ///
- [BrowsableAttribute(false)]
- [DataMemberAttribute()]
- public EntityReference Address1Reference
- {
- get
- {
- return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesOrderHeader_Address_ShipToAddressID", "Address");
- }
- set
- {
- if ((value != null))
- {
- ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_SalesOrderHeader_Address_ShipToAddressID", "Address", value);
- }
- }
- }
-
- ///
- /// No Metadata Documentation available.
- ///
- [XmlIgnoreAttribute()]
- [SoapIgnoreAttribute()]
- [DataMemberAttribute()]
- [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_SalesOrderHeader_Contact_ContactID", "Contact")]
- public Contact Contact
- {
- get
- {
- return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesOrderHeader_Contact_ContactID", "Contact").Value;
- }
- set
- {
- ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesOrderHeader_Contact_ContactID", "Contact").Value = value;
- }
- }
- ///
- /// No Metadata Documentation available.
- ///
- [BrowsableAttribute(false)]
- [DataMemberAttribute()]
- public EntityReference ContactReference
- {
- get
- {
- return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesOrderHeader_Contact_ContactID", "Contact");
- }
- set
- {
- if ((value != null))
- {
- ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_SalesOrderHeader_Contact_ContactID", "Contact", value);
- }
- }
- }
-
- ///
- /// No Metadata Documentation available.
- ///
- [XmlIgnoreAttribute()]
- [SoapIgnoreAttribute()]
- [DataMemberAttribute()]
- [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_SalesOrderDetail_SalesOrderHeader_SalesOrderID", "SalesOrderDetail")]
- public EntityCollection SalesOrderDetail
- {
- get
- {
- return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_SalesOrderDetail_SalesOrderHeader_SalesOrderID", "SalesOrderDetail");
- }
- set
- {
- if ((value != null))
- {
- ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_SalesOrderDetail_SalesOrderHeader_SalesOrderID", "SalesOrderDetail", value);
- }
- }
- }
-
- #endregion
-
- }
-
- #endregion
-
-}
diff --git a/snippets/csharp/System.Data.EntityClient/EntityConnection/ConnectionString/AdventureWorksModel.edmx b/snippets/csharp/System.Data.EntityClient/EntityConnection/ConnectionString/AdventureWorksModel.edmx
deleted file mode 100644
index 5f2ed122d9d..00000000000
--- a/snippets/csharp/System.Data.EntityClient/EntityConnection/ConnectionString/AdventureWorksModel.edmx
+++ /dev/null
@@ -1,561 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/snippets/csharp/System.Data.EntityClient/EntityConnection/ConnectionString/App.Config b/snippets/csharp/System.Data.EntityClient/EntityConnection/ConnectionString/App.Config
deleted file mode 100644
index 3071e6392c4..00000000000
--- a/snippets/csharp/System.Data.EntityClient/EntityConnection/ConnectionString/App.Config
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
diff --git a/snippets/csharp/System.Data.EntityClient/EntityConnection/ConnectionString/Program.cs b/snippets/csharp/System.Data.EntityClient/EntityConnection/ConnectionString/Program.cs
deleted file mode 100644
index ad9c59c09c9..00000000000
--- a/snippets/csharp/System.Data.EntityClient/EntityConnection/ConnectionString/Program.cs
+++ /dev/null
@@ -1,877 +0,0 @@
-//
-using System;
-using System.Collections.Generic;
-using System.Data;
-using System.Data.Common;
-using System.Data.EntityClient;
-//using AdventureWorksModel;
-using System.Data.Metadata.Edm;
-//
-//
-using System.Data.Objects;
-using System.Data.SqlClient;
-//
-
-namespace eSQLExamplesCS
-{
- class Program
- {
- static void Main(string[] args)
- {
- //ReturnEntityTypeWithObectQuery();
- //ParameterizedQueryWithObjectQuery();
- //NavRelationshipWithNavProperties();
- //GroupDataWithObjectQuery();
- //AggregateDataWithObjectQuery();
- //ReturnAnonymousTypeWithObjectQuery();
- //ReturnPrimitiveTypeWithObjectQuery();
- //OrderTwoUnionizedQueriesWithObjectQuery();
- //ESQLPagingWithObjectQuery();
-
- //BuildingConnectionStringWithEntityCommand();
- // ParameterizedQueryWithEntityCommand();
- //NavigateWithNavOperatorWithEntityCommand();
- //ReturnNestedCollectionWithEntityCommand();
- //StoredProcWithEntityCommand();
- //ExecuteStructuralTypeQuery(@"SELECT VALUE Product FROM AdventureWorksEntities.Product AS Product");
- //ExecuteRefTypeQuery(@"SELECT REF(p) FROM AdventureWorksEntities.Product as p");
- //ExecutePrimitiveTypeQuery(@"SELECT VALUE AVG(p.ListPrice) FROM AdventureWorksEntities.Product as p");
- }
-
- static private void PolymorphicQuery()
- {
- //
- using (EntityConnection conn = new EntityConnection("name=SchoolEntities"))
- {
- conn.Open();
- // Create a query that specifies to
- // get a collection of only Students
- // with enrollment dates from
- // a collection of People.
- string esqlQuery = @"SELECT Student.LastName,
- Student.EnrollmentDate FROM
- OFTYPE(SchoolEntities.Person,
- SchoolModel.Student) AS Student";
-
- using (EntityCommand cmd = new EntityCommand(esqlQuery, conn))
- {
- // Execute the command.
- using (DbDataReader rdr = cmd.ExecuteReader(CommandBehavior.SequentialAccess))
- {
- // Start reading.
- while (rdr.Read())
- {
- // Display student's last name and enrollment date.
- Console.Write(rdr["LastName"] + " ");
- Console.WriteLine(rdr["EnrollmentDate"]);
- }
- }
- }
- }
- //
- }
-
- static private void Transactions()
- {
- //
- using (EntityConnection con = new EntityConnection("name=AdventureWorksEntities"))
- {
- con.Open();
- EntityTransaction transaction = con.BeginTransaction();
- DbCommand cmd = con.CreateCommand();
- cmd.Transaction = transaction;
- cmd.CommandText = @"SELECT VALUE Contact FROM AdventureWorksEntities.Contact
- AS Contact WHERE Contact.LastName = 'Adams'";
-
- using (DbDataReader rdr = cmd.ExecuteReader(CommandBehavior.SequentialAccess))
- {
- // Iterate through the collection of Contact items.
- while (rdr.Read())
- {
- Console.Write("First Name: "+ rdr["FirstName"]);
- Console.WriteLine("\tLast Name: " + rdr["LastName"]);
- }
- }
- transaction.Commit();
- }
- //
- }
-
- static private void ComplexTypeWithEntityCommand()
- {
- //
- using (EntityConnection conn =
- new EntityConnection("name=CustomerComplexAddrContext"))
- {
- conn.Open();
-
- // Create a query that returns Address complex type.
- string esqlQuery =
- @"SELECT VALUE customers FROM
- CustomerComplexAddrContext.CCustomers
- AS customers WHERE customers.CustomerId < 3";
- try
- {
- // Create an EntityCommand.
- using (EntityCommand cmd = conn.CreateCommand())
- {
- cmd.CommandText = esqlQuery;
- // Execute the command.
- using (EntityDataReader rdr =
- cmd.ExecuteReader(CommandBehavior.SequentialAccess))
- {
- // The result returned by this query contains
- // Address complex Types.
- while (rdr.Read())
- {
- // Display CustomerID
- Console.WriteLine("Customer ID: {0}",
- rdr["CustomerId"]);
- // Display Address information.
- DbDataRecord nestedRecord =
- rdr["Address"] as DbDataRecord;
- Console.WriteLine("Address:");
- for (int i = 0; i < nestedRecord.FieldCount; i++)
- {
- Console.WriteLine(" " + nestedRecord.GetName(i) +
- ": " + nestedRecord.GetValue(i));
- }
- }
- }
- }
- }
- catch (EntityException ex)
- {
- Console.WriteLine(ex.ToString());
- }
- conn.Close();
- }
- //
- }
-
- static private void StoredProcWithEntityCommand()
- {
- //
- using (EntityConnection conn =
- new EntityConnection("name=AdventureWorksEntities"))
- {
- conn.Open();
- try
- {
- // Create an EntityCommand.
- using (EntityCommand cmd = conn.CreateCommand())
- {
- cmd.CommandText = "AdventureWorksEntities.GetOrderDetails";
- cmd.CommandType = CommandType.StoredProcedure;
- EntityParameter param = new EntityParameter();
- param.Value = "43659";
- param.ParameterName = "SalesOrderHeaderId";
- cmd.Parameters.Add(param);
-
- // Execute the command.
- using (EntityDataReader rdr =
- cmd.ExecuteReader(CommandBehavior.SequentialAccess))
- {
- // Read the results returned by the stored procedure.
- while (rdr.Read())
- {
- Console.WriteLine("Header#: {0} " +
- "Order#: {1} ProductID: {2} Quantity: {3} Price: {4}",
- rdr[0], rdr[1], rdr[2], rdr[3], rdr[4]);
- }
- }
- }
- }
- catch (EntityException ex)
- {
- Console.WriteLine(ex.ToString());
- }
- conn.Close();
- }
- //
- }
-
- static private void BuildingConnectionStringWithEntityCommand()
- {
- //
-
- // Specify the provider name, server and database.
- string providerName = "System.Data.SqlClient";
- string serverName = ".";
- string databaseName = "AdventureWorks";
-
- // Initialize the connection string builder for the
- // underlying provider.
- SqlConnectionStringBuilder sqlBuilder =
- new SqlConnectionStringBuilder();
-
- // Set the properties for the data source.
- sqlBuilder.DataSource = serverName;
- sqlBuilder.InitialCatalog = databaseName;
- sqlBuilder.IntegratedSecurity = true;
-
- // Build the SqlConnection connection string.
- string providerString = sqlBuilder.ToString();
-
- // Initialize the EntityConnectionStringBuilder.
- EntityConnectionStringBuilder entityBuilder =
- new EntityConnectionStringBuilder();
-
- //Set the provider name.
- entityBuilder.Provider = providerName;
-
- // Set the provider-specific connection string.
- entityBuilder.ProviderConnectionString = providerString;
-
- // Set the Metadata location.
- entityBuilder.Metadata = @"res://*/AdventureWorksModel.csdl|
- res://*/AdventureWorksModel.ssdl|
- res://*/AdventureWorksModel.msl";
- Console.WriteLine(entityBuilder.ToString());
-
- using (EntityConnection conn =
- new EntityConnection(entityBuilder.ToString()))
- {
- conn.Open();
- Console.WriteLine("Just testing the connection.");
- conn.Close();
- }
- //
- }
-
- static private void ParameterizedQueryWithEntityCommand()
- {
- //
- using (EntityConnection conn =
- new EntityConnection("name=AdventureWorksEntities"))
- {
- conn.Open();
- // Create a query that takes two parameters.
- string esqlQuery =
- @"SELECT VALUE Contact FROM AdventureWorksEntities.Contact
- AS Contact WHERE Contact.LastName = @ln AND
- Contact.FirstName = @fn";
-
- try
- {
- using (EntityCommand cmd = new EntityCommand(esqlQuery, conn))
- {
- // Create two parameters and add them to
- // the EntityCommand's Parameters collection
- EntityParameter param1 = new EntityParameter();
- param1.ParameterName = "ln";
- param1.Value = "Adams";
- EntityParameter param2 = new EntityParameter();
- param2.ParameterName = "fn";
- param2.Value = "Frances";
-
- cmd.Parameters.Add(param1);
- cmd.Parameters.Add(param2);
-
- using (DbDataReader rdr = cmd.ExecuteReader(CommandBehavior.SequentialAccess))
- {
- // Iterate through the collection of Contact items.
- while (rdr.Read())
- {
- Console.WriteLine(rdr["FirstName"]);
- Console.WriteLine(rdr["LastName"]);
- }
- }
- }
- }
- catch (EntityException ex)
- {
- Console.WriteLine(ex.ToString());
- }
- conn.Close();
- }
- //
- }
-
- static private void NavigateWithNavOperatorWithEntityCommand()
- {
- //
- using (EntityConnection conn =
- new EntityConnection("name=AdventureWorksEntities"))
- {
- conn.Open();
- try
- {
- // Create an EntityCommand.
- using (EntityCommand cmd = conn.CreateCommand())
- {
- // Create an Entity SQL query.
- string esqlQuery =
- @"SELECT address.AddressID, (SELECT VALUE DEREF(soh) FROM
- NAVIGATE(address, AdventureWorksModel.FK_SalesOrderHeader_Address_BillToAddressID)
- AS soh) FROM AdventureWorksEntities.Address AS address";
-
- cmd.CommandText = esqlQuery;
-
- // Execute the command.
- using (DbDataReader rdr = cmd.ExecuteReader(CommandBehavior.SequentialAccess))
- {
- // Start reading.
- while (rdr.Read())
- {
- Console.WriteLine(rdr["AddressID"]);
- }
- }
- }
- }
- catch (EntityException ex)
- {
- Console.WriteLine(ex.ToString());
- }
- conn.Close();
- }
- //
- }
-
- static private void ReturnNestedCollectionWithEntityCommand()
- {
- //
- using (EntityConnection conn =
- new EntityConnection("name=AdventureWorksEntities"))
- {
- conn.Open();
- try
- {
- // Create an EntityCommand.
- using (EntityCommand cmd = conn.CreateCommand())
- {
- // Create a nested query.
- string esqlQuery =
- @"Select c.ContactID, c.SalesOrderHeader
- From AdventureWorksEntities.Contact as c";
-
- cmd.CommandText = esqlQuery;
- // Execute the command.
- using (EntityDataReader rdr =
- cmd.ExecuteReader(CommandBehavior.SequentialAccess))
- {
- // The result returned by this query contains
- // ContactID and a nested collection of SalesOrderHeader items.
- // associated with this Contact.
- while (rdr.Read())
- {
- // the first column contains Contact ID.
- Console.WriteLine("Contact ID: {0}", rdr["ContactID"]);
-
- // The second column contains a collection of SalesOrderHeader
- // items associated with the Contact.
- DbDataReader nestedReader = rdr.GetDataReader(1);
- while (nestedReader.Read())
- {
- Console.WriteLine(" SalesOrderID: {0} ", nestedReader["SalesOrderID"]);
- Console.WriteLine(" OrderDate: {0} ", nestedReader["OrderDate"]);
- }
- }
- }
- }
- }
- catch (EntityException ex)
- {
- Console.WriteLine(ex.ToString());
- }
- conn.Close();
- }
- //
- }
-
- static private void ReturnEntityTypeWithObectQuery()
- {
- //
- using (AdventureWorksEntities advWorksContext =
- new AdventureWorksEntities())
- {
- try
- {
- string queryString =
- @"SELECT VALUE Product FROM AdventureWorksEntities.Product AS Product";
-
- ObjectQuery productQuery =
- new ObjectQuery(queryString, advWorksContext, MergeOption.NoTracking);
-
- // Iterate through the collection of Product items.
- foreach (Product result in productQuery)
- Console.WriteLine("Product Name: {0}; Product ID: {1}",
- result.Name, result.ProductID);
- }
- catch (EntityException ex)
- {
- Console.WriteLine(ex.ToString());
- }
- catch (InvalidOperationException ex)
- {
- Console.WriteLine(ex.ToString());
- }
- }
- //
- }
-
- static private void ParameterizedQueryWithObjectQuery()
- {
- //
- using (AdventureWorksEntities advWorksContext =
- new AdventureWorksEntities())
- {
- try
- {
- // Create a query that takes two parameters.
- string queryString =
- @"SELECT VALUE Contact FROM AdventureWorksEntities.Contact
- AS Contact WHERE Contact.LastName = @ln AND
- Contact.FirstName = @fn";
-
- ObjectQuery contactQuery =
- new ObjectQuery(queryString, advWorksContext);
-
- // Add parameters to the collection.
- contactQuery.Parameters.Add(new ObjectParameter("ln", "Adams"));
- contactQuery.Parameters.Add(new ObjectParameter("fn", "Frances"));
-
- // Iterate through the collection of Contact items.
- foreach (Contact result in contactQuery)
- Console.WriteLine("Last Name: {0}; First Name: {1}",
- result.LastName, result.FirstName);
- }
- catch (EntityException ex)
- {
- Console.WriteLine(ex.ToString());
- }
- catch (InvalidOperationException ex)
- {
- Console.WriteLine(ex.ToString());
- }
- }
- //
- }
-
- static private void NavRelationshipWithNavProperties()
- {
- //
-
- using (AdventureWorksEntities advWorksContext =
- new AdventureWorksEntities())
- {
- string esqlQuery = @"SELECT c.FirstName, c.SalesOrderHeader
- FROM AdventureWorksEntities.Contact AS c where c.LastName = 'Zhou'";
-
- try
- {
- foreach (DbDataRecord rec in
- new ObjectQuery(esqlQuery, advWorksContext))
- {
-
- // Display contact's first name.
- Console.WriteLine("First Name {0}: ", rec[0]);
- List list = rec[1] as List;
- // Display SalesOrderHeader information
- // associated with the contact.
- foreach (SalesOrderHeader soh in list)
- {
- Console.WriteLine(" Order ID: {0}, Order date: {1}, Total Due: {2}",
- soh.SalesOrderID, soh.OrderDate, soh.TotalDue);
- }
- }
- }
- catch (EntityException ex)
- {
- Console.WriteLine(ex.ToString());
- }
- catch (InvalidOperationException ex)
- {
- Console.WriteLine(ex.ToString());
- }
- }
- //
- }
-
- static private void ReturnAnonymousTypeWithObjectQuery()
- {
- //
- using (AdventureWorksEntities advWorksContext =
- new AdventureWorksEntities())
- {
- string myQuery = @"SELECT p.ProductID, p.Name FROM
- AdventureWorksEntities.Product as p";
- try
- {
- foreach (DbDataRecord rec in
- new ObjectQuery(myQuery, advWorksContext))
- {
- Console.WriteLine("ID {0}; Name {1}", rec[0], rec[1]);
- }
- }
- catch (EntityException ex)
- {
- Console.WriteLine(ex.ToString());
- }
- catch (InvalidOperationException ex)
- {
- Console.WriteLine(ex.ToString());
- }
- }
- //
- }
-
- static private void ReturnPrimitiveTypeWithObjectQuery()
- {
- //
- using (AdventureWorksEntities advWorksContext =
- new AdventureWorksEntities())
- {
- string queryString = @"SELECT VALUE Length(p.Name)FROM
- AdventureWorksEntities.Product AS p";
-
- try
- {
- ObjectQuery productQuery =
- new ObjectQuery(queryString, advWorksContext, MergeOption.NoTracking);
- foreach (Int32 result in productQuery)
- Console.WriteLine("{0}", result);
- }
- catch (EntityException ex)
- {
- Console.WriteLine(ex.ToString());
- }
- catch (InvalidOperationException ex)
- {
- Console.WriteLine(ex.ToString());
- }
- }
- //
- }
- static private void GroupDataWithObjectQuery()
- {
- //
- using (AdventureWorksEntities advWorksContext =
- new AdventureWorksEntities())
- {
- string esqlQuery = @"SELECT ln,
- (SELECT c1.LastName FROM AdventureWorksEntities.Contact
- AS c1 WHERE SUBSTRING(c1.LastName ,1,1) = ln)
- AS CONTACT
- FROM AdventureWorksEntities.CONTACT AS c2 GROUP BY SUBSTRING(c2.LastName ,1,1) AS ln
- ORDER BY ln";
- try
- {
- foreach (DbDataRecord rec in
- new ObjectQuery(esqlQuery, advWorksContext))
- {
- Console.WriteLine("Last names that start with the letter '{0}':",
- rec[0]);
- List list = rec[1] as List;
- foreach (DbDataRecord nestedRec in list)
- {
- for (int i = 0; i < nestedRec.FieldCount; i++)
- {
- Console.WriteLine(" {0} ", nestedRec[i]);
- }
- }
- }
- }
- catch (EntityException ex)
- {
- Console.WriteLine(ex.ToString());
- }
- catch (InvalidOperationException ex)
- {
- Console.WriteLine(ex.ToString());
- }
- }
- //
- }
-
- static private void AggregateDataWithObjectQuery()
- {
-
- //
- using (AdventureWorksEntities advWorksContext =
- new AdventureWorksEntities())
- {
- string esqlQuery = @"SELECT contactID, AVG(order.TotalDue)
- FROM AdventureWorksEntities.SalesOrderHeader
- AS order GROUP BY order.Contact.ContactID as contactID";
-
- try
- {
- foreach (DbDataRecord rec in
- new ObjectQuery(esqlQuery, advWorksContext))
- {
- Console.WriteLine("ContactID = {0} Average TotalDue = {1} ",
- rec[0], rec[1]);
- }
- }
- catch (EntityException ex)
- {
- Console.WriteLine(ex.ToString());
- }
- catch (InvalidOperationException ex)
- {
- Console.WriteLine(ex.ToString());
- }
- }
- //
- }
-
- static private void OrderTwoUnionizedQueriesWithObjectQuery()
- {
- //
- using (AdventureWorksEntities advWorksContext =
- new AdventureWorksEntities())
- {
- String esqlQuery = @"SELECT P2.Name, P2.ListPrice
- FROM ((SELECT P1.Name, P1.ProductID as Pid, P1.ListPrice
- FROM AdventureWorksEntities.Product as P1
- where P1.Name like 'A%')
- union all
- (SELECT P1.Name, P1.ProductID as Pid, P1.ListPrice
- FROM AdventureWorksEntities.Product as P1
- WHERE P1.Name like 'B%')
- ) as P2
- ORDER BY P2.Name";
- try
- {
- foreach (DbDataRecord rec in
- new ObjectQuery(esqlQuery, advWorksContext))
- {
- Console.WriteLine("Name: {0}; ListPrice: {1}", rec[0], rec[1]);
- }
- }
- catch (EntityException ex)
- {
- Console.WriteLine(ex.ToString());
- }
- catch (InvalidOperationException ex)
- {
- Console.WriteLine(ex.ToString());
- }
- }
- //
- }
-
- static private void ESQLPagingWithObjectQuery()
- {
- //
- using (AdventureWorksEntities advWorksContext =
- new AdventureWorksEntities())
- {
- try
- {
- // Create a query that takes two parameters.
- string queryString =
- @"SELECT VALUE product FROM
- AdventureWorksEntities.Product AS product
- order by product.ListPrice SKIP @skip LIMIT @limit";
-
- ObjectQuery productQuery =
- new ObjectQuery(queryString, advWorksContext);
-
- // Add parameters to the collection.
- productQuery.Parameters.Add(new ObjectParameter("skip", 3));
- productQuery.Parameters.Add(new ObjectParameter("limit", 5));
-
- // Iterate through the collection of Contact items.
- foreach (Product result in productQuery)
- Console.WriteLine("ID: {0}; Name: {1}",
- result.ProductID, result.Name);
- }
- catch (EntityException ex)
- {
- Console.WriteLine(ex.ToString());
- }
- catch (InvalidOperationException ex)
- {
- Console.WriteLine(ex.ToString());
- }
- }
- //
- }
-
- //string esqlQuery = @"SELECT VALUE Product FROM AdventureWorksEntities.Product AS Product";
- //
- static void ExecuteStructuralTypeQuery(string esqlQuery)
- {
- if (esqlQuery.Length == 0)
- {
- Console.WriteLine("The query string is empty.");
- return;
- }
-
- using (EntityConnection conn =
- new EntityConnection("name=AdventureWorksEntities"))
- {
- conn.Open();
-
- try
- {
- // Create an EntityCommand.
- using (EntityCommand cmd = conn.CreateCommand())
- {
- cmd.CommandText = esqlQuery;
- // Execute the command.
- using (EntityDataReader rdr =
- cmd.ExecuteReader(CommandBehavior.SequentialAccess))
- {
- // Start reading results.
- while (rdr.Read())
- {
- StructuralTypeVisitRecord(rdr as IExtendedDataRecord);
- }
- }
- }
- }
- catch (EntityException ex)
- {
- Console.WriteLine(ex.ToString());
- }
- conn.Close();
- }
- }
-
- static void StructuralTypeVisitRecord(IExtendedDataRecord record)
- {
- int fieldCount = record.DataRecordInfo.FieldMetadata.Count;
- for (int fieldIndex = 0; fieldIndex < fieldCount; fieldIndex++)
- {
- Console.Write(record.GetName(fieldIndex) + ": ");
-
- // If the field is flagged as DbNull, the shape of the value is undetermined.
- // An attempt to get such a value may trigger an exception.
- if (!record.IsDBNull(fieldIndex))
- {
- BuiltInTypeKind fieldTypeKind = record.DataRecordInfo.FieldMetadata[fieldIndex].
- FieldType.TypeUsage.EdmType.BuiltInTypeKind;
- // The EntityType, ComplexType and RowType are structural types
- // that have members.
- // Read only the PrimitiveType members of this structural type.
- if (fieldTypeKind == BuiltInTypeKind.PrimitiveType)
- {
- // Primitive types are surfaced as plain objects.
- Console.WriteLine(record.GetValue(fieldIndex).ToString());
- }
- }
- }
- }
- //
-
- //string esqlQuery = @"SELECT REF(p) FROM AdventureWorksEntities.Product as p";
- //
- static void ExecuteRefTypeQuery(string esqlQuery)
- {
- if (esqlQuery.Length == 0)
- {
- Console.WriteLine("The query string is empty.");
- return;
- }
-
- using (EntityConnection conn =
- new EntityConnection("name=AdventureWorksEntities"))
- {
- conn.Open();
-
- try
- {
- // Create an EntityCommand.
- using (EntityCommand cmd = conn.CreateCommand())
- {
- cmd.CommandText = esqlQuery;
- // Execute the command.
- using (EntityDataReader rdr =
- cmd.ExecuteReader(CommandBehavior.SequentialAccess))
- {
- // Start reading results.
- while (rdr.Read())
- {
- RefTypeVisitRecord(rdr as IExtendedDataRecord);
- }
- }
- }
- }
- catch (EntityException ex)
- {
- Console.WriteLine(ex.ToString());
- }
- conn.Close();
- }
- }
-
- static void RefTypeVisitRecord(IExtendedDataRecord record)
- {
- // For RefType the record contains exactly one field.
- int fieldIndex = 0;
-
- // If the field is flagged as DbNull, the shape of the value is undetermined.
- // An attempt to get such a value may trigger an exception.
- if (!record.IsDBNull(fieldIndex))
- {
- BuiltInTypeKind fieldTypeKind = record.DataRecordInfo.FieldMetadata[fieldIndex].
- FieldType.TypeUsage.EdmType.BuiltInTypeKind;
- //read only fields that contain PrimitiveType
- if (fieldTypeKind == BuiltInTypeKind.RefType)
- {
- // Ref types are surfaced as EntityKey instances.
- // The containing record sees them as atomic.
- EntityKey key = record.GetValue(fieldIndex) as EntityKey;
- // Get the EntitySet name.
- Console.WriteLine("EntitySetName " + key.EntitySetName);
- // Get the Name and the Value information of the EntityKey.
- foreach (EntityKeyMember keyMember in key.EntityKeyValues)
- {
- Console.WriteLine(" Key Name: " + keyMember.Key);
- Console.WriteLine(" Key Value: " + keyMember.Value);
- }
- }
- }
- }
- //
-
- //string esqlQuery = @"SELECT VALUE AVG(p.ListPrice) FROM AdventureWorksEntities.Product as p";
- //
- static void ExecutePrimitiveTypeQuery(string esqlQuery)
- {
- if (esqlQuery.Length == 0)
- {
- Console.WriteLine("The query string is empty.");
- return;
- }
-
- using (EntityConnection conn =
- new EntityConnection("name=AdventureWorksEntities"))
- {
- conn.Open();
-
- try
- {
- // Create an EntityCommand.
- using (EntityCommand cmd = conn.CreateCommand())
- {
- cmd.CommandText = esqlQuery;
- // Execute the command.
- using (EntityDataReader rdr =
- cmd.ExecuteReader(CommandBehavior.SequentialAccess))
- {
- // Start reading results.
- while (rdr.Read())
- {
- IExtendedDataRecord record = rdr as IExtendedDataRecord;
- // For PrimitiveType
- // the record contains exactly one field.
- int fieldIndex = 0;
- Console.WriteLine("Value: " + record.GetValue(fieldIndex));
- }
- }
- }
- }
- catch (EntityException ex)
- {
- Console.WriteLine(ex.ToString());
- }
- conn.Close();
- }
- }
- //
- }
-}
diff --git a/snippets/csharp/System.Data.EntityClient/EntityConnection/ConnectionString/Properties/AssemblyInfo.cs b/snippets/csharp/System.Data.EntityClient/EntityConnection/ConnectionString/Properties/AssemblyInfo.cs
deleted file mode 100644
index 36b1bfae25b..00000000000
--- a/snippets/csharp/System.Data.EntityClient/EntityConnection/ConnectionString/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-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("eSQLExamplesCS")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Microsoft")]
-[assembly: AssemblyProduct("eSQLExamplesCS")]
-[assembly: AssemblyCopyright("Copyright © Microsoft 2008")]
-[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("37090b5a-e65f-40c7-9031-8ba42e8b7ac4")]
-
-// 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 --git a/snippets/csharp/System.Data.EntityClient/EntityConnection/ConnectionString/eSQLExamplesCS.csproj b/snippets/csharp/System.Data.EntityClient/EntityConnection/ConnectionString/eSQLExamplesCS.csproj
deleted file mode 100644
index ad02edf8d74..00000000000
--- a/snippets/csharp/System.Data.EntityClient/EntityConnection/ConnectionString/eSQLExamplesCS.csproj
+++ /dev/null
@@ -1,114 +0,0 @@
-
-
-
- Debug
- AnyCPU
- 9.0.30229
- 2.0
- {E3606F40-4AC8-4497-9F31-D9524FF3E263}
- Exe
- Properties
- eSQLExamplesCS
- eSQLExamplesCS
- v4.8
- 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
- false
-
-
- pdbonly
- true
- bin\Release\
- TRACE
- prompt
- 4
- false
-
-
-
-
- 3.5
-
-
- 3.5
-
-
- 3.0
-
-
-
- 3.5
-
-
- 3.5
-
-
-
-
-
-
-
- True
- True
- AdventureWorksModel.edmx
-
-
-
-
-
-
-
-
-
- EntityModelCodeGenerator
- AdventureWorksModel.Designer.cs
-
-
-
-
-
-
-
- False
- .NET Framework 3.5 SP1
- true
-
-
-
-
-
\ No newline at end of file
diff --git a/snippets/csharp/System.Data.Linq.Mapping/AssociationAttribute/Overview/northwind.cs b/snippets/csharp/System.Data.Linq.Mapping/AssociationAttribute/Overview/northwind.cs
deleted file mode 100644
index 57e40711006..00000000000
--- a/snippets/csharp/System.Data.Linq.Mapping/AssociationAttribute/Overview/northwind.cs
+++ /dev/null
@@ -1,4295 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// This code was generated by a tool.
-// Runtime Version:2.0.50727.1412
-//
-// 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.ComponentModel;
-using System.Data;
-using System.Data.Linq;
-using System.Data.Linq.Mapping;
-using System.Linq;
-using System.Linq.Expressions;
-using System.Reflection;
-
-
-
-[System.Data.Linq.Mapping.DatabaseAttribute(Name="northwnd")]
-public partial class Northwnd : System.Data.Linq.DataContext
-{
-
- private static System.Data.Linq.Mapping.MappingSource mappingSource = new AttributeMappingSource();
-
- #region Extensibility Method Definitions
- partial void OnCreated();
- partial void InsertCategory(Category instance);
- partial void UpdateCategory(Category instance);
- partial void DeleteCategory(Category instance);
- partial void InsertCustomerCustomerDemo(CustomerCustomerDemo instance);
- partial void UpdateCustomerCustomerDemo(CustomerCustomerDemo instance);
- partial void DeleteCustomerCustomerDemo(CustomerCustomerDemo instance);
- partial void InsertCustomerDemographic(CustomerDemographic instance);
- partial void UpdateCustomerDemographic(CustomerDemographic instance);
- partial void DeleteCustomerDemographic(CustomerDemographic instance);
- partial void InsertCustomer(Customer instance);
- partial void UpdateCustomer(Customer instance);
- partial void DeleteCustomer(Customer instance);
- partial void InsertEmployee(Employee instance);
- partial void UpdateEmployee(Employee instance);
- partial void DeleteEmployee(Employee instance);
- partial void InsertEmployeeTerritory(EmployeeTerritory instance);
- partial void UpdateEmployeeTerritory(EmployeeTerritory instance);
- partial void DeleteEmployeeTerritory(EmployeeTerritory instance);
- partial void InsertOrderDetail(OrderDetail instance);
- partial void UpdateOrderDetail(OrderDetail instance);
- partial void DeleteOrderDetail(OrderDetail instance);
- partial void InsertOrder(Order instance);
- partial void UpdateOrder(Order instance);
- partial void DeleteOrder(Order instance);
- partial void InsertProduct(Product instance);
- partial void UpdateProduct(Product instance);
- partial void DeleteProduct(Product instance);
- partial void InsertRegion(Region instance);
- partial void UpdateRegion(Region instance);
- partial void DeleteRegion(Region instance);
- partial void InsertShipper(Shipper instance);
- partial void UpdateShipper(Shipper instance);
- partial void DeleteShipper(Shipper instance);
- partial void InsertSupplier(Supplier instance);
- partial void UpdateSupplier(Supplier instance);
- partial void DeleteSupplier(Supplier instance);
- partial void InsertTerritory(Territory instance);
- partial void UpdateTerritory(Territory instance);
- partial void DeleteTerritory(Territory instance);
- #endregion
-
- static Northwnd()
- {
- }
-
- public Northwnd(string connection) :
- base(connection, mappingSource)
- {
- OnCreated();
- }
-
- public Northwnd(System.Data.IDbConnection connection) :
- base(connection, mappingSource)
- {
- OnCreated();
- }
-
- public Northwnd(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
- base(connection, mappingSource)
- {
- OnCreated();
- }
-
- public Northwnd(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
- base(connection, mappingSource)
- {
- OnCreated();
- }
-
- public System.Data.Linq.Table Categories
- {
- get
- {
- return this.GetTable();
- }
- }
-
- public System.Data.Linq.Table CustomerCustomerDemos
- {
- get
- {
- return this.GetTable();
- }
- }
-
- public System.Data.Linq.Table CustomerDemographics
- {
- get
- {
- return this.GetTable();
- }
- }
-
- public System.Data.Linq.Table Customers
- {
- get
- {
- return this.GetTable();
- }
- }
-
- public System.Data.Linq.Table Employees
- {
- get
- {
- return this.GetTable();
- }
- }
-
- public System.Data.Linq.Table EmployeeTerritories
- {
- get
- {
- return this.GetTable();
- }
- }
-
- public System.Data.Linq.Table OrderDetails
- {
- get
- {
- return this.GetTable();
- }
- }
-
- public System.Data.Linq.Table Orders
- {
- get
- {
- return this.GetTable();
- }
- }
-
- public System.Data.Linq.Table Products
- {
- get
- {
- return this.GetTable();
- }
- }
-
- public System.Data.Linq.Table Regions
- {
- get
- {
- return this.GetTable();
- }
- }
-
- public System.Data.Linq.Table Shippers
- {
- get
- {
- return this.GetTable();
- }
- }
-
- public System.Data.Linq.Table Suppliers
- {
- get
- {
- return this.GetTable();
- }
- }
-
- public System.Data.Linq.Table Territories
- {
- get
- {
- return this.GetTable();
- }
- }
-
- [Function(Name="dbo.CustOrderHist")]
- public ISingleResult CustOrderHist([Parameter(Name="CustomerID", DbType="NChar(5)")] string customerID)
- {
- IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), customerID);
- return ((ISingleResult)(result.ReturnValue));
- }
-
- [Function(Name="dbo.CustOrdersDetail")]
- public ISingleResult CustOrdersDetail([Parameter(Name="OrderID", DbType="Int")] System.Nullable orderID)
- {
- IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), orderID);
- return ((ISingleResult)(result.ReturnValue));
- }
-
- [Function(Name="dbo.CustOrdersOrders")]
- public ISingleResult CustOrdersOrders([Parameter(Name="CustomerID", DbType="NChar(5)")] string customerID)
- {
- IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), customerID);
- return ((ISingleResult)(result.ReturnValue));
- }
-
- [Function(Name="dbo.Employee Sales by Country")]
- public ISingleResult EmployeeSalesByCountry([Parameter(Name="Beginning_Date", DbType="DateTime")] System.Nullable beginning_Date, [Parameter(Name="Ending_Date", DbType="DateTime")] System.Nullable ending_Date)
- {
- IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), beginning_Date, ending_Date);
- return ((ISingleResult)(result.ReturnValue));
- }
-
- [Function(Name="dbo.Sales by Year")]
- public ISingleResult SalesByYear([Parameter(Name="Beginning_Date", DbType="DateTime")] System.Nullable beginning_Date, [Parameter(Name="Ending_Date", DbType="DateTime")] System.Nullable ending_Date)
- {
- IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), beginning_Date, ending_Date);
- return ((ISingleResult)(result.ReturnValue));
- }
-
- [Function(Name="dbo.SalesByCategory")]
- public ISingleResult SalesByCategory([Parameter(Name="CategoryName", DbType="NVarChar(15)")] string categoryName, [Parameter(Name="OrdYear", DbType="NVarChar(4)")] string ordYear)
- {
- IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), categoryName, ordYear);
- return ((ISingleResult)(result.ReturnValue));
- }
-
- [Function(Name="dbo.Ten Most Expensive Products")]
- public ISingleResult TenMostExpensiveProducts()
- {
- IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())));
- return ((ISingleResult)(result.ReturnValue));
- }
-}
-
-[Table(Name="dbo.Categories")]
-public partial class Category : INotifyPropertyChanging, INotifyPropertyChanged
-{
-
- private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
-
- private int _CategoryID;
-
- private string _CategoryName;
-
- private string _Description;
-
- private System.Data.Linq.Binary _Picture;
-
- private EntitySet _Products;
-
- #region Extensibility Method Definitions
- partial void OnLoaded();
- partial void OnValidate();
- partial void OnCreated();
- partial void OnCategoryIDChanging(int value);
- partial void OnCategoryIDChanged();
- partial void OnCategoryNameChanging(string value);
- partial void OnCategoryNameChanged();
- partial void OnDescriptionChanging(string value);
- partial void OnDescriptionChanged();
- partial void OnPictureChanging(System.Data.Linq.Binary value);
- partial void OnPictureChanged();
- #endregion
-
- public Category()
- {
- OnCreated();
- this._Products = new EntitySet(new Action(this.attach_Products), new Action(this.detach_Products));
- }
-
- [Column(Storage="_CategoryID", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
- public int CategoryID
- {
- get
- {
- return this._CategoryID;
- }
- set
- {
- if ((this._CategoryID != value))
- {
- this.OnCategoryIDChanging(value);
- this.SendPropertyChanging();
- this._CategoryID = value;
- this.SendPropertyChanged("CategoryID");
- this.OnCategoryIDChanged();
- }
- }
- }
-
- [Column(Storage="_CategoryName", DbType="NVarChar(15) NOT NULL", CanBeNull=false)]
- public string CategoryName
- {
- get
- {
- return this._CategoryName;
- }
- set
- {
- if ((this._CategoryName != value))
- {
- this.OnCategoryNameChanging(value);
- this.SendPropertyChanging();
- this._CategoryName = value;
- this.SendPropertyChanged("CategoryName");
- this.OnCategoryNameChanged();
- }
- }
- }
-
- [Column(Storage="_Description", DbType="NText", UpdateCheck=UpdateCheck.Never)]
- public string Description
- {
- get
- {
- return this._Description;
- }
- set
- {
- if ((this._Description != value))
- {
- this.OnDescriptionChanging(value);
- this.SendPropertyChanging();
- this._Description = value;
- this.SendPropertyChanged("Description");
- this.OnDescriptionChanged();
- }
- }
- }
-
- [Column(Storage="_Picture", DbType="Image", CanBeNull=true, UpdateCheck=UpdateCheck.Never)]
- public System.Data.Linq.Binary Picture
- {
- get
- {
- return this._Picture;
- }
- set
- {
- if ((this._Picture != value))
- {
- this.OnPictureChanging(value);
- this.SendPropertyChanging();
- this._Picture = value;
- this.SendPropertyChanged("Picture");
- this.OnPictureChanged();
- }
- }
- }
-
- //
- [Association(Name="FK_Products_Categories", Storage="_Products", OtherKey="CategoryID", DeleteRule="NO ACTION")]
- public EntitySet Products
- {
- get
- {
- return this._Products;
- }
- set
- {
- this._Products.Assign(value);
- }
- }
- //
-
- public event PropertyChangingEventHandler PropertyChanging;
-
- public event PropertyChangedEventHandler PropertyChanged;
-
- protected virtual void SendPropertyChanging()
- {
- if ((this.PropertyChanging != null))
- {
- this.PropertyChanging(this, emptyChangingEventArgs);
- }
- }
-
- protected virtual void SendPropertyChanged(String propertyName)
- {
- if ((this.PropertyChanged != null))
- {
- this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
- }
- }
-
- private void attach_Products(Product entity)
- {
- this.SendPropertyChanging();
- entity.Category = this;
- this.SendPropertyChanged("Products");
- }
-
- private void detach_Products(Product entity)
- {
- this.SendPropertyChanging();
- entity.Category = null;
- this.SendPropertyChanged("Products");
- }
-}
-
-[Table(Name="dbo.CustomerCustomerDemo")]
-public partial class CustomerCustomerDemo : INotifyPropertyChanging, INotifyPropertyChanged
-{
-
- private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
-
- private string _CustomerID;
-
- private string _CustomerTypeID;
-
- private EntityRef _CustomerDemographic;
-
- private EntityRef _Customer;
-
- #region Extensibility Method Definitions
- partial void OnLoaded();
- partial void OnValidate();
- partial void OnCreated();
- partial void OnCustomerIDChanging(string value);
- partial void OnCustomerIDChanged();
- partial void OnCustomerTypeIDChanging(string value);
- partial void OnCustomerTypeIDChanged();
- #endregion
-
- public CustomerCustomerDemo()
- {
- OnCreated();
- this._CustomerDemographic = default(EntityRef);
- this._Customer = default(EntityRef);
- }
-
- [Column(Storage="_CustomerID", DbType="NChar(5) NOT NULL", CanBeNull=false, IsPrimaryKey=true)]
- public string CustomerID
- {
- get
- {
- return this._CustomerID;
- }
- set
- {
- if ((this._CustomerID != value))
- {
- if (this._Customer.HasLoadedOrAssignedValue)
- {
- throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
- }
- this.OnCustomerIDChanging(value);
- this.SendPropertyChanging();
- this._CustomerID = value;
- this.SendPropertyChanged("CustomerID");
- this.OnCustomerIDChanged();
- }
- }
- }
-
- [Column(Storage="_CustomerTypeID", DbType="NChar(10) NOT NULL", CanBeNull=false, IsPrimaryKey=true)]
- public string CustomerTypeID
- {
- get
- {
- return this._CustomerTypeID;
- }
- set
- {
- if ((this._CustomerTypeID != value))
- {
- if (this._CustomerDemographic.HasLoadedOrAssignedValue)
- {
- throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
- }
- this.OnCustomerTypeIDChanging(value);
- this.SendPropertyChanging();
- this._CustomerTypeID = value;
- this.SendPropertyChanged("CustomerTypeID");
- this.OnCustomerTypeIDChanged();
- }
- }
- }
-
- //
- [Association(Name="FK_CustomerCustomerDemo", Storage="_CustomerDemographic", ThisKey="CustomerTypeID", IsForeignKey=true)]
- public CustomerDemographic CustomerDemographic
- {
- get
- {
- return this._CustomerDemographic.Entity;
- }
- set
- {
- CustomerDemographic previousValue = this._CustomerDemographic.Entity;
- if (((previousValue != value)
- || (!this._CustomerDemographic.HasLoadedOrAssignedValue )))
- {
- this.SendPropertyChanging();
- if ((previousValue != null))
- {
- this._CustomerDemographic.Entity = null;
- previousValue.CustomerCustomerDemos.Remove(this);
- }
- this._CustomerDemographic.Entity = value;
- if ((value != null))
- {
- value.CustomerCustomerDemos.Add(this);
- this._CustomerTypeID = value.CustomerTypeID;
- }
- else
- {
- this._CustomerTypeID = default(string);
- }
- this.SendPropertyChanged("CustomerDemographic");
- }
- }
- }
- //
-
- [Association(Name="FK_CustomerCustomerDemo_Customers", Storage="_Customer", ThisKey="CustomerID", IsForeignKey=true)]
- public Customer Customer
- {
- get
- {
- return this._Customer.Entity;
- }
- set
- {
- Customer previousValue = this._Customer.Entity;
- if (((previousValue != value)
- || (!this._Customer.HasLoadedOrAssignedValue )))
- {
- this.SendPropertyChanging();
- if ((previousValue != null))
- {
- this._Customer.Entity = null;
- previousValue.CustomerCustomerDemos.Remove(this);
- }
- this._Customer.Entity = value;
- if ((value != null))
- {
- value.CustomerCustomerDemos.Add(this);
- this._CustomerID = value.CustomerID;
- }
- else
- {
- this._CustomerID = default(string);
- }
- this.SendPropertyChanged("Customer");
- }
- }
- }
-
- public event PropertyChangingEventHandler PropertyChanging;
-
- public event PropertyChangedEventHandler PropertyChanged;
-
- protected virtual void SendPropertyChanging()
- {
- if ((this.PropertyChanging != null))
- {
- this.PropertyChanging(this, emptyChangingEventArgs);
- }
- }
-
- protected virtual void SendPropertyChanged(String propertyName)
- {
- if ((this.PropertyChanged != null))
- {
- this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
- }
- }
-}
-
-[Table(Name="dbo.CustomerDemographics")]
-public partial class CustomerDemographic : INotifyPropertyChanging, INotifyPropertyChanged
-{
-
- private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
-
- private string _CustomerTypeID;
-
- private string _CustomerDesc;
-
- private EntitySet _CustomerCustomerDemos;
-
- #region Extensibility Method Definitions
- partial void OnLoaded();
- partial void OnValidate();
- partial void OnCreated();
- partial void OnCustomerTypeIDChanging(string value);
- partial void OnCustomerTypeIDChanged();
- partial void OnCustomerDescChanging(string value);
- partial void OnCustomerDescChanged();
- #endregion
-
- public CustomerDemographic()
- {
- OnCreated();
- this._CustomerCustomerDemos = new EntitySet(new Action(this.attach_CustomerCustomerDemos), new Action(this.detach_CustomerCustomerDemos));
- }
-
- [Column(Storage="_CustomerTypeID", DbType="NChar(10) NOT NULL", CanBeNull=false, IsPrimaryKey=true)]
- public string CustomerTypeID
- {
- get
- {
- return this._CustomerTypeID;
- }
- set
- {
- if ((this._CustomerTypeID != value))
- {
- this.OnCustomerTypeIDChanging(value);
- this.SendPropertyChanging();
- this._CustomerTypeID = value;
- this.SendPropertyChanged("CustomerTypeID");
- this.OnCustomerTypeIDChanged();
- }
- }
- }
-
- [Column(Storage="_CustomerDesc", DbType="NText", UpdateCheck=UpdateCheck.Never)]
- public string CustomerDesc
- {
- get
- {
- return this._CustomerDesc;
- }
- set
- {
- if ((this._CustomerDesc != value))
- {
- this.OnCustomerDescChanging(value);
- this.SendPropertyChanging();
- this._CustomerDesc = value;
- this.SendPropertyChanged("CustomerDesc");
- this.OnCustomerDescChanged();
- }
- }
- }
-
- [Association(Name="FK_CustomerCustomerDemo", Storage="_CustomerCustomerDemos", OtherKey="CustomerTypeID", DeleteRule="NO ACTION")]
- public EntitySet CustomerCustomerDemos
- {
- get
- {
- return this._CustomerCustomerDemos;
- }
- set
- {
- this._CustomerCustomerDemos.Assign(value);
- }
- }
-
- public event PropertyChangingEventHandler PropertyChanging;
-
- public event PropertyChangedEventHandler PropertyChanged;
-
- protected virtual void SendPropertyChanging()
- {
- if ((this.PropertyChanging != null))
- {
- this.PropertyChanging(this, emptyChangingEventArgs);
- }
- }
-
- protected virtual void SendPropertyChanged(String propertyName)
- {
- if ((this.PropertyChanged != null))
- {
- this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
- }
- }
-
- private void attach_CustomerCustomerDemos(CustomerCustomerDemo entity)
- {
- this.SendPropertyChanging();
- entity.CustomerDemographic = this;
- this.SendPropertyChanged("CustomerCustomerDemos");
- }
-
- private void detach_CustomerCustomerDemos(CustomerCustomerDemo entity)
- {
- this.SendPropertyChanging();
- entity.CustomerDemographic = null;
- this.SendPropertyChanged("CustomerCustomerDemos");
- }
-}
-
-[Table(Name="dbo.Customers")]
-public partial class Customer : INotifyPropertyChanging, INotifyPropertyChanged
-{
-
- private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
-
- private string _CustomerID;
-
- private string _CompanyName;
-
- private string _ContactName;
-
- private string _ContactTitle;
-
- private string _Address;
-
- private string _City;
-
- private string _Region;
-
- private string _PostalCode;
-
- private string _Country;
-
- private string _Phone;
-
- private string _Fax;
-
- private EntitySet _CustomerCustomerDemos;
-
- private EntitySet _Orders;
-
- #region Extensibility Method Definitions
- partial void OnLoaded();
- partial void OnValidate();
- partial void OnCreated();
- partial void OnCustomerIDChanging(string value);
- partial void OnCustomerIDChanged();
- partial void OnCompanyNameChanging(string value);
- partial void OnCompanyNameChanged();
- partial void OnContactNameChanging(string value);
- partial void OnContactNameChanged();
- partial void OnContactTitleChanging(string value);
- partial void OnContactTitleChanged();
- partial void OnAddressChanging(string value);
- partial void OnAddressChanged();
- partial void OnCityChanging(string value);
- partial void OnCityChanged();
- partial void OnRegionChanging(string value);
- partial void OnRegionChanged();
- partial void OnPostalCodeChanging(string value);
- partial void OnPostalCodeChanged();
- partial void OnCountryChanging(string value);
- partial void OnCountryChanged();
- partial void OnPhoneChanging(string value);
- partial void OnPhoneChanged();
- partial void OnFaxChanging(string value);
- partial void OnFaxChanged();
- #endregion
-
- public Customer()
- {
- OnCreated();
- this._CustomerCustomerDemos = new EntitySet(new Action(this.attach_CustomerCustomerDemos), new Action(this.detach_CustomerCustomerDemos));
- this._Orders = new EntitySet(new Action(this.attach_Orders), new Action(this.detach_Orders));
- }
-
- [Column(Storage="_CustomerID", DbType="NChar(5) NOT NULL", CanBeNull=false, IsPrimaryKey=true)]
- public string CustomerID
- {
- get
- {
- return this._CustomerID;
- }
- set
- {
- if ((this._CustomerID != value))
- {
- this.OnCustomerIDChanging(value);
- this.SendPropertyChanging();
- this._CustomerID = value;
- this.SendPropertyChanged("CustomerID");
- this.OnCustomerIDChanged();
- }
- }
- }
-
- [Column(Storage="_CompanyName", DbType="NVarChar(40) NOT NULL", CanBeNull=false)]
- public string CompanyName
- {
- get
- {
- return this._CompanyName;
- }
- set
- {
- if ((this._CompanyName != value))
- {
- this.OnCompanyNameChanging(value);
- this.SendPropertyChanging();
- this._CompanyName = value;
- this.SendPropertyChanged("CompanyName");
- this.OnCompanyNameChanged();
- }
- }
- }
-
- [Column(Storage="_ContactName", DbType="NVarChar(30)")]
- public string ContactName
- {
- get
- {
- return this._ContactName;
- }
- set
- {
- if ((this._ContactName != value))
- {
- this.OnContactNameChanging(value);
- this.SendPropertyChanging();
- this._ContactName = value;
- this.SendPropertyChanged("ContactName");
- this.OnContactNameChanged();
- }
- }
- }
-
- [Column(Storage="_ContactTitle", DbType="NVarChar(30)")]
- public string ContactTitle
- {
- get
- {
- return this._ContactTitle;
- }
- set
- {
- if ((this._ContactTitle != value))
- {
- this.OnContactTitleChanging(value);
- this.SendPropertyChanging();
- this._ContactTitle = value;
- this.SendPropertyChanged("ContactTitle");
- this.OnContactTitleChanged();
- }
- }
- }
-
- [Column(Storage="_Address", DbType="NVarChar(60)")]
- public string Address
- {
- get
- {
- return this._Address;
- }
- set
- {
- if ((this._Address != value))
- {
- this.OnAddressChanging(value);
- this.SendPropertyChanging();
- this._Address = value;
- this.SendPropertyChanged("Address");
- this.OnAddressChanged();
- }
- }
- }
-
- [Column(Storage="_City", DbType="NVarChar(15)")]
- public string City
- {
- get
- {
- return this._City;
- }
- set
- {
- if ((this._City != value))
- {
- this.OnCityChanging(value);
- this.SendPropertyChanging();
- this._City = value;
- this.SendPropertyChanged("City");
- this.OnCityChanged();
- }
- }
- }
-
- [Column(Storage="_Region", DbType="NVarChar(15)")]
- public string Region
- {
- get
- {
- return this._Region;
- }
- set
- {
- if ((this._Region != value))
- {
- this.OnRegionChanging(value);
- this.SendPropertyChanging();
- this._Region = value;
- this.SendPropertyChanged("Region");
- this.OnRegionChanged();
- }
- }
- }
-
- [Column(Storage="_PostalCode", DbType="NVarChar(10)")]
- public string PostalCode
- {
- get
- {
- return this._PostalCode;
- }
- set
- {
- if ((this._PostalCode != value))
- {
- this.OnPostalCodeChanging(value);
- this.SendPropertyChanging();
- this._PostalCode = value;
- this.SendPropertyChanged("PostalCode");
- this.OnPostalCodeChanged();
- }
- }
- }
-
- [Column(Storage="_Country", DbType="NVarChar(15)")]
- public string Country
- {
- get
- {
- return this._Country;
- }
- set
- {
- if ((this._Country != value))
- {
- this.OnCountryChanging(value);
- this.SendPropertyChanging();
- this._Country = value;
- this.SendPropertyChanged("Country");
- this.OnCountryChanged();
- }
- }
- }
-
- [Column(Storage="_Phone", DbType="NVarChar(24)")]
- public string Phone
- {
- get
- {
- return this._Phone;
- }
- set
- {
- if ((this._Phone != value))
- {
- this.OnPhoneChanging(value);
- this.SendPropertyChanging();
- this._Phone = value;
- this.SendPropertyChanged("Phone");
- this.OnPhoneChanged();
- }
- }
- }
-
- [Column(Storage="_Fax", DbType="NVarChar(24)")]
- public string Fax
- {
- get
- {
- return this._Fax;
- }
- set
- {
- if ((this._Fax != value))
- {
- this.OnFaxChanging(value);
- this.SendPropertyChanging();
- this._Fax = value;
- this.SendPropertyChanged("Fax");
- this.OnFaxChanged();
- }
- }
- }
-
- [Association(Name="FK_CustomerCustomerDemo_Customers", Storage="_CustomerCustomerDemos", OtherKey="CustomerID", DeleteRule="NO ACTION")]
- public EntitySet CustomerCustomerDemos
- {
- get
- {
- return this._CustomerCustomerDemos;
- }
- set
- {
- this._CustomerCustomerDemos.Assign(value);
- }
- }
-
- [Association(Name="FK_Orders_Customers", Storage="_Orders", OtherKey="CustomerID", DeleteRule="NO ACTION")]
- public EntitySet Orders
- {
- get
- {
- return this._Orders;
- }
- set
- {
- this._Orders.Assign(value);
- }
- }
-
- public event PropertyChangingEventHandler PropertyChanging;
-
- public event PropertyChangedEventHandler PropertyChanged;
-
- protected virtual void SendPropertyChanging()
- {
- if ((this.PropertyChanging != null))
- {
- this.PropertyChanging(this, emptyChangingEventArgs);
- }
- }
-
- protected virtual void SendPropertyChanged(String propertyName)
- {
- if ((this.PropertyChanged != null))
- {
- this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
- }
- }
-
- private void attach_CustomerCustomerDemos(CustomerCustomerDemo entity)
- {
- this.SendPropertyChanging();
- entity.Customer = this;
- this.SendPropertyChanged("CustomerCustomerDemos");
- }
-
- private void detach_CustomerCustomerDemos(CustomerCustomerDemo entity)
- {
- this.SendPropertyChanging();
- entity.Customer = null;
- this.SendPropertyChanged("CustomerCustomerDemos");
- }
-
- private void attach_Orders(Order entity)
- {
- this.SendPropertyChanging();
- entity.Customer = this;
- this.SendPropertyChanged("Orders");
- }
-
- private void detach_Orders(Order entity)
- {
- this.SendPropertyChanging();
- entity.Customer = null;
- this.SendPropertyChanged("Orders");
- }
-}
-
-[Table(Name="dbo.Employees")]
-public partial class Employee : INotifyPropertyChanging, INotifyPropertyChanged
-{
-
- private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
-
- private int _EmployeeID;
-
- private string _LastName;
-
- private string _FirstName;
-
- private string _Title;
-
- private string _TitleOfCourtesy;
-
- private System.Nullable _BirthDate;
-
- private System.Nullable _HireDate;
-
- private string _Address;
-
- private string _City;
-
- private string _Region;
-
- private string _PostalCode;
-
- private string _Country;
-
- private string _HomePhone;
-
- private string _Extension;
-
- private System.Data.Linq.Binary _Photo;
-
- private string _Notes;
-
- private System.Nullable _ReportsTo;
-
- private string _PhotoPath;
-
- private EntityRef _ReportsToEmployee;
-
- private EntitySet _Employees;
-
- private EntitySet _EmployeeTerritories;
-
- private EntitySet _Orders;
-
- #region Extensibility Method Definitions
- partial void OnLoaded();
- partial void OnValidate();
- partial void OnCreated();
- partial void OnEmployeeIDChanging(int value);
- partial void OnEmployeeIDChanged();
- partial void OnLastNameChanging(string value);
- partial void OnLastNameChanged();
- partial void OnFirstNameChanging(string value);
- partial void OnFirstNameChanged();
- partial void OnTitleChanging(string value);
- partial void OnTitleChanged();
- partial void OnTitleOfCourtesyChanging(string value);
- partial void OnTitleOfCourtesyChanged();
- partial void OnBirthDateChanging(System.Nullable value);
- partial void OnBirthDateChanged();
- partial void OnHireDateChanging(System.Nullable value);
- partial void OnHireDateChanged();
- partial void OnAddressChanging(string value);
- partial void OnAddressChanged();
- partial void OnCityChanging(string value);
- partial void OnCityChanged();
- partial void OnRegionChanging(string value);
- partial void OnRegionChanged();
- partial void OnPostalCodeChanging(string value);
- partial void OnPostalCodeChanged();
- partial void OnCountryChanging(string value);
- partial void OnCountryChanged();
- partial void OnHomePhoneChanging(string value);
- partial void OnHomePhoneChanged();
- partial void OnExtensionChanging(string value);
- partial void OnExtensionChanged();
- partial void OnPhotoChanging(System.Data.Linq.Binary value);
- partial void OnPhotoChanged();
- partial void OnNotesChanging(string value);
- partial void OnNotesChanged();
- partial void OnReportsToChanging(System.Nullable value);
- partial void OnReportsToChanged();
- partial void OnPhotoPathChanging(string value);
- partial void OnPhotoPathChanged();
- #endregion
-
- public Employee()
- {
- OnCreated();
- this._ReportsToEmployee = default(EntityRef);
- this._Employees = new EntitySet(new Action(this.attach_Employees), new Action(this.detach_Employees));
- this._EmployeeTerritories = new EntitySet(new Action(this.attach_EmployeeTerritories), new Action(this.detach_EmployeeTerritories));
- this._Orders = new EntitySet(new Action(this.attach_Orders), new Action(this.detach_Orders));
- }
-
- [Column(Storage="_EmployeeID", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
- public int EmployeeID
- {
- get
- {
- return this._EmployeeID;
- }
- set
- {
- if ((this._EmployeeID != value))
- {
- this.OnEmployeeIDChanging(value);
- this.SendPropertyChanging();
- this._EmployeeID = value;
- this.SendPropertyChanged("EmployeeID");
- this.OnEmployeeIDChanged();
- }
- }
- }
-
- [Column(Storage="_LastName", DbType="NVarChar(20) NOT NULL", CanBeNull=false)]
- public string LastName
- {
- get
- {
- return this._LastName;
- }
- set
- {
- if ((this._LastName != value))
- {
- this.OnLastNameChanging(value);
- this.SendPropertyChanging();
- this._LastName = value;
- this.SendPropertyChanged("LastName");
- this.OnLastNameChanged();
- }
- }
- }
-
- [Column(Storage="_FirstName", DbType="NVarChar(10) NOT NULL", CanBeNull=false)]
- public string FirstName
- {
- get
- {
- return this._FirstName;
- }
- set
- {
- if ((this._FirstName != value))
- {
- this.OnFirstNameChanging(value);
- this.SendPropertyChanging();
- this._FirstName = value;
- this.SendPropertyChanged("FirstName");
- this.OnFirstNameChanged();
- }
- }
- }
-
- [Column(Storage="_Title", DbType="NVarChar(30)")]
- public string Title
- {
- get
- {
- return this._Title;
- }
- set
- {
- if ((this._Title != value))
- {
- this.OnTitleChanging(value);
- this.SendPropertyChanging();
- this._Title = value;
- this.SendPropertyChanged("Title");
- this.OnTitleChanged();
- }
- }
- }
-
- [Column(Storage="_TitleOfCourtesy", DbType="NVarChar(25)")]
- public string TitleOfCourtesy
- {
- get
- {
- return this._TitleOfCourtesy;
- }
- set
- {
- if ((this._TitleOfCourtesy != value))
- {
- this.OnTitleOfCourtesyChanging(value);
- this.SendPropertyChanging();
- this._TitleOfCourtesy = value;
- this.SendPropertyChanged("TitleOfCourtesy");
- this.OnTitleOfCourtesyChanged();
- }
- }
- }
-
- [Column(Storage="_BirthDate", DbType="DateTime")]
- public System.Nullable BirthDate
- {
- get
- {
- return this._BirthDate;
- }
- set
- {
- if ((this._BirthDate != value))
- {
- this.OnBirthDateChanging(value);
- this.SendPropertyChanging();
- this._BirthDate = value;
- this.SendPropertyChanged("BirthDate");
- this.OnBirthDateChanged();
- }
- }
- }
-
- [Column(Storage="_HireDate", DbType="DateTime")]
- public System.Nullable HireDate
- {
- get
- {
- return this._HireDate;
- }
- set
- {
- if ((this._HireDate != value))
- {
- this.OnHireDateChanging(value);
- this.SendPropertyChanging();
- this._HireDate = value;
- this.SendPropertyChanged("HireDate");
- this.OnHireDateChanged();
- }
- }
- }
-
- [Column(Storage="_Address", DbType="NVarChar(60)")]
- public string Address
- {
- get
- {
- return this._Address;
- }
- set
- {
- if ((this._Address != value))
- {
- this.OnAddressChanging(value);
- this.SendPropertyChanging();
- this._Address = value;
- this.SendPropertyChanged("Address");
- this.OnAddressChanged();
- }
- }
- }
-
- [Column(Storage="_City", DbType="NVarChar(15)")]
- public string City
- {
- get
- {
- return this._City;
- }
- set
- {
- if ((this._City != value))
- {
- this.OnCityChanging(value);
- this.SendPropertyChanging();
- this._City = value;
- this.SendPropertyChanged("City");
- this.OnCityChanged();
- }
- }
- }
-
- [Column(Storage="_Region", DbType="NVarChar(15)")]
- public string Region
- {
- get
- {
- return this._Region;
- }
- set
- {
- if ((this._Region != value))
- {
- this.OnRegionChanging(value);
- this.SendPropertyChanging();
- this._Region = value;
- this.SendPropertyChanged("Region");
- this.OnRegionChanged();
- }
- }
- }
-
- [Column(Storage="_PostalCode", DbType="NVarChar(10)")]
- public string PostalCode
- {
- get
- {
- return this._PostalCode;
- }
- set
- {
- if ((this._PostalCode != value))
- {
- this.OnPostalCodeChanging(value);
- this.SendPropertyChanging();
- this._PostalCode = value;
- this.SendPropertyChanged("PostalCode");
- this.OnPostalCodeChanged();
- }
- }
- }
-
- [Column(Storage="_Country", DbType="NVarChar(15)")]
- public string Country
- {
- get
- {
- return this._Country;
- }
- set
- {
- if ((this._Country != value))
- {
- this.OnCountryChanging(value);
- this.SendPropertyChanging();
- this._Country = value;
- this.SendPropertyChanged("Country");
- this.OnCountryChanged();
- }
- }
- }
-
- [Column(Storage="_HomePhone", DbType="NVarChar(24)")]
- public string HomePhone
- {
- get
- {
- return this._HomePhone;
- }
- set
- {
- if ((this._HomePhone != value))
- {
- this.OnHomePhoneChanging(value);
- this.SendPropertyChanging();
- this._HomePhone = value;
- this.SendPropertyChanged("HomePhone");
- this.OnHomePhoneChanged();
- }
- }
- }
-
- [Column(Storage="_Extension", DbType="NVarChar(4)")]
- public string Extension
- {
- get
- {
- return this._Extension;
- }
- set
- {
- if ((this._Extension != value))
- {
- this.OnExtensionChanging(value);
- this.SendPropertyChanging();
- this._Extension = value;
- this.SendPropertyChanged("Extension");
- this.OnExtensionChanged();
- }
- }
- }
-
- [Column(Storage="_Photo", DbType="Image", CanBeNull=true, UpdateCheck=UpdateCheck.Never)]
- public System.Data.Linq.Binary Photo
- {
- get
- {
- return this._Photo;
- }
- set
- {
- if ((this._Photo != value))
- {
- this.OnPhotoChanging(value);
- this.SendPropertyChanging();
- this._Photo = value;
- this.SendPropertyChanged("Photo");
- this.OnPhotoChanged();
- }
- }
- }
-
- [Column(Storage="_Notes", DbType="NText", UpdateCheck=UpdateCheck.Never)]
- public string Notes
- {
- get
- {
- return this._Notes;
- }
- set
- {
- if ((this._Notes != value))
- {
- this.OnNotesChanging(value);
- this.SendPropertyChanging();
- this._Notes = value;
- this.SendPropertyChanged("Notes");
- this.OnNotesChanged();
- }
- }
- }
-
- [Column(Storage="_ReportsTo", DbType="Int")]
- public System.Nullable ReportsTo
- {
- get
- {
- return this._ReportsTo;
- }
- set
- {
- if ((this._ReportsTo != value))
- {
- if (this._ReportsToEmployee.HasLoadedOrAssignedValue)
- {
- throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
- }
- this.OnReportsToChanging(value);
- this.SendPropertyChanging();
- this._ReportsTo = value;
- this.SendPropertyChanged("ReportsTo");
- this.OnReportsToChanged();
- }
- }
- }
-
- [Column(Storage="_PhotoPath", DbType="NVarChar(255)")]
- public string PhotoPath
- {
- get
- {
- return this._PhotoPath;
- }
- set
- {
- if ((this._PhotoPath != value))
- {
- this.OnPhotoPathChanging(value);
- this.SendPropertyChanging();
- this._PhotoPath = value;
- this.SendPropertyChanged("PhotoPath");
- this.OnPhotoPathChanged();
- }
- }
- }
-
- [Association(Name="FK_Employees_Employees", Storage="_ReportsToEmployee", ThisKey="ReportsTo", IsForeignKey=true)]
- public Employee ReportsToEmployee
- {
- get
- {
- return this._ReportsToEmployee.Entity;
- }
- set
- {
- Employee previousValue = this._ReportsToEmployee.Entity;
- if (((previousValue != value)
- || (!this._ReportsToEmployee.HasLoadedOrAssignedValue )))
- {
- this.SendPropertyChanging();
- if ((previousValue != null))
- {
- this._ReportsToEmployee.Entity = null;
- previousValue.Employees.Remove(this);
- }
- this._ReportsToEmployee.Entity = value;
- if ((value != null))
- {
- value.Employees.Add(this);
- this._ReportsTo = value.EmployeeID;
- }
- else
- {
- this._ReportsTo = default(Nullable);
- }
- this.SendPropertyChanged("ReportsToEmployee");
- }
- }
- }
-
- [Association(Name="FK_Employees_Employees", Storage="_Employees", OtherKey="ReportsTo", DeleteRule="NO ACTION")]
- public EntitySet Employees
- {
- get
- {
- return this._Employees;
- }
- set
- {
- this._Employees.Assign(value);
- }
- }
-
- [Association(Name="FK_EmployeeTerritories_Employees", Storage="_EmployeeTerritories", OtherKey="EmployeeID", DeleteRule="NO ACTION")]
- public EntitySet EmployeeTerritories
- {
- get
- {
- return this._EmployeeTerritories;
- }
- set
- {
- this._EmployeeTerritories.Assign(value);
- }
- }
-
- [Association(Name="FK_Orders_Employees", Storage="_Orders", OtherKey="EmployeeID", DeleteRule="NO ACTION")]
- public EntitySet Orders
- {
- get
- {
- return this._Orders;
- }
- set
- {
- this._Orders.Assign(value);
- }
- }
-
- public event PropertyChangingEventHandler PropertyChanging;
-
- public event PropertyChangedEventHandler PropertyChanged;
-
- protected virtual void SendPropertyChanging()
- {
- if ((this.PropertyChanging != null))
- {
- this.PropertyChanging(this, emptyChangingEventArgs);
- }
- }
-
- protected virtual void SendPropertyChanged(String propertyName)
- {
- if ((this.PropertyChanged != null))
- {
- this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
- }
- }
-
- private void attach_Employees(Employee entity)
- {
- this.SendPropertyChanging();
- entity.ReportsToEmployee = this;
- this.SendPropertyChanged("Employees");
- }
-
- private void detach_Employees(Employee entity)
- {
- this.SendPropertyChanging();
- entity.ReportsToEmployee = null;
- this.SendPropertyChanged("Employees");
- }
-
- private void attach_EmployeeTerritories(EmployeeTerritory entity)
- {
- this.SendPropertyChanging();
- entity.Employee = this;
- this.SendPropertyChanged("EmployeeTerritories");
- }
-
- private void detach_EmployeeTerritories(EmployeeTerritory entity)
- {
- this.SendPropertyChanging();
- entity.Employee = null;
- this.SendPropertyChanged("EmployeeTerritories");
- }
-
- private void attach_Orders(Order entity)
- {
- this.SendPropertyChanging();
- entity.Employee = this;
- this.SendPropertyChanged("Orders");
- }
-
- private void detach_Orders(Order entity)
- {
- this.SendPropertyChanging();
- entity.Employee = null;
- this.SendPropertyChanged("Orders");
- }
-}
-
-[Table(Name="dbo.EmployeeTerritories")]
-public partial class EmployeeTerritory : INotifyPropertyChanging, INotifyPropertyChanged
-{
-
- private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
-
- private int _EmployeeID;
-
- private string _TerritoryID;
-
- private EntityRef _Employee;
-
- private EntityRef _Territory;
-
- #region Extensibility Method Definitions
- partial void OnLoaded();
- partial void OnValidate();
- partial void OnCreated();
- partial void OnEmployeeIDChanging(int value);
- partial void OnEmployeeIDChanged();
- partial void OnTerritoryIDChanging(string value);
- partial void OnTerritoryIDChanged();
- #endregion
-
- public EmployeeTerritory()
- {
- OnCreated();
- this._Employee = default(EntityRef);
- this._Territory = default(EntityRef);
- }
-
- [Column(Storage="_EmployeeID", DbType="Int NOT NULL", IsPrimaryKey=true)]
- public int EmployeeID
- {
- get
- {
- return this._EmployeeID;
- }
- set
- {
- if ((this._EmployeeID != value))
- {
- if (this._Employee.HasLoadedOrAssignedValue)
- {
- throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
- }
- this.OnEmployeeIDChanging(value);
- this.SendPropertyChanging();
- this._EmployeeID = value;
- this.SendPropertyChanged("EmployeeID");
- this.OnEmployeeIDChanged();
- }
- }
- }
-
- [Column(Storage="_TerritoryID", DbType="NVarChar(20) NOT NULL", CanBeNull=false, IsPrimaryKey=true)]
- public string TerritoryID
- {
- get
- {
- return this._TerritoryID;
- }
- set
- {
- if ((this._TerritoryID != value))
- {
- if (this._Territory.HasLoadedOrAssignedValue)
- {
- throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
- }
- this.OnTerritoryIDChanging(value);
- this.SendPropertyChanging();
- this._TerritoryID = value;
- this.SendPropertyChanged("TerritoryID");
- this.OnTerritoryIDChanged();
- }
- }
- }
-
- [Association(Name="FK_EmployeeTerritories_Employees", Storage="_Employee", ThisKey="EmployeeID", IsForeignKey=true)]
- public Employee Employee
- {
- get
- {
- return this._Employee.Entity;
- }
- set
- {
- Employee previousValue = this._Employee.Entity;
- if (((previousValue != value)
- || (!this._Employee.HasLoadedOrAssignedValue )))
- {
- this.SendPropertyChanging();
- if ((previousValue != null))
- {
- this._Employee.Entity = null;
- previousValue.EmployeeTerritories.Remove(this);
- }
- this._Employee.Entity = value;
- if ((value != null))
- {
- value.EmployeeTerritories.Add(this);
- this._EmployeeID = value.EmployeeID;
- }
- else
- {
- this._EmployeeID = default(int);
- }
- this.SendPropertyChanged("Employee");
- }
- }
- }
-
- [Association(Name="FK_EmployeeTerritories_Territories", Storage="_Territory", ThisKey="TerritoryID", IsForeignKey=true)]
- public Territory Territory
- {
- get
- {
- return this._Territory.Entity;
- }
- set
- {
- Territory previousValue = this._Territory.Entity;
- if (((previousValue != value)
- || (!this._Territory.HasLoadedOrAssignedValue )))
- {
- this.SendPropertyChanging();
- if ((previousValue != null))
- {
- this._Territory.Entity = null;
- previousValue.EmployeeTerritories.Remove(this);
- }
- this._Territory.Entity = value;
- if ((value != null))
- {
- value.EmployeeTerritories.Add(this);
- this._TerritoryID = value.TerritoryID;
- }
- else
- {
- this._TerritoryID = default(string);
- }
- this.SendPropertyChanged("Territory");
- }
- }
- }
-
- public event PropertyChangingEventHandler PropertyChanging;
-
- public event PropertyChangedEventHandler PropertyChanged;
-
- protected virtual void SendPropertyChanging()
- {
- if ((this.PropertyChanging != null))
- {
- this.PropertyChanging(this, emptyChangingEventArgs);
- }
- }
-
- protected virtual void SendPropertyChanged(String propertyName)
- {
- if ((this.PropertyChanged != null))
- {
- this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
- }
- }
-}
-
-[Table(Name="dbo.Order Details")]
-public partial class OrderDetail : INotifyPropertyChanging, INotifyPropertyChanged
-{
-
- private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
-
- private int _OrderID;
-
- private int _ProductID;
-
- private decimal _UnitPrice;
-
- private short _Quantity;
-
- private float _Discount;
-
- private EntityRef _Order;
-
- private EntityRef _Product;
-
- #region Extensibility Method Definitions
- partial void OnLoaded();
- partial void OnValidate();
- partial void OnCreated();
- partial void OnOrderIDChanging(int value);
- partial void OnOrderIDChanged();
- partial void OnProductIDChanging(int value);
- partial void OnProductIDChanged();
- partial void OnUnitPriceChanging(decimal value);
- partial void OnUnitPriceChanged();
- partial void OnQuantityChanging(short value);
- partial void OnQuantityChanged();
- partial void OnDiscountChanging(float value);
- partial void OnDiscountChanged();
- #endregion
-
- public OrderDetail()
- {
- OnCreated();
- this._Order = default(EntityRef);
- this._Product = default(EntityRef);
- }
-
- [Column(Storage="_OrderID", DbType="Int NOT NULL", IsPrimaryKey=true)]
- public int OrderID
- {
- get
- {
- return this._OrderID;
- }
- set
- {
- if ((this._OrderID != value))
- {
- if (this._Order.HasLoadedOrAssignedValue)
- {
- throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
- }
- this.OnOrderIDChanging(value);
- this.SendPropertyChanging();
- this._OrderID = value;
- this.SendPropertyChanged("OrderID");
- this.OnOrderIDChanged();
- }
- }
- }
-
- [Column(Storage="_ProductID", DbType="Int NOT NULL", IsPrimaryKey=true)]
- public int ProductID
- {
- get
- {
- return this._ProductID;
- }
- set
- {
- if ((this._ProductID != value))
- {
- if (this._Product.HasLoadedOrAssignedValue)
- {
- throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
- }
- this.OnProductIDChanging(value);
- this.SendPropertyChanging();
- this._ProductID = value;
- this.SendPropertyChanged("ProductID");
- this.OnProductIDChanged();
- }
- }
- }
-
- [Column(Storage="_UnitPrice", DbType="Money NOT NULL")]
- public decimal UnitPrice
- {
- get
- {
- return this._UnitPrice;
- }
- set
- {
- if ((this._UnitPrice != value))
- {
- this.OnUnitPriceChanging(value);
- this.SendPropertyChanging();
- this._UnitPrice = value;
- this.SendPropertyChanged("UnitPrice");
- this.OnUnitPriceChanged();
- }
- }
- }
-
- [Column(Storage="_Quantity", DbType="SmallInt NOT NULL")]
- public short Quantity
- {
- get
- {
- return this._Quantity;
- }
- set
- {
- if ((this._Quantity != value))
- {
- this.OnQuantityChanging(value);
- this.SendPropertyChanging();
- this._Quantity = value;
- this.SendPropertyChanged("Quantity");
- this.OnQuantityChanged();
- }
- }
- }
-
- [Column(Storage="_Discount", DbType="Real NOT NULL")]
- public float Discount
- {
- get
- {
- return this._Discount;
- }
- set
- {
- if ((this._Discount != value))
- {
- this.OnDiscountChanging(value);
- this.SendPropertyChanging();
- this._Discount = value;
- this.SendPropertyChanged("Discount");
- this.OnDiscountChanged();
- }
- }
- }
-
- [Association(Name="FK_Order_Details_Orders", Storage="_Order", ThisKey="OrderID", IsForeignKey=true)]
- public Order Order
- {
- get
- {
- return this._Order.Entity;
- }
- set
- {
- Order previousValue = this._Order.Entity;
- if (((previousValue != value)
- || (!this._Order.HasLoadedOrAssignedValue )))
- {
- this.SendPropertyChanging();
- if ((previousValue != null))
- {
- this._Order.Entity = null;
- previousValue.OrderDetails.Remove(this);
- }
- this._Order.Entity = value;
- if ((value != null))
- {
- value.OrderDetails.Add(this);
- this._OrderID = value.OrderID;
- }
- else
- {
- this._OrderID = default(int);
- }
- this.SendPropertyChanged("Order");
- }
- }
- }
-
- [Association(Name="FK_Order_Details_Products", Storage="_Product", ThisKey="ProductID", IsForeignKey=true)]
- public Product Product
- {
- get
- {
- return this._Product.Entity;
- }
- set
- {
- Product previousValue = this._Product.Entity;
- if (((previousValue != value)
- || (!this._Product.HasLoadedOrAssignedValue )))
- {
- this.SendPropertyChanging();
- if ((previousValue != null))
- {
- this._Product.Entity = null;
- previousValue.OrderDetails.Remove(this);
- }
- this._Product.Entity = value;
- if ((value != null))
- {
- value.OrderDetails.Add(this);
- this._ProductID = value.ProductID;
- }
- else
- {
- this._ProductID = default(int);
- }
- this.SendPropertyChanged("Product");
- }
- }
- }
-
- public event PropertyChangingEventHandler PropertyChanging;
-
- public event PropertyChangedEventHandler PropertyChanged;
-
- protected virtual void SendPropertyChanging()
- {
- if ((this.PropertyChanging != null))
- {
- this.PropertyChanging(this, emptyChangingEventArgs);
- }
- }
-
- protected virtual void SendPropertyChanged(String propertyName)
- {
- if ((this.PropertyChanged != null))
- {
- this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
- }
- }
-}
-
-[Table(Name="dbo.Orders")]
-public partial class Order : INotifyPropertyChanging, INotifyPropertyChanged
-{
-
- private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
-
- private int _OrderID;
-
- private string _CustomerID;
-
- private System.Nullable _EmployeeID;
-
- private System.Nullable _OrderDate;
-
- private System.Nullable _RequiredDate;
-
- private System.Nullable _ShippedDate;
-
- private System.Nullable _ShipVia;
-
- private System.Nullable _Freight;
-
- private string _ShipName;
-
- private string _ShipAddress;
-
- private string _ShipCity;
-
- private string _ShipRegion;
-
- private string _ShipPostalCode;
-
- private string _ShipCountry;
-
- private EntitySet _OrderDetails;
-
- // private EntityRef _Customer; ***
-
- private EntityRef _Employee;
-
- private EntityRef _Shipper;
-
- #region Extensibility Method Definitions
- partial void OnLoaded();
- partial void OnValidate();
- partial void OnCreated();
- partial void OnOrderIDChanging(int value);
- partial void OnOrderIDChanged();
- partial void OnCustomerIDChanging(string value);
- partial void OnCustomerIDChanged();
- partial void OnEmployeeIDChanging(System.Nullable value);
- partial void OnEmployeeIDChanged();
- partial void OnOrderDateChanging(System.Nullable value);
- partial void OnOrderDateChanged();
- partial void OnRequiredDateChanging(System.Nullable value);
- partial void OnRequiredDateChanged();
- partial void OnShippedDateChanging(System.Nullable value);
- partial void OnShippedDateChanged();
- partial void OnShipViaChanging(System.Nullable value);
- partial void OnShipViaChanged();
- partial void OnFreightChanging(System.Nullable value);
- partial void OnFreightChanged();
- partial void OnShipNameChanging(string value);
- partial void OnShipNameChanged();
- partial void OnShipAddressChanging(string value);
- partial void OnShipAddressChanged();
- partial void OnShipCityChanging(string value);
- partial void OnShipCityChanged();
- partial void OnShipRegionChanging(string value);
- partial void OnShipRegionChanged();
- partial void OnShipPostalCodeChanging(string value);
- partial void OnShipPostalCodeChanged();
- partial void OnShipCountryChanging(string value);
- partial void OnShipCountryChanged();
- #endregion
-
- public Order()
- {
- OnCreated();
- this._OrderDetails = new EntitySet(new Action(this.attach_OrderDetails), new Action(this.detach_OrderDetails));
- this._Customer = default(EntityRef);
- this._Employee = default(EntityRef);
- this._Shipper = default(EntityRef);
- }
-
- [Column(Storage="_OrderID", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
- public int OrderID
- {
- get
- {
- return this._OrderID;
- }
- set
- {
- if ((this._OrderID != value))
- {
- this.OnOrderIDChanging(value);
- this.SendPropertyChanging();
- this._OrderID = value;
- this.SendPropertyChanged("OrderID");
- this.OnOrderIDChanged();
- }
- }
- }
-
- [Column(Storage="_CustomerID", DbType="NChar(5)")]
- public string CustomerID
- {
- get
- {
- return this._CustomerID;
- }
- set
- {
- if ((this._CustomerID != value))
- {
- if (this._Customer.HasLoadedOrAssignedValue)
- {
- throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
- }
- this.OnCustomerIDChanging(value);
- this.SendPropertyChanging();
- this._CustomerID = value;
- this.SendPropertyChanged("CustomerID");
- this.OnCustomerIDChanged();
- }
- }
- }
-
- [Column(Storage="_EmployeeID", DbType="Int")]
- public System.Nullable EmployeeID
- {
- get
- {
- return this._EmployeeID;
- }
- set
- {
- if ((this._EmployeeID != value))
- {
- if (this._Employee.HasLoadedOrAssignedValue)
- {
- throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
- }
- this.OnEmployeeIDChanging(value);
- this.SendPropertyChanging();
- this._EmployeeID = value;
- this.SendPropertyChanged("EmployeeID");
- this.OnEmployeeIDChanged();
- }
- }
- }
-
- [Column(Storage="_OrderDate", DbType="DateTime")]
- public System.Nullable OrderDate
- {
- get
- {
- return this._OrderDate;
- }
- set
- {
- if ((this._OrderDate != value))
- {
- this.OnOrderDateChanging(value);
- this.SendPropertyChanging();
- this._OrderDate = value;
- this.SendPropertyChanged("OrderDate");
- this.OnOrderDateChanged();
- }
- }
- }
-
- [Column(Storage="_RequiredDate", DbType="DateTime")]
- public System.Nullable RequiredDate
- {
- get
- {
- return this._RequiredDate;
- }
- set
- {
- if ((this._RequiredDate != value))
- {
- this.OnRequiredDateChanging(value);
- this.SendPropertyChanging();
- this._RequiredDate = value;
- this.SendPropertyChanged("RequiredDate");
- this.OnRequiredDateChanged();
- }
- }
- }
-
- [Column(Storage="_ShippedDate", DbType="DateTime")]
- public System.Nullable ShippedDate
- {
- get
- {
- return this._ShippedDate;
- }
- set
- {
- if ((this._ShippedDate != value))
- {
- this.OnShippedDateChanging(value);
- this.SendPropertyChanging();
- this._ShippedDate = value;
- this.SendPropertyChanged("ShippedDate");
- this.OnShippedDateChanged();
- }
- }
- }
-
- [Column(Storage="_ShipVia", DbType="Int")]
- public System.Nullable ShipVia
- {
- get
- {
- return this._ShipVia;
- }
- set
- {
- if ((this._ShipVia != value))
- {
- if (this._Shipper.HasLoadedOrAssignedValue)
- {
- throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
- }
- this.OnShipViaChanging(value);
- this.SendPropertyChanging();
- this._ShipVia = value;
- this.SendPropertyChanged("ShipVia");
- this.OnShipViaChanged();
- }
- }
- }
-
- [Column(Storage="_Freight", DbType="Money")]
- public System.Nullable Freight
- {
- get
- {
- return this._Freight;
- }
- set
- {
- if ((this._Freight != value))
- {
- this.OnFreightChanging(value);
- this.SendPropertyChanging();
- this._Freight = value;
- this.SendPropertyChanged("Freight");
- this.OnFreightChanged();
- }
- }
- }
-
- [Column(Storage="_ShipName", DbType="NVarChar(40)")]
- public string ShipName
- {
- get
- {
- return this._ShipName;
- }
- set
- {
- if ((this._ShipName != value))
- {
- this.OnShipNameChanging(value);
- this.SendPropertyChanging();
- this._ShipName = value;
- this.SendPropertyChanged("ShipName");
- this.OnShipNameChanged();
- }
- }
- }
-
- [Column(Storage="_ShipAddress", DbType="NVarChar(60)")]
- public string ShipAddress
- {
- get
- {
- return this._ShipAddress;
- }
- set
- {
- if ((this._ShipAddress != value))
- {
- this.OnShipAddressChanging(value);
- this.SendPropertyChanging();
- this._ShipAddress = value;
- this.SendPropertyChanged("ShipAddress");
- this.OnShipAddressChanged();
- }
- }
- }
-
- [Column(Storage="_ShipCity", DbType="NVarChar(15)")]
- public string ShipCity
- {
- get
- {
- return this._ShipCity;
- }
- set
- {
- if ((this._ShipCity != value))
- {
- this.OnShipCityChanging(value);
- this.SendPropertyChanging();
- this._ShipCity = value;
- this.SendPropertyChanged("ShipCity");
- this.OnShipCityChanged();
- }
- }
- }
-
- [Column(Storage="_ShipRegion", DbType="NVarChar(15)")]
- public string ShipRegion
- {
- get
- {
- return this._ShipRegion;
- }
- set
- {
- if ((this._ShipRegion != value))
- {
- this.OnShipRegionChanging(value);
- this.SendPropertyChanging();
- this._ShipRegion = value;
- this.SendPropertyChanged("ShipRegion");
- this.OnShipRegionChanged();
- }
- }
- }
-
- [Column(Storage="_ShipPostalCode", DbType="NVarChar(10)")]
- public string ShipPostalCode
- {
- get
- {
- return this._ShipPostalCode;
- }
- set
- {
- if ((this._ShipPostalCode != value))
- {
- this.OnShipPostalCodeChanging(value);
- this.SendPropertyChanging();
- this._ShipPostalCode = value;
- this.SendPropertyChanged("ShipPostalCode");
- this.OnShipPostalCodeChanged();
- }
- }
- }
-
- [Column(Storage="_ShipCountry", DbType="NVarChar(15)")]
- public string ShipCountry
- {
- get
- {
- return this._ShipCountry;
- }
- set
- {
- if ((this._ShipCountry != value))
- {
- this.OnShipCountryChanging(value);
- this.SendPropertyChanging();
- this._ShipCountry = value;
- this.SendPropertyChanged("ShipCountry");
- this.OnShipCountryChanged();
- }
- }
- }
-
- [Association(Name="FK_Order_Details_Orders", Storage="_OrderDetails", OtherKey="OrderID", DeleteRule="NO ACTION")]
- public EntitySet OrderDetails
- {
- get
- {
- return this._OrderDetails;
- }
- set
- {
- this._OrderDetails.Assign(value);
- }
- }
-
- //
- private EntityRef _Customer;
- // ...
- [Association(Name="FK_Orders_Customers", Storage="_Customer", ThisKey="CustomerID", IsForeignKey=true)]
- public Customer Customer
- {
- get
- {
- return this._Customer.Entity;
- }
- set
- {
- Customer previousValue = this._Customer.Entity;
- if (((previousValue != value)
- || (!this._Customer.HasLoadedOrAssignedValue )))
- {
- this.SendPropertyChanging();
- if ((previousValue != null))
- {
- this._Customer.Entity = null;
- previousValue.Orders.Remove(this);
- }
- this._Customer.Entity = value;
- if ((value != null))
- {
- value.Orders.Add(this);
- this._CustomerID = value.CustomerID;
- }
- else
- {
- this._CustomerID = default(string);
- }
- this.SendPropertyChanged("Customer");
- }
- }
- }
- //
-
- [Association(Name="FK_Orders_Employees", Storage="_Employee", ThisKey="EmployeeID", IsForeignKey=true)]
- public Employee Employee
- {
- get
- {
- return this._Employee.Entity;
- }
- set
- {
- Employee previousValue = this._Employee.Entity;
- if (((previousValue != value)
- || (!this._Employee.HasLoadedOrAssignedValue )))
- {
- this.SendPropertyChanging();
- if ((previousValue != null))
- {
- this._Employee.Entity = null;
- previousValue.Orders.Remove(this);
- }
- this._Employee.Entity = value;
- if ((value != null))
- {
- value.Orders.Add(this);
- this._EmployeeID = value.EmployeeID;
- }
- else
- {
- this._EmployeeID = default(Nullable);
- }
- this.SendPropertyChanged("Employee");
- }
- }
- }
-
- [Association(Name="FK_Orders_Shippers", Storage="_Shipper", ThisKey="ShipVia", IsForeignKey=true)]
- public Shipper Shipper
- {
- get
- {
- return this._Shipper.Entity;
- }
- set
- {
- Shipper previousValue = this._Shipper.Entity;
- if (((previousValue != value)
- || (!this._Shipper.HasLoadedOrAssignedValue )))
- {
- this.SendPropertyChanging();
- if ((previousValue != null))
- {
- this._Shipper.Entity = null;
- previousValue.Orders.Remove(this);
- }
- this._Shipper.Entity = value;
- if ((value != null))
- {
- value.Orders.Add(this);
- this._ShipVia = value.ShipperID;
- }
- else
- {
- this._ShipVia = default(Nullable);
- }
- this.SendPropertyChanged("Shipper");
- }
- }
- }
-
- public event PropertyChangingEventHandler PropertyChanging;
-
- public event PropertyChangedEventHandler PropertyChanged;
-
- protected virtual void SendPropertyChanging()
- {
- if ((this.PropertyChanging != null))
- {
- this.PropertyChanging(this, emptyChangingEventArgs);
- }
- }
-
- protected virtual void SendPropertyChanged(String propertyName)
- {
- if ((this.PropertyChanged != null))
- {
- this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
- }
- }
-
- private void attach_OrderDetails(OrderDetail entity)
- {
- this.SendPropertyChanging();
- entity.Order = this;
- this.SendPropertyChanged("OrderDetails");
- }
-
- private void detach_OrderDetails(OrderDetail entity)
- {
- this.SendPropertyChanging();
- entity.Order = null;
- this.SendPropertyChanged("OrderDetails");
- }
-}
-
-[Table(Name="dbo.Products")]
-public partial class Product : INotifyPropertyChanging, INotifyPropertyChanged
-{
-
- private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
-
- private int _ProductID;
-
- private string _ProductName;
-
- private System.Nullable _SupplierID;
-
- private System.Nullable _CategoryID;
-
- private string _QuantityPerUnit;
-
- private System.Nullable _UnitPrice;
-
- private System.Nullable _UnitsInStock;
-
- private System.Nullable _UnitsOnOrder;
-
- private System.Nullable _ReorderLevel;
-
- private bool _Discontinued;
-
- private EntitySet _OrderDetails;
-
- private EntityRef _Category;
-
- private EntityRef _Supplier;
-
- #region Extensibility Method Definitions
- partial void OnLoaded();
- partial void OnValidate();
- partial void OnCreated();
- partial void OnProductIDChanging(int value);
- partial void OnProductIDChanged();
- partial void OnProductNameChanging(string value);
- partial void OnProductNameChanged();
- partial void OnSupplierIDChanging(System.Nullable value);
- partial void OnSupplierIDChanged();
- partial void OnCategoryIDChanging(System.Nullable value);
- partial void OnCategoryIDChanged();
- partial void OnQuantityPerUnitChanging(string value);
- partial void OnQuantityPerUnitChanged();
- partial void OnUnitPriceChanging(System.Nullable value);
- partial void OnUnitPriceChanged();
- partial void OnUnitsInStockChanging(System.Nullable value);
- partial void OnUnitsInStockChanged();
- partial void OnUnitsOnOrderChanging(System.Nullable value);
- partial void OnUnitsOnOrderChanged();
- partial void OnReorderLevelChanging(System.Nullable value);
- partial void OnReorderLevelChanged();
- partial void OnDiscontinuedChanging(bool value);
- partial void OnDiscontinuedChanged();
- #endregion
-
- public Product()
- {
- OnCreated();
- this._OrderDetails = new EntitySet(new Action(this.attach_OrderDetails), new Action(this.detach_OrderDetails));
- this._Category = default(EntityRef);
- this._Supplier = default(EntityRef);
- }
-
- [Column(Storage="_ProductID", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
- public int ProductID
- {
- get
- {
- return this._ProductID;
- }
- set
- {
- if ((this._ProductID != value))
- {
- this.OnProductIDChanging(value);
- this.SendPropertyChanging();
- this._ProductID = value;
- this.SendPropertyChanged("ProductID");
- this.OnProductIDChanged();
- }
- }
- }
-
- [Column(Storage="_ProductName", DbType="NVarChar(40) NOT NULL", CanBeNull=false)]
- public string ProductName
- {
- get
- {
- return this._ProductName;
- }
- set
- {
- if ((this._ProductName != value))
- {
- this.OnProductNameChanging(value);
- this.SendPropertyChanging();
- this._ProductName = value;
- this.SendPropertyChanged("ProductName");
- this.OnProductNameChanged();
- }
- }
- }
-
- [Column(Storage="_SupplierID", DbType="Int")]
- public System.Nullable SupplierID
- {
- get
- {
- return this._SupplierID;
- }
- set
- {
- if ((this._SupplierID != value))
- {
- if (this._Supplier.HasLoadedOrAssignedValue)
- {
- throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
- }
- this.OnSupplierIDChanging(value);
- this.SendPropertyChanging();
- this._SupplierID = value;
- this.SendPropertyChanged("SupplierID");
- this.OnSupplierIDChanged();
- }
- }
- }
-
- [Column(Storage="_CategoryID", DbType="Int")]
- public System.Nullable CategoryID
- {
- get
- {
- return this._CategoryID;
- }
- set
- {
- if ((this._CategoryID != value))
- {
- if (this._Category.HasLoadedOrAssignedValue)
- {
- throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
- }
- this.OnCategoryIDChanging(value);
- this.SendPropertyChanging();
- this._CategoryID = value;
- this.SendPropertyChanged("CategoryID");
- this.OnCategoryIDChanged();
- }
- }
- }
-
- [Column(Storage="_QuantityPerUnit", DbType="NVarChar(20)")]
- public string QuantityPerUnit
- {
- get
- {
- return this._QuantityPerUnit;
- }
- set
- {
- if ((this._QuantityPerUnit != value))
- {
- this.OnQuantityPerUnitChanging(value);
- this.SendPropertyChanging();
- this._QuantityPerUnit = value;
- this.SendPropertyChanged("QuantityPerUnit");
- this.OnQuantityPerUnitChanged();
- }
- }
- }
-
- [Column(Storage="_UnitPrice", DbType="Money")]
- public System.Nullable UnitPrice
- {
- get
- {
- return this._UnitPrice;
- }
- set
- {
- if ((this._UnitPrice != value))
- {
- this.OnUnitPriceChanging(value);
- this.SendPropertyChanging();
- this._UnitPrice = value;
- this.SendPropertyChanged("UnitPrice");
- this.OnUnitPriceChanged();
- }
- }
- }
-
- [Column(Storage="_UnitsInStock", DbType="SmallInt")]
- public System.Nullable UnitsInStock
- {
- get
- {
- return this._UnitsInStock;
- }
- set
- {
- if ((this._UnitsInStock != value))
- {
- this.OnUnitsInStockChanging(value);
- this.SendPropertyChanging();
- this._UnitsInStock = value;
- this.SendPropertyChanged("UnitsInStock");
- this.OnUnitsInStockChanged();
- }
- }
- }
-
- [Column(Storage="_UnitsOnOrder", DbType="SmallInt")]
- public System.Nullable UnitsOnOrder
- {
- get
- {
- return this._UnitsOnOrder;
- }
- set
- {
- if ((this._UnitsOnOrder != value))
- {
- this.OnUnitsOnOrderChanging(value);
- this.SendPropertyChanging();
- this._UnitsOnOrder = value;
- this.SendPropertyChanged("UnitsOnOrder");
- this.OnUnitsOnOrderChanged();
- }
- }
- }
-
- [Column(Storage="_ReorderLevel", DbType="SmallInt")]
- public System.Nullable ReorderLevel
- {
- get
- {
- return this._ReorderLevel;
- }
- set
- {
- if ((this._ReorderLevel != value))
- {
- this.OnReorderLevelChanging(value);
- this.SendPropertyChanging();
- this._ReorderLevel = value;
- this.SendPropertyChanged("ReorderLevel");
- this.OnReorderLevelChanged();
- }
- }
- }
-
- [Column(Storage="_Discontinued", DbType="Bit NOT NULL")]
- public bool Discontinued
- {
- get
- {
- return this._Discontinued;
- }
- set
- {
- if ((this._Discontinued != value))
- {
- this.OnDiscontinuedChanging(value);
- this.SendPropertyChanging();
- this._Discontinued = value;
- this.SendPropertyChanged("Discontinued");
- this.OnDiscontinuedChanged();
- }
- }
- }
-
- [Association(Name="FK_Order_Details_Products", Storage="_OrderDetails", OtherKey="ProductID", DeleteRule="NO ACTION")]
- public EntitySet OrderDetails
- {
- get
- {
- return this._OrderDetails;
- }
- set
- {
- this._OrderDetails.Assign(value);
- }
- }
-
- [Association(Name="FK_Products_Categories", Storage="_Category", ThisKey="CategoryID", IsForeignKey=true)]
- public Category Category
- {
- get
- {
- return this._Category.Entity;
- }
- set
- {
- Category previousValue = this._Category.Entity;
- if (((previousValue != value)
- || (!this._Category.HasLoadedOrAssignedValue )))
- {
- this.SendPropertyChanging();
- if ((previousValue != null))
- {
- this._Category.Entity = null;
- previousValue.Products.Remove(this);
- }
- this._Category.Entity = value;
- if ((value != null))
- {
- value.Products.Add(this);
- this._CategoryID = value.CategoryID;
- }
- else
- {
- this._CategoryID = default(Nullable);
- }
- this.SendPropertyChanged("Category");
- }
- }
- }
-
- [Association(Name="FK_Products_Suppliers", Storage="_Supplier", ThisKey="SupplierID", IsForeignKey=true)]
- public Supplier Supplier
- {
- get
- {
- return this._Supplier.Entity;
- }
- set
- {
- Supplier previousValue = this._Supplier.Entity;
- if (((previousValue != value)
- || (!this._Supplier.HasLoadedOrAssignedValue )))
- {
- this.SendPropertyChanging();
- if ((previousValue != null))
- {
- this._Supplier.Entity = null;
- previousValue.Products.Remove(this);
- }
- this._Supplier.Entity = value;
- if ((value != null))
- {
- value.Products.Add(this);
- this._SupplierID = value.SupplierID;
- }
- else
- {
- this._SupplierID = default(Nullable);
- }
- this.SendPropertyChanged("Supplier");
- }
- }
- }
-
- public event PropertyChangingEventHandler PropertyChanging;
-
- public event PropertyChangedEventHandler PropertyChanged;
-
- protected virtual void SendPropertyChanging()
- {
- if ((this.PropertyChanging != null))
- {
- this.PropertyChanging(this, emptyChangingEventArgs);
- }
- }
-
- protected virtual void SendPropertyChanged(String propertyName)
- {
- if ((this.PropertyChanged != null))
- {
- this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
- }
- }
-
- private void attach_OrderDetails(OrderDetail entity)
- {
- this.SendPropertyChanging();
- entity.Product = this;
- this.SendPropertyChanged("OrderDetails");
- }
-
- private void detach_OrderDetails(OrderDetail entity)
- {
- this.SendPropertyChanging();
- entity.Product = null;
- this.SendPropertyChanged("OrderDetails");
- }
-}
-
-[Table(Name="dbo.Region")]
-public partial class Region : INotifyPropertyChanging, INotifyPropertyChanged
-{
-
- private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
-
- private int _RegionID;
-
- private string _RegionDescription;
-
- private EntitySet _Territories;
-
- #region Extensibility Method Definitions
- partial void OnLoaded();
- partial void OnValidate();
- partial void OnCreated();
- partial void OnRegionIDChanging(int value);
- partial void OnRegionIDChanged();
- partial void OnRegionDescriptionChanging(string value);
- partial void OnRegionDescriptionChanged();
- #endregion
-
- public Region()
- {
- OnCreated();
- this._Territories = new EntitySet(new Action(this.attach_Territories), new Action(this.detach_Territories));
- }
-
- [Column(Storage="_RegionID", DbType="Int NOT NULL", IsPrimaryKey=true)]
- public int RegionID
- {
- get
- {
- return this._RegionID;
- }
- set
- {
- if ((this._RegionID != value))
- {
- this.OnRegionIDChanging(value);
- this.SendPropertyChanging();
- this._RegionID = value;
- this.SendPropertyChanged("RegionID");
- this.OnRegionIDChanged();
- }
- }
- }
-
- [Column(Storage="_RegionDescription", DbType="NChar(50) NOT NULL", CanBeNull=false)]
- public string RegionDescription
- {
- get
- {
- return this._RegionDescription;
- }
- set
- {
- if ((this._RegionDescription != value))
- {
- this.OnRegionDescriptionChanging(value);
- this.SendPropertyChanging();
- this._RegionDescription = value;
- this.SendPropertyChanged("RegionDescription");
- this.OnRegionDescriptionChanged();
- }
- }
- }
-
- [Association(Name="FK_Territories_Region", Storage="_Territories", OtherKey="RegionID", DeleteRule="NO ACTION")]
- public EntitySet Territories
- {
- get
- {
- return this._Territories;
- }
- set
- {
- this._Territories.Assign(value);
- }
- }
-
- public event PropertyChangingEventHandler PropertyChanging;
-
- public event PropertyChangedEventHandler PropertyChanged;
-
- protected virtual void SendPropertyChanging()
- {
- if ((this.PropertyChanging != null))
- {
- this.PropertyChanging(this, emptyChangingEventArgs);
- }
- }
-
- protected virtual void SendPropertyChanged(String propertyName)
- {
- if ((this.PropertyChanged != null))
- {
- this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
- }
- }
-
- private void attach_Territories(Territory entity)
- {
- this.SendPropertyChanging();
- entity.Region = this;
- this.SendPropertyChanged("Territories");
- }
-
- private void detach_Territories(Territory entity)
- {
- this.SendPropertyChanging();
- entity.Region = null;
- this.SendPropertyChanged("Territories");
- }
-}
-
-[Table(Name="dbo.Shippers")]
-public partial class Shipper : INotifyPropertyChanging, INotifyPropertyChanged
-{
-
- private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
-
- private int _ShipperID;
-
- private string _CompanyName;
-
- private string _Phone;
-
- private EntitySet _Orders;
-
- #region Extensibility Method Definitions
- partial void OnLoaded();
- partial void OnValidate();
- partial void OnCreated();
- partial void OnShipperIDChanging(int value);
- partial void OnShipperIDChanged();
- partial void OnCompanyNameChanging(string value);
- partial void OnCompanyNameChanged();
- partial void OnPhoneChanging(string value);
- partial void OnPhoneChanged();
- #endregion
-
- public Shipper()
- {
- OnCreated();
- this._Orders = new EntitySet(new Action