System.Data.SQLite

Check-in Differences
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Difference From 147afad4ff71bd6e To faaaeb7bd77a6fd5

2008-10-05
15:35
1.0.60.0 check-in: c425f2d2e9 user: rmsimpson tags: sourceforge
2008-09-22
16:27
1.0.59.0 check-in: 147afad4ff user: rmsimpson tags: sourceforge
16:18
1.0.59.0 check-in: 4d6b467497 user: rmsimpson tags: sourceforge
2008-09-02
15:46
pre 1.0.59.0 check-in: c0dab1edea user: rmsimpson tags: sourceforge
2008-08-11
21:12
1.0.56.0 check-in: faaaeb7bd7 user: rmsimpson tags: sourceforge
2008-08-08
05:42
1.0.56.0 beta check-in: 85ed84191d user: rmsimpson tags: sourceforge

Changes to Doc/Extra/dbfactorysupport.html.
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
<configuration>
  <system.data>
    <DbProviderFactories>
      <remove invariant="System.Data.SQLite"/>
      <add name="SQLite Data Provider" invariant="System.Data.SQLite" 
           description=".Net Framework Data Provider for SQLite"
           type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite,
                 Version=1.0.59.0, Culture=neutral,
                 PublicKeyToken=db937bc2d44ff139"/>
    </DbProviderFactories>
  </system.data>
</configuration>
</pre>
      </div>
      <p>







|







93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
&lt;configuration&gt;
  &lt;system.data&gt;
    &lt;DbProviderFactories&gt;
      &lt;remove invariant="System.Data.SQLite"/&gt;
      &lt;add name="SQLite Data Provider" invariant="System.Data.SQLite" 
           description=".Net Framework Data Provider for SQLite"
           type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite,
                 Version=1.0.56.0, Culture=neutral,
                 PublicKeyToken=db937bc2d44ff139"/&gt;
    &lt;/DbProviderFactories&gt;
  &lt;/system.data&gt;
&lt;/configuration&gt;
</pre>
      </div>
      <p>
Changes to Doc/Extra/version.html.
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
          </td>
        </tr>
      </table>
    </div>
    <div id="mainSection">
    <div id="mainBody">
    <h1 class="heading">Version History</h1>
    <p><b>1.0.59.0 - September 22, 2008</b></p>
    <ul>
      <li>Code merge with SQLite 3.6.3.&nbsp; Solves 
        a couple different EF issues that were either giving inconsistent results or 
        crashing the engine.</li>
      <li>Fixed the parsing of literal binaries in the EF SqlGen code.&nbsp; SQLite now 
        passes nearly all the testcases in 
        <a href="http://sqlite.phxsoftware.com/forums/p/1377/5921.aspx#5921">Microsoft's EF Query Samples</a> application -- 
        the exception being the <i>datetimeoffset </i>and<i> time</i> constants tests, and tests 
        that use the <i>APPLY </i>keyword which are unsupported for now.</li>
      <li>Revamped the Compact Framework mixed-mode assembly.&nbsp; Tired of playing cat 
        and mouse with the Compact Framework&#39;s support for mixed-mode assemblies.&nbsp; 
        The CF build now requires that you distribute both the System.Data.SQLite 
        library and the paired SQLite.Interop.XXX library.&nbsp;&nbsp; The XXX denotes 
        the build number of the library.</li>
      <li>Implemented a workaround for Vista&#39;s overzealous caching by turning off 
        FILE_FLAG_RANDOM_ACCESS for OS versions above XP.&nbsp; This is implemented 
        as a custom (default override) VFS in the interop.c file, so no changes are made 
        to the SQLite source code.</li>
      <li>Fixed some registry issues in the designer install.exe, which prevented some 
        design-time stuff from working on the Compact Framework when .NET 3.5 was 
        installed.</li>
    </ul>
    <p><b>1.0.58.0 - August 30, 2008</b></p>
    <ul>
      <li>Code merge with SQLite 3.6.2.&nbsp; If only I&#39;d waited one more day to release 
        57!&nbsp; Several LINQ issues have been resolved with this engine release 
        relating to deeply-nested subqueries that the EF SqlGen creates.</li>
      <li>Fixed the Rollback SQLiteConnection event to not require a connection be 
        opened first.</li>
    </ul>
    <p><b>1.0.57.0 - August 29, 2008</b></p>
    <ul>
      <li>Compiled against 3.6.1 with checkin
        <a href="http://www.sqlite.org/cvstrac/tktview?tn=3300">#3300</a> resolved, 
        which fixes an Entity Framework bug I was seeing.&nbsp; I currently have 3 other 
        tickets out on the engine, which are not yet resolved and relate to EF.</li>
      <li>Fixed decimal types to store and fetch using InvariantCulture.&nbsp; If you&#39;re 
        using decimal datatypes in your database and were affected by the 56 release, 
        please issue an UPDATE &lt;table&gt; SET &lt;column&gt; = REPLACE(&lt;column&gt;, &#39;,&#39;, &#39;.&#39;);&nbsp; 
        to fix the decimal separators.&nbsp; Apologies for not testing that more 
        thoroughly before releasing 56.</li>
      <li>Too many LINQ fixes to list.&nbsp; Fixed views so they generate, 
        fixed the LIMIT clause, implemented additional functionality and removed unnecessary code.</li>
      <li>Fixed foreign key names in the designer so viewing the SQL script on a new 
        unsaved table after renaming it in the properties toolwindow will reflect in the 
        script properly.</li>
      <li>Fixed the Update and Commit events on SQLiteConnection so they don&#39;t require 
        the connection to be opened first.</li>
      <li>Fixed userdef aggregate functions so they play nice with each other when 
        appearing multiple times in the same statement.</li>
      <li>Fixed the editing and saving of default values in the table designer.</li>
      <li>Fixed ForeignKeys schema to support multi-column foreign keys.&nbsp; Also 
        hacked support for them in the table designer, provided two foreign keys in the 
        designer have the same name and reference the same foreign table and different 
        columns.&nbsp; Will implement first-class support for this in the next release.</li>
    </ul>
    <p><b>1.0.56.0 - August 11, 2008</b></p>
    <ul>
      <li>Fixed a bug in the table designer when designing new tables, wherein you had to 
        save the table first before being able to create indexes and foreign keys.</li>
      <li>Tweaks to decimal type handling.&nbsp; The &#39;decimal&#39; type can&#39;t be represented 
        by Int64 or Double (without loss of precision) in SQLite, so we have to fudge it 
        by treating it like a string and converting it back and forth in the provider.&nbsp; 







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







51
52
53
54
55
56
57

























































58
59
60
61
62
63
64
          </td>
        </tr>
      </table>
    </div>
    <div id="mainSection">
    <div id="mainBody">
    <h1 class="heading">Version History</h1>

























































    <p><b>1.0.56.0 - August 11, 2008</b></p>
    <ul>
      <li>Fixed a bug in the table designer when designing new tables, wherein you had to 
        save the table first before being able to create indexes and foreign keys.</li>
      <li>Tweaks to decimal type handling.&nbsp; The &#39;decimal&#39; type can&#39;t be represented 
        by Int64 or Double (without loss of precision) in SQLite, so we have to fudge it 
        by treating it like a string and converting it back and forth in the provider.&nbsp; 
Changes to Doc/Extra/welcome.html.
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
          support both binary and cleartext password types. </li>
        <li>Visual Studio 2005/2008 Design-Time Support.&nbsp; You can add a SQLite 
        database to the Servers list, design queries with the Query Designer, 
        drag-and-drop tables onto a Typed DataSet, etc.</li>
            <li>Full SQLite schema editing inside Visual Studio.&nbsp; You can create/edit 
              tables, views, triggers, indexes, check constraints and foreign keys. </li>
        <li>
        Single file redistributable (except Compact Framework).&nbsp; The core sqlite3 codebase and the ADO.NET wrapper 
        are combined into one multi-module assembly. </li>
        <li>Binaries included for Itanium, x64, x86 and ARM processors. </li>
        <li>
        DbProviderFactory support. </li>
        <li>
          Full support for ATTACH'ed databases.&nbsp; Exposed as <i>Catalogs</i>
        in the schema.&nbsp; When cloning a connection, all attached databases are 







|







104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
          support both binary and cleartext password types. </li>
        <li>Visual Studio 2005/2008 Design-Time Support.&nbsp; You can add a SQLite 
        database to the Servers list, design queries with the Query Designer, 
        drag-and-drop tables onto a Typed DataSet, etc.</li>
            <li>Full SQLite schema editing inside Visual Studio.&nbsp; You can create/edit 
              tables, views, triggers, indexes, check constraints and foreign keys. </li>
        <li>
        Single file redistributable.&nbsp; The core sqlite3 codebase and the ADO.NET wrapper 
        are combined into one multi-module assembly. </li>
        <li>Binaries included for Itanium, x64, x86 and ARM processors. </li>
        <li>
        DbProviderFactory support. </li>
        <li>
          Full support for ATTACH'ed databases.&nbsp; Exposed as <i>Catalogs</i>
        in the schema.&nbsp; When cloning a connection, all attached databases are 
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163



164
165
166
167
        Full support for user-defined collating sequences, every bit as simple to 
        implement as user-defined functions and uses the same base class. </li>
        <li>
          Full source for the entire engine and wrapper.&nbsp; No copyrights.&nbsp; 
          Public Domain.&nbsp; 100% free for commercial and non-commercial use.&nbsp;</li>
      </UL>
      <br>
      <h1 class="heading">Distributing the Binaries (Desktop)</h1>
      <p><b>System.Data.SQLite.DLL</b> is a mixed assembly signed with a strong name 
        in case you want to add it to the Global Assembly Cache (GAC). This is the only DLL required to be redistributed with 
        your SQLite.NET application(s).&nbsp; It 
        comes in&nbsp;3
        flavors: Win32, Itanium and x64 (AMD64).</p>
      <h1 class="heading">Distributing the Binaries (Compact Framework)</h1>
      <p><b>System.Data.SQLite.DLL </b>and <b>SQLite.Interop.XXX.DLL</b> must be 
        deployed on the Compact Framework.&nbsp; The XXX is the build number of the 
        System.Data.SQLite library (e.g. &quot;059&quot;).&nbsp; SQLite.Interop.XXX is a fully 
        native assembly compiled for the ARM processor, and System.Data.SQLite is the 
        fully-managed Compact Framework assembly.</p>
      <hr />
      <div id="footer">
        <p>
          <a href="mailto:robert@blackcastlesoft.com?subject=SQLite%20ADO.NET%202.0%20Provider%201.0.0.0%20Documentation%20Feedback:%20Welcome">



          Send comments on this topic.<!--[if gte IE 5]><tool:tip element="seeAlsoToolTip" avoidmouse="false" /><tool:tip element="languageFilterToolTip" avoidmouse="false" /><![endif]-->    </div>
    </div>
  </body>
</html>







|



|
|
|
|
<
<
<
|



|
>
>
>
|



141
142
143
144
145
146
147
148
149
150
151
152
153
154
155



156
157
158
159
160
161
162
163
164
165
166
167
        Full support for user-defined collating sequences, every bit as simple to 
        implement as user-defined functions and uses the same base class. </li>
        <li>
          Full source for the entire engine and wrapper.&nbsp; No copyrights.&nbsp; 
          Public Domain.&nbsp; 100% free for commercial and non-commercial use.&nbsp;</li>
      </UL>
      <br>
      <h1 class="heading">Distributing the Binaries</h1>
      <p><b>System.Data.SQLite.DLL</b> is a mixed assembly signed with a strong name 
        in case you want to add it to the Global Assembly Cache (GAC). This is the only DLL required to be redistributed with 
        your SQLite.NET application(s).&nbsp; It 
        comes in&nbsp;4
        flavors: Win32, Itanium, X64 (AMD64) and ARM (Compact Framework).&nbsp; The Compact
        Framework library is signed with a separate strong name, but all the other
        versions share the same strong name so they can be interchanged where appropriate without



        any change to your application.</p>
      <hr />
      <div id="footer">
        <p>
          <a href="mailto:robert@blackcastlesoft.com?subject=SQLite%20ADO.NET%202.0%20Provider%201.0.0.0%20Documentation%20Feedback:%20Welcome">Send comments on this topic.</a>
        </p>
        <p />
        <p />
      </div><!--[if gte IE 5]><tool:tip element="seeAlsoToolTip" avoidmouse="false" /><tool:tip element="languageFilterToolTip" avoidmouse="false" /><![endif]-->    </div>
    </div>
  </body>
</html>
Changes to Doc/SQLite.NET.chm.

cannot compute difference between binary files

Changes to SQLite.Designer/AssemblyInfo.cs.
28
29
30
31
32
33
34
35
36
37
38
39
//      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.36.0")]
[assembly: AssemblyFileVersion("1.0.36.0")]
[assembly: AssemblyDelaySignAttribute(false)]
[assembly: AssemblyKeyFileAttribute("..\\System.Data.SQLite\\System.Data.SQLite.snk")]
[assembly: AssemblyKeyNameAttribute("")]







|
|



28
29
30
31
32
33
34
35
36
37
38
39
//      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.35.0")]
[assembly: AssemblyFileVersion("1.0.35.0")]
[assembly: AssemblyDelaySignAttribute(false)]
[assembly: AssemblyKeyFileAttribute("..\\System.Data.SQLite\\System.Data.SQLite.snk")]
[assembly: AssemblyKeyNameAttribute("")]
Changes to SQLite.Designer/Design/Column.cs.
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262

    [DisplayName("Default Value")]
    [Category("Constraints")]
    [Description("The default value to populate in the column when an explicit value is not specified.")]
    public virtual string DefaultValue
    {
      get { return _defaultValue; }
      set
      {
        value = value.Trim();

        if (value != _defaultValue)
        {
          _defaultValue = value;
          _table.MakeDirty();
        }
      }
    }

    internal void WriteSql(StringBuilder builder)
    {
      builder.AppendFormat("[{0}]", ColumnName);
      if (String.IsNullOrEmpty(DataType) == false)
        builder.AppendFormat(" {0}", DataType);







<
<
<
<
<
<
|
<
<
<







239
240
241
242
243
244
245






246



247
248
249
250
251
252
253

    [DisplayName("Default Value")]
    [Category("Constraints")]
    [Description("The default value to populate in the column when an explicit value is not specified.")]
    public virtual string DefaultValue
    {
      get { return _defaultValue; }






      set { _defaultValue = value; }



    }

    internal void WriteSql(StringBuilder builder)
    {
      builder.AppendFormat("[{0}]", ColumnName);
      if (String.IsNullOrEmpty(DataType) == false)
        builder.AppendFormat(" {0}", DataType);
285
286
287
288
289
290
291
292
293
294
295
296
297

      if (Unique.Enabled == true && isprimary == false)
      {
        builder.Append(" UNIQUE");
        if (Unique.Conflict != ConflictEnum.Abort)
          builder.AppendFormat(" ON CONFLICT {0}", Unique.Conflict.ToString().ToUpperInvariant());
      }

      if (String.IsNullOrEmpty(DefaultValue) == false)
        builder.AppendFormat(" DEFAULT {0}", DefaultValue);
    }
  }
}







<
<
<



276
277
278
279
280
281
282



283
284
285

      if (Unique.Enabled == true && isprimary == false)
      {
        builder.Append(" UNIQUE");
        if (Unique.Conflict != ConflictEnum.Abort)
          builder.AppendFormat(" ON CONFLICT {0}", Unique.Conflict.ToString().ToUpperInvariant());
      }



    }
  }
}
Changes to SQLite.Designer/Design/ForeignKey.cs.
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
  {
    internal ForeignKeyFromItem(ForeignKey fkey, string column)
      : base(fkey, fkey._table.Catalog, fkey._table.Name, column)
    {
    }

    [Editor(typeof(ColumnsTypeEditor), typeof(UITypeEditor))]
    [Description("The column of the current table that refers to the foreign key relationship")]
    public new string Column
    {
      get { return base.Column; }
      set { SetColumn(value); }
    }

    [Browsable(false)]
    public override string Catalog
    {
      get
      {
        return base.Catalog;
      }
    }

    [Browsable(false)]
    public override string Table
    {
      get
      {
        return base.DesignTable.Name;
      }
    }
  }

  [TypeConverter(typeof(ExpandableObjectConverter))]
  internal class ForeignKeyToItem : ForeignKeyItem
  {







|




















|







210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
  {
    internal ForeignKeyFromItem(ForeignKey fkey, string column)
      : base(fkey, fkey._table.Catalog, fkey._table.Name, column)
    {
    }

    [Editor(typeof(ColumnsTypeEditor), typeof(UITypeEditor))]
    [Description("The primary (parent) column of the foreign key relationship")]
    public new string Column
    {
      get { return base.Column; }
      set { SetColumn(value); }
    }

    [Browsable(false)]
    public override string Catalog
    {
      get
      {
        return base.Catalog;
      }
    }

    [Browsable(false)]
    public override string Table
    {
      get
      {
        return base.Table;
      }
    }
  }

  [TypeConverter(typeof(ExpandableObjectConverter))]
  internal class ForeignKeyToItem : ForeignKeyItem
  {
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
      {
        SetCatalog(value);
      }
    }

    [DisplayName("Base Table")]
    [Editor(typeof(TablesTypeEditor), typeof(UITypeEditor))]
    [Description("The table to which the foreign key refers.")]
    public new string Table
    {
      get { return base.Table; }
      set { SetTable(value); }
    }

    [Editor(typeof(ColumnsTypeEditor), typeof(UITypeEditor))]
    [Description("The column to which the foreign key refers.")]
    public new string Column
    {
      get { return base.Column; }
      set { SetColumn(value); }
    }
  }








|







|







261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
      {
        SetCatalog(value);
      }
    }

    [DisplayName("Base Table")]
    [Editor(typeof(TablesTypeEditor), typeof(UITypeEditor))]
    [Description("The child table to which the foreign key refers.")]
    public new string Table
    {
      get { return base.Table; }
      set { SetTable(value); }
    }

    [Editor(typeof(ColumnsTypeEditor), typeof(UITypeEditor))]
    [Description("The child column to which the foreign key refers.")]
    public new string Column
    {
      get { return base.Column; }
      set { SetColumn(value); }
    }
  }

328
329
330
331
332
333
334
335
336

337
338
339

340
341
342


343
344
345
346
347
348
349
      {
        _name = null;
        _from = new ForeignKeyFromItem(this, "");
        _to = new ForeignKeyToItem(this, _table.Catalog, "", "");
      }
    }

    //internal void WriteSql(StringBuilder builder)
    //{

    //  if (String.IsNullOrEmpty(_from.Column) == false && String.IsNullOrEmpty(_to.Catalog) == false &&
    //    String.IsNullOrEmpty(_to.Table) == false && String.IsNullOrEmpty(_to.Column) == false)
    //  {

    //    builder.AppendFormat("CONSTRAINT [{0}] FOREIGN KEY ([{1}]) REFERENCES [{3}] ([{4}])", Name, _from.Column, _to.Catalog, _to.Table, _to.Column);
    //  }
    //}



    [ParenthesizePropertyName(true)]
    [Category("Identity")]
    [Description("The name of the foreign key.")]
    public string Name
    {
      get







|
<
>
|
|
<
>
|
<
<
>
>







328
329
330
331
332
333
334
335

336
337
338

339
340


341
342
343
344
345
346
347
348
349
      {
        _name = null;
        _from = new ForeignKeyFromItem(this, "");
        _to = new ForeignKeyToItem(this, _table.Catalog, "", "");
      }
    }

    internal void WriteSql(StringBuilder builder)

    {
      if (String.IsNullOrEmpty(_from.Column) == false && String.IsNullOrEmpty(_to.Catalog) == false &&
        String.IsNullOrEmpty(_to.Table) == false && String.IsNullOrEmpty(_to.Column) == false)

      {
        builder.AppendFormat("CONSTRAINT [{0}] FOREIGN KEY ([{1}]) REFERENCES [{3}] ([{4}])", Name, _from.Column, _to.Catalog, _to.Table, _to.Column);


      }
    }

    [ParenthesizePropertyName(true)]
    [Category("Identity")]
    [Description("The name of the foreign key.")]
    public string Name
    {
      get
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
    public DbConnection GetConnection()
    {
      return ((IHaveConnection)_table).GetConnection();
    }

    #endregion

    [DisplayName("From Key")]
    [Category("From")]
    [Description("The source column in the current table that refers to the foreign key.")]
    public ForeignKeyFromItem From
    {
      get { return _from; }
    }

    [DisplayName("To Key")]
    [Category("To")]
    [Description("The table and column to which the specified from column is related.")]
    public ForeignKeyToItem To
    {
      get { return _to; }
    }

    #region ICloneable Members








|
|
|





|
|
|







373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
    public DbConnection GetConnection()
    {
      return ((IHaveConnection)_table).GetConnection();
    }

    #endregion

    [DisplayName("Primary/Unique Key")]
    [Category("Source")]
    [Description("The source (parent) column in the current table that is to be the unique value of the foreign key.")]
    public ForeignKeyFromItem From
    {
      get { return _from; }
    }

    [DisplayName("Foreign Key")]
    [Category("Target")]
    [Description("The child table and column to which the specified parent column is related.")]
    public ForeignKeyToItem To
    {
      get { return _to; }
    }

    #region ICloneable Members

Changes to SQLite.Designer/Design/Table.cs.
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
    {
      get { return _origSql; }
    }

    [Category("Storage")]
    [RefreshProperties(RefreshProperties.All)]
    [ParenthesizePropertyName(true)]
    [NotifyParentProperty(true)]
    public override string Name
    {
      get { return _name; }
      set
      {
        if (_name != value)
        {







<







269
270
271
272
273
274
275

276
277
278
279
280
281
282
    {
      get { return _origSql; }
    }

    [Category("Storage")]
    [RefreshProperties(RefreshProperties.All)]
    [ParenthesizePropertyName(true)]

    public override string Name
    {
      get { return _name; }
      set
      {
        if (_name != value)
        {
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
            break;
          }
        }
        builder.Append(separator);
        builder.AppendFormat("CONSTRAINT [CK_{0}_{1}] CHECK {2}", Name, n + 1, check);
      }

      List<ForeignKey> keys = new List<ForeignKey>();

      for (int x = 0; x < ForeignKeys.Count; x++)
      {
        ForeignKey key = ForeignKeys[x];

        if (String.IsNullOrEmpty(key.From.Column) == true || String.IsNullOrEmpty(key.From.Catalog) == true ||
          String.IsNullOrEmpty(key.To.Table) == true || String.IsNullOrEmpty(key.To.Column) == true)
          continue;

        if (keys.Count > 0)
        {
          if (keys[0].Name == key.Name && keys[0].To.Catalog == key.To.Catalog && keys[0].To.Table == key.To.Table)
          {
            keys.Add(key);
            continue;
          }
          builder.Append(separator);
          WriteFKeys(keys, builder);
          keys.Clear();
        }
        keys.Add(key);
      }

      if (keys.Count > 0)
      {
        builder.Append(separator);
        WriteFKeys(keys, builder);
      }

      builder.Append("\r\n);\r\n");

      // Rebuilding an existing table
      if (altName != null)
      {







<
|
<

<
<
<
<
<
<
<
<
<
<
<
<
<
|
|
<
<
<
<
<
<
<
<
<







402
403
404
405
406
407
408

409

410













411
412









413
414
415
416
417
418
419
            break;
          }
        }
        builder.Append(separator);
        builder.AppendFormat("CONSTRAINT [CK_{0}_{1}] CHECK {2}", Name, n + 1, check);
      }


      foreach (ForeignKey fkey in ForeignKeys)

      {













        builder.Append(separator);
        fkey.WriteSql(builder);









      }

      builder.Append("\r\n);\r\n");

      // Rebuilding an existing table
      if (altName != null)
      {
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
        }
        builder.AppendLine();
      }

      return builder.ToString();
    }

    private void WriteFKeys(List<ForeignKey> keys, StringBuilder builder)
    {
      builder.AppendFormat("CONSTRAINT [{0}] FOREIGN KEY (", keys[0].Name);
      string separator = "";

      foreach (ForeignKey key in keys)
      {
        builder.AppendFormat("{0}[{1}]", separator, key.From.Column);
        separator = ", ";
      }

      builder.AppendFormat(") REFERENCES [{0}] (", keys[0].To.Table);

      separator = "";
      foreach (ForeignKey key in keys)
      {
        builder.AppendFormat("{0}[{1}]", separator, key.To.Column);
        separator = ", ";
      }
      builder.Append(")");
    }

    [Browsable(false)]
    public override ViewTableBase DesignTable
    {
      get { return this; }
    }

    public override DbConnection GetConnection()







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







467
468
469
470
471
472
473






















474
475
476
477
478
479
480
        }
        builder.AppendLine();
      }

      return builder.ToString();
    }























    [Browsable(false)]
    public override ViewTableBase DesignTable
    {
      get { return this; }
    }

    public override DbConnection GetConnection()
Deleted SQLite.Designer/Resources/ToolboxItems.txt.
1
2
3
4
[SQLite]
System.Data.SQLite.SQLiteConnection, System.Data.SQLite
System.Data.SQLite.SQLiteDataAdapter, System.Data.SQLite
System.Data.SQLite.SQLiteCommand, System.Data.SQLite
<
<
<
<








Changes to SQLite.Designer/SQLiteDataViewSupport2005.xml.
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
          <Category resource="Category_Location"/>
        </Part>
        <Part name="Table">
          <Category resource="Category_Location"/>
        </Part>
      </Identifier>
      <Properties>
        <!--<Property name="ColumnName">
          <DisplayName>Source Column</DisplayName>
          <Category resource="Category_Source"/>
        </Property>-->
        <Property name="ReferencedTableDatabase">
          <DisplayName>Referenced Database</DisplayName>
          <Category resource="Category_Refs"/>
        </Property>
        <Property name="ReferencedTableName">
          <DisplayName>Referenced Table</DisplayName>
          <Category resource="Category_Refs"/>
        </Property>
        <!--<Property name="ReferencedColumnName">
          <DisplayName>Referenced Column</DisplayName>
          <Category resource="Category_Refs"/>
        </Property>-->
      </Properties>
      <CommandBindings>
        <CommandBinding name="NewQuery" guid="501822E1-B5AF-11d0-B4DC-00A0C91506EF" cmdid="13608" handler="884DD964-5327-461f-9F06-6484DD540F8F"/>
      </CommandBindings>
    </TypeExtension>
  </TypeExtensions>








|


|








|


|







347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
          <Category resource="Category_Location"/>
        </Part>
        <Part name="Table">
          <Category resource="Category_Location"/>
        </Part>
      </Identifier>
      <Properties>
        <Property name="ColumnName">
          <DisplayName>Source Column</DisplayName>
          <Category resource="Category_Source"/>
        </Property>
        <Property name="ReferencedTableDatabase">
          <DisplayName>Referenced Database</DisplayName>
          <Category resource="Category_Refs"/>
        </Property>
        <Property name="ReferencedTableName">
          <DisplayName>Referenced Table</DisplayName>
          <Category resource="Category_Refs"/>
        </Property>
        <Property name="ReferencedColumnName">
          <DisplayName>Referenced Column</DisplayName>
          <Category resource="Category_Refs"/>
        </Property>
      </Properties>
      <CommandBindings>
        <CommandBinding name="NewQuery" guid="501822E1-B5AF-11d0-B4DC-00A0C91506EF" cmdid="13608" handler="884DD964-5327-461f-9F06-6484DD540F8F"/>
      </CommandBindings>
    </TypeExtension>
  </TypeExtensions>

Changes to SQLite.Designer/SQLiteDataViewSupport2008.xml.
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
          <Category resource="Category_Location"/>
        </Part>
        <Part name="Table">
          <Category resource="Category_Location"/>
        </Part>
      </Identifier>
      <Properties>
        <!--<Property name="ColumnName">
          <DisplayName>Source Column</DisplayName>
          <Category resource="Category_Source"/>
        </Property>-->
        <Property name="ReferencedTableDatabase">
          <DisplayName>Referenced Database</DisplayName>
          <Category resource="Category_Refs"/>
        </Property>
        <Property name="ReferencedTableName">
          <DisplayName>Referenced Table</DisplayName>
          <Category resource="Category_Refs"/>
        </Property>
        <!--<Property name="ReferencedColumnName">
          <DisplayName>Referenced Column</DisplayName>
          <Category resource="Category_Refs"/>
        </Property>-->
      </Properties>
      <CommandBindings>
        <CommandBinding name="NewQuery" guid="501822E1-B5AF-11d0-B4DC-00A0C91506EF" cmdid="13608" handler="884DD964-5327-461f-9F06-6484DD540F8F"/>
      </CommandBindings>
    </TypeExtension>
  </TypeExtensions>








|


|








|


|







350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
          <Category resource="Category_Location"/>
        </Part>
        <Part name="Table">
          <Category resource="Category_Location"/>
        </Part>
      </Identifier>
      <Properties>
        <Property name="ColumnName">
          <DisplayName>Source Column</DisplayName>
          <Category resource="Category_Source"/>
        </Property>
        <Property name="ReferencedTableDatabase">
          <DisplayName>Referenced Database</DisplayName>
          <Category resource="Category_Refs"/>
        </Property>
        <Property name="ReferencedTableName">
          <DisplayName>Referenced Table</DisplayName>
          <Category resource="Category_Refs"/>
        </Property>
        <Property name="ReferencedColumnName">
          <DisplayName>Referenced Column</DisplayName>
          <Category resource="Category_Refs"/>
        </Property>
      </Properties>
      <CommandBindings>
        <CommandBinding name="NewQuery" guid="501822E1-B5AF-11d0-B4DC-00A0C91506EF" cmdid="13608" handler="884DD964-5327-461f-9F06-6484DD540F8F"/>
      </CommandBindings>
    </TypeExtension>
  </TypeExtensions>

Changes to SQLite.Interop/SQLite.Interop.rc.
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84

/////////////////////////////////////////////////////////////////////////////
//
// Version
//

VS_VERSION_INFO VERSIONINFO
 FILEVERSION 1,0,59,0
 PRODUCTVERSION 1,0,0,0
 FILEFLAGSMASK 0x17L
#ifdef _DEBUG
 FILEFLAGS 0x1L
#else
 FILEFLAGS 0x0L
#endif
 FILEOS 0x4L
 FILETYPE 0x2L
 FILESUBTYPE 0x0L
BEGIN
    BLOCK "StringFileInfo"
    BEGIN
        BLOCK "040904b0"
        BEGIN
            VALUE "Comments", "http://sqlite.phxsoftware.com"
            VALUE "FileDescription", "System.Data.SQLite Interop Library"
            VALUE "FileVersion", "1.0.59.0"
            VALUE "InternalName", "SQLite.Interop.DLL"
            VALUE "LegalCopyright", "Released to the public domain"
            VALUE "OriginalFilename", "SQLite3.DLL 3.6.3"
            VALUE "ProductName", "System.Data.SQLite"
            VALUE "ProductVersion", "1.0"
        END
    END
    BLOCK "VarFileInfo"
    BEGIN
        VALUE "Translation", 0x409, 1200







|

















|


|







49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84

/////////////////////////////////////////////////////////////////////////////
//
// Version
//

VS_VERSION_INFO VERSIONINFO
 FILEVERSION 1,0,56,0
 PRODUCTVERSION 1,0,0,0
 FILEFLAGSMASK 0x17L
#ifdef _DEBUG
 FILEFLAGS 0x1L
#else
 FILEFLAGS 0x0L
#endif
 FILEOS 0x4L
 FILETYPE 0x2L
 FILESUBTYPE 0x0L
BEGIN
    BLOCK "StringFileInfo"
    BEGIN
        BLOCK "040904b0"
        BEGIN
            VALUE "Comments", "http://sqlite.phxsoftware.com"
            VALUE "FileDescription", "System.Data.SQLite Interop Library"
            VALUE "FileVersion", "1.0.56.0"
            VALUE "InternalName", "SQLite.Interop.DLL"
            VALUE "LegalCopyright", "Released to the public domain"
            VALUE "OriginalFilename", "SQLite3.DLL 3.6.1"
            VALUE "ProductName", "System.Data.SQLite"
            VALUE "ProductVersion", "1.0"
        END
    END
    BLOCK "VarFileInfo"
    BEGIN
        VALUE "Translation", 0x409, 1200
Changes to SQLite.Interop/SQLite.Interop.vcproj.
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156

157
158
159
160
161
162

163
164
165
166
167
168
169


170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189

190
191
192
193
194
195
196
197
				ExecutionBucket="7"
				Optimization="1"
				FavorSizeOrSpeed="2"
				PreprocessorDefinitions="_WIN32_WCE=$(CEVER);UNDER_CE=$(CEVER);WINCE;$(PLATFORMDEFINES);NDEBUG;_WINDOWS;_USRDLL;CPPSMART_EXPORTS;$(ARCHFAM);$(_ARCHFAM_);UNICODE;_UNICODE;SQLITE_HAS_CODEC;SQLITE_ENABLE_COLUMN_METADATA;SQLITE_ENABLE_FTS3;SQLITE_ENABLE_RTREE;SQLITE_ENABLE_LOAD_EXTENSION;SQLITE_SOUNDEX;INVALID_FILE_ATTRIBUTES=((DWORD)-1)"
				StringPooling="true"
				ExceptionHandling="0"
				BufferSecurityCheck="false"
				CompileForArchitecture="0"
				InterworkCalls="false"
			/>
			<Tool
				Name="VCManagedResourceCompilerTool"
			/>
			<Tool
				Name="VCResourceCompilerTool"
				PreprocessorDefinitions="NDEBUG;_UNICODE;UNICODE;_WIN32_WCE;UNDER_CE"
				Culture="1033"
				AdditionalIncludeDirectories="$(IntDir)"
			/>
			<Tool
				Name="VCPreLinkEventTool"

				CommandLine=""
			/>
			<Tool
				Name="VCLinkerTool"
				IgnoreImportLibrary="true"
				OutputFile="../bin/CompactFramework/$(InputName).059.DLL"

				AdditionalLibraryDirectories=""
				IgnoreDefaultLibraryNames=""
				ModuleDefinitionFile="src\sqlite3.def"
				AddModuleNamesToAssembly=""
				EmbedManagedResourceFile=""
				SubSystem="8"
				EntryPointSymbol=""


				MergeSections=""
				TargetMachine="3"
			/>
			<Tool
				Name="VCALinkTool"
			/>
			<Tool
				Name="VCXDCMakeTool"
			/>
			<Tool
				Name="VCBscMakeTool"
			/>
			<Tool
				Name="VCFxCopTool"
			/>
			<Tool
				Name="VCCodeSignTool"
			/>
			<Tool
				Name="VCPostBuildEventTool"

				CommandLine=""
			/>
			<DeploymentTool
				ForceDirty="-1"
				RemoteDirectory="\Program Files\testce"
				RegisterOutput="0"
				AdditionalFiles=""
			/>







|
<












>
|



<
|
>







>
>




















>
|







136
137
138
139
140
141
142
143

144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160

161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
				ExecutionBucket="7"
				Optimization="1"
				FavorSizeOrSpeed="2"
				PreprocessorDefinitions="_WIN32_WCE=$(CEVER);UNDER_CE=$(CEVER);WINCE;$(PLATFORMDEFINES);NDEBUG;_WINDOWS;_USRDLL;CPPSMART_EXPORTS;$(ARCHFAM);$(_ARCHFAM_);UNICODE;_UNICODE;SQLITE_HAS_CODEC;SQLITE_ENABLE_COLUMN_METADATA;SQLITE_ENABLE_FTS3;SQLITE_ENABLE_RTREE;SQLITE_ENABLE_LOAD_EXTENSION;SQLITE_SOUNDEX;INVALID_FILE_ATTRIBUTES=((DWORD)-1)"
				StringPooling="true"
				ExceptionHandling="0"
				BufferSecurityCheck="false"
				EnableFunctionLevelLinking="true"

			/>
			<Tool
				Name="VCManagedResourceCompilerTool"
			/>
			<Tool
				Name="VCResourceCompilerTool"
				PreprocessorDefinitions="NDEBUG;_UNICODE;UNICODE;_WIN32_WCE;UNDER_CE"
				Culture="1033"
				AdditionalIncludeDirectories="$(IntDir)"
			/>
			<Tool
				Name="VCPreLinkEventTool"
				Description="Fixing .bss section"
				CommandLine="..\bin\tools\mergebin.exe /B:&quot;$(IntDir)\interop.obj&quot;"
			/>
			<Tool
				Name="VCLinkerTool"

				OutputFile="../bin/CompactFramework/System.Data.SQLite.DLL"
				SuppressStartupBanner="false"
				AdditionalLibraryDirectories=""
				IgnoreDefaultLibraryNames=""
				ModuleDefinitionFile="src\sqlite3.def"
				AddModuleNamesToAssembly=""
				EmbedManagedResourceFile=""
				SubSystem="8"
				EntryPointSymbol=""
				RandomizedBaseAddress="0"
				DataExecutionPrevention="0"
				MergeSections=""
				TargetMachine="3"
			/>
			<Tool
				Name="VCALinkTool"
			/>
			<Tool
				Name="VCXDCMakeTool"
			/>
			<Tool
				Name="VCBscMakeTool"
			/>
			<Tool
				Name="VCFxCopTool"
			/>
			<Tool
				Name="VCCodeSignTool"
			/>
			<Tool
				Name="VCPostBuildEventTool"
				Description="Merging binaries ..."
				CommandLine="..\bin\tools\mergebin.exe /S:.clr ..\System.Data.SQLite\bin\CompactFramework\$(TargetFileName) &quot;$(TargetPath)&quot;&#x0D;&#x0A;sn -Ra &quot;$(TargetPath)&quot; ..\System.Data.SQLite\System.Data.SQLite.CF.snk&#x0D;&#x0A;"
			/>
			<DeploymentTool
				ForceDirty="-1"
				RemoteDirectory="\Program Files\testce"
				RegisterOutput="0"
				AdditionalFiles=""
			/>
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
			<Tool
				Name="VCMIDLTool"
			/>
			<Tool
				Name="VCCLCompilerTool"
				AdditionalOptions="/GS-"
				Optimization="0"
				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;NO_TCL;THREADSAFE=1;SQLITE_HAS_CODEC;SQLITE_ENABLE_COLUMN_METADATA;SQLITE_ENABLE_FTS3;SQLITE_ENABLE_RTREE;SQLITE_ENABLE_LOAD_EXTENSION;SQLITE_SOUNDEX"
				RuntimeLibrary="3"
				RuntimeTypeInfo="false"
				DebugInformationFormat="3"
			/>
			<Tool
				Name="VCManagedResourceCompilerTool"
			/>







|







394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
			<Tool
				Name="VCMIDLTool"
			/>
			<Tool
				Name="VCCLCompilerTool"
				AdditionalOptions="/GS-"
				Optimization="0"
				PreprocessorDefinitions="WIN32;SQLITE_DEBUG;_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;NO_TCL;THREADSAFE=1;SQLITE_HAS_CODEC;SQLITE_ENABLE_COLUMN_METADATA;SQLITE_ENABLE_FTS3;SQLITE_ENABLE_RTREE;SQLITE_ENABLE_LOAD_EXTENSION;SQLITE_SOUNDEX;SQLITE_CORE"
				RuntimeLibrary="3"
				RuntimeTypeInfo="false"
				DebugInformationFormat="3"
			/>
			<Tool
				Name="VCManagedResourceCompilerTool"
			/>
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506


507
508
509
510
511
512
513
				TargetEnvironment="1"
			/>
			<Tool
				Name="VCCLCompilerTool"
				ExecutionBucket="7"
				AdditionalOptions="/GS-"
				Optimization="0"
				PreprocessorDefinitions="_WIN32_WCE=$(CEVER);UNDER_CE=$(CEVER);WINCE;$(PLATFORMDEFINES);_DEBUG;_WINDOWS;_USRDLL;CPPSMART_EXPORTS;$(ARCHFAM);$(_ARCHFAM_);UNICODE;_UNICODE;SQLITE_HAS_CODEC;SQLITE_ENABLE_COLUMN_METADATA;SQLITE_ENABLE_FTS3;SQLITE_ENABLE_RTREE;SQLITE_ENABLE_LOAD_EXTENSION;SQLITE_SOUNDEX;INVALID_FILE_ATTRIBUTES=((DWORD)-1)"
				DebugInformationFormat="3"
				InterworkCalls="true"
			/>
			<Tool
				Name="VCManagedResourceCompilerTool"
			/>
			<Tool
				Name="VCResourceCompilerTool"
				PreprocessorDefinitions="NDEBUG;_UNICODE;UNICODE;_WIN32_WCE;UNDER_CE"
				Culture="1033"
				AdditionalIncludeDirectories="$(IntDir)"
			/>
			<Tool
				Name="VCPreLinkEventTool"
			/>
			<Tool
				Name="VCLinkerTool"
				IgnoreImportLibrary="true"
				AdditionalOptions=" /subsystem:windowsce,4.20 /machine:ARM /ARMPADCODE"
				OutputFile="../bin/CompactFramework/$(InputName).059.DLL"
				AdditionalLibraryDirectories=""
				IgnoreDefaultLibraryNames=""
				ModuleDefinitionFile="src\sqlite3.def"
				AddModuleNamesToAssembly=""
				EmbedManagedResourceFile=""
				GenerateDebugInformation="true"


				TargetMachine="3"
			/>
			<Tool
				Name="VCALinkTool"
			/>
			<Tool
				Name="VCXDCMakeTool"







|

<

















|






>
>







476
477
478
479
480
481
482
483
484

485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
				TargetEnvironment="1"
			/>
			<Tool
				Name="VCCLCompilerTool"
				ExecutionBucket="7"
				AdditionalOptions="/GS-"
				Optimization="0"
				PreprocessorDefinitions="SQLITE_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE=$(CEVER);WINCE;$(PLATFORMDEFINES);_DEBUG;_WINDOWS;_USRDLL;CPPSMART_EXPORTS;$(ARCHFAM);$(_ARCHFAM_);UNICODE;_UNICODE;SQLITE_HAS_CODEC;SQLITE_ENABLE_COLUMN_METADATA;SQLITE_ENABLE_FTS3;SQLITE_ENABLE_RTREE;SQLITE_ENABLE_LOAD_EXTENSION;SQLITE_SOUNDEX;SQLITE_CORE;INVALID_FILE_ATTRIBUTES=((DWORD)-1)"
				DebugInformationFormat="3"

			/>
			<Tool
				Name="VCManagedResourceCompilerTool"
			/>
			<Tool
				Name="VCResourceCompilerTool"
				PreprocessorDefinitions="NDEBUG;_UNICODE;UNICODE;_WIN32_WCE;UNDER_CE"
				Culture="1033"
				AdditionalIncludeDirectories="$(IntDir)"
			/>
			<Tool
				Name="VCPreLinkEventTool"
			/>
			<Tool
				Name="VCLinkerTool"
				IgnoreImportLibrary="true"
				AdditionalOptions=" /subsystem:windowsce,4.20 /machine:ARM /ARMPADCODE"
				OutputFile="../bin/CompactFramework/$(InputName).DLL"
				AdditionalLibraryDirectories=""
				IgnoreDefaultLibraryNames=""
				ModuleDefinitionFile="src\sqlite3.def"
				AddModuleNamesToAssembly=""
				EmbedManagedResourceFile=""
				GenerateDebugInformation="true"
				RandomizedBaseAddress="1"
				DataExecutionPrevention="0"
				TargetMachine="3"
			/>
			<Tool
				Name="VCALinkTool"
			/>
			<Tool
				Name="VCXDCMakeTool"
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
			/>
			<Tool
				Name="VCAppVerifierTool"
			/>
			<Tool
				Name="VCPostBuildEventTool"
			/>
		</Configuration>
		<Configuration
			Name="StockDebug|Win32"
			OutputDirectory="$(ConfigurationName)"
			IntermediateDirectory="$(ConfigurationName)"
			ConfigurationType="2"
			CharacterSet="2"
			ManagedExtensions="0"
			WholeProgramOptimization="0"
			>
			<Tool
				Name="VCPreBuildEventTool"
				CommandLine=""
			/>
			<Tool
				Name="VCCustomBuildTool"
			/>
			<Tool
				Name="VCXMLDataGeneratorTool"
			/>
			<Tool
				Name="VCWebServiceProxyGeneratorTool"
			/>
			<Tool
				Name="VCMIDLTool"
			/>
			<Tool
				Name="VCCLCompilerTool"
				AdditionalOptions="/GS-"
				Optimization="0"
				PreprocessorDefinitions="WIN32;SQLITE_DEBUG;_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;NO_TCL;THREADSAFE=1;SQLITE_HAS_CODEC;SQLITE_ENABLE_COLUMN_METADATA;SQLITE_ENABLE_FTS3;SQLITE_ENABLE_RTREE;SQLITE_ENABLE_LOAD_EXTENSION;SQLITE_SOUNDEX;SQLITE_CORE"
				RuntimeLibrary="3"
				RuntimeTypeInfo="false"
				DebugInformationFormat="3"
			/>
			<Tool
				Name="VCManagedResourceCompilerTool"
			/>
			<Tool
				Name="VCResourceCompilerTool"
			/>
			<Tool
				Name="VCPreLinkEventTool"
			/>
			<Tool
				Name="VCLinkerTool"
				OutputFile="../bin/sqlite3.dll"
				LinkIncremental="1"
				ModuleDefinitionFile="src\sqlite3.def"
				EmbedManagedResourceFile=""
				DelayLoadDLLs="advapi32.dll"
				GenerateDebugInformation="true"
				RandomizedBaseAddress="1"
				DataExecutionPrevention="0"
				ImportLibrary=""
				TargetMachine="1"
				KeyFile="..\System.Data.SQLite\System.Data.SQLite.snk"
			/>
			<Tool
				Name="VCALinkTool"
			/>
			<Tool
				Name="VCManifestTool"
				EmbedManifest="true"
			/>
			<Tool
				Name="VCXDCMakeTool"
			/>
			<Tool
				Name="VCBscMakeTool"
			/>
			<Tool
				Name="VCFxCopTool"
			/>
			<Tool
				Name="VCAppVerifierTool"
			/>
			<Tool
				Name="VCPostBuildEventTool"
				CommandLine=""
			/>
		</Configuration>
		<Configuration
			Name="StockDebug|Pocket PC 2003 (ARMV4)"
			OutputDirectory="Pocket PC 2003 (ARMV4)\$(ConfigurationName)"
			IntermediateDirectory="Pocket PC 2003 (ARMV4)\$(ConfigurationName)"
			ConfigurationType="2"
			CharacterSet="1"
			WholeProgramOptimization="0"
			>
			<Tool
				Name="VCPreBuildEventTool"
				CommandLine=""
			/>
			<Tool
				Name="VCCustomBuildTool"
			/>
			<Tool
				Name="VCXMLDataGeneratorTool"
			/>
			<Tool
				Name="VCWebServiceProxyGeneratorTool"
			/>
			<Tool
				Name="VCMIDLTool"
				TargetEnvironment="1"
			/>
			<Tool
				Name="VCCLCompilerTool"
				ExecutionBucket="7"
				AdditionalOptions="/GS-"
				Optimization="0"
				PreprocessorDefinitions="SQLITE_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE=$(CEVER);WINCE;$(PLATFORMDEFINES);_DEBUG;_WINDOWS;_USRDLL;CPPSMART_EXPORTS;$(ARCHFAM);$(_ARCHFAM_);UNICODE;_UNICODE;SQLITE_HAS_CODEC;SQLITE_ENABLE_COLUMN_METADATA;SQLITE_ENABLE_FTS3;SQLITE_ENABLE_RTREE;SQLITE_ENABLE_LOAD_EXTENSION;SQLITE_SOUNDEX;SQLITE_CORE;INVALID_FILE_ATTRIBUTES=((DWORD)-1)"
				DebugInformationFormat="3"
				InterworkCalls="true"
			/>
			<Tool
				Name="VCManagedResourceCompilerTool"
			/>
			<Tool
				Name="VCResourceCompilerTool"
				PreprocessorDefinitions="NDEBUG;_UNICODE;UNICODE;_WIN32_WCE;UNDER_CE"
				Culture="1033"
				AdditionalIncludeDirectories="$(IntDir)"
			/>
			<Tool
				Name="VCPreLinkEventTool"
			/>
			<Tool
				Name="VCLinkerTool"
				IgnoreImportLibrary="true"
				AdditionalOptions=" /subsystem:windowsce,4.20 /machine:ARM /ARMPADCODE"
				OutputFile="../bin/CompactFramework/sqlite3.dll"
				AdditionalLibraryDirectories=""
				IgnoreDefaultLibraryNames=""
				ModuleDefinitionFile="src\sqlite3.def"
				AddModuleNamesToAssembly=""
				EmbedManagedResourceFile=""
				GenerateDebugInformation="true"
				TargetMachine="0"
			/>
			<Tool
				Name="VCALinkTool"
			/>
			<Tool
				Name="VCXDCMakeTool"
			/>
			<Tool
				Name="VCBscMakeTool"
			/>
			<Tool
				Name="VCFxCopTool"
			/>
			<Tool
				Name="VCCodeSignTool"
			/>
			<Tool
				Name="VCPostBuildEventTool"
				CommandLine=""
			/>
			<DeploymentTool
				ForceDirty="-1"
				RemoteDirectory="\Program Files\testce"
				RegisterOutput="0"
				AdditionalFiles=""
			/>
			<DebuggerTool
			/>
		</Configuration>
		<Configuration
			Name="StockDebug|Itanium"
			OutputDirectory="$(PlatformName)\$(ConfigurationName)"
			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
			ConfigurationType="2"
			CharacterSet="2"
			ManagedExtensions="0"
			WholeProgramOptimization="0"
			>
			<Tool
				Name="VCPreBuildEventTool"
				CommandLine=""
			/>
			<Tool
				Name="VCCustomBuildTool"
			/>
			<Tool
				Name="VCXMLDataGeneratorTool"
			/>
			<Tool
				Name="VCWebServiceProxyGeneratorTool"
			/>
			<Tool
				Name="VCMIDLTool"
				TargetEnvironment="2"
			/>
			<Tool
				Name="VCCLCompilerTool"
				AdditionalOptions="/GS-"
				Optimization="0"
				PreprocessorDefinitions="SQLITE_DEBUG;_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;NO_TCL;THREADSAFE=1;WIN64;SQLITE_HAS_CODEC;SQLITE_ENABLE_COLUMN_METADATA;SQLITE_ENABLE_FTS3;SQLITE_ENABLE_RTREE;SQLITE_ENABLE_LOAD_EXTENSION;SQLITE_SOUNDEX"
				RuntimeLibrary="3"
				RuntimeTypeInfo="false"
				DebugInformationFormat="3"
			/>
			<Tool
				Name="VCManagedResourceCompilerTool"
			/>
			<Tool
				Name="VCResourceCompilerTool"
			/>
			<Tool
				Name="VCPreLinkEventTool"
			/>
			<Tool
				Name="VCLinkerTool"
				OutputFile="../bin/Itanium/$(InputName).DLL"
				ModuleDefinitionFile="src\sqlite3.def"
				EmbedManagedResourceFile=""
				DelayLoadDLLs="advapi32.dll"
				GenerateDebugInformation="true"
				RandomizedBaseAddress="1"
				DataExecutionPrevention="0"
				ImportLibrary=""
				TargetMachine="5"
				KeyFile="..\System.Data.SQLite\System.Data.SQLite.snk"
			/>
			<Tool
				Name="VCALinkTool"
			/>
			<Tool
				Name="VCManifestTool"
				EmbedManifest="true"
			/>
			<Tool
				Name="VCXDCMakeTool"
			/>
			<Tool
				Name="VCBscMakeTool"
			/>
			<Tool
				Name="VCFxCopTool"
			/>
			<Tool
				Name="VCAppVerifierTool"
			/>
			<Tool
				Name="VCPostBuildEventTool"
			/>
		</Configuration>
		<Configuration
			Name="StockDebug|x64"
			OutputDirectory="$(PlatformName)\$(ConfigurationName)"
			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
			ConfigurationType="2"
			CharacterSet="2"
			ManagedExtensions="0"
			WholeProgramOptimization="0"
			>
			<Tool
				Name="VCPreBuildEventTool"
				CommandLine=""
			/>
			<Tool
				Name="VCCustomBuildTool"
			/>
			<Tool
				Name="VCXMLDataGeneratorTool"
			/>
			<Tool
				Name="VCWebServiceProxyGeneratorTool"
			/>
			<Tool
				Name="VCMIDLTool"
				TargetEnvironment="3"
			/>
			<Tool
				Name="VCCLCompilerTool"
				AdditionalOptions="/GS-"
				Optimization="0"
				PreprocessorDefinitions="SQLITE_DEBUG;_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;NO_TCL;THREADSAFE=1;WIN64;SQLITE_HAS_CODEC;SQLITE_ENABLE_COLUMN_METADATA;SQLITE_ENABLE_FTS3;SQLITE_ENABLE_RTREE;SQLITE_ENABLE_LOAD_EXTENSION;SQLITE_SOUNDEX"
				RuntimeLibrary="3"
				RuntimeTypeInfo="false"
				DebugInformationFormat="3"
			/>
			<Tool
				Name="VCManagedResourceCompilerTool"
			/>
			<Tool
				Name="VCResourceCompilerTool"
			/>
			<Tool
				Name="VCPreLinkEventTool"
			/>
			<Tool
				Name="VCLinkerTool"
				OutputFile="../bin/x64/$(InputName).DLL"
				ModuleDefinitionFile="src\sqlite3.def"
				EmbedManagedResourceFile=""
				DelayLoadDLLs="advapi32.dll"
				GenerateDebugInformation="true"
				RandomizedBaseAddress="1"
				DataExecutionPrevention="0"
				ImportLibrary=""
				TargetMachine="17"
				KeyFile="..\System.Data.SQLite\System.Data.SQLite.snk"
			/>
			<Tool
				Name="VCALinkTool"
			/>
			<Tool
				Name="VCManifestTool"
				EmbedManifest="true"
			/>
			<Tool
				Name="VCXDCMakeTool"
			/>
			<Tool
				Name="VCBscMakeTool"
			/>
			<Tool
				Name="VCFxCopTool"
			/>
			<Tool
				Name="VCAppVerifierTool"
			/>
			<Tool
				Name="VCPostBuildEventTool"
			/>
		</Configuration>
	</Configurations>
	<References>
	</References>
	<Files>
		<Filter
			Name="Header Files"







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







693
694
695
696
697
698
699








































































































































































































































































































































700
701
702
703
704
705
706
			/>
			<Tool
				Name="VCAppVerifierTool"
			/>
			<Tool
				Name="VCPostBuildEventTool"
			/>








































































































































































































































































































































		</Configuration>
	</Configurations>
	<References>
	</References>
	<Files>
		<Filter
			Name="Header Files"
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Win32"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Pocket PC 2003 (ARMV4)"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\analyze.c"
				>
				<FileConfiguration
					Name="Release|Win32"







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







757
758
759
760
761
762
763
















764
765
766
767
768
769
770
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
















				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\analyze.c"
				>
				<FileConfiguration
					Name="Release|Win32"
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Win32"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Pocket PC 2003 (ARMV4)"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\attach.c"







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







790
791
792
793
794
795
796
















797
798
799
800
801
802
803
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
















					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\attach.c"
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Win32"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Pocket PC 2003 (ARMV4)"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\auth.c"
				>
				<FileConfiguration
					Name="Release|Win32"







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







829
830
831
832
833
834
835
















836
837
838
839
840
841
842
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
















				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\auth.c"
				>
				<FileConfiguration
					Name="Release|Win32"
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Win32"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Pocket PC 2003 (ARMV4)"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\bitvec.c"







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







862
863
864
865
866
867
868
















869
870
871
872
873
874
875
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
















					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\bitvec.c"
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Win32"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Pocket PC 2003 (ARMV4)"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\btmutex.c"
				>
				<FileConfiguration
					Name="Release|Win32"







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







901
902
903
904
905
906
907
















908
909
910
911
912
913
914
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
















				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\btmutex.c"
				>
				<FileConfiguration
					Name="Release|Win32"
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Win32"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Pocket PC 2003 (ARMV4)"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\btree.c"







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







934
935
936
937
938
939
940
















941
942
943
944
945
946
947
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
















					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\btree.c"
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Win32"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Pocket PC 2003 (ARMV4)"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\build.c"
				>
				<FileConfiguration
					Name="Release|Win32"







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







973
974
975
976
977
978
979
















980
981
982
983
984
985
986
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
















				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\build.c"
				>
				<FileConfiguration
					Name="Release|Win32"
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Win32"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Pocket PC 2003 (ARMV4)"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\callback.c"
				>
				<FileConfiguration
					Name="Release|Win32"







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







1009
1010
1011
1012
1013
1014
1015
















1016
1017
1018
1019
1020
1021
1022
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
















				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\callback.c"
				>
				<FileConfiguration
					Name="Release|Win32"
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Win32"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Pocket PC 2003 (ARMV4)"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\complete.c"







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







1042
1043
1044
1045
1046
1047
1048
















1049
1050
1051
1052
1053
1054
1055
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
















					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\complete.c"
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Win32"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Pocket PC 2003 (ARMV4)"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\date.c"
				>
				<FileConfiguration
					Name="Release|Win32"







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







1081
1082
1083
1084
1085
1086
1087
















1088
1089
1090
1091
1092
1093
1094
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
















				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\date.c"
				>
				<FileConfiguration
					Name="Release|Win32"
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Win32"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Pocket PC 2003 (ARMV4)"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\delete.c"







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







1114
1115
1116
1117
1118
1119
1120
















1121
1122
1123
1124
1125
1126
1127
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
















					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\delete.c"
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Win32"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Pocket PC 2003 (ARMV4)"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\expr.c"
				>
				<FileConfiguration
					Name="Release|Win32"







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







1153
1154
1155
1156
1157
1158
1159
















1160
1161
1162
1163
1164
1165
1166
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
















				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\expr.c"
				>
				<FileConfiguration
					Name="Release|Win32"
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Win32"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Pocket PC 2003 (ARMV4)"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\fault.c"
				>
				<FileConfiguration
					Name="Release|Win32"







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







1189
1190
1191
1192
1193
1194
1195
















1196
1197
1198
1199
1200
1201
1202
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
















				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\fault.c"
				>
				<FileConfiguration
					Name="Release|Win32"
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Win32"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Pocket PC 2003 (ARMV4)"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\fts3.c"







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







1222
1223
1224
1225
1226
1227
1228
















1229
1230
1231
1232
1233
1234
1235
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
















					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\fts3.c"
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Win32"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Pocket PC 2003 (ARMV4)"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\fts3_hash.c"
				>
				<FileConfiguration
					Name="Release|Win32"







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







1261
1262
1263
1264
1265
1266
1267
















1268
1269
1270
1271
1272
1273
1274
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
















				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\fts3_hash.c"
				>
				<FileConfiguration
					Name="Release|Win32"
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Win32"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Pocket PC 2003 (ARMV4)"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\fts3_porter.c"







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







1294
1295
1296
1297
1298
1299
1300
















1301
1302
1303
1304
1305
1306
1307
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
















					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\fts3_porter.c"
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Win32"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Pocket PC 2003 (ARMV4)"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\fts3_tokenizer.c"
				>
				<FileConfiguration
					Name="Release|Win32"







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







1333
1334
1335
1336
1337
1338
1339
















1340
1341
1342
1343
1344
1345
1346
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
















				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\fts3_tokenizer.c"
				>
				<FileConfiguration
					Name="Release|Win32"
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Win32"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Pocket PC 2003 (ARMV4)"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\fts3_tokenizer1.c"
				>
				<FileConfiguration
					Name="Release|Win32"







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







1369
1370
1371
1372
1373
1374
1375
















1376
1377
1378
1379
1380
1381
1382
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
















				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\fts3_tokenizer1.c"
				>
				<FileConfiguration
					Name="Release|Win32"
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Win32"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Pocket PC 2003 (ARMV4)"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\func.c"







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







1402
1403
1404
1405
1406
1407
1408
















1409
1410
1411
1412
1413
1414
1415
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
















					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\func.c"
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Win32"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Pocket PC 2003 (ARMV4)"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\global.c"
				>
				<FileConfiguration
					Name="Release|Win32"







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







1441
1442
1443
1444
1445
1446
1447
















1448
1449
1450
1451
1452
1453
1454
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
















				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\global.c"
				>
				<FileConfiguration
					Name="Release|Win32"
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Win32"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Pocket PC 2003 (ARMV4)"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\hash.c"







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







1474
1475
1476
1477
1478
1479
1480
















1481
1482
1483
1484
1485
1486
1487
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
















					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\hash.c"
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Win32"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Pocket PC 2003 (ARMV4)"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\insert.c"
				>
				<FileConfiguration
					Name="Release|Win32"







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







1513
1514
1515
1516
1517
1518
1519
















1520
1521
1522
1523
1524
1525
1526
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
















				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\insert.c"
				>
				<FileConfiguration
					Name="Release|Win32"
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Win32"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Pocket PC 2003 (ARMV4)"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\journal.c"







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







1546
1547
1548
1549
1550
1551
1552
















1553
1554
1555
1556
1557
1558
1559
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
















					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\journal.c"
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Win32"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Pocket PC 2003 (ARMV4)"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\legacy.c"
				>
				<FileConfiguration
					Name="Release|Win32"







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







1585
1586
1587
1588
1589
1590
1591
















1592
1593
1594
1595
1596
1597
1598
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
















				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\legacy.c"
				>
				<FileConfiguration
					Name="Release|Win32"
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Win32"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Pocket PC 2003 (ARMV4)"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\loadext.c"







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







1618
1619
1620
1621
1622
1623
1624
















1625
1626
1627
1628
1629
1630
1631
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
















					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\loadext.c"
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Win32"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Pocket PC 2003 (ARMV4)"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\main.c"
				>
				<FileConfiguration
					Name="Release|Win32"







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







1657
1658
1659
1660
1661
1662
1663
















1664
1665
1666
1667
1668
1669
1670
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
















				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\main.c"
				>
				<FileConfiguration
					Name="Release|Win32"
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Win32"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Pocket PC 2003 (ARMV4)"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\malloc.c"
				>
				<FileConfiguration
					Name="Release|Win32"







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







1693
1694
1695
1696
1697
1698
1699
















1700
1701
1702
1703
1704
1705
1706
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
















				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\malloc.c"
				>
				<FileConfiguration
					Name="Release|Win32"
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Win32"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Pocket PC 2003 (ARMV4)"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\mem1.c"







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







1726
1727
1728
1729
1730
1731
1732
















1733
1734
1735
1736
1737
1738
1739
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
















					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\mem1.c"
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Win32"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Pocket PC 2003 (ARMV4)"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\mem2.c"
				>
				<FileConfiguration
					Name="Release|Win32"







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







1765
1766
1767
1768
1769
1770
1771
















1772
1773
1774
1775
1776
1777
1778
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
















				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\mem2.c"
				>
				<FileConfiguration
					Name="Release|Win32"
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Win32"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Pocket PC 2003 (ARMV4)"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\mem3.c"







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







1798
1799
1800
1801
1802
1803
1804
















1805
1806
1807
1808
1809
1810
1811
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
















					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\mem3.c"
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Win32"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Pocket PC 2003 (ARMV4)"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\mem4.c"
				>
				<FileConfiguration
					Name="Release|Win32"







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







1837
1838
1839
1840
1841
1842
1843
















1844
1845
1846
1847
1848
1849
1850
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
















				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\mem4.c"
				>
				<FileConfiguration
					Name="Release|Win32"
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Win32"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Pocket PC 2003 (ARMV4)"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\mem5.c"
				>
				<FileConfiguration
					Name="Release|Win32"







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







1873
1874
1875
1876
1877
1878
1879
















1880
1881
1882
1883
1884
1885
1886
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
















				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\mem5.c"
				>
				<FileConfiguration
					Name="Release|Win32"
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Win32"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Pocket PC 2003 (ARMV4)"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\mutex.c"







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







1906
1907
1908
1909
1910
1911
1912
















1913
1914
1915
1916
1917
1918
1919
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
















					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\mutex.c"
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Win32"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Pocket PC 2003 (ARMV4)"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\mutex_w32.c"
				>
				<FileConfiguration
					Name="Release|Win32"







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







1945
1946
1947
1948
1949
1950
1951
















1952
1953
1954
1955
1956
1957
1958
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
















				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\mutex_w32.c"
				>
				<FileConfiguration
					Name="Release|Win32"
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Win32"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Pocket PC 2003 (ARMV4)"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\opcodes.c"







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







1978
1979
1980
1981
1982
1983
1984
















1985
1986
1987
1988
1989
1990
1991
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
















					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\opcodes.c"
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Win32"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Pocket PC 2003 (ARMV4)"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\os.c"
				>
				<FileConfiguration
					Name="Release|Win32"







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







2017
2018
2019
2020
2021
2022
2023
















2024
2025
2026
2027
2028
2029
2030
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
















				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\os.c"
				>
				<FileConfiguration
					Name="Release|Win32"
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Win32"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Pocket PC 2003 (ARMV4)"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\os_win.c"
				>
				<FileConfiguration
					Name="Release|Win32"







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







2053
2054
2055
2056
2057
2058
2059
















2060
2061
2062
2063
2064
2065
2066
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
















				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\os_win.c"
				>
				<FileConfiguration
					Name="Release|Win32"
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Win32"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Pocket PC 2003 (ARMV4)"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\pager.c"







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







2086
2087
2088
2089
2090
2091
2092
















2093
2094
2095
2096
2097
2098
2099
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
















					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\pager.c"
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
				<FileConfiguration
					Name="Debug|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="StockDebug|Win32"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="StockDebug|Pocket PC 2003 (ARMV4)"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="StockDebug|Itanium"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="StockDebug|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\parse.c"
				>
				<FileConfiguration
					Name="Release|Win32"







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







2157
2158
2159
2160
2161
2162
2163
































2164
2165
2166
2167
2168
2169
2170
				<FileConfiguration
					Name="Debug|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
































				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\parse.c"
				>
				<FileConfiguration
					Name="Release|Win32"
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Win32"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Pocket PC 2003 (ARMV4)"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\pcache.c"
				>
				<FileConfiguration
					Name="Release|Win32"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|Pocket PC 2003 (ARMV4)"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|Itanium"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Win32"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Pocket PC 2003 (ARMV4)"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Itanium"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







2188
2189
2190
2191
2192
2193
2194




















































































2195
2196
2197
2198
2199
2200
2201
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|x64"




















































































					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Win32"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Pocket PC 2003 (ARMV4)"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\prepare.c"
				>
				<FileConfiguration
					Name="Release|Win32"







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







2229
2230
2231
2232
2233
2234
2235
















2236
2237
2238
2239
2240
2241
2242
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
















				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\prepare.c"
				>
				<FileConfiguration
					Name="Release|Win32"
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Win32"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Pocket PC 2003 (ARMV4)"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\printf.c"
				>
				<FileConfiguration
					Name="Release|Win32"







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







2265
2266
2267
2268
2269
2270
2271
















2272
2273
2274
2275
2276
2277
2278
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
















				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\printf.c"
				>
				<FileConfiguration
					Name="Release|Win32"
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Win32"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Pocket PC 2003 (ARMV4)"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\random.c"







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







2298
2299
2300
2301
2302
2303
2304
















2305
2306
2307
2308
2309
2310
2311
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
















					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\random.c"
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Win32"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Pocket PC 2003 (ARMV4)"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\resolve.c"
				>
				<FileConfiguration
					Name="Release|Win32"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|Pocket PC 2003 (ARMV4)"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|Itanium"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Win32"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Pocket PC 2003 (ARMV4)"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Itanium"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\rtree.c"
				>
				<FileConfiguration
					Name="Release|Win32"







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







2337
2338
2339
2340
2341
2342
2343




















































































2344
2345
2346
2347
2348
2349
2350
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>




















































































				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\rtree.c"
				>
				<FileConfiguration
					Name="Release|Win32"
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Win32"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Pocket PC 2003 (ARMV4)"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\select.c"







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







2370
2371
2372
2373
2374
2375
2376
















2377
2378
2379
2380
2381
2382
2383
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
















					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\select.c"
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Win32"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Pocket PC 2003 (ARMV4)"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\status.c"
				>
				<FileConfiguration
					Name="Release|Win32"







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







2409
2410
2411
2412
2413
2414
2415
















2416
2417
2418
2419
2420
2421
2422
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
















				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\status.c"
				>
				<FileConfiguration
					Name="Release|Win32"
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Win32"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Pocket PC 2003 (ARMV4)"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\table.c"







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







2442
2443
2444
2445
2446
2447
2448
















2449
2450
2451
2452
2453
2454
2455
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
















					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\table.c"
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Win32"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Pocket PC 2003 (ARMV4)"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\tokenize.c"
				>
				<FileConfiguration
					Name="Release|Win32"







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







2481
2482
2483
2484
2485
2486
2487
















2488
2489
2490
2491
2492
2493
2494
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
















				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\tokenize.c"
				>
				<FileConfiguration
					Name="Release|Win32"
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Win32"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Pocket PC 2003 (ARMV4)"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\trigger.c"







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







2514
2515
2516
2517
2518
2519
2520
















2521
2522
2523
2524
2525
2526
2527
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
















					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\trigger.c"
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Win32"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Pocket PC 2003 (ARMV4)"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\update.c"
				>
				<FileConfiguration
					Name="Release|Win32"







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







2553
2554
2555
2556
2557
2558
2559
















2560
2561
2562
2563
2564
2565
2566
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
















				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\update.c"
				>
				<FileConfiguration
					Name="Release|Win32"
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Win32"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Pocket PC 2003 (ARMV4)"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\utf.c"
				>
				<FileConfiguration
					Name="Release|Win32"







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







2589
2590
2591
2592
2593
2594
2595
















2596
2597
2598
2599
2600
2601
2602
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
















				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\utf.c"
				>
				<FileConfiguration
					Name="Release|Win32"
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Win32"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Pocket PC 2003 (ARMV4)"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\util.c"







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







2622
2623
2624
2625
2626
2627
2628
















2629
2630
2631
2632
2633
2634
2635
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
















					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\util.c"
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Win32"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Pocket PC 2003 (ARMV4)"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\vacuum.c"
				>
				<FileConfiguration
					Name="Release|Win32"







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







2661
2662
2663
2664
2665
2666
2667
















2668
2669
2670
2671
2672
2673
2674
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
















				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\vacuum.c"
				>
				<FileConfiguration
					Name="Release|Win32"
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Win32"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Pocket PC 2003 (ARMV4)"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\vdbe.c"







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







2694
2695
2696
2697
2698
2699
2700
















2701
2702
2703
2704
2705
2706
2707
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
















					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\vdbe.c"
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Win32"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Pocket PC 2003 (ARMV4)"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\vdbeapi.c"
				>
				<FileConfiguration
					Name="Release|Win32"







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







2733
2734
2735
2736
2737
2738
2739
















2740
2741
2742
2743
2744
2745
2746
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
















				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\vdbeapi.c"
				>
				<FileConfiguration
					Name="Release|Win32"
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Win32"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Pocket PC 2003 (ARMV4)"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\vdbeaux.c"







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







2766
2767
2768
2769
2770
2771
2772
















2773
2774
2775
2776
2777
2778
2779
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
















					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\vdbeaux.c"
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Win32"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Pocket PC 2003 (ARMV4)"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\vdbeblob.c"
				>
				<FileConfiguration
					Name="Release|Win32"







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







2805
2806
2807
2808
2809
2810
2811
















2812
2813
2814
2815
2816
2817
2818
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
















				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\vdbeblob.c"
				>
				<FileConfiguration
					Name="Release|Win32"
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Win32"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Pocket PC 2003 (ARMV4)"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\vdbefifo.c"
				>
				<FileConfiguration
					Name="Release|Win32"







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







2841
2842
2843
2844
2845
2846
2847
















2848
2849
2850
2851
2852
2853
2854
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
















				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\vdbefifo.c"
				>
				<FileConfiguration
					Name="Release|Win32"
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Win32"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Pocket PC 2003 (ARMV4)"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\vdbemem.c"







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







2874
2875
2876
2877
2878
2879
2880
















2881
2882
2883
2884
2885
2886
2887
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
















					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\vdbemem.c"
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Win32"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Pocket PC 2003 (ARMV4)"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\vtab.c"
				>
				<FileConfiguration
					Name="Release|Win32"







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







2913
2914
2915
2916
2917
2918
2919
















2920
2921
2922
2923
2924
2925
2926
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
















				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\vtab.c"
				>
				<FileConfiguration
					Name="Release|Win32"
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Win32"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Pocket PC 2003 (ARMV4)"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\walker.c"
				>
				<FileConfiguration
					Name="Release|Win32"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|Pocket PC 2003 (ARMV4)"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|Itanium"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Win32"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Pocket PC 2003 (ARMV4)"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Itanium"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\where.c"
				>
				<FileConfiguration
					Name="Release|Win32"







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







2949
2950
2951
2952
2953
2954
2955




















































































2956
2957
2958
2959
2960
2961
2962
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>




















































































				</FileConfiguration>
			</File>
			<File
				RelativePath=".\splitsource\where.c"
				>
				<FileConfiguration
					Name="Release|Win32"
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Win32"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Pocket PC 2003 (ARMV4)"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
		</Filter>
		<File







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







2982
2983
2984
2985
2986
2987
2988
















2989
2990
2991
2992
2993
2994
2995
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|x64"
					ExcludedFromBuild="true"
					>
















					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
			</File>
		</Filter>
		<File
Changes to SQLite.Interop/crypt.c.
1
2
3
4
5
6
7
8
9
10
11
#ifndef SQLITE_OMIT_DISKIO
#ifdef SQLITE_HAS_CODEC

#ifdef SQLITE_DEBUG
#include "splitsource\pager.c"
#endif

#include <windows.h>
#include <wincrypt.h>

// Extra padding before and after the cryptographic buffer



|







1
2
3
4
5
6
7
8
9
10
11
#ifndef SQLITE_OMIT_DISKIO
#ifdef SQLITE_HAS_CODEC

#if _DEBUG
#include "splitsource\pager.c"
#endif

#include <windows.h>
#include <wincrypt.h>

// Extra padding before and after the cryptographic buffer
Changes to SQLite.Interop/interop.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115

116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136

137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
#ifndef SQLITE_DEBUG
#include "src/sqlite3.c"
#else
#include "splitsource\btreeint.h"
#include "splitsource\vdbeint.h"
#include "splitsource\sqliteInt.h"
#endif

#include "extension-functions.c"
#include "crypt.c"
#include <tchar.h>

#ifdef NDEBUG

#if _WIN32_WCE
//#include "merge.h"
#else
#include "merge_full.h"
#endif // _WIN32_WCE
#endif // NDEBUG

extern int RegisterExtensionFunctions(sqlite3 *db);

#ifdef SQLITE_OS_WIN




// Additional open flags, we use this one privately
//#define SQLITE_OPEN_SHAREDCACHE      0x01000000

typedef void (*SQLITEUSERFUNC)(sqlite3_context *, int, sqlite3_value **);
typedef void (*SQLITEFUNCFINAL)(sqlite3_context *);

typedef HANDLE (WINAPI *CREATEFILEW)(
    LPCWSTR,
    DWORD,
    DWORD,
    LPSECURITY_ATTRIBUTES,
    DWORD,
    DWORD,
    HANDLE);


/*
** Vista cache hack.  Open a file, but don't use FILE_FLAG_RANDOM_ACCESS -- Vista and above only.
*/
static int winOpenVista(
  sqlite3_vfs *pVfs,        /* Not used */
  const char *zName,        /* Name of the file (UTF-8) */
  sqlite3_file *id,         /* Write the SQLite file handle here */
  int flags,                /* Open mode flags */
  int *pOutFlags            /* Status return flags */
){
  HANDLE h;
  DWORD dwDesiredAccess;
  DWORD dwShareMode;
  DWORD dwCreationDisposition;
  DWORD dwFlagsAndAttributes = 0;
  int isTemp;
  winFile *pFile = (winFile*)id;
  void *zConverted;                 /* Filename in OS encoding */
  const char *zUtf8Name = zName;    /* Filename in UTF-8 encoding */
  char zTmpname[MAX_PATH+1];        /* Buffer used to create temp filename */

  /* If the second argument to this function is NULL, generate a 
  ** temporary file name to use 
  */
  if( !zUtf8Name ){
    int rc = getTempname(MAX_PATH+1, zTmpname);
    if( rc!=SQLITE_OK ){
      return rc;
    }
    zUtf8Name = zTmpname;
  }

  /* Convert the filename to the system encoding. */
  zConverted = convertUtf8Filename(zUtf8Name);
  if( zConverted==0 ){
    return SQLITE_NOMEM;
  }

  if( flags & SQLITE_OPEN_READWRITE ){
    dwDesiredAccess = GENERIC_READ | GENERIC_WRITE;
  }else{
    dwDesiredAccess = GENERIC_READ;
  }
  if( flags & SQLITE_OPEN_CREATE ){
    dwCreationDisposition = OPEN_ALWAYS;
  }else{
    dwCreationDisposition = OPEN_EXISTING;
  }
  if( flags & SQLITE_OPEN_MAIN_DB ){
    dwShareMode = FILE_SHARE_READ | FILE_SHARE_WRITE;
  }else{
    dwShareMode = 0;
  }
  if( flags & SQLITE_OPEN_DELETEONCLOSE ){
#if SQLITE_OS_WINCE
    dwFlagsAndAttributes = FILE_ATTRIBUTE_HIDDEN;
#else
    dwFlagsAndAttributes = FILE_ATTRIBUTE_TEMPORARY
                               | FILE_ATTRIBUTE_HIDDEN
                               | FILE_FLAG_DELETE_ON_CLOSE;
#endif
    isTemp = 1;
  }else{
    dwFlagsAndAttributes = FILE_ATTRIBUTE_NORMAL;
    isTemp = 0;
  }
  /* Reports from the internet are that performance is always
  ** better if FILE_FLAG_RANDOM_ACCESS is used.  Ticket #2699. */
  //dwFlagsAndAttributes |= FILE_FLAG_RANDOM_ACCESS;
  if( isNT() ){
    h = CreateFileW((WCHAR*)zConverted,
       dwDesiredAccess,
       dwShareMode,
       NULL,

       dwCreationDisposition,
       dwFlagsAndAttributes,
       NULL
    );
  }else{
    h = CreateFileA((char*)zConverted,
       dwDesiredAccess,
       dwShareMode,
       NULL,
       dwCreationDisposition,
       dwFlagsAndAttributes,
       NULL
    );
  }
  if( h==INVALID_HANDLE_VALUE ){
    free(zConverted);
    if( flags & SQLITE_OPEN_READWRITE ){
      return winOpen(0, zName, id, 
             ((flags|SQLITE_OPEN_READONLY)&~SQLITE_OPEN_READWRITE), pOutFlags);
    }else{
      return SQLITE_CANTOPEN;

    }
  }
  if( pOutFlags ){
    if( flags & SQLITE_OPEN_READWRITE ){
      *pOutFlags = SQLITE_OPEN_READWRITE;
    }else{
      *pOutFlags = SQLITE_OPEN_READONLY;
    }
  }
  memset(pFile, 0, sizeof(*pFile));
  pFile->pMethod = &winIoMethod;
  pFile->h = h;
#if SQLITE_OS_WINCE
  if( (flags & (SQLITE_OPEN_READWRITE|SQLITE_OPEN_MAIN_DB)) ==
               (SQLITE_OPEN_READWRITE|SQLITE_OPEN_MAIN_DB)
       && !winceCreateLock(zName, pFile)
  ){
    CloseHandle(h);
    free(zConverted);
    return SQLITE_CANTOPEN;
  }
  if( isTemp ){
    pFile->zDeleteOnClose = zConverted;
  }else
#endif
  {
    free(zConverted);
  }
  OpenCounter(+1);
  return SQLITE_OK;
}

int sqlite3_vista_init(void){
  static sqlite3_vfs winVfs = {
    1,                 /* iVersion */
    sizeof(winFile),   /* szOsFile */
    MAX_PATH,          /* mxPathname */
    0,                 /* pNext */
    "win32",           /* zName */
    0,                 /* pAppData */
 
    winOpenVista,      /* xOpen */
    winDelete,         /* xDelete */
    winAccess,         /* xAccess */
    winFullPathname,   /* xFullPathname */
    winDlOpen,         /* xDlOpen */
    winDlError,        /* xDlError */
    winDlSym,          /* xDlSym */
    winDlClose,        /* xDlClose */
    winRandomness,     /* xRandomness */
    winSleep,          /* xSleep */
    winCurrentTime,    /* xCurrentTime */
    winGetLastError    /* xGetLastError */
  };
  sqlite3_vfs_register(&winVfs, 1);
  return SQLITE_OK; 
}

int SetCompression(const wchar_t *pwszFilename, unsigned short ufLevel)
{
#ifdef FSCTL_SET_COMPRESSION
  HMODULE hMod = GetModuleHandle(_T("KERNEL32"));
  CREATEFILEW pfunc;
|














|








>
>
>
















|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|
<
<
<
<
<
<
<
|
<
<
|
<
<
<
<
<
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
>
|
<
<
<
<
<
<
<
<
<
<
<
<
|
<
<
<
<
<
<
<
>
|
|
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|
<
<
<
<
<
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44




















45







46


47





48




































49
50












51







52
53
54
55






















56





57
























58
59
60
61
62
63
64
#ifdef NDEBUG
#include "src/sqlite3.c"
#else
#include "splitsource\btreeint.h"
#include "splitsource\vdbeint.h"
#include "splitsource\sqliteInt.h"
#endif

#include "extension-functions.c"
#include "crypt.c"
#include <tchar.h>

#ifdef NDEBUG

#if _WIN32_WCE
#include "merge.h"
#else
#include "merge_full.h"
#endif // _WIN32_WCE
#endif // NDEBUG

extern int RegisterExtensionFunctions(sqlite3 *db);

#ifdef SQLITE_OS_WIN

// Additional flag for sqlite3.flags, we use it as a reference counter
#define SQLITE_WantClose 0x10000000

// Additional open flags, we use this one privately
//#define SQLITE_OPEN_SHAREDCACHE      0x01000000

typedef void (*SQLITEUSERFUNC)(sqlite3_context *, int, sqlite3_value **);
typedef void (*SQLITEFUNCFINAL)(sqlite3_context *);

typedef HANDLE (WINAPI *CREATEFILEW)(
    LPCWSTR,
    DWORD,
    DWORD,
    LPSECURITY_ATTRIBUTES,
    DWORD,
    DWORD,
    HANDLE);

static CRITICAL_SECTION g_cs;




















static LONG g_dwcsInit = 0;










void EnterGlobalMutex()





{




































  if (InterlockedCompareExchange(&g_dwcsInit, 1, 0) == 0)
    InitializeCriticalSection(&g_cs);




















  EnterCriticalSection(&g_cs);
}

void LeaveGlobalMutex()






















{





  LeaveCriticalSection(&g_cs);
























}

int SetCompression(const wchar_t *pwszFilename, unsigned short ufLevel)
{
#ifdef FSCTL_SET_COMPRESSION
  HMODULE hMod = GetModuleHandle(_T("KERNEL32"));
  CREATEFILEW pfunc;
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275


276
277
278
279
280
281
282
}

__declspec(dllexport) int WINAPI sqlite3_decompressfile(const wchar_t *pwszFilename)
{
  return SetCompression(pwszFilename, COMPRESSION_FORMAT_NONE);
}

__declspec(dllexport) int WINAPI sqlite3_initialize_interop()
{
  int ret = sqlite3_initialize();
  if (ret == SQLITE_OK)
  {
    // Override Vista and abov OS's so they use our hack open() function
    OSVERSIONINFO osi;
    osi.dwOSVersionInfoSize = sizeof(osi);
    if (GetVersionEx(&osi))
    {
      if (osi.dwMajorVersion > 5)
        ret = sqlite3_vista_init();
    }
  }
  return ret;
}

/*
    The goal of this version of close is different than that of sqlite3_close(), and is designed to lend itself better to .NET's non-deterministic finalizers and
    the GC thread.  SQLite will not close a database if statements are open on it -- but for our purposes, we'd rather finalize all active statements
    and forcibly close the database.  The reason is simple -- a lot of people don't Dispose() of their objects correctly and let the garbage collector
    do it.  This leads to unexpected behavior when a user thinks they've closed a database, but it's still open because not all the statements have
    hit the GC yet.

    So, here we have a problem ... .NET has a pointer to any number of sqlite3_stmt objects.  We can't call sqlite3_finalize() on these because
    their memory is freed and can be used for something else.  The GC thread could potentially try and call finalize again on the statement after
    that memory was deallocated.  BAD.  So, what we need to do is make a copy of each statement, and call finalize() on the copy -- so that the original
    statement's memory is preserved, and marked as BAD, but we can still manage to finalize everything and forcibly close the database.  Later when the 
    GC gets around to calling finalize_interop() on the "bad" statement, we detect that and finish deallocating the pointer.
*/
__declspec(dllexport) int WINAPI sqlite3_close_interop(sqlite3 *db)
{
  int ret;
  


  ret = sqlite3_close(db);

  if (ret == SQLITE_BUSY && db->pVdbe)
  {
    while (db->pVdbe)
    {
      // Make a copy of the first prepared statement







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<

















>
>







100
101
102
103
104
105
106

















107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
}

__declspec(dllexport) int WINAPI sqlite3_decompressfile(const wchar_t *pwszFilename)
{
  return SetCompression(pwszFilename, COMPRESSION_FORMAT_NONE);
}


















/*
    The goal of this version of close is different than that of sqlite3_close(), and is designed to lend itself better to .NET's non-deterministic finalizers and
    the GC thread.  SQLite will not close a database if statements are open on it -- but for our purposes, we'd rather finalize all active statements
    and forcibly close the database.  The reason is simple -- a lot of people don't Dispose() of their objects correctly and let the garbage collector
    do it.  This leads to unexpected behavior when a user thinks they've closed a database, but it's still open because not all the statements have
    hit the GC yet.

    So, here we have a problem ... .NET has a pointer to any number of sqlite3_stmt objects.  We can't call sqlite3_finalize() on these because
    their memory is freed and can be used for something else.  The GC thread could potentially try and call finalize again on the statement after
    that memory was deallocated.  BAD.  So, what we need to do is make a copy of each statement, and call finalize() on the copy -- so that the original
    statement's memory is preserved, and marked as BAD, but we can still manage to finalize everything and forcibly close the database.  Later when the 
    GC gets around to calling finalize_interop() on the "bad" statement, we detect that and finish deallocating the pointer.
*/
__declspec(dllexport) int WINAPI sqlite3_close_interop(sqlite3 *db)
{
  int ret;
  
  EnterGlobalMutex();

  ret = sqlite3_close(db);

  if (ret == SQLITE_BUSY && db->pVdbe)
  {
    while (db->pVdbe)
    {
      // Make a copy of the first prepared statement
306
307
308
309
310
311
312


313
314
315
316
317
318
319
320


321
322
323
324
325
326
327


328
329
330
331
332
333
334
        ZeroMemory(po, sizeof(Vdbe));
        po->magic = VDBE_MAGIC_DEAD;
      }
    }
    ret = sqlite3_close(db);
  }



  return ret;
}

__declspec(dllexport) int WINAPI sqlite3_open_interop(const char*filename, int flags, sqlite3 **ppdb)
{
  int ret;
  //int sharedcache = ((flags & SQLITE_OPEN_SHAREDCACHE) != 0);
  //flags &= ~SQLITE_OPEN_SHAREDCACHE;



  //sqlite3_enable_shared_cache(sharedcache);
  ret = sqlite3_open_v2(filename, ppdb, flags, NULL);
  //sqlite3_enable_shared_cache(0);

  if (ret == 0)
    RegisterExtensionFunctions(*ppdb);



  return ret;
}

__declspec(dllexport) int WINAPI sqlite3_open16_interop(const char *filename, int flags, sqlite3 **ppdb)
{
  int ret = sqlite3_open_interop(filename, flags, ppdb);







>
>








>
>







>
>







156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
        ZeroMemory(po, sizeof(Vdbe));
        po->magic = VDBE_MAGIC_DEAD;
      }
    }
    ret = sqlite3_close(db);
  }

  LeaveGlobalMutex();

  return ret;
}

__declspec(dllexport) int WINAPI sqlite3_open_interop(const char*filename, int flags, sqlite3 **ppdb)
{
  int ret;
  //int sharedcache = ((flags & SQLITE_OPEN_SHAREDCACHE) != 0);
  //flags &= ~SQLITE_OPEN_SHAREDCACHE;

  //EnterGlobalMutex();

  //sqlite3_enable_shared_cache(sharedcache);
  ret = sqlite3_open_v2(filename, ppdb, flags, NULL);
  //sqlite3_enable_shared_cache(0);

  if (ret == 0)
    RegisterExtensionFunctions(*ppdb);

  //LeaveGlobalMutex();

  return ret;
}

__declspec(dllexport) int WINAPI sqlite3_open16_interop(const char *filename, int flags, sqlite3 **ppdb)
{
  int ret = sqlite3_open_interop(filename, flags, ppdb);
434
435
436
437
438
439
440

441
442
443
444


445
446
447


448
449
450
451
452
453

454
455
456
457















458
459
460
461
462
463
464
  const void *pval = sqlite3_column_text16(stmt, iCol);
  *plen = (pval != 0) ? wcslen((wchar_t *)pval) * sizeof(wchar_t): 0;
  return pval;
}

__declspec(dllexport) int WINAPI sqlite3_finalize_interop(sqlite3_stmt *stmt)
{

  Vdbe *p;
  sqlite3 *db;
  int ret;



  p = (Vdbe *)stmt;
  db = (p == NULL) ? NULL : p->db;



  if (p->magic == VDBE_MAGIC_DEAD)
  {
    if (db == NULL)
    {
      sqlite3_free(p);
      ret = SQLITE_OK;

    }
  }
  else
    ret = sqlite3_finalize(stmt);
















  return ret;
}

__declspec(dllexport) int WINAPI sqlite3_reset_interop(sqlite3_stmt *stmt)
{
  int ret;







>




>
>



>
>
|
|
|
|
|
|
>
|
|
|

>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
  const void *pval = sqlite3_column_text16(stmt, iCol);
  *plen = (pval != 0) ? wcslen((wchar_t *)pval) * sizeof(wchar_t): 0;
  return pval;
}

__declspec(dllexport) int WINAPI sqlite3_finalize_interop(sqlite3_stmt *stmt)
{
  // Try and finalize a statement, and close the database it belonged to if the database was marked for closing
  Vdbe *p;
  sqlite3 *db;
  int ret;

  EnterGlobalMutex();

  p = (Vdbe *)stmt;
  db = (p == NULL) ? NULL : p->db;

  while(1)
  {
    if (p->magic == VDBE_MAGIC_DEAD)
    {
      if (db == NULL)
      {
        sqlite3_free(p);
        ret = SQLITE_OK;
        break;
      }
    }

    ret = sqlite3_finalize(stmt);

    if (ret == SQLITE_OK)
    {
      if (db->flags & SQLITE_WantClose)
      {
        if (db->pVdbe == NULL)
        {
          ret = sqlite3_close(db);
        }
      }
    }
    break;
  }

  LeaveGlobalMutex();

  return ret;
}

__declspec(dllexport) int WINAPI sqlite3_reset_interop(sqlite3_stmt *stmt)
{
  int ret;
Changes to SQLite.Interop/merge.h.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// This code was automatically generated from assembly
// C:\Src\SQLite.NET\bin\CompactFramework\System.Data.SQLite.dll

#include <windef.h>

#pragma data_seg(push,clrseg,".clr")
#pragma comment(linker, "/SECTION:.clr,ER")
  char __ph[592628] = {0}; // The number of bytes to reserve
#pragma data_seg(pop,clrseg)

typedef BOOL (WINAPI *DLLMAIN)(HANDLE, DWORD, LPVOID);
typedef struct EXTRA_STUFF
{
  DWORD dwNativeEntryPoint;
} EXTRA_STUFF, *LPEXTRA_STUFF;

|





|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// This code was automatically generated from assembly
// C:\Src\SQLite.NET\System.Data.SQLite\bin\CompactFramework\System.Data.SQLite.dll

#include <windef.h>

#pragma data_seg(push,clrseg,".clr")
#pragma comment(linker, "/SECTION:.clr,ER")
  char __ph[143484] = {0}; // The number of bytes to reserve
#pragma data_seg(pop,clrseg)

typedef BOOL (WINAPI *DLLMAIN)(HANDLE, DWORD, LPVOID);
typedef struct EXTRA_STUFF
{
  DWORD dwNativeEntryPoint;
} EXTRA_STUFF, *LPEXTRA_STUFF;
Changes to SQLite.Interop/merge_full.h.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// This code was automatically generated from assembly
// C:\Src\SQLite.NET\System.Data.SQLite\bin\System.Data.SQLite.dll

#include <windef.h>

#pragma data_seg(push,clrseg,".clr")
#pragma comment(linker, "/SECTION:.clr,ER")
  char __ph[157996] = {0}; // The number of bytes to reserve
#pragma data_seg(pop,clrseg)

typedef BOOL (WINAPI *DLLMAIN)(HANDLE, DWORD, LPVOID);
typedef struct EXTRA_STUFF
{
  DWORD dwNativeEntryPoint;
} EXTRA_STUFF, *LPEXTRA_STUFF;

|





|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// This code was automatically generated from assembly
// C:\Src\SQLite.NET\bin\ManagedOnly\System.Data.SQLite.dll

#include <windef.h>

#pragma data_seg(push,clrseg,".clr")
#pragma comment(linker, "/SECTION:.clr,ER")
  char __ph[155780] = {0}; // The number of bytes to reserve
#pragma data_seg(pop,clrseg)

typedef BOOL (WINAPI *DLLMAIN)(HANDLE, DWORD, LPVOID);
typedef struct EXTRA_STUFF
{
  DWORD dwNativeEntryPoint;
} EXTRA_STUFF, *LPEXTRA_STUFF;
Changes to SQLite.Interop/src/sqlite3.c.

more than 10,000 changes

Changes to SQLite.Interop/src/sqlite3.h.
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
** on how SQLite interfaces are suppose to operate.
**
** The name of this file under configuration management is "sqlite.h.in".
** The makefile makes some minor changes to this file (such as inserting
** the version number) and changes its name to "sqlite3.h" as
** part of the build process.
**
** @(#) $Id: sqlite3.h,v 1.38 2008/09/22 16:30:23 rmsimpson Exp $
*/
#ifndef _SQLITE3_H_
#define _SQLITE3_H_
#include <stdarg.h>     /* Needed for the definition of va_list */

/*
** Make sure we can call this stuff from C++.
*/
#ifdef __cplusplus
extern "C" {
#endif


/*
** Add the ability to override 'extern'
*/
#ifndef SQLITE_EXTERN
# define SQLITE_EXTERN extern
#endif

/*
** Add the ability to mark interfaces as deprecated.
*/
#if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))
  /* GCC added the deprecated attribute in version 3.1 */
  #define SQLITE_DEPRECATED __attribute__ ((deprecated))
#elif defined(_MSC_VER) && (_MSC_VER>1200) 
  #define SQLITE_DEPRECATED __declspec(deprecated)
#else
  #define SQLITE_DEPRECATED
#endif

/*
** Add the ability to mark interfaces as experimental.
*/
#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
  /* I can confirm that it does not work on version 4.1.0... */
  /* First appears in GCC docs for version 4.3.0 */
  #define SQLITE_EXPERIMENTAL __attribute__ ((warning ("is experimental")))
#elif defined(_MSC_VER) && (_MSC_VER>1200) 
  #define SQLITE_EXPERIMENTAL __declspec(deprecated("was declared experimental"))
#else
  #define SQLITE_EXPERIMENTAL
#endif

/*
** Ensure these symbols were not defined by some previous header file.
*/
#ifdef SQLITE_VERSION
# undef SQLITE_VERSION
#endif
#ifdef SQLITE_VERSION_NUMBER







|




















<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53

























54
55
56
57
58
59
60
** on how SQLite interfaces are suppose to operate.
**
** The name of this file under configuration management is "sqlite.h.in".
** The makefile makes some minor changes to this file (such as inserting
** the version number) and changes its name to "sqlite3.h" as
** part of the build process.
**
** @(#) $Id: sqlite3.h,v 1.36 2008/08/06 21:45:32 rmsimpson Exp $
*/
#ifndef _SQLITE3_H_
#define _SQLITE3_H_
#include <stdarg.h>     /* Needed for the definition of va_list */

/*
** Make sure we can call this stuff from C++.
*/
#ifdef __cplusplus
extern "C" {
#endif


/*
** Add the ability to override 'extern'
*/
#ifndef SQLITE_EXTERN
# define SQLITE_EXTERN extern
#endif


























/*
** Ensure these symbols were not defined by some previous header file.
*/
#ifdef SQLITE_VERSION
# undef SQLITE_VERSION
#endif
#ifdef SQLITE_VERSION_NUMBER
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
**          evaluate to a string literal that is the SQLite version
**          with which the header file is associated.
**
** {H10014} The SQLITE_VERSION_NUMBER #define shall resolve to an integer
**          with the value (X*1000000 + Y*1000 + Z) where X, Y, and Z
**          are the major version, minor version, and release number.
*/
#define SQLITE_VERSION         "3.6.3"
#define SQLITE_VERSION_NUMBER  3006003

/*
** CAPI3REF: Run-Time Library Version Numbers {H10020} <S60100>
** KEYWORDS: sqlite3_version
**
** These features provide the same information as the [SQLITE_VERSION]
** and [SQLITE_VERSION_NUMBER] #defines in the header, but are associated







|
|







87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
**          evaluate to a string literal that is the SQLite version
**          with which the header file is associated.
**
** {H10014} The SQLITE_VERSION_NUMBER #define shall resolve to an integer
**          with the value (X*1000000 + Y*1000 + Z) where X, Y, and Z
**          are the major version, minor version, and release number.
*/
#define SQLITE_VERSION         "3.6.1"
#define SQLITE_VERSION_NUMBER  3006001

/*
** CAPI3REF: Run-Time Library Version Numbers {H10020} <S60100>
** KEYWORDS: sqlite3_version
**
** These features provide the same information as the [SQLITE_VERSION]
** and [SQLITE_VERSION_NUMBER] #defines in the header, but are associated
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
const char *sqlite3_libversion(void);
int sqlite3_libversion_number(void);

/*
** CAPI3REF: Test To See If The Library Is Threadsafe {H10100} <S60100>
**
** SQLite can be compiled with or without mutexes.  When
** the [SQLITE_THREADSAFE] C preprocessor macro 1 or 2, mutexes
** are enabled and SQLite is threadsafe.  When the
** [SQLITE_THREADSAFE] macro is 0, 
** the mutexes are omitted.  Without the mutexes, it is not safe
** to use SQLite concurrently from more than one thread.
**
** Enabling mutexes incurs a measurable performance penalty.
** So if speed is of utmost importance, it makes sense to disable
** the mutexes.  But for maximum safety, mutexes should be enabled.
** The default behavior is for mutexes to be enabled.







|
|
<







125
126
127
128
129
130
131
132
133

134
135
136
137
138
139
140
const char *sqlite3_libversion(void);
int sqlite3_libversion_number(void);

/*
** CAPI3REF: Test To See If The Library Is Threadsafe {H10100} <S60100>
**
** SQLite can be compiled with or without mutexes.  When
** the [SQLITE_THREADSAFE] C preprocessor macro is true, mutexes
** are enabled and SQLite is threadsafe.  When that macro is false,

** the mutexes are omitted.  Without the mutexes, it is not safe
** to use SQLite concurrently from more than one thread.
**
** Enabling mutexes incurs a measurable performance penalty.
** So if speed is of utmost importance, it makes sense to disable
** the mutexes.  But for maximum safety, mutexes should be enabled.
** The default behavior is for mutexes to be enabled.
174
175
176
177
178
179
180
181
182
183
184
185
186
187


188
189
190
191
192
193
194
** SQLITE_THREADSAFE=1 then mutexes are enabled by default but
** can be fully or partially disabled using a call to [sqlite3_config()]
** with the verbs [SQLITE_CONFIG_SINGLETHREAD], [SQLITE_CONFIG_MULTITHREAD],
** or [SQLITE_CONFIG_MUTEX].  The return value of this function shows
** only the default compile-time setting, not any run-time changes
** to that setting.
**
** See the [threading mode] documentation for additional information.
**
** INVARIANTS:
**
** {H10101} The [sqlite3_threadsafe()] function shall return nonzero if
**          and only if
**          SQLite was compiled with the its mutexes enabled by default.


**
** {H10102} The value returned by the [sqlite3_threadsafe()] function
**          shall not change when mutex setting are modified at
**          runtime using the [sqlite3_config()] interface and 
**          especially the [SQLITE_CONFIG_SINGLETHREAD],
**          [SQLITE_CONFIG_MULTITHREAD], [SQLITE_CONFIG_SERIALIZED],
**          and [SQLITE_CONFIG_MUTEX] verbs.







<
<



<
|
>
>







148
149
150
151
152
153
154


155
156
157

158
159
160
161
162
163
164
165
166
167
** SQLITE_THREADSAFE=1 then mutexes are enabled by default but
** can be fully or partially disabled using a call to [sqlite3_config()]
** with the verbs [SQLITE_CONFIG_SINGLETHREAD], [SQLITE_CONFIG_MULTITHREAD],
** or [SQLITE_CONFIG_MUTEX].  The return value of this function shows
** only the default compile-time setting, not any run-time changes
** to that setting.
**


** INVARIANTS:
**
** {H10101} The [sqlite3_threadsafe()] function shall return nonzero if

**          SQLite was compiled with the its mutexes enabled by default
**          or zero if SQLite was compiled such that mutexes are
**          permanently disabled.
**
** {H10102} The value returned by the [sqlite3_threadsafe()] function
**          shall not change when mutex setting are modified at
**          runtime using the [sqlite3_config()] interface and 
**          especially the [SQLITE_CONFIG_SINGLETHREAD],
**          [SQLITE_CONFIG_MULTITHREAD], [SQLITE_CONFIG_SERIALIZED],
**          and [SQLITE_CONFIG_MUTEX] verbs.
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
#define SQLITE_IOERR_UNLOCK            (SQLITE_IOERR | (8<<8))
#define SQLITE_IOERR_RDLOCK            (SQLITE_IOERR | (9<<8))
#define SQLITE_IOERR_DELETE            (SQLITE_IOERR | (10<<8))
#define SQLITE_IOERR_BLOCKED           (SQLITE_IOERR | (11<<8))
#define SQLITE_IOERR_NOMEM             (SQLITE_IOERR | (12<<8))
#define SQLITE_IOERR_ACCESS            (SQLITE_IOERR | (13<<8))
#define SQLITE_IOERR_CHECKRESERVEDLOCK (SQLITE_IOERR | (14<<8))
#define SQLITE_IOERR_LOCK              (SQLITE_IOERR | (15<<8))

/*
** CAPI3REF: Flags For File Open Operations {H10230} <H11120> <H12700>
**
** These bit values are intended for use in the
** 3rd parameter to the [sqlite3_open_v2()] interface and
** in the 4th parameter to the xOpen method of the







<







487
488
489
490
491
492
493

494
495
496
497
498
499
500
#define SQLITE_IOERR_UNLOCK            (SQLITE_IOERR | (8<<8))
#define SQLITE_IOERR_RDLOCK            (SQLITE_IOERR | (9<<8))
#define SQLITE_IOERR_DELETE            (SQLITE_IOERR | (10<<8))
#define SQLITE_IOERR_BLOCKED           (SQLITE_IOERR | (11<<8))
#define SQLITE_IOERR_NOMEM             (SQLITE_IOERR | (12<<8))
#define SQLITE_IOERR_ACCESS            (SQLITE_IOERR | (13<<8))
#define SQLITE_IOERR_CHECKRESERVEDLOCK (SQLITE_IOERR | (14<<8))


/*
** CAPI3REF: Flags For File Open Operations {H10230} <H11120> <H12700>
**
** These bit values are intended for use in the
** 3rd parameter to the [sqlite3_open_v2()] interface and
** in the 4th parameter to the xOpen method of the
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
#define SQLITE_OPEN_TEMP_DB          0x00000200
#define SQLITE_OPEN_TRANSIENT_DB     0x00000400
#define SQLITE_OPEN_MAIN_JOURNAL     0x00000800
#define SQLITE_OPEN_TEMP_JOURNAL     0x00001000
#define SQLITE_OPEN_SUBJOURNAL       0x00002000
#define SQLITE_OPEN_MASTER_JOURNAL   0x00004000
#define SQLITE_OPEN_NOMUTEX          0x00008000
#define SQLITE_OPEN_FULLMUTEX        0x00010000

/*
** CAPI3REF: Device Characteristics {H10240} <H11120>
**
** The xDeviceCapabilities method of the [sqlite3_io_methods]
** object returns an integer which is a vector of the these
** bit values expressing I/O characteristics of the mass storage







<







509
510
511
512
513
514
515

516
517
518
519
520
521
522
#define SQLITE_OPEN_TEMP_DB          0x00000200
#define SQLITE_OPEN_TRANSIENT_DB     0x00000400
#define SQLITE_OPEN_MAIN_JOURNAL     0x00000800
#define SQLITE_OPEN_TEMP_JOURNAL     0x00001000
#define SQLITE_OPEN_SUBJOURNAL       0x00002000
#define SQLITE_OPEN_MASTER_JOURNAL   0x00004000
#define SQLITE_OPEN_NOMUTEX          0x00008000


/*
** CAPI3REF: Device Characteristics {H10240} <H11120>
**
** The xDeviceCapabilities method of the [sqlite3_io_methods]
** object returns an integer which is a vector of the these
** bit values expressing I/O characteristics of the mass storage
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
** vary depending on the [SQLITE_CONFIG_SINGLETHREAD | configuration option]
** in the first argument.
**
** When a configuration option is set, sqlite3_config() returns SQLITE_OK.
** If the option is unknown or SQLite is unable to set the option
** then this routine returns a non-zero [error code].
*/
SQLITE_EXPERIMENTAL int sqlite3_config(int, ...);

/*
** CAPI3REF: Configure database connections  {H10180} <S20000>
** EXPERIMENTAL
**
** The sqlite3_db_config() interface is used to make configuration
** changes to a [database connection].  The interface is similar to
** [sqlite3_config()] except that the changes apply to a single
** [database connection] (specified in the first argument).  The
** sqlite3_db_config() interface can only be used immediately after
** the database connection is created using [sqlite3_open()],
** [sqlite3_open16()], or [sqlite3_open_v2()].  
**
** The second argument to sqlite3_db_config(D,V,...)  is the
** configuration verb - an integer code that indicates what
** aspect of the [database connection] is being configured.
** The only choice for this value is [SQLITE_DBCONFIG_LOOKASIDE].
** New verbs are likely to be added in future releases of SQLite.
** Additional arguments depend on the verb.
*/
SQLITE_EXPERIMENTAL int sqlite3_db_config(sqlite3*, int op, ...);

/*
** CAPI3REF: Memory Allocation Routines {H10155} <S20120>
** EXPERIMENTAL
**
** An instance of this object defines the interface between SQLite
** and low-level memory allocation routines.







|




















|







962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
** vary depending on the [SQLITE_CONFIG_SINGLETHREAD | configuration option]
** in the first argument.
**
** When a configuration option is set, sqlite3_config() returns SQLITE_OK.
** If the option is unknown or SQLite is unable to set the option
** then this routine returns a non-zero [error code].
*/
int sqlite3_config(int, ...);

/*
** CAPI3REF: Configure database connections  {H10180} <S20000>
** EXPERIMENTAL
**
** The sqlite3_db_config() interface is used to make configuration
** changes to a [database connection].  The interface is similar to
** [sqlite3_config()] except that the changes apply to a single
** [database connection] (specified in the first argument).  The
** sqlite3_db_config() interface can only be used immediately after
** the database connection is created using [sqlite3_open()],
** [sqlite3_open16()], or [sqlite3_open_v2()].  
**
** The second argument to sqlite3_db_config(D,V,...)  is the
** configuration verb - an integer code that indicates what
** aspect of the [database connection] is being configured.
** The only choice for this value is [SQLITE_DBCONFIG_LOOKASIDE].
** New verbs are likely to be added in future releases of SQLite.
** Additional arguments depend on the verb.
*/
int sqlite3_db_config(sqlite3*, int op, ...);

/*
** CAPI3REF: Memory Allocation Routines {H10155} <S20120>
** EXPERIMENTAL
**
** An instance of this object defines the interface between SQLite
** and low-level memory allocation routines.
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115




1116
1117
1118
1119
1120
1121
1122
**
** <dt>SQLITE_CONFIG_MULTITHREAD</dt>
** <dd>There are no arguments to this option.  This option disables
** mutexing on [database connection] and [prepared statement] objects.
** The application is responsible for serializing access to
** [database connections] and [prepared statements].  But other mutexes
** are enabled so that SQLite will be safe to use in a multi-threaded
** environment as long as no two threads attempt to use the same
** [database connection] at the same time.  See the [threading mode]
** documentation for additional information.</dd>
**
** <dt>SQLITE_CONFIG_SERIALIZED</dt>
** <dd>There are no arguments to this option.  This option enables
** all mutexes including the recursive
** mutexes on [database connection] and [prepared statement] objects.
** In this mode (which is the default when SQLite is compiled with
** [SQLITE_THREADSAFE=1]) the SQLite library will itself serialize access
** to [database connections] and [prepared statements] so that the
** application is free to use the same [database connection] or the
** same [prepared statement] in different threads at the same time.
** See the [threading mode] documentation for additional information.</dd>




**
** <dt>SQLITE_CONFIG_MALLOC</dt>
** <dd>This option takes a single argument which is a pointer to an
** instance of the [sqlite3_mem_methods] structure.  The argument specifies
** alternative low-level memory allocation routines to be used in place of
** the memory allocation routines built into SQLite.</dd>
**







|
<
<










|
>
>
>
>







1066
1067
1068
1069
1070
1071
1072
1073


1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
**
** <dt>SQLITE_CONFIG_MULTITHREAD</dt>
** <dd>There are no arguments to this option.  This option disables
** mutexing on [database connection] and [prepared statement] objects.
** The application is responsible for serializing access to
** [database connections] and [prepared statements].  But other mutexes
** are enabled so that SQLite will be safe to use in a multi-threaded
** environment.</dd>


**
** <dt>SQLITE_CONFIG_SERIALIZED</dt>
** <dd>There are no arguments to this option.  This option enables
** all mutexes including the recursive
** mutexes on [database connection] and [prepared statement] objects.
** In this mode (which is the default when SQLite is compiled with
** [SQLITE_THREADSAFE=1]) the SQLite library will itself serialize access
** to [database connections] and [prepared statements] so that the
** application is free to use the same [database connection] or the
** same [prepared statement] in different threads at the same time.
**
** <p>This configuration option merely sets the default mutex 
** behavior to serialize access to [database connections].  Individual
** [database connections] can override this setting
** using the [SQLITE_OPEN_NOMUTEX] flag to [sqlite3_open_v2()].</p></dd>
**
** <dt>SQLITE_CONFIG_MALLOC</dt>
** <dd>This option takes a single argument which is a pointer to an
** instance of the [sqlite3_mem_methods] structure.  The argument specifies
** alternative low-level memory allocation routines to be used in place of
** the memory allocation routines built into SQLite.</dd>
**
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
** this is important.
**
** There can only be a single busy handler defined for each
** [database connection].  Setting a new busy handler clears any
** previously set handler.  Note that calling [sqlite3_busy_timeout()]
** will also set or clear the busy handler.
**
** The busy callback should not take any actions which modify the
** database connection that invoked the busy handler.  Any such actions
** result in undefined behavior.
** 
** INVARIANTS:
**
** {H12311} The [sqlite3_busy_handler(D,C,A)] function shall replace
**          busy callback in the [database connection] D with a new
**          a new busy handler C and application data pointer A.
**
** {H12312} Newly created [database connections] shall have a busy







<
<
<
<







1544
1545
1546
1547
1548
1549
1550




1551
1552
1553
1554
1555
1556
1557
** this is important.
**
** There can only be a single busy handler defined for each
** [database connection].  Setting a new busy handler clears any
** previously set handler.  Note that calling [sqlite3_busy_timeout()]
** will also set or clear the busy handler.
**




** INVARIANTS:
**
** {H12311} The [sqlite3_busy_handler(D,C,A)] function shall replace
**          busy callback in the [database connection] D with a new
**          a new busy handler C and application data pointer A.
**
** {H12312} Newly created [database connections] shall have a busy
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
** in addition to using an authorizer.
**
** Only a single authorizer can be in place on a database connection
** at a time.  Each call to sqlite3_set_authorizer overrides the
** previous call.  Disable the authorizer by installing a NULL callback.
** The authorizer is disabled by default.
**
** The authorizer callback must not do anything that will modify
** the database connection that invoked the authorizer callback.
** Note that [sqlite3_prepare_v2()] and [sqlite3_step()] both modify their
** database connections for the meaning of "modify" in this paragraph.
**
** When [sqlite3_prepare_v2()] is used to prepare a statement, the
** statement might be reprepared during [sqlite3_step()] due to a 
** schema change.  Hence, the application should ensure that the
** correct authorizer callback remains in place during the [sqlite3_step()].
**
** Note that the authorizer callback is invoked only during
** [sqlite3_prepare()] or its variants.  Authorization is not
** performed during statement evaluation in [sqlite3_step()].
**
** INVARIANTS:
**
** {H12501} The [sqlite3_set_authorizer(D,...)] interface registers a
**          authorizer callback with database connection D.
**
** {H12502} The authorizer callback is invoked as SQL statements are
**          being parseed and compiled.
**
** {H12503} If the authorizer callback returns any value other than
**          [SQLITE_IGNORE], [SQLITE_OK], or [SQLITE_DENY], then
**          the application interface call that caused
**          the authorizer callback to run shall fail with an
**          [SQLITE_ERROR] error code and an appropriate error message.
**
** {H12504} When the authorizer callback returns [SQLITE_OK], the operation
**          described is processed normally.
**
** {H12505} When the authorizer callback returns [SQLITE_DENY], the
**          application interface call that caused the
**          authorizer callback to run shall fail
**          with an [SQLITE_ERROR] error code and an error message
**          explaining that access is denied.
**
** {H12506} If the authorizer code (the 2nd parameter to the authorizer
**          callback) is [SQLITE_READ] and the authorizer callback returns
**          [SQLITE_IGNORE], then the prepared statement is constructed to







<
<
<
<
<
<
<
<
<
<










|



|







|







2072
2073
2074
2075
2076
2077
2078










2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
** in addition to using an authorizer.
**
** Only a single authorizer can be in place on a database connection
** at a time.  Each call to sqlite3_set_authorizer overrides the
** previous call.  Disable the authorizer by installing a NULL callback.
** The authorizer is disabled by default.
**










** Note that the authorizer callback is invoked only during
** [sqlite3_prepare()] or its variants.  Authorization is not
** performed during statement evaluation in [sqlite3_step()].
**
** INVARIANTS:
**
** {H12501} The [sqlite3_set_authorizer(D,...)] interface registers a
**          authorizer callback with database connection D.
**
** {H12502} The authorizer callback is invoked as SQL statements are
**          being compiled.
**
** {H12503} If the authorizer callback returns any value other than
**          [SQLITE_IGNORE], [SQLITE_OK], or [SQLITE_DENY], then
**          the [sqlite3_prepare_v2()] or equivalent call that caused
**          the authorizer callback to run shall fail with an
**          [SQLITE_ERROR] error code and an appropriate error message.
**
** {H12504} When the authorizer callback returns [SQLITE_OK], the operation
**          described is processed normally.
**
** {H12505} When the authorizer callback returns [SQLITE_DENY], the
**          [sqlite3_prepare_v2()] or equivalent call that caused the
**          authorizer callback to run shall fail
**          with an [SQLITE_ERROR] error code and an error message
**          explaining that access is denied.
**
** {H12506} If the authorizer code (the 2nd parameter to the authorizer
**          callback) is [SQLITE_READ] and the authorizer callback returns
**          [SQLITE_IGNORE], then the prepared statement is constructed to
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
** is the name of the inner-most trigger or view that is responsible for
** the access attempt or NULL if this access attempt is directly from
** top-level SQL code.
**
** INVARIANTS:
**
** {H12551} The second parameter to an
**          [sqlite3_set_authorizer | authorizer callback] shall be an integer
**          [SQLITE_COPY | authorizer code] that specifies what action
**          is being authorized.
**
** {H12552} The 3rd and 4th parameters to the
**          [sqlite3_set_authorizer | authorization callback]
**          shall be parameters or NULL depending on which
**          [SQLITE_COPY | authorizer code] is used as the second parameter.
**
** {H12553} The 5th parameter to the
**          [sqlite3_set_authorizer | authorizer callback] shall be the name
**          of the database (example: "main", "temp", etc.) if applicable.
**
** {H12554} The 6th parameter to the
**          [sqlite3_set_authorizer | authorizer callback] shall be the name
**          of the inner-most trigger or view that is responsible for
**          the access attempt or NULL if this access attempt is directly from
**          top-level SQL code.
*/
/******************************************* 3rd ************ 4th ***********/
#define SQLITE_CREATE_INDEX          1   /* Index Name      Table Name      */
#define SQLITE_CREATE_TABLE          2   /* Table Name      NULL            */







|





|



|



|







2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
** is the name of the inner-most trigger or view that is responsible for
** the access attempt or NULL if this access attempt is directly from
** top-level SQL code.
**
** INVARIANTS:
**
** {H12551} The second parameter to an
**          [sqlite3_set_authorizer | authorizer callback] is always an integer
**          [SQLITE_COPY | authorizer code] that specifies what action
**          is being authorized.
**
** {H12552} The 3rd and 4th parameters to the
**          [sqlite3_set_authorizer | authorization callback]
**          will be parameters or NULL depending on which
**          [SQLITE_COPY | authorizer code] is used as the second parameter.
**
** {H12553} The 5th parameter to the
**          [sqlite3_set_authorizer | authorizer callback] is the name
**          of the database (example: "main", "temp", etc.) if applicable.
**
** {H12554} The 6th parameter to the
**          [sqlite3_set_authorizer | authorizer callback] is the name
**          of the inner-most trigger or view that is responsible for
**          the access attempt or NULL if this access attempt is directly from
**          top-level SQL code.
*/
/******************************************* 3rd ************ 4th ***********/
#define SQLITE_CREATE_INDEX          1   /* Index Name      Table Name      */
#define SQLITE_CREATE_TABLE          2   /* Table Name      NULL            */
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
** The callback function registered by sqlite3_profile() is invoked
** as each SQL statement finishes.  The profile callback contains
** the original statement text and an estimate of wall-clock time
** of how long that statement took to run.
**
** INVARIANTS:
**
** {H12281} The callback function registered by [sqlite3_trace()] 
**          shall be invoked
**          whenever an SQL statement first begins to execute and
**          whenever a trigger subprogram first begins to run.
**
** {H12282} Each call to [sqlite3_trace()] shall override the previously
**          registered trace callback.
**
** {H12283} A NULL trace callback shall disable tracing.
**
** {H12284} The first argument to the trace callback shall be a copy of
**          the pointer which was the 3rd argument to [sqlite3_trace()].
**
** {H12285} The second argument to the trace callback is a
**          zero-terminated UTF-8 string containing the original text
**          of the SQL statement as it was passed into [sqlite3_prepare_v2()]
**          or the equivalent, or an SQL comment indicating the beginning
**          of a trigger subprogram.







|
<



|


|

|







2242
2243
2244
2245
2246
2247
2248
2249

2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
** The callback function registered by sqlite3_profile() is invoked
** as each SQL statement finishes.  The profile callback contains
** the original statement text and an estimate of wall-clock time
** of how long that statement took to run.
**
** INVARIANTS:
**
** {H12281} The callback function registered by [sqlite3_trace()] is

**          whenever an SQL statement first begins to execute and
**          whenever a trigger subprogram first begins to run.
**
** {H12282} Each call to [sqlite3_trace()] overrides the previously
**          registered trace callback.
**
** {H12283} A NULL trace callback disables tracing.
**
** {H12284} The first argument to the trace callback is a copy of
**          the pointer which was the 3rd argument to [sqlite3_trace()].
**
** {H12285} The second argument to the trace callback is a
**          zero-terminated UTF-8 string containing the original text
**          of the SQL statement as it was passed into [sqlite3_prepare_v2()]
**          or the equivalent, or an SQL comment indicating the beginning
**          of a trigger subprogram.
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
**          the SQL statement as it was processed by [sqlite3_prepare_v2()]
**          or the equivalent.
**
** {H12290} The third parameter to the profile callback is an estimate
**          of the number of nanoseconds of wall-clock time required to
**          run the SQL statement from start to finish.
*/
SQLITE_EXPERIMENTAL void *sqlite3_trace(sqlite3*, void(*xTrace)(void*,const char*), void*);
SQLITE_EXPERIMENTAL void *sqlite3_profile(sqlite3*,
   void(*xProfile)(void*,const char*,sqlite3_uint64), void*);

/*
** CAPI3REF: Query Progress Callbacks {H12910} <S60400>
**
** This routine configures a callback function - the
** progress callback - that is invoked periodically during long
** running calls to [sqlite3_exec()], [sqlite3_step()] and
** [sqlite3_get_table()].  An example use for this
** interface is to keep a GUI updated during a large query.
**
** If the progress callback returns non-zero, the operation is
** interrupted.  This feature can be used to implement a
** "Cancel" button on a GUI progress dialog box.
**
** The progress handler must not do anything that will modify
** the database connection that invoked the progress handler.
** Note that [sqlite3_prepare_v2()] and [sqlite3_step()] both modify their
** database connections for the meaning of "modify" in this paragraph.
**
** INVARIANTS:
**
** {H12911} The callback function registered by sqlite3_progress_handler()
**          is invoked periodically during long running calls to
**          [sqlite3_step()].
**







|
|













|
<
<
<
<
<







2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297





2298
2299
2300
2301
2302
2303
2304
**          the SQL statement as it was processed by [sqlite3_prepare_v2()]
**          or the equivalent.
**
** {H12290} The third parameter to the profile callback is an estimate
**          of the number of nanoseconds of wall-clock time required to
**          run the SQL statement from start to finish.
*/
void *sqlite3_trace(sqlite3*, void(*xTrace)(void*,const char*), void*);
void *sqlite3_profile(sqlite3*,
   void(*xProfile)(void*,const char*,sqlite3_uint64), void*);

/*
** CAPI3REF: Query Progress Callbacks {H12910} <S60400>
**
** This routine configures a callback function - the
** progress callback - that is invoked periodically during long
** running calls to [sqlite3_exec()], [sqlite3_step()] and
** [sqlite3_get_table()].  An example use for this
** interface is to keep a GUI updated during a large query.
**
** If the progress callback returns non-zero, the operation is
** interrupted.  This feature can be used to implement a
** "Cancel" button on a GUI dialog box.





**
** INVARIANTS:
**
** {H12911} The callback function registered by sqlite3_progress_handler()
**          is invoked periodically during long running calls to
**          [sqlite3_step()].
**
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433


2434
2435

2436
2437
2438
2439
2440
2441
2442
** associated with the [database connection] handle should be released by
** passing it to [sqlite3_close()] when it is no longer required.
**
** The sqlite3_open_v2() interface works like sqlite3_open()
** except that it accepts two additional parameters for additional control
** over the new database connection.  The flags parameter can take one of
** the following three values, optionally combined with the 
** [SQLITE_OPEN_NOMUTEX] or [SQLITE_OPEN_FULLMUTEX] flags:
**
** <dl>
** <dt>[SQLITE_OPEN_READONLY]</dt>
** <dd>The database is opened in read-only mode.  If the database does not
** already exist, an error is returned.</dd>
**
** <dt>[SQLITE_OPEN_READWRITE]</dt>
** <dd>The database is opened for reading and writing if possible, or reading
** only if the file is write protected by the operating system.  In either
** case the database must already exist, otherwise an error is returned.</dd>
**
** <dt>[SQLITE_OPEN_READWRITE] | [SQLITE_OPEN_CREATE]</dt>
** <dd>The database is opened for reading and writing, and is creates it if
** it does not already exist. This is the behavior that is always used for
** sqlite3_open() and sqlite3_open16().</dd>
** </dl>
**
** If the 3rd parameter to sqlite3_open_v2() is not one of the
** combinations shown above or one of the combinations shown above combined
** with the [SQLITE_OPEN_NOMUTEX] or [SQLITE_OPEN_FULLMUTEX] flags,
** then the behavior is undefined.
**
** If the [SQLITE_OPEN_NOMUTEX] flag is set, then the database connection
** opens in the multi-thread [threading mode] as long as the single-thread
** mode has not been set at compile-time or start-time.  If the
** [SQLITE_OPEN_FULLMUTEX] flag is set then the database connection opens


** in the serialized [threading mode] unless single-thread was
** previously selected at compile-time or start-time.

**
** If the filename is ":memory:", then a private, temporary in-memory database
** is created for the connection.  This in-memory database will vanish when
** the database connection is closed.  Future versions of SQLite might
** make use of additional special filenames that begin with the ":" character.
** It is recommended that when a database filename actually does begin with
** a ":" character you should prefix the filename with a pathname such as







|



















|
<

|
|
<
|
>
>
|
|
>







2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380

2381
2382
2383

2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
** associated with the [database connection] handle should be released by
** passing it to [sqlite3_close()] when it is no longer required.
**
** The sqlite3_open_v2() interface works like sqlite3_open()
** except that it accepts two additional parameters for additional control
** over the new database connection.  The flags parameter can take one of
** the following three values, optionally combined with the 
** [SQLITE_OPEN_NOMUTEX] flag:
**
** <dl>
** <dt>[SQLITE_OPEN_READONLY]</dt>
** <dd>The database is opened in read-only mode.  If the database does not
** already exist, an error is returned.</dd>
**
** <dt>[SQLITE_OPEN_READWRITE]</dt>
** <dd>The database is opened for reading and writing if possible, or reading
** only if the file is write protected by the operating system.  In either
** case the database must already exist, otherwise an error is returned.</dd>
**
** <dt>[SQLITE_OPEN_READWRITE] | [SQLITE_OPEN_CREATE]</dt>
** <dd>The database is opened for reading and writing, and is creates it if
** it does not already exist. This is the behavior that is always used for
** sqlite3_open() and sqlite3_open16().</dd>
** </dl>
**
** If the 3rd parameter to sqlite3_open_v2() is not one of the
** combinations shown above or one of the combinations shown above combined
** with the [SQLITE_OPEN_NOMUTEX] flag, then the behavior is undefined.

**
** If the [SQLITE_OPEN_NOMUTEX] flag is set, then mutexes on the
** opened [database connection] are disabled and the appliation must

** insure that access to the [database connection] and its associated
** [prepared statements] is serialized.  The [SQLITE_OPEN_NOMUTEX] flag
** is the default behavior is SQLite is configured using the
** [SQLITE_CONFIG_MULTITHREAD] or [SQLITE_CONFIG_SINGLETHREAD] options
** to [sqlite3_config()].  The [SQLITE_OPEN_NOMUTEX] flag only makes a
** difference when SQLite is in its default [SQLITE_CONFIG_SERIALIZED] mode.
**
** If the filename is ":memory:", then a private, temporary in-memory database
** is created for the connection.  This in-memory database will vanish when
** the database connection is closed.  Future versions of SQLite might
** make use of additional special filenames that begin with the ":" character.
** It is recommended that when a database filename actually does begin with
** a ":" character you should prefix the filename with a pathname such as
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
**          for reading only.
**
** {H12712} If the G parameter to [sqlite3_open_v2(F,D,G,V)] contains the
**          bit value [SQLITE_OPEN_READWRITE] then the database is opened
**          reading and writing if possible, or for reading only if the
**          file is write protected by the operating system.
**
** {H12713} If the G parameter to [sqlite3_open_v2(F,D,G,V)] omits the
**          bit value [SQLITE_OPEN_CREATE] and the database does not
**          previously exist, an error is returned.
**
** {H12714} If the G parameter to [sqlite3_open_v2(F,D,G,V)] contains the
**          bit value [SQLITE_OPEN_CREATE] and the database does not
**          previously exist, then an attempt is made to create and
**          initialize the database.
**
** {H12717} If the filename argument to [sqlite3_open()], [sqlite3_open16()],
**          or [sqlite3_open_v2()] is ":memory:", then an private,
**          ephemeral, in-memory database is created for the connection.







|



|







2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
**          for reading only.
**
** {H12712} If the G parameter to [sqlite3_open_v2(F,D,G,V)] contains the
**          bit value [SQLITE_OPEN_READWRITE] then the database is opened
**          reading and writing if possible, or for reading only if the
**          file is write protected by the operating system.
**
** {H12713} If the G parameter to [sqlite3_open(v2(F,D,G,V)] omits the
**          bit value [SQLITE_OPEN_CREATE] and the database does not
**          previously exist, an error is returned.
**
** {H12714} If the G parameter to [sqlite3_open(v2(F,D,G,V)] contains the
**          bit value [SQLITE_OPEN_CREATE] and the database does not
**          previously exist, then an attempt is made to create and
**          initialize the database.
**
** {H12717} If the filename argument to [sqlite3_open()], [sqlite3_open16()],
**          or [sqlite3_open_v2()] is ":memory:", then an private,
**          ephemeral, in-memory database is created for the connection.
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
**
** The second parameter is the name of the SQL function to be created or
** redefined.  The length of the name is limited to 255 bytes, exclusive of
** the zero-terminator.  Note that the name length limit is in bytes, not
** characters.  Any attempt to create a function with a longer name
** will result in [SQLITE_ERROR] being returned.
**
** The third parameter (nArg)
** is the number of arguments that the SQL function or
** aggregate takes. If this parameter is negative, then the SQL function or
** aggregate may take any number of arguments.
**
** The fourth parameter, eTextRep, specifies what
** [SQLITE_UTF8 | text encoding] this SQL function prefers for
** its parameters.  Any SQL function implementation should be able to work
** work with UTF-8, UTF-16le, or UTF-16be.  But some implementations may be







<
|







3801
3802
3803
3804
3805
3806
3807

3808
3809
3810
3811
3812
3813
3814
3815
**
** The second parameter is the name of the SQL function to be created or
** redefined.  The length of the name is limited to 255 bytes, exclusive of
** the zero-terminator.  Note that the name length limit is in bytes, not
** characters.  Any attempt to create a function with a longer name
** will result in [SQLITE_ERROR] being returned.
**

** The third parameter is the number of arguments that the SQL function or
** aggregate takes. If this parameter is negative, then the SQL function or
** aggregate may take any number of arguments.
**
** The fourth parameter, eTextRep, specifies what
** [SQLITE_UTF8 | text encoding] this SQL function prefers for
** its parameters.  Any SQL function implementation should be able to work
** work with UTF-8, UTF-16le, or UTF-16be.  But some implementations may be
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930

3931
3932
3933
3934
3935
3936
3937

3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
** and xFinal and NULL should be passed for xFunc. To delete an existing
** SQL function or aggregate, pass NULL for all three function callbacks.
**
** It is permitted to register multiple implementations of the same
** functions with the same name but with either differing numbers of
** arguments or differing preferred text encodings.  SQLite will use
** the implementation most closely matches the way in which the
** SQL function is used.  A function implementation with a non-negative
** nArg parameter is a better match than a function implementation with
** a negative nArg.  A function where the preferred text encoding
** matches the database encoding is a better
** match than a function where the encoding is different.  
** A function where the encoding difference is between UTF16le and UTF16be
** is a closer match than a function where the encoding difference is
** between UTF8 and UTF16.
**
** Built-in functions may be overloaded by new application-defined functions.
** The first application-defined function with a given name overrides all
** built-in functions in the same [database connection] with the same name.
** Subsequent application-defined functions of the same name only override 
** prior application-defined functions that are an exact match for the
** number of parameters and preferred encoding.
**
** An application-defined function is permitted to call other
** SQLite interfaces.  However, such calls must not
** close the database connection nor finalize or reset the prepared
** statement in which the function is running.
**
** INVARIANTS:
**
** {H16103} The [sqlite3_create_function16(D,X,...)] interface shall behave
**          as [sqlite3_create_function(D,X,...)] in every way except that it
**          interprets the X argument as zero-terminated UTF-16
**          native byte order instead of as zero-terminated UTF-8.
**
** {H16106} A successful invocation of the
**          [sqlite3_create_function(D,X,N,E,...)] interface shall register
**          or replaces callback functions in the [database connection] D
**          used to implement the SQL function named X with N parameters
**          and having a preferred text encoding of E.
**
** {H16109} A successful call to [sqlite3_create_function(D,X,N,E,P,F,S,L)]
**          shall replace the P, F, S, and L values from any prior calls with
**          the same D, X, N, and E values.
**
** {H16112} The [sqlite3_create_function(D,X,...)] interface shall fail
**          if the SQL function name X is
**          longer than 255 bytes exclusive of the zero terminator.
**
** {H16118} The [sqlite3_create_function(D,X,N,E,P,F,S,L)] interface
**          shall fail unless either F is NULL and S and L are non-NULL or
***         F is non-NULL and S and L are NULL.

**
** {H16121} The [sqlite3_create_function(D,...)] interface shall fails with an
**          error code of [SQLITE_BUSY] if there exist [prepared statements]
**          associated with the [database connection] D.
**
** {H16124} The [sqlite3_create_function(D,X,N,...)] interface shall fail with
**          an error code of [SQLITE_ERROR] if parameter N is less

**          than -1 or greater than 127.
**
** {H16127} When N is non-negative, the [sqlite3_create_function(D,X,N,...)]
**          interface shall register callbacks to be invoked for the
**          SQL function
**          named X when the number of arguments to the SQL function is
**          exactly N.
**
** {H16130} When N is -1, the [sqlite3_create_function(D,X,N,...)]
**          interface shall register callbacks to be invoked for the SQL
**          function named X with any number of arguments.
**
** {H16133} When calls to [sqlite3_create_function(D,X,N,...)]
**          specify multiple implementations of the same function X
**          and when one implementation has N>=0 and the other has N=(-1)
**          the implementation with a non-zero N shall be preferred.
**
** {H16136} When calls to [sqlite3_create_function(D,X,N,E,...)]
**          specify multiple implementations of the same function X with
**          the same number of arguments N but with different
**          encodings E, then the implementation where E matches the
**          database encoding shall preferred.
**
** {H16139} For an aggregate SQL function created using
**          [sqlite3_create_function(D,X,N,E,P,0,S,L)] the finalizer
**          function L shall always be invoked exactly once if the
**          step function S is called one or more times.
**
** {H16142} When SQLite invokes either the xFunc or xStep function of
**          an application-defined SQL function or aggregate created
**          by [sqlite3_create_function()] or [sqlite3_create_function16()],
**          then the array of [sqlite3_value] objects passed as the
**          third parameter shall be [protected sqlite3_value] objects.
*/
int sqlite3_create_function(
  sqlite3 *db,
  const char *zFunctionName,
  int nArg,
  int eTextRep,
  void *pApp,







|
<
<
<
<
<
<
<

<
<
<
<
<
<
<
<
<
<
<
<


|
|
|


|
|





|


|
|


<
|
|
>

|



|
|
>



|
<




|
|




|





|



|






|







3832
3833
3834
3835
3836
3837
3838
3839







3840












3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861

3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876

3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
** and xFinal and NULL should be passed for xFunc. To delete an existing
** SQL function or aggregate, pass NULL for all three function callbacks.
**
** It is permitted to register multiple implementations of the same
** functions with the same name but with either differing numbers of
** arguments or differing preferred text encodings.  SQLite will use
** the implementation most closely matches the way in which the
** SQL function is used.







**












** INVARIANTS:
**
** {H16103} The [sqlite3_create_function16()] interface behaves exactly
**          like [sqlite3_create_function()] in every way except that it
**          interprets the zFunctionName argument as zero-terminated UTF-16
**          native byte order instead of as zero-terminated UTF-8.
**
** {H16106} A successful invocation of
**          the [sqlite3_create_function(D,X,N,E,...)] interface registers
**          or replaces callback functions in the [database connection] D
**          used to implement the SQL function named X with N parameters
**          and having a preferred text encoding of E.
**
** {H16109} A successful call to [sqlite3_create_function(D,X,N,E,P,F,S,L)]
**          replaces the P, F, S, and L values from any prior calls with
**          the same D, X, N, and E values.
**
** {H16112} The [sqlite3_create_function(D,X,...)] interface fails with
**          a return code of [SQLITE_ERROR] if the SQL function name X is
**          longer than 255 bytes exclusive of the zero terminator.
**

** {H16118} Either F must be NULL and S and L are non-NULL or else F
**          is non-NULL and S and L are NULL, otherwise
**          [sqlite3_create_function(D,X,N,E,P,F,S,L)] returns [SQLITE_ERROR].
**
** {H16121} The [sqlite3_create_function(D,...)] interface fails with an
**          error code of [SQLITE_BUSY] if there exist [prepared statements]
**          associated with the [database connection] D.
**
** {H16124} The [sqlite3_create_function(D,X,N,...)] interface fails with an
**          error code of [SQLITE_ERROR] if parameter N (specifying the number
**          of arguments to the SQL function being registered) is less
**          than -1 or greater than 127.
**
** {H16127} When N is non-negative, the [sqlite3_create_function(D,X,N,...)]
**          interface causes callbacks to be invoked for the SQL function

**          named X when the number of arguments to the SQL function is
**          exactly N.
**
** {H16130} When N is -1, the [sqlite3_create_function(D,X,N,...)]
**          interface causes callbacks to be invoked for the SQL function
**          named X with any number of arguments.
**
** {H16133} When calls to [sqlite3_create_function(D,X,N,...)]
**          specify multiple implementations of the same function X
**          and when one implementation has N>=0 and the other has N=(-1)
**          the implementation with a non-zero N is preferred.
**
** {H16136} When calls to [sqlite3_create_function(D,X,N,E,...)]
**          specify multiple implementations of the same function X with
**          the same number of arguments N but with different
**          encodings E, then the implementation where E matches the
**          database encoding is preferred.
**
** {H16139} For an aggregate SQL function created using
**          [sqlite3_create_function(D,X,N,E,P,0,S,L)] the finalizer
**          function L will always be invoked exactly once if the
**          step function S is called one or more times.
**
** {H16142} When SQLite invokes either the xFunc or xStep function of
**          an application-defined SQL function or aggregate created
**          by [sqlite3_create_function()] or [sqlite3_create_function16()],
**          then the array of [sqlite3_value] objects passed as the
**          third parameter are always [protected sqlite3_value] objects.
*/
int sqlite3_create_function(
  sqlite3 *db,
  const char *zFunctionName,
  int nArg,
  int eTextRep,
  void *pApp,
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
**
** These functions are [deprecated].  In order to maintain
** backwards compatibility with older code, these functions continue 
** to be supported.  However, new applications should avoid
** the use of these functions.  To help encourage people to avoid
** using these functions, we are not going to tell you want they do.
*/
SQLITE_DEPRECATED int sqlite3_aggregate_count(sqlite3_context*);
SQLITE_DEPRECATED int sqlite3_expired(sqlite3_stmt*);
SQLITE_DEPRECATED int sqlite3_transfer_bindings(sqlite3_stmt*, sqlite3_stmt*);
SQLITE_DEPRECATED int sqlite3_global_recover(void);
SQLITE_DEPRECATED void sqlite3_thread_cleanup(void);
SQLITE_DEPRECATED int sqlite3_memory_alarm(void(*)(void*,sqlite3_int64,int),void*,sqlite3_int64);

/*
** CAPI3REF: Obtaining SQL Function Parameter Values {H15100} <S20200>
**
** The C-language implementation of SQL functions and aggregates uses
** this set of interface routines to access the parameter values on
** the function or aggregate.







|
|
|
|
|
|







3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
**
** These functions are [deprecated].  In order to maintain
** backwards compatibility with older code, these functions continue 
** to be supported.  However, new applications should avoid
** the use of these functions.  To help encourage people to avoid
** using these functions, we are not going to tell you want they do.
*/
int sqlite3_aggregate_count(sqlite3_context*);
int sqlite3_expired(sqlite3_stmt*);
int sqlite3_transfer_bindings(sqlite3_stmt*, sqlite3_stmt*);
int sqlite3_global_recover(void);
void sqlite3_thread_cleanup(void);
int sqlite3_memory_alarm(void(*)(void*,sqlite3_int64,int),void*,sqlite3_int64);

/*
** CAPI3REF: Obtaining SQL Function Parameter Values {H15100} <S20200>
**
** The C-language implementation of SQL functions and aggregates uses
** this set of interface routines to access the parameter values on
** the function or aggregate.
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
** The pArg argument is passed through to the callback.
** If the callback on a commit hook function returns non-zero,
** then the commit is converted into a rollback.
**
** If another function was previously registered, its
** pArg value is returned.  Otherwise NULL is returned.
**
** The callback implementation must not do anything that will modify
** the database connection that invoked the callback.  Any actions
** to modify the database connection must be deferred until after the
** completion of the [sqlite3_step()] call that triggered the commit
** or rollback hook in the first place.
** Note that [sqlite3_prepare_v2()] and [sqlite3_step()] both modify their
** database connections for the meaning of "modify" in this paragraph.
**
** Registering a NULL function disables the callback.
**
** For the purposes of this API, a transaction is said to have been
** rolled back if an explicit "ROLLBACK" statement is executed, or
** an error or constraint causes an implicit rollback to occur.
** The rollback callback is not invoked if a transaction is
** automatically rolled back because the database connection is closed.







<
<
<
<
<
<
<
<







4809
4810
4811
4812
4813
4814
4815








4816
4817
4818
4819
4820
4821
4822
** The pArg argument is passed through to the callback.
** If the callback on a commit hook function returns non-zero,
** then the commit is converted into a rollback.
**
** If another function was previously registered, its
** pArg value is returned.  Otherwise NULL is returned.
**








** Registering a NULL function disables the callback.
**
** For the purposes of this API, a transaction is said to have been
** rolled back if an explicit "ROLLBACK" statement is executed, or
** an error or constraint causes an implicit rollback to occur.
** The rollback callback is not invoked if a transaction is
** automatically rolled back because the database connection is closed.
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
** database and table name containing the affected row.
** The final callback parameter is the rowid of the row. In the case of
** an update, this is the rowid after the update takes place.
**
** The update hook is not invoked when internal system tables are
** modified (i.e. sqlite_master and sqlite_sequence).
**
** The update hook implementation must not do anything that will modify
** the database connection that invoked the update hook.  Any actions
** to modify the database connection must be deferred until after the
** completion of the [sqlite3_step()] call that triggered the update hook.
** Note that [sqlite3_prepare_v2()] and [sqlite3_step()] both modify their
** database connections for the meaning of "modify" in this paragraph.
**
** If another function was previously registered, its pArg value
** is returned.  Otherwise NULL is returned.
**
** INVARIANTS:
**
** {H12971} The [sqlite3_update_hook(D,F,P)] interface causes the callback
**          function F to be invoked with first parameter P whenever







<
<
<
<
<
<
<







4883
4884
4885
4886
4887
4888
4889







4890
4891
4892
4893
4894
4895
4896
** database and table name containing the affected row.
** The final callback parameter is the rowid of the row. In the case of
** an update, this is the rowid after the update takes place.
**
** The update hook is not invoked when internal system tables are
** modified (i.e. sqlite_master and sqlite_sequence).
**







** If another function was previously registered, its pArg value
** is returned.  Otherwise NULL is returned.
**
** INVARIANTS:
**
** {H12971} The [sqlite3_update_hook(D,F,P)] interface causes the callback
**          function F to be invoked with first parameter P whenever
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
** [database connection].  Module names must be registered before
** creating new virtual tables on the module, or before using
** preexisting virtual tables of the module.
**
** This interface is experimental and is subject to change or
** removal in future releases of SQLite.
*/
SQLITE_EXPERIMENTAL int sqlite3_create_module(
  sqlite3 *db,               /* SQLite connection to register module with */
  const char *zName,         /* Name of the module */
  const sqlite3_module *,    /* Methods for the module */
  void *                     /* Client data for xCreate/xConnect */
);

/*
** CAPI3REF: Register A Virtual Table Implementation {H18210} <S20400>
** EXPERIMENTAL
**
** This routine is identical to the [sqlite3_create_module()] method above,
** except that it allows a destructor function to be specified. It is
** even more experimental than the rest of the virtual tables API.
*/
SQLITE_EXPERIMENTAL int sqlite3_create_module_v2(
  sqlite3 *db,               /* SQLite connection to register module with */
  const char *zName,         /* Name of the module */
  const sqlite3_module *,    /* Methods for the module */
  void *,                    /* Client data for xCreate/xConnect */
  void(*xDestroy)(void*)     /* Module destructor function */
);








|














|







5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
** [database connection].  Module names must be registered before
** creating new virtual tables on the module, or before using
** preexisting virtual tables of the module.
**
** This interface is experimental and is subject to change or
** removal in future releases of SQLite.
*/
int sqlite3_create_module(
  sqlite3 *db,               /* SQLite connection to register module with */
  const char *zName,         /* Name of the module */
  const sqlite3_module *,    /* Methods for the module */
  void *                     /* Client data for xCreate/xConnect */
);

/*
** CAPI3REF: Register A Virtual Table Implementation {H18210} <S20400>
** EXPERIMENTAL
**
** This routine is identical to the [sqlite3_create_module()] method above,
** except that it allows a destructor function to be specified. It is
** even more experimental than the rest of the virtual tables API.
*/
int sqlite3_create_module_v2(
  sqlite3 *db,               /* SQLite connection to register module with */
  const char *zName,         /* Name of the module */
  const sqlite3_module *,    /* Methods for the module */
  void *,                    /* Client data for xCreate/xConnect */
  void(*xDestroy)(void*)     /* Module destructor function */
);

5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
** The xCreate and xConnect methods of a module use the following API
** to declare the format (the names and datatypes of the columns) of
** the virtual tables they implement.
**
** This interface is experimental and is subject to change or
** removal in future releases of SQLite.
*/
SQLITE_EXPERIMENTAL int sqlite3_declare_vtab(sqlite3*, const char *zCreateTable);

/*
** CAPI3REF: Overload A Function For A Virtual Table {H18300} <S20400>
** EXPERIMENTAL
**
** Virtual tables can provide alternative implementations of functions
** using the xFindFunction method.  But global versions of those functions
** must exist in order to be overloaded.
**
** This API makes sure a global version of a function with a particular
** name and number of parameters exists.  If no such function exists
** before this API is called, a new function is created.  The implementation
** of the new function always causes an exception to be thrown.  So
** the new function is not good for anything by itself.  Its only
** purpose is to be a placeholder function that can be overloaded
** by virtual tables.
**
** This API should be considered part of the virtual table interface,
** which is experimental and subject to change.
*/
SQLITE_EXPERIMENTAL int sqlite3_overload_function(sqlite3*, const char *zFuncName, int nArg);

/*
** The interface to the virtual-table mechanism defined above (back up
** to a comment remarkably similar to this one) is currently considered
** to be experimental.  The interface might change in incompatible ways.
** If this is a problem for you, do not use the interface at this time.
**







|




















|







5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
** The xCreate and xConnect methods of a module use the following API
** to declare the format (the names and datatypes of the columns) of
** the virtual tables they implement.
**
** This interface is experimental and is subject to change or
** removal in future releases of SQLite.
*/
int sqlite3_declare_vtab(sqlite3*, const char *zCreateTable);

/*
** CAPI3REF: Overload A Function For A Virtual Table {H18300} <S20400>
** EXPERIMENTAL
**
** Virtual tables can provide alternative implementations of functions
** using the xFindFunction method.  But global versions of those functions
** must exist in order to be overloaded.
**
** This API makes sure a global version of a function with a particular
** name and number of parameters exists.  If no such function exists
** before this API is called, a new function is created.  The implementation
** of the new function always causes an exception to be thrown.  So
** the new function is not good for anything by itself.  Its only
** purpose is to be a placeholder function that can be overloaded
** by virtual tables.
**
** This API should be considered part of the virtual table interface,
** which is experimental and subject to change.
*/
int sqlite3_overload_function(sqlite3*, const char *zFuncName, int nArg);

/*
** The interface to the virtual-table mechanism defined above (back up
** to a comment remarkably similar to this one) is currently considered
** to be experimental.  The interface might change in incompatible ways.
** If this is a problem for you, do not use the interface at this time.
**
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
** interfaces.  However the values returned in *pCurrent and
** *pHighwater reflect the status of SQLite at different points in time
** and it is possible that another thread might change the parameter
** in between the times when *pCurrent and *pHighwater are written.
**
** See also: [sqlite3_db_status()]
*/
SQLITE_EXPERIMENTAL int sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag);

/*
** CAPI3REF: Database Connection Status {H17201} <S60200>
** EXPERIMENTAL
**
** This interface is used to retrieve runtime status information 
** about a single [database connection].  The first argument is the
** database connection object to be interrogated.  The second argument
** is the parameter to interrogate.  Currently, the only allowed value
** for the second parameter is [SQLITE_DBSTATUS_LOOKASIDE_USED].
** Additional options will likely appear in future releases of SQLite.
**
** The current value of the request parameter is written into *pCur
** and the highest instantaneous value is written into *pHiwtr.  If
** the resetFlg is true, then the highest instantaneous value is
** reset back down to the current value.
**
** See also: [sqlite3_status()].
*/
SQLITE_EXPERIMENTAL int sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int resetFlg);


int sqlite3_wsd_init(int N, int J);
void *sqlite3_wsd_find(void *K, int L);

/*
** CAPI3REF: Status Parameters {H17250} <H17200>
** EXPERIMENTAL
**
** These integer constants designate various run-time status parameters
** that can be returned by [sqlite3_status()].







|



















|
<
<
<
<







6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165




6166
6167
6168
6169
6170
6171
6172
** interfaces.  However the values returned in *pCurrent and
** *pHighwater reflect the status of SQLite at different points in time
** and it is possible that another thread might change the parameter
** in between the times when *pCurrent and *pHighwater are written.
**
** See also: [sqlite3_db_status()]
*/
int sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag);

/*
** CAPI3REF: Database Connection Status {H17201} <S60200>
** EXPERIMENTAL
**
** This interface is used to retrieve runtime status information 
** about a single [database connection].  The first argument is the
** database connection object to be interrogated.  The second argument
** is the parameter to interrogate.  Currently, the only allowed value
** for the second parameter is [SQLITE_DBSTATUS_LOOKASIDE_USED].
** Additional options will likely appear in future releases of SQLite.
**
** The current value of the request parameter is written into *pCur
** and the highest instantaneous value is written into *pHiwtr.  If
** the resetFlg is true, then the highest instantaneous value is
** reset back down to the current value.
**
** See also: [sqlite3_status()].
*/
int sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int resetFlg);





/*
** CAPI3REF: Status Parameters {H17250} <H17200>
** EXPERIMENTAL
**
** These integer constants designate various run-time status parameters
** that can be returned by [sqlite3_status()].
Changes to SQLite.Interop/src/sqlite3ext.h.
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
*************************************************************************
** This header file defines the SQLite interface for use by
** shared libraries that want to be imported as extensions into
** an SQLite instance.  Shared libraries that intend to be loaded
** as extensions by SQLite should #include this file instead of 
** sqlite3.h.
**
** @(#) $Id: sqlite3ext.h,v 1.15 2008/09/22 16:30:23 rmsimpson Exp $
*/
#ifndef _SQLITE3EXT_H_
#define _SQLITE3EXT_H_
#include "sqlite3.h"

typedef struct sqlite3_api_routines sqlite3_api_routines;








|







11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
*************************************************************************
** This header file defines the SQLite interface for use by
** shared libraries that want to be imported as extensions into
** an SQLite instance.  Shared libraries that intend to be loaded
** as extensions by SQLite should #include this file instead of 
** sqlite3.h.
**
** @(#) $Id: sqlite3ext.h,v 1.13 2008/08/06 21:45:32 rmsimpson Exp $
*/
#ifndef _SQLITE3EXT_H_
#define _SQLITE3EXT_H_
#include "sqlite3.h"

typedef struct sqlite3_api_routines sqlite3_api_routines;

Changes to SQLite.NET.sln.
8
9
10
11
12
13
14

15
16
17
18
19
20
21
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Data.SQLite - Compact", "System.Data.SQLite\System.Data.SQLite - Compact.csproj", "{AC139951-261A-4463-B6FA-AEBC25283A66}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "test", "test\test.csproj", "{E27B1B1E-19C0-45E8-AA74-B6E1C041A130}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SQLite.Interop", "SQLite.Interop\SQLite.Interop.vcproj", "{10B51CE8-A838-44DE-BD82-B658F0296F80}"
	ProjectSection(ProjectDependencies) = postProject

		{AC139952-261A-4463-B6FA-AEBC25283A66} = {AC139952-261A-4463-B6FA-AEBC25283A66}
	EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "testce", "testce\testce.csproj", "{B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}"
	ProjectSection(ProjectDependencies) = postProject
		{AC139951-261A-4463-B6FA-AEBC25283A66} = {AC139951-261A-4463-B6FA-AEBC25283A66}
		{10B51CE8-A838-44DE-BD82-B658F0296F80} = {10B51CE8-A838-44DE-BD82-B658F0296F80}







>







8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Data.SQLite - Compact", "System.Data.SQLite\System.Data.SQLite - Compact.csproj", "{AC139951-261A-4463-B6FA-AEBC25283A66}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "test", "test\test.csproj", "{E27B1B1E-19C0-45E8-AA74-B6E1C041A130}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SQLite.Interop", "SQLite.Interop\SQLite.Interop.vcproj", "{10B51CE8-A838-44DE-BD82-B658F0296F80}"
	ProjectSection(ProjectDependencies) = postProject
		{AC139951-261A-4463-B6FA-AEBC25283A66} = {AC139951-261A-4463-B6FA-AEBC25283A66}
		{AC139952-261A-4463-B6FA-AEBC25283A66} = {AC139952-261A-4463-B6FA-AEBC25283A66}
	EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "testce", "testce\testce.csproj", "{B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}"
	ProjectSection(ProjectDependencies) = postProject
		{AC139951-261A-4463-B6FA-AEBC25283A66} = {AC139951-261A-4463-B6FA-AEBC25283A66}
		{10B51CE8-A838-44DE-BD82-B658F0296F80} = {10B51CE8-A838-44DE-BD82-B658F0296F80}
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
		{E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
		{E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.Release|Mixed Platforms.Build.0 = Release|Any CPU
		{E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.Release|Win32.ActiveCfg = Release|x86
		{E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.Release|Win32.Build.0 = Release|x86
		{E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.Release|x64.ActiveCfg = Release|x64
		{E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.Release|x64.Build.0 = Release|x64
		{10B51CE8-A838-44DE-BD82-B658F0296F80}.Debug - Stock|Any CPU.ActiveCfg = Debug|x64
		{10B51CE8-A838-44DE-BD82-B658F0296F80}.Debug - Stock|Compact Framework (ARMV4).ActiveCfg = StockDebug|Pocket PC 2003 (ARMV4)
		{10B51CE8-A838-44DE-BD82-B658F0296F80}.Debug - Stock|Compact Framework (ARMV4).Build.0 = StockDebug|Pocket PC 2003 (ARMV4)
		{10B51CE8-A838-44DE-BD82-B658F0296F80}.Debug - Stock|Compact Framework (ARMV4).Deploy.0 = StockDebug|Pocket PC 2003 (ARMV4)
		{10B51CE8-A838-44DE-BD82-B658F0296F80}.Debug - Stock|Itanium.ActiveCfg = Debug|Itanium
		{10B51CE8-A838-44DE-BD82-B658F0296F80}.Debug - Stock|Itanium.Build.0 = Debug|Itanium
		{10B51CE8-A838-44DE-BD82-B658F0296F80}.Debug - Stock|Itanium.Deploy.0 = Debug|Itanium
		{10B51CE8-A838-44DE-BD82-B658F0296F80}.Debug - Stock|Mixed Platforms.ActiveCfg = Debug|x64
		{10B51CE8-A838-44DE-BD82-B658F0296F80}.Debug - Stock|Mixed Platforms.Build.0 = Debug|x64
		{10B51CE8-A838-44DE-BD82-B658F0296F80}.Debug - Stock|Win32.ActiveCfg = StockDebug|Win32
		{10B51CE8-A838-44DE-BD82-B658F0296F80}.Debug - Stock|Win32.Build.0 = StockDebug|Win32
		{10B51CE8-A838-44DE-BD82-B658F0296F80}.Debug - Stock|Win32.Deploy.0 = StockDebug|Win32
		{10B51CE8-A838-44DE-BD82-B658F0296F80}.Debug - Stock|x64.ActiveCfg = Debug|x64
		{10B51CE8-A838-44DE-BD82-B658F0296F80}.Debug - Stock|x64.Build.0 = Debug|x64
		{10B51CE8-A838-44DE-BD82-B658F0296F80}.Debug - Stock|x64.Deploy.0 = Debug|x64
		{10B51CE8-A838-44DE-BD82-B658F0296F80}.Debug|Any CPU.ActiveCfg = Debug|x64
		{10B51CE8-A838-44DE-BD82-B658F0296F80}.Debug|Compact Framework (ARMV4).ActiveCfg = Debug|Pocket PC 2003 (ARMV4)
		{10B51CE8-A838-44DE-BD82-B658F0296F80}.Debug|Compact Framework (ARMV4).Build.0 = Debug|Pocket PC 2003 (ARMV4)
		{10B51CE8-A838-44DE-BD82-B658F0296F80}.Debug|Compact Framework (ARMV4).Deploy.0 = Debug|Pocket PC 2003 (ARMV4)







|
|
|





|
|
<







133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149

150
151
152
153
154
155
156
		{E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
		{E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.Release|Mixed Platforms.Build.0 = Release|Any CPU
		{E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.Release|Win32.ActiveCfg = Release|x86
		{E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.Release|Win32.Build.0 = Release|x86
		{E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.Release|x64.ActiveCfg = Release|x64
		{E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.Release|x64.Build.0 = Release|x64
		{10B51CE8-A838-44DE-BD82-B658F0296F80}.Debug - Stock|Any CPU.ActiveCfg = Debug|x64
		{10B51CE8-A838-44DE-BD82-B658F0296F80}.Debug - Stock|Compact Framework (ARMV4).ActiveCfg = Debug|Pocket PC 2003 (ARMV4)
		{10B51CE8-A838-44DE-BD82-B658F0296F80}.Debug - Stock|Compact Framework (ARMV4).Build.0 = Debug|Pocket PC 2003 (ARMV4)
		{10B51CE8-A838-44DE-BD82-B658F0296F80}.Debug - Stock|Compact Framework (ARMV4).Deploy.0 = Debug|Pocket PC 2003 (ARMV4)
		{10B51CE8-A838-44DE-BD82-B658F0296F80}.Debug - Stock|Itanium.ActiveCfg = Debug|Itanium
		{10B51CE8-A838-44DE-BD82-B658F0296F80}.Debug - Stock|Itanium.Build.0 = Debug|Itanium
		{10B51CE8-A838-44DE-BD82-B658F0296F80}.Debug - Stock|Itanium.Deploy.0 = Debug|Itanium
		{10B51CE8-A838-44DE-BD82-B658F0296F80}.Debug - Stock|Mixed Platforms.ActiveCfg = Debug|x64
		{10B51CE8-A838-44DE-BD82-B658F0296F80}.Debug - Stock|Mixed Platforms.Build.0 = Debug|x64
		{10B51CE8-A838-44DE-BD82-B658F0296F80}.Debug - Stock|Win32.ActiveCfg = Debug|Win32
		{10B51CE8-A838-44DE-BD82-B658F0296F80}.Debug - Stock|Win32.Deploy.0 = Debug|Win32

		{10B51CE8-A838-44DE-BD82-B658F0296F80}.Debug - Stock|x64.ActiveCfg = Debug|x64
		{10B51CE8-A838-44DE-BD82-B658F0296F80}.Debug - Stock|x64.Build.0 = Debug|x64
		{10B51CE8-A838-44DE-BD82-B658F0296F80}.Debug - Stock|x64.Deploy.0 = Debug|x64
		{10B51CE8-A838-44DE-BD82-B658F0296F80}.Debug|Any CPU.ActiveCfg = Debug|x64
		{10B51CE8-A838-44DE-BD82-B658F0296F80}.Debug|Compact Framework (ARMV4).ActiveCfg = Debug|Pocket PC 2003 (ARMV4)
		{10B51CE8-A838-44DE-BD82-B658F0296F80}.Debug|Compact Framework (ARMV4).Build.0 = Debug|Pocket PC 2003 (ARMV4)
		{10B51CE8-A838-44DE-BD82-B658F0296F80}.Debug|Compact Framework (ARMV4).Deploy.0 = Debug|Pocket PC 2003 (ARMV4)
175
176
177
178
179
180
181

182
183
184
185
186
187
188
		{10B51CE8-A838-44DE-BD82-B658F0296F80}.Release - Stock|Mixed Platforms.Build.0 = Release|x64
		{10B51CE8-A838-44DE-BD82-B658F0296F80}.Release - Stock|Win32.ActiveCfg = Release|Win32
		{10B51CE8-A838-44DE-BD82-B658F0296F80}.Release - Stock|x64.ActiveCfg = Release|x64
		{10B51CE8-A838-44DE-BD82-B658F0296F80}.Release - Stock|x64.Build.0 = Release|x64
		{10B51CE8-A838-44DE-BD82-B658F0296F80}.Release|Any CPU.ActiveCfg = Release|x64
		{10B51CE8-A838-44DE-BD82-B658F0296F80}.Release|Compact Framework (ARMV4).ActiveCfg = Release|Pocket PC 2003 (ARMV4)
		{10B51CE8-A838-44DE-BD82-B658F0296F80}.Release|Compact Framework (ARMV4).Build.0 = Release|Pocket PC 2003 (ARMV4)

		{10B51CE8-A838-44DE-BD82-B658F0296F80}.Release|Itanium.ActiveCfg = Release|Itanium
		{10B51CE8-A838-44DE-BD82-B658F0296F80}.Release|Itanium.Build.0 = Release|Itanium
		{10B51CE8-A838-44DE-BD82-B658F0296F80}.Release|Mixed Platforms.ActiveCfg = Release|x64
		{10B51CE8-A838-44DE-BD82-B658F0296F80}.Release|Mixed Platforms.Build.0 = Release|x64
		{10B51CE8-A838-44DE-BD82-B658F0296F80}.Release|Win32.ActiveCfg = Release|Win32
		{10B51CE8-A838-44DE-BD82-B658F0296F80}.Release|Win32.Build.0 = Release|Win32
		{10B51CE8-A838-44DE-BD82-B658F0296F80}.Release|x64.ActiveCfg = Release|x64







>







175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
		{10B51CE8-A838-44DE-BD82-B658F0296F80}.Release - Stock|Mixed Platforms.Build.0 = Release|x64
		{10B51CE8-A838-44DE-BD82-B658F0296F80}.Release - Stock|Win32.ActiveCfg = Release|Win32
		{10B51CE8-A838-44DE-BD82-B658F0296F80}.Release - Stock|x64.ActiveCfg = Release|x64
		{10B51CE8-A838-44DE-BD82-B658F0296F80}.Release - Stock|x64.Build.0 = Release|x64
		{10B51CE8-A838-44DE-BD82-B658F0296F80}.Release|Any CPU.ActiveCfg = Release|x64
		{10B51CE8-A838-44DE-BD82-B658F0296F80}.Release|Compact Framework (ARMV4).ActiveCfg = Release|Pocket PC 2003 (ARMV4)
		{10B51CE8-A838-44DE-BD82-B658F0296F80}.Release|Compact Framework (ARMV4).Build.0 = Release|Pocket PC 2003 (ARMV4)
		{10B51CE8-A838-44DE-BD82-B658F0296F80}.Release|Compact Framework (ARMV4).Deploy.0 = Release|Pocket PC 2003 (ARMV4)
		{10B51CE8-A838-44DE-BD82-B658F0296F80}.Release|Itanium.ActiveCfg = Release|Itanium
		{10B51CE8-A838-44DE-BD82-B658F0296F80}.Release|Itanium.Build.0 = Release|Itanium
		{10B51CE8-A838-44DE-BD82-B658F0296F80}.Release|Mixed Platforms.ActiveCfg = Release|x64
		{10B51CE8-A838-44DE-BD82-B658F0296F80}.Release|Mixed Platforms.Build.0 = Release|x64
		{10B51CE8-A838-44DE-BD82-B658F0296F80}.Release|Win32.ActiveCfg = Release|Win32
		{10B51CE8-A838-44DE-BD82-B658F0296F80}.Release|Win32.Build.0 = Release|Win32
		{10B51CE8-A838-44DE-BD82-B658F0296F80}.Release|x64.ActiveCfg = Release|x64
Changes to SQLite.NET.suo.

cannot compute difference between binary files

Changes to System.Data.SQLite.Linq/AssemblyInfo.cs.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using System;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security.Permissions;
using System.Security;
using System.Runtime.ConstrainedExecution;

// 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("System.Data.SQLite.Linq")]
[assembly: AssemblyDescription("ADO.NET 3.5SP1 Entity Framework support for SQLite")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("http://sqlite.phxsoftware.com")]
[assembly: AssemblyProduct("System.Data.SQLite")]
[assembly: AssemblyCopyright("Public Domain")]
[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)]
[assembly: CLSCompliant(true)]
[assembly: AllowPartiallyTrustedCallers]
[assembly: ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]

// 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("2.0.38.0")]
[assembly: AssemblyFileVersion("2.0.38.0")]
<



<
<
<





|











|
|
|
<











|
|

1
2
3



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

24
25
26
27
28
29
30
31
32
33
34
35
36

using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;




// General Information about an assembly is controlled through the following 
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("System.Data.SQLite.Linq")]
[assembly: AssemblyDescription("ADO.NET 2.0 Data Provider for SQLite")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("http://sqlite.phxsoftware.com")]
[assembly: AssemblyProduct("System.Data.SQLite")]
[assembly: AssemblyCopyright("Public Domain")]
[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("d9d0877d-53d0-4ba6-962e-66b7e1663478")]


// 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("2.0.36.0")]
[assembly: AssemblyFileVersion("2.0.36.0")]
Deleted System.Data.SQLite.Linq/Properties/Resources.Designer.cs.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:2.0.50727.3053
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace System.Data.SQLite.Properties {
    using System;
    
    
    /// <summary>
    ///   A strongly-typed resource class, for looking up localized strings, etc.
    /// </summary>
    // This class was auto-generated by the StronglyTypedResourceBuilder
    // class via a tool like ResGen or Visual Studio.
    // To add or remove a member, edit your .ResX file then rerun ResGen
    // with the /str option, or rebuild your VS project.
    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")]
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
    internal class Resources {
        
        private static global::System.Resources.ResourceManager resourceMan;
        
        private static global::System.Globalization.CultureInfo resourceCulture;
        
        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
        internal Resources() {
        }
        
        /// <summary>
        ///   Returns the cached ResourceManager instance used by this class.
        /// </summary>
        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
        internal static global::System.Resources.ResourceManager ResourceManager {
            get {
                if (object.ReferenceEquals(resourceMan, null)) {
                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("System.Data.SQLite.Properties.Resources", typeof(Resources).Assembly);
                    resourceMan = temp;
                }
                return resourceMan;
            }
        }
        
        /// <summary>
        ///   Overrides the current thread's CurrentUICulture property for all
        ///   resource lookups using this strongly typed resource class.
        /// </summary>
        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
        internal static global::System.Globalization.CultureInfo Culture {
            get {
                return resourceCulture;
            }
            set {
                resourceCulture = value;
            }
        }
        
        /// <summary>
        ///   Looks up a localized string similar to CREATE TEMP VIEW SCHEMACONSTRAINTCOLUMNS AS
        ///SELECT CONSTRAINT_CATALOG, NULL AS CONSTRAINT_SCHEMA, CONSTRAINT_NAME, TABLE_CATALOG, NULL AS TABLE_SCHEMA, TABLE_NAME, COLUMN_NAME 
        ///FROM TEMP.SCHEMAINDEXCOLUMNS
        ///UNION
        ///SELECT CONSTRAINT_CATALOG, NULL, CONSTRAINT_NAME, TABLE_CATALOG, NULL, TABLE_NAME, FKEY_FROM_COLUMN
        ///FROM TEMP.SCHEMAFOREIGNKEYS;.
        /// </summary>
        internal static string SQL_CONSTRAINTCOLUMNS {
            get {
                return ResourceManager.GetString("SQL_CONSTRAINTCOLUMNS", resourceCulture);
            }
        }
        
        /// <summary>
        ///   Looks up a localized string similar to CREATE TEMP VIEW SCHEMACONSTRAINTS AS
        ///SELECT INDEX_CATALOG AS CONSTRAINT_CATALOG, NULL AS CONSTRAINT_SCHEMA, INDEX_NAME AS CONSTRAINT_NAME, TABLE_CATALOG, NULL AS TABLE_SCHEMA, TABLE_NAME, &apos;PRIMARY KEY&apos; AS CONSTRAINT_TYPE, 0 AS IS_DEFERRABLE, 0 AS INITIALLY_DEFERRED, NULL AS CHECK_CLAUSE
        ///FROM TEMP.SCHEMAINDEXES WHERE PRIMARY_KEY = 1
        ///UNION
        ///SELECT INDEX_CATALOG, NULL, INDEX_NAME, TABLE_CATALOG, NULL, TABLE_NAME, &apos;UNIQUE&apos;, 0, 0, NULL 
        ///FROM TEMP.SCHEMAINDEXES WHERE PRIMARY_KEY = 0 AND [UNIQUE] = 1
        ///UNION
        /// [rest of string was truncated]&quot;;.
        /// </summary>
        internal static string SQL_CONSTRAINTS {
            get {
                return ResourceManager.GetString("SQL_CONSTRAINTS", resourceCulture);
            }
        }
    }
}
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<


























































































































































































Deleted System.Data.SQLite.Linq/Properties/Resources.resx.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
<?xml version="1.0" encoding="utf-8"?>
<root>
  <!-- 
    Microsoft ResX Schema 
    
    Version 2.0
    
    The primary goals of this format is to allow a simple XML format 
    that is mostly human readable. The generation and parsing of the 
    various data types are done through the TypeConverter classes 
    associated with the data types.
    
    Example:
    
    ... ado.net/XML headers & schema ...
    <resheader name="resmimetype">text/microsoft-resx</resheader>
    <resheader name="version">2.0</resheader>
    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
        <value>[base64 mime encoded serialized .NET Framework object]</value>
    </data>
    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
        <comment>This is a comment</comment>
    </data>
                
    There are any number of "resheader" rows that contain simple 
    name/value pairs.
    
    Each data row contains a name, and value. The row also contains a 
    type or mimetype. Type corresponds to a .NET class that support 
    text/value conversion through the TypeConverter architecture. 
    Classes that don't support this are serialized and stored with the 
    mimetype set.
    
    The mimetype is used for serialized objects, and tells the 
    ResXResourceReader how to depersist the object. This is currently not 
    extensible. For a given mimetype the value must be set accordingly:
    
    Note - application/x-microsoft.net.object.binary.base64 is the format 
    that the ResXResourceWriter will generate, however the reader can 
    read any of the formats listed below.
    
    mimetype: application/x-microsoft.net.object.binary.base64
    value   : The object must be serialized with 
            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
            : and then encoded with base64 encoding.
    
    mimetype: application/x-microsoft.net.object.soap.base64
    value   : The object must be serialized with 
            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
            : and then encoded with base64 encoding.

    mimetype: application/x-microsoft.net.object.bytearray.base64
    value   : The object must be serialized into a byte array 
            : using a System.ComponentModel.TypeConverter
            : and then encoded with base64 encoding.
    -->
  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
    <xsd:element name="root" msdata:IsDataSet="true">
      <xsd:complexType>
        <xsd:choice maxOccurs="unbounded">
          <xsd:element name="metadata">
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element name="value" type="xsd:string" minOccurs="0" />
              </xsd:sequence>
              <xsd:attribute name="name" use="required" type="xsd:string" />
              <xsd:attribute name="type" type="xsd:string" />
              <xsd:attribute name="mimetype" type="xsd:string" />
              <xsd:attribute ref="xml:space" />
            </xsd:complexType>
          </xsd:element>
          <xsd:element name="assembly">
            <xsd:complexType>
              <xsd:attribute name="alias" type="xsd:string" />
              <xsd:attribute name="name" type="xsd:string" />
            </xsd:complexType>
          </xsd:element>
          <xsd:element name="data">
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
              </xsd:sequence>
              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
              <xsd:attribute ref="xml:space" />
            </xsd:complexType>
          </xsd:element>
          <xsd:element name="resheader">
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
              </xsd:sequence>
              <xsd:attribute name="name" type="xsd:string" use="required" />
            </xsd:complexType>
          </xsd:element>
        </xsd:choice>
      </xsd:complexType>
    </xsd:element>
  </xsd:schema>
  <resheader name="resmimetype">
    <value>text/microsoft-resx</value>
  </resheader>
  <resheader name="version">
    <value>2.0</value>
  </resheader>
  <resheader name="reader">
    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
  </resheader>
  <resheader name="writer">
    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
  </resheader>
  <data name="SQL_CONSTRAINTCOLUMNS" xml:space="preserve">
    <value>CREATE TEMP VIEW SCHEMACONSTRAINTCOLUMNS AS
SELECT CONSTRAINT_CATALOG, NULL AS CONSTRAINT_SCHEMA, CONSTRAINT_NAME, TABLE_CATALOG, NULL AS TABLE_SCHEMA, TABLE_NAME, COLUMN_NAME 
FROM TEMP.SCHEMAINDEXCOLUMNS
UNION
SELECT CONSTRAINT_CATALOG, NULL, CONSTRAINT_NAME, TABLE_CATALOG, NULL, TABLE_NAME, FKEY_FROM_COLUMN
FROM TEMP.SCHEMAFOREIGNKEYS;</value>
  </data>
  <data name="SQL_CONSTRAINTS" xml:space="preserve">
    <value>CREATE TEMP VIEW SCHEMACONSTRAINTS AS
SELECT INDEX_CATALOG AS CONSTRAINT_CATALOG, NULL AS CONSTRAINT_SCHEMA, INDEX_NAME AS CONSTRAINT_NAME, TABLE_CATALOG, NULL AS TABLE_SCHEMA, TABLE_NAME, 'PRIMARY KEY' AS CONSTRAINT_TYPE, 0 AS IS_DEFERRABLE, 0 AS INITIALLY_DEFERRED, NULL AS CHECK_CLAUSE
FROM TEMP.SCHEMAINDEXES WHERE PRIMARY_KEY = 1
UNION
SELECT INDEX_CATALOG, NULL, INDEX_NAME, TABLE_CATALOG, NULL, TABLE_NAME, 'UNIQUE', 0, 0, NULL 
FROM TEMP.SCHEMAINDEXES WHERE PRIMARY_KEY = 0 AND [UNIQUE] = 1
UNION
SELECT CONSTRAINT_CATALOG, NULL, CONSTRAINT_NAME, TABLE_CATALOG, NULL, TABLE_NAME, CONSTRAINT_TYPE, IS_DEFERRABLE, INITIALLY_DEFERRED, NULL 
FROM TEMP.SCHEMAFOREIGNKEYS;</value>
  </data>
</root>
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<






















































































































































































































































































Changes to System.Data.SQLite.Linq/Resources/SQLiteProviderServices.StoreSchemaDefinition.ssdl.
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
        ,   c.COLLATION_CATALOG [CollationCatalog]
        ,   c.COLLATION_SCHEMA [CollationSchema]
        ,   c.COLLATION_NAME [CollationName]
        ,   c.CHARACTER_SET_CATALOG [CharacterSetCatalog]
        ,   c.CHARACTER_SET_SCHEMA [CharacterSetSchema]
        ,   c.CHARACTER_SET_NAME [CharacterSetName]
        ,   0 as [IsMultiSet]
        ,   c.[AUTOINCREMENT] as [IsIdentity]
        ,   0 as [IsStoreGenerated]
        , c.COLUMN_DEFAULT as [Default]
        FROM
        TEMP.SCHEMACOLUMNS c
      </DefiningQuery>
    </EntitySet>








|







31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
        ,   c.COLLATION_CATALOG [CollationCatalog]
        ,   c.COLLATION_SCHEMA [CollationSchema]
        ,   c.COLLATION_NAME [CollationName]
        ,   c.CHARACTER_SET_CATALOG [CharacterSetCatalog]
        ,   c.CHARACTER_SET_SCHEMA [CharacterSetSchema]
        ,   c.CHARACTER_SET_NAME [CharacterSetName]
        ,   0 as [IsMultiSet]
        ,   c.PRIMARY_KEY as [IsIdentity]
        ,   0 as [IsStoreGenerated]
        , c.COLUMN_DEFAULT as [Default]
        FROM
        TEMP.SCHEMACOLUMNS c
      </DefiningQuery>
    </EntitySet>

56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
        TEMP.SCHEMAVIEWS
      </DefiningQuery>
    </EntitySet>

    <EntitySet Name="SViewColumns" EntityType="Self.ViewColumn">
      <DefiningQuery>
        SELECT
        '[' || c.VIEW_NAME || ']' || '[' || c.VIEW_COLUMN_NAME || ']' COLLATE NOCASE [Id]
        ,   '[' || c.VIEW_NAME || ']' COLLATE NOCASE                             [ParentId]
        ,   c.VIEW_COLUMN_NAME   [Name]
        ,   c.ORDINAL_POSITION [Ordinal]
        ,   c.IS_NULLABLE [IsNullable]
        ,   c.EDM_TYPE [TypeName]
        ,   c.CHARACTER_MAXIMUM_LENGTH [MaxLength]
        ,   c.NUMERIC_PRECISION [Precision]
        ,   c.DATETIME_PRECISION as [DateTimePrecision]
        ,   c.NUMERIC_SCALE [Scale]
        ,   c.COLLATION_CATALOG [CollationCatalog]
        ,   c.COLLATION_SCHEMA [CollationSchema]
        ,   c.COLLATION_NAME [CollationName]
        ,   c.CHARACTER_SET_CATALOG [CharacterSetCatalog]
        ,   c.CHARACTER_SET_SCHEMA [CharacterSetSchema]
        ,   c.CHARACTER_SET_NAME [CharacterSetName]
        ,   0 as [IsMultiSet]
        ,   c.[AUTOINCREMENT] as [IsIdentity]
        ,   0 as [IsStoreGenerated]
        ,   c.COLUMN_DEFAULT [Default]
        FROM
        TEMP.SCHEMAVIEWCOLUMNS c
      </DefiningQuery>
    </EntitySet>








|
|
|














|







56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
        TEMP.SCHEMAVIEWS
      </DefiningQuery>
    </EntitySet>

    <EntitySet Name="SViewColumns" EntityType="Self.ViewColumn">
      <DefiningQuery>
        SELECT
        '[' || c.TABLE_NAME || ']' || '[' || c.COLUMN_NAME || ']' COLLATE NOCASE [Id]
        ,   '[' || c.TABLE_NAME || ']' COLLATE NOCASE                             [ParentId]
        ,   c.COLUMN_NAME   [Name]
        ,   c.ORDINAL_POSITION [Ordinal]
        ,   c.IS_NULLABLE [IsNullable]
        ,   c.EDM_TYPE [TypeName]
        ,   c.CHARACTER_MAXIMUM_LENGTH [MaxLength]
        ,   c.NUMERIC_PRECISION [Precision]
        ,   c.DATETIME_PRECISION as [DateTimePrecision]
        ,   c.NUMERIC_SCALE [Scale]
        ,   c.COLLATION_CATALOG [CollationCatalog]
        ,   c.COLLATION_SCHEMA [CollationSchema]
        ,   c.COLLATION_NAME [CollationName]
        ,   c.CHARACTER_SET_CATALOG [CharacterSetCatalog]
        ,   c.CHARACTER_SET_SCHEMA [CharacterSetSchema]
        ,   c.CHARACTER_SET_NAME [CharacterSetName]
        ,   0 as [IsMultiSet]
        ,   c.PRIMARY_KEY as [IsIdentity]
        ,   0 as [IsStoreGenerated]
        ,   c.COLUMN_DEFAULT [Default]
        FROM
        TEMP.SCHEMAVIEWCOLUMNS c
      </DefiningQuery>
    </EntitySet>

203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
        FROM
        TEMP.SCHEMACONSTRAINTCOLUMNS
      </DefiningQuery>
    </EntitySet>

    <EntitySet Name="SForeignKeyConstraints" EntityType="Self.ForeignKeyConstraint">
      <DefiningQuery>
        SELECT DISTINCT
        '[' || rc.CONSTRAINT_NAME || ']'  COLLATE NOCASE [Id]
        , 'NO ACTION'  COLLATE NOCASE [UpdateRule]
        , 'NO ACTION'  COLLATE NOCASE [DeleteRule]
        FROM
        TEMP.SCHEMAFOREIGNKEYS rc
      </DefiningQuery>
    </EntitySet>







|







203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
        FROM
        TEMP.SCHEMACONSTRAINTCOLUMNS
      </DefiningQuery>
    </EntitySet>

    <EntitySet Name="SForeignKeyConstraints" EntityType="Self.ForeignKeyConstraint">
      <DefiningQuery>
        SELECT
        '[' || rc.CONSTRAINT_NAME || ']'  COLLATE NOCASE [Id]
        , 'NO ACTION'  COLLATE NOCASE [UpdateRule]
        , 'NO ACTION'  COLLATE NOCASE [DeleteRule]
        FROM
        TEMP.SCHEMAFOREIGNKEYS rc
      </DefiningQuery>
    </EntitySet>
Changes to System.Data.SQLite.Linq/SQL.
1
2
3


4










5
6
7
8
9




10




11




























12




























13









14



15
16













17
18








19











































































20

21







22








23






24




25




26

27





28















































































29

30
31

32
33
34
35
36
37
38
39
40
41
42


43
44

45





























46
47
48















49
50

51
































52
53


















































































54
55

56
57

58
59



60

61





62

63




































































































64



65




66




67









68

















69














70








71

72


73





















74
75


76
77

































78




79


80









81











82





83



84



85
























86


87



































88
89

90

91








92
93










94

95





96


97




















































































98








99


100









101




















102
103






















104




105


106



107



































































108




109



110


111


112















113








114

115


116

117




118







































119
120




121


122

123









124







































125
126










127


128












129


































130










































131
132
133








134


135



136


137
138

139


















































140





141








142




143

144
145










146




























147




148


149










150






151






















152
153
























154

155

156







157








158

159



160




161






















162



163














































164


165






166


167
















168






























169


170





171


172













173



174









175

176






















177


178



179


180


181

182

183


184






























































































185



186
187







188

189

190


191

192




193

194



























































































195

196

197


198




199


200



201
202




















































203
204















































205






206

207










208





209

210

211


212


213











214





































































215





216






217








218

219






































220




















221




222





223







224





225









226


227





228


229


230


231















































232
233








234





235















236













237









238






239


240







241


242

243




































244









245
246










247









248




























249










250


251











252




253
254





255

256














































257
258



































259


260

261







262


263















264



















265
266








267


268







269




270









271








272




















273
274









275

276


277

278
































































279
280


281











282

283



















284







285

286




287



288



289








290

291





292








293














































































294


295




































296
297










298



299
300

301



302



















303

304

305








































306

307


308

























309
310













311
312
313
314


























































315















316




317








318



319



























320



321


322










323







324

325


326


327










328













329




























































330





331




332




333

334







335
336
337



338






339



340
























341

342


343













344










345




346
347





348




349

350


































































351







352






353








































































354
355
356


357












358




359








/********************************************************
 * ADO.NET 2.0 Data Provider for SQLite Version 3.X
 * Written by Robert Simpson (robert@blackcastlesoft.com)


 * 










 * Released to the public domain, use at your own risk!
 ********************************************************/

namespace System.Data.SQLite
{




  using System;




  using System.Collections.Generic;




























  using System.Data;




























  using System.Data.Common.CommandTrees;









  using System.Data.Entity;



  using System.Runtime.CompilerServices;














  internal class SqlChecker : DbExpressionVisitor<bool>
  {








    private static Type sql8rewriter;













































































    static SqlChecker()







    {








      sql8rewriter = Type.GetType("System.Data.SqlClient.SqlGen.Sql8ExpressionRewriter, System.Data.Entity, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", false);






    }









    private SqlChecker()

    {





    }

















































































    /// <summary>
    /// SQLite doesn't support things like SKIP and a few other things.  So determine if the query has to be rewritten

    /// </summary>
    /// <remarks>
    /// Microsoft went to all the trouble of making things like SKIP work on Sql Server 2000 by doing a rewrite of the commandtree.
    /// However, all that fancy stuff is hidden from us.  Thanks to reflection however, we can go ahead and use the Sql 2000 rewriter code
    /// they made.
    /// </remarks>
    /// <param name="tree">The tree to inspect for a rewrite</param>
    /// <returns>Returns a new query tree if it needs rewriting</returns>
    internal static DbQueryCommandTree Rewrite(DbQueryCommandTree tree)
    {
      SqlChecker visitor = new SqlChecker();


      if (tree.Query.Accept<bool>(visitor))
      {

        tree = sql8rewriter.InvokeMember("Rewrite", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.InvokeMethod | System.Reflection.BindingFlags.Static, null, null, new object[] { tree }) as DbQueryCommandTree;





























      }      
      return tree;
    }
















    public override bool Visit(DbAndExpression expression)

    {
































      return VisitBinaryExpression(expression);
    }



















































































    public override bool Visit(DbApplyExpression expression)

    {
      throw new NotSupportedException("apply expression");

    }




    public override bool Visit(DbArithmeticExpression expression)

    {





      return VisitExpressionList(expression.Arguments);

    }








































































































    public override bool Visit(DbCaseExpression expression)




    {




      bool flag1 = VisitExpressionList(expression.When);









      bool flag2 = VisitExpressionList(expression.Then);

















      bool flag3 = VisitExpression(expression.Else);























      return (flag1 || flag2 || flag3);

    }
























    public override bool Visit(DbCastExpression expression)
    {


      return VisitUnaryExpression(expression);
    }






































    public override bool Visit(DbComparisonExpression expression)


    {









      return VisitBinaryExpression(expression);











    }









    public override bool Visit(DbConstantExpression expression)



    {
























      return false;


    }




































    public override bool Visit(DbCrossJoinExpression expression)

    {

      return VisitExpressionBindingList(expression.Inputs);








    }











    public override bool Visit(DbDerefExpression expression)

    {





      return VisitUnaryExpression(expression);


    }





























































































    public override bool Visit(DbDistinctExpression expression)


    {









      return VisitUnaryExpression(expression);




















    }























    public override bool Visit(DbElementExpression expression)




    {


      return VisitUnaryExpression(expression);



    }








































































    public override bool Visit(DbEntityRefExpression expression)



    {


      return VisitUnaryExpression(expression);


    }
























    public override bool Visit(DbExceptExpression expression)

    {


      VisitExpression(expression.Left);

      VisitExpression(expression.Right);




      return true;







































    }





    public override bool Visit(DbExpression expression)


    {

      throw new NotSupportedException(expression.GetType().FullName);









    }








































    public override bool Visit(DbFilterExpression expression)










    {


      bool flag1 = VisitExpressionBinding(expression.Input);












      bool flag2 = VisitExpression(expression.Predicate);













































































      return (flag1 || flag2);
    }









    public override bool Visit(DbFunctionExpression expression)


    {



      return VisitExpressionList(expression.Arguments);


    }


    public override bool Visit(DbGroupByExpression expression)


















































    {





      bool flag1 = VisitExpression(expression.Input.Expression);








      bool flag2 = VisitExpressionList(expression.Keys);




      bool flag3 = VisitAggregateList(expression.Aggregates);


      return (flag1 || flag2 || flag3);










    }

































    public override bool Visit(DbIntersectExpression expression)


    {










      VisitExpression(expression.Left);






      VisitExpression(expression.Right);






















      return true;
    }


























    public override bool Visit(DbIsEmptyExpression expression)

    {







      return VisitUnaryExpression(expression);








    }





    public override bool Visit(DbIsNullExpression expression)




    {






















      return VisitUnaryExpression(expression);



    }

















































    public override bool Visit(DbIsOfExpression expression)






    {


      return VisitUnaryExpression(expression);
















    }

































    public override bool Visit(DbJoinExpression expression)





    {


      bool flag1 = VisitExpressionBinding(expression.Left);













      bool flag2 = VisitExpressionBinding(expression.Right);



      bool flag3 = VisitExpression(expression.JoinCondition);









      return (flag1 || flag2 || flag3);

    }

























    public override bool Visit(DbLikeExpression expression)



    {


      bool flag1 = VisitExpression(expression.Argument);


      bool flag2 = VisitExpression(expression.Pattern);

      bool flag3 = VisitExpression(expression.Escape);

      return (flag1 || flag2 || flag3);


    }


































































































    public override bool Visit(DbLimitExpression expression)
    {







      return VisitExpression(expression.Argument);

    }




    public override bool Visit(DbNewInstanceExpression expression)

    {




      return VisitExpressionList(expression.Arguments);

    }





























































































    public override bool Visit(DbNotExpression expression)

    {


      return VisitUnaryExpression(expression);




    }






    public override bool Visit(DbNullExpression expression)
    {




















































      return false;
    }






















































    public override bool Visit(DbOfTypeExpression expression)

    {










      return VisitUnaryExpression(expression);





    }



    public override bool Visit(DbOrExpression expression)


    {


      return VisitBinaryExpression(expression);











    }











































































    public override bool Visit(DbParameterReferenceExpression expression)






    {








      return false;

    }



























































    public override bool Visit(DbProjectExpression expression)




    {





      bool flag1 = VisitExpressionBinding(expression.Input);







      bool flag2 = VisitExpression(expression.Projection);





      return (flag1 || flag2);









    }








    public override bool Visit(DbPropertyExpression expression)


    {


      return VisitExpression(expression.Instance);


    }
















































    public override bool Visit(DbQuantifierExpression expression)








    {





      bool flag1 = VisitExpressionBinding(expression.Input);















      bool flag2 = VisitExpression(expression.Predicate);













      return (flag1 || flag2);









    }









    public override bool Visit(DbRefExpression expression)







    {


      return VisitUnaryExpression(expression);

    }














































    public override bool Visit(DbRefKeyExpression expression)
    {










      return VisitUnaryExpression(expression);









    }







































    public override bool Visit(DbRelationshipNavigationExpression expression)


    {











      return VisitExpression(expression.NavigationSource);




    }






    public override bool Visit(DbScanExpression expression)

    {














































      return false;
    }






































    public override bool Visit(DbSkipExpression expression)

    {







      VisitExpressionBinding(expression.Input);


      VisitSortClauseList(expression.SortOrder);















      VisitExpression(expression.Count);



















      return true;
    }











    public override bool Visit(DbSortExpression expression)







    {




      bool flag1 = VisitExpressionBinding(expression.Input);









      bool flag2 = VisitSortClauseList(expression.SortOrder);








      return (flag1 || flag2);




















    }










    public override bool Visit(DbTreatExpression expression)

    {


      return VisitUnaryExpression(expression);

    }

































































    public override bool Visit(DbUnionAllExpression expression)


    {











      return VisitBinaryExpression(expression);

    }



























    public override bool Visit(DbVariableReferenceExpression expression)

    {




      return false;



    }












    private bool VisitAggregate(DbAggregate aggregate)

    {





      return VisitExpressionList(aggregate.Arguments);








    }

















































































    private bool VisitAggregateList(IList<DbAggregate> list)




































    {
      return VisitList<DbAggregate>(new ListElementHandler<DbAggregate>(VisitAggregate), list);










    }




    private bool VisitBinaryExpression(DbBinaryExpression expr)

    {



      bool flag1 = VisitExpression(expr.Left);



















      bool flag2 = VisitExpression(expr.Right);

      return (flag1 || flag2);

    }










































    private bool VisitExpression(DbExpression expression)


    {

























      if (expression == null)
      {













        return false;
      }
      return expression.Accept<bool>(this);
    }










































































    private bool VisitExpressionBinding(DbExpressionBinding expressionBinding)




    {








      return VisitExpression(expressionBinding.Expression);



    }































    private bool VisitExpressionBindingList(IList<DbExpressionBinding> list)


    {










      return VisitList<DbExpressionBinding>(new ListElementHandler<DbExpressionBinding>(VisitExpressionBinding), list);







    }




    private bool VisitExpressionList(IList<DbExpression> list)


    {










      return VisitList<DbExpression>(new ListElementHandler<DbExpression>(VisitExpression), list);













    }


































































    private static bool VisitList<TElementType>(ListElementHandler<TElementType> handler, IList<TElementType> list)




    {




      bool flag = false;

      foreach (TElementType local in list)







      {
        bool flag2 = handler(local);
        flag = flag || flag2;



      }






      return flag;



    }


























    private bool VisitSortClause(DbSortClause sortClause)


    {













      return VisitExpression(sortClause.Expression);










    }





    private bool VisitSortClauseList(IList<DbSortClause> list)





    {




      return VisitList<DbSortClause>(new ListElementHandler<DbSortClause>(VisitSortClause), list);

    }










































































    private bool VisitUnaryExpression(DbUnaryExpression expr)






    {








































































      return VisitExpression(expr.Argument);
    }



    private delegate bool ListElementHandler<TElementType>(TElementType element);












  }




}








|
|
|
>
>
|
>
>
>
>
>
>
>
>
>
>
|
<



>
>
>
>
|
>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
|
>
>
>
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
|
<
>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
|
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
|
>
>
>
>
|
>
>
>
>
|
>
|
>
>
>
>
>

>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>

<
>

|
<
<
<
<
<
<
|

<
>
>
|
<
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
<
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
|
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
|
>
|
|
>
|

>
>
>
|
>
|
>
>
>
>
>
|
>

>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

>
>
>
|
>
>
>
>
|
>
>
>
>
|
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>

>
>
>
>
>
>
>
>
|
>
|
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|

>
>
|

>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

>
>
>
>
|
>
>
|
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>

>
>
>
|
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
|
>
|
>
|
>
>
>
>
>
>
>
>


>
>
>
>
>
>
>
>
>
>
|
>
|
>
>
>
>
>
|
>
>

>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
|
>
>
|
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>


>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
|
>
>
|
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
|
>
>
>
|
>
>
|
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
|
>
|
>
>
|
>
|
>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|

>
>
>
>
|
>
>
|
>
|
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
|
>
>
>
>
>
>
>
>
>
>

>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|


>
>
>
>
>
>
>
>
|
>
>
|
>
>
>
|
>
>
|

>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>
|
>
>
>
>
>
>
>
>
|
>
>
>
>
|
>
|
|
>
>
>
>
>
>
>
>
>
>

>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
|
>
>
|
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|

>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
|
>
|
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
|
>
|
>
>
>
|
>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
|
>
>
>
>
>
>

>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

>
>
|
>
>
>
>
>
|
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
|
>
>
>
>
>
>
>
>
>
|
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
|
>
>
>
|
>
>
|
>
>
|
>
|
>
|
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

>
>
>
|
|
>
>
>
>
>
>
>
|
>
|
>
|
>
>
|
>
|
>
>
>
>
|
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
|
>
|
>
>
|
>
>
>
>
|
>
>
|
>
>
>
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|

>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

>
>
>
>
>
>
|
>
|
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>
|
>

>
|
>
>
|
>
>
|
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

>
>
>
>
>
|
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
|
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
|
>
>
>
>
>
|
>
>
>
>
>
>
>
|
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
|
>
>
|
>
>
>
>
>
|
>
>
|
>
>
|
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
|
>
>
>
>
>
>
>
>

>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
|
>
>
|
>
>
>
>
>
>
>

>
>
|
>

>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
|
|
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>

>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
|
>
>
|
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
|

>
>
>
>
>
|
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|

>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
|
>
|
>
>
>
>
>
>
>
|
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|

>
>
>
>
>
>
>
>
|
>
>
|
>
>
>
>
>
>
>

>
>
>
>
|
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>


>
>
>
>
>
>
>
>
>
|
>
|
>
>
|
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
<
>
>
|
>
>
>
>
>
>
>
>
>
>
>
|
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
|
>
|
>
>
>
>
|
>
>
>
|
>
>
>

>
>
>
>
>
>
>
>
|
>
|
>
>
>
>
>
|
>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

<
>
>
>
>
>
>
>
>
>
>
|
>
>
>
|
|
>
|
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
|
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
|
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|

>
>
>
>
>
>
>
>
>
>
>
>
>
|
|
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
|
>
>
>
>
>
>
>
>
|
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

>
>
>
|
>
>
|
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
|
>
|
>
>
|
>
>
|
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>

>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

>
>
>
>
>
|
>
>
>
>
|
>
>
>
>
|
>
|
>
>
>
>
>
>
>
|
<
<
>
>
>
|
>
>
>
>
>
>
|
>
>
>

>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
|
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
|
|
>
>
>
>
>
|
>
>
>
>
|
>

>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

>
>
>
>
>
>
>
|
>
>
>
>
>
>

>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
|
|
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
|
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117

118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328

329
330
331






332
333

334
335
336

337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368

369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003

3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208

3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611


3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
//---------------------------------------------------------------------
// <copyright file="SqlGenerator.cs" company="Microsoft">
//      Copyright (c) Microsoft Corporation.  All rights reserved.
// </copyright>
//---------------------------------------------------------------------

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Text;
using System.Data.Common;
using System.Data.Metadata.Edm;
using System.Data.Common.CommandTrees;
using System.Data;



namespace System.Data.SQLite
{
  /// <summary>
  /// Translates the command object into a SQL string that can be executed on
  /// SQL Server 2005.
  /// </summary>
  /// <remarks>
  /// The translation is implemented as a visitor <see cref="DbExpressionVisitor{T}"/>
  /// over the query tree.  It makes a single pass over the tree, collecting the sql
  /// fragments for the various nodes in the tree <see cref="ISqlFragment"/>.
  ///
  /// The major operations are
  /// <list type="bullet">
  /// <item>Select statement minimization.  Multiple nodes in the query tree
  /// that can be part of a single SQL select statement are merged. e.g. a
  /// Filter node that is the input of a Project node can typically share the
  /// same SQL statement.</item>
  /// <item>Alpha-renaming.  As a result of the statement minimization above, there
  /// could be name collisions when using correlated subqueries
  /// <example>
  /// <code>
  /// Filter(
  ///     b = Project( c.x
  ///         c = Extent(foo)
  ///         )
  ///     exists (
  ///         Filter(
  ///             c = Extent(foo)
  ///             b.x = c.x
  ///             )
  ///     )
  /// )
  /// </code>
  /// The first Filter, Project and Extent will share the same SQL select statement.
  /// The alias for the Project i.e. b, will be replaced with c.
  /// If the alias c for the Filter within the exists clause is not renamed,
  /// we will get <c>c.x = c.x</c>, which is incorrect.
  /// Instead, the alias c within the second filter should be renamed to c1, to give
  /// <c>c.x = c1.x</c> i.e. b is renamed to c, and c is renamed to c1.
  /// </example>
  /// </item>
  /// <item>Join flattening.  In the query tree, a list of join nodes is typically
  /// represented as a tree of Join nodes, each with 2 children. e.g.
  /// <example>
  /// <code>
  /// a = Join(InnerJoin
  ///     b = Join(CrossJoin
  ///         c = Extent(foo)
  ///         d = Extent(foo)
  ///         )
  ///     e = Extent(foo)
  ///     on b.c.x = e.x
  ///     )
  /// </code>
  /// If translated directly, this will be translated to
  /// <code>
  /// FROM ( SELECT c.*, d.*
  ///         FROM foo as c
  ///         CROSS JOIN foo as d) as b
  /// INNER JOIN foo as e on b.x' = e.x
  /// </code>
  /// It would be better to translate this as
  /// <code>
  /// FROM foo as c
  /// CROSS JOIN foo as d
  /// INNER JOIN foo as e on c.x = e.x
  /// </code>
  /// This allows the optimizer to choose an appropriate join ordering for evaluation.
  /// </example>
  /// </item>
  /// <item>Select * and column renaming.  In the example above, we noticed that
  /// in some cases we add <c>SELECT * FROM ...</c> to complete the SQL
  /// statement. i.e. there is no explicit PROJECT list.
  /// In this case, we enumerate all the columns available in the FROM clause
  /// This is particularly problematic in the case of Join trees, since the columns
  /// from the extents joined might have the same name - this is illegal.  To solve
  /// this problem, we will have to rename columns if they are part of a SELECT *
  /// for a JOIN node - we do not need renaming in any other situation.
  /// <see cref="SqlGenerator.AddDefaultColumns"/>.
  /// </item>
  /// </list>
  ///
  /// <para>
  /// Renaming issues.
  /// When rows or columns are renamed, we produce names that are unique globally
  /// with respect to the query.  The names are derived from the original names,
  /// with an integer as a suffix. e.g. CustomerId will be renamed to CustomerId1,
  /// CustomerId2 etc.
  ///
  /// Since the names generated are globally unique, they will not conflict when the
  /// columns of a JOIN SELECT statement are joined with another JOIN. 
  ///
  /// </para>
  ///
  /// <para>
  /// Record flattening.
  /// SQL server does not have the concept of records.  However, a join statement
  /// produces records.  We have to flatten the record accesses into a simple
  /// <c>alias.column</c> form.  <see cref="SqlGenerator.Visit(DbPropertyExpression)"/>

  /// </para>
  ///
  /// <para>
  /// Building the SQL.
  /// There are 2 phases
  /// <list type="numbered">
  /// <item>Traverse the tree, producing a sql builder <see cref="SqlBuilder"/></item>
  /// <item>Write the SqlBuilder into a string, renaming the aliases and columns
  /// as needed.</item>
  /// </list>
  ///
  /// In the first phase, we traverse the tree.  We cannot generate the SQL string
  /// right away, since
  /// <list type="bullet">
  /// <item>The WHERE clause has to be visited before the from clause.</item>
  /// <item>extent aliases and column aliases need to be renamed.  To minimize
  /// renaming collisions, all the names used must be known, before any renaming
  /// choice is made.</item>
  /// </list>
  /// To defer the renaming choices, we use symbols <see cref="Symbol"/>.  These
  /// are renamed in the second phase.
  ///
  /// Since visitor methods cannot transfer information to child nodes through
  /// parameters, we use some global stacks,
  /// <list type="bullet">
  /// <item>A stack for the current SQL select statement.  This is needed by
  /// <see cref="SqlGenerator.Visit(DbVariableReferenceExpression)"/> to create a
  /// list of free variables used by a select statement.  This is needed for
  /// alias renaming.
  /// </item>
  /// <item>A stack for the join context.  When visiting a <see cref="DbScanExpression"/>,
  /// we need to know whether we are inside a join or not.  If we are inside
  /// a join, we do not create a new SELECT statement.</item>
  /// </list>
  /// </para>
  ///
  /// <para>
  /// Global state.
  /// To enable renaming, we maintain
  /// <list type="bullet">
  /// <item>The set of all extent aliases used.</item>
  /// <item>The set of all column aliases used.</item>
  /// </list>
  ///
  /// Finally, we have a symbol table to lookup variable references.  All references
  /// to the same extent have the same symbol.
  /// </para>
  ///
  /// <para>
  /// Sql select statement sharing.
  ///
  /// Each of the relational operator nodes
  /// <list type="bullet">
  /// <item>Project</item>
  /// <item>Filter</item>
  /// <item>GroupBy</item>
  /// <item>Sort/OrderBy</item>
  /// </list>
  /// can add its non-input (e.g. project, predicate, sort order etc.) to
  /// the SQL statement for the input, or create a new SQL statement.
  /// If it chooses to reuse the input's SQL statement, we play the following
  /// symbol table trick to accomplish renaming.  The symbol table entry for
  /// the alias of the current node points to the symbol for the input in
  /// the input's SQL statement.
  /// <example>
  /// <code>
  /// Project(b.x
  ///     b = Filter(
  ///         c = Extent(foo)
  ///         c.x = 5)
  ///     )
  /// </code>
  /// The Extent node creates a new SqlSelectStatement.  This is added to the
  /// symbol table by the Filter as {c, Symbol(c)}.  Thus, <c>c.x</c> is resolved to
  /// <c>Symbol(c).x</c>.
  /// Looking at the project node, we add {b, Symbol(c)} to the symbol table if the
  /// SQL statement is reused, and {b, Symbol(b)}, if there is no reuse.
  ///
  /// Thus, <c>b.x</c> is resolved to <c>Symbol(c).x</c> if there is reuse, and to
  /// <c>Symbol(b).x</c> if there is no reuse.
  /// </example>
  /// </para>
  /// </remarks>
  internal sealed class SqlGenerator : DbExpressionVisitor<ISqlFragment>
  {
    private SQLiteProviderManifest _manifest;

    #region Visitor parameter stacks
    /// <summary>
    /// Every relational node has to pass its SELECT statement to its children
    /// This allows them (DbVariableReferenceExpression eventually) to update the list of
    /// outer extents (free variables) used by this select statement.
    /// </summary>
    Stack<SqlSelectStatement> selectStatementStack;

    /// <summary>
    /// The top of the stack
    /// </summary>
    private SqlSelectStatement CurrentSelectStatement
    {
      // There is always something on the stack, so we can always Peek.
      get { return selectStatementStack.Peek(); }
    }

    /// <summary>
    /// Nested joins and extents need to know whether they should create
    /// a new Select statement, or reuse the parent's.  This flag
    /// indicates whether the parent is a join or not.
    /// </summary>
    Stack<bool> isParentAJoinStack;

    /// <summary>
    /// The top of the stack
    /// </summary>
    private bool IsParentAJoin
    {
      // There might be no entry on the stack if a Join node has never
      // been seen, so we return false in that case.
      get { return isParentAJoinStack.Count == 0 ? false : isParentAJoinStack.Peek(); }
    }

    #endregion

    #region Global lists and state
    Dictionary<string, int> allExtentNames;
    internal Dictionary<string, int> AllExtentNames
    {
      get { return allExtentNames; }
    }

    // For each column name, we store the last integer suffix that
    // was added to produce a unique column name.  This speeds up
    // the creation of the next unique name for this column name.
    Dictionary<string, int> allColumnNames;
    internal Dictionary<string, int> AllColumnNames
    {
      get { return allColumnNames; }
    }

    SymbolTable symbolTable = new SymbolTable();

    /// <summary>
    /// VariableReferenceExpressions are allowed only as children of DbPropertyExpression
    /// or MethodExpression.  The cheapest way to ensure this is to set the following
    /// property in DbVariableReferenceExpression and reset it in the allowed parent expressions.
    /// </summary>
    bool isVarRefSingle = false;

    #endregion

    #region Statics
    static private readonly Dictionary<string, FunctionHandler> _builtInFunctionHandlers = InitializeBuiltInFunctionHandlers();
    static private readonly Dictionary<string, FunctionHandler> _canonicalFunctionHandlers = InitializeCanonicalFunctionHandlers();
    static private readonly Dictionary<string, string> _functionNameToOperatorDictionary = InitializeFunctionNameToOperatorDictionary();
    static private readonly Dictionary<string, string> _datepartKeywords = InitializeDatepartKeywords();
    static private readonly char[] hexDigits = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };

    private delegate ISqlFragment FunctionHandler(SqlGenerator sqlgen, DbFunctionExpression functionExpr);

    /// <summary>
    /// All special built-in functions and their handlers
    /// </summary>
    /// <returns></returns>
    private static Dictionary<string, FunctionHandler> InitializeBuiltInFunctionHandlers()
    {
      Dictionary<string, FunctionHandler> functionHandlers = new Dictionary<string, FunctionHandler>(7, StringComparer.Ordinal);
      functionHandlers.Add("CONCAT", HandleConcatFunction);
      functionHandlers.Add("DATEPART", HandleDatepartDateFunction);
      functionHandlers.Add("DatePart", HandleDatepartDateFunction);
      functionHandlers.Add("GETDATE", HandleGetDateFunction);
      functionHandlers.Add("GETUTCDATE", HandleGetUtcDateFunction);
      return functionHandlers;
    }

    /// <summary>
    /// All special non-aggregate canonical functions and their handlers
    /// </summary>
    /// <returns></returns>
    private static Dictionary<string, FunctionHandler> InitializeCanonicalFunctionHandlers()
    {
      Dictionary<string, FunctionHandler> functionHandlers = new Dictionary<string, FunctionHandler>(16, StringComparer.Ordinal);
      functionHandlers.Add("IndexOf", HandleCanonicalFunctionIndexOf);
      functionHandlers.Add("Length", HandleCanonicalFunctionLength);
      functionHandlers.Add("NewGuid", HandleCanonicalFunctionNewGuid);
      functionHandlers.Add("Round", HandleCanonicalFunctionRound);
      functionHandlers.Add("ToLower", HandleCanonicalFunctionToLower);
      functionHandlers.Add("ToUpper", HandleCanonicalFunctionToUpper);
      functionHandlers.Add("Trim", HandleCanonicalFunctionTrim);

      //DatePartFunctions
      functionHandlers.Add("Year", HandleCanonicalFunctionDatepart);
      functionHandlers.Add("Month", HandleCanonicalFunctionDatepart);
      functionHandlers.Add("Day", HandleCanonicalFunctionDatepart);
      functionHandlers.Add("Hour", HandleCanonicalFunctionDatepart);
      functionHandlers.Add("Minute", HandleCanonicalFunctionDatepart);
      functionHandlers.Add("Second", HandleCanonicalFunctionDatepart);
      functionHandlers.Add("DateAdd", HandleCanonicalFunctionDateAdd);
      functionHandlers.Add("DateDiff", HandleCanonicalFunctionDateSubtract);
      functionHandlers.Add("DATEADD", HandleCanonicalFunctionDateAdd); // store
      functionHandlers.Add("DATEDIFF", HandleCanonicalFunctionDateSubtract); // store

      //Functions that translate to operators
      functionHandlers.Add("Concat", HandleConcatFunction);
      functionHandlers.Add("BitwiseAnd", HandleCanonicalFunctionBitwise);
      functionHandlers.Add("BitwiseNot", HandleCanonicalFunctionBitwise);
      functionHandlers.Add("BitwiseOr", HandleCanonicalFunctionBitwise);
      functionHandlers.Add("BitwiseXor", HandleCanonicalFunctionBitwise);
      return functionHandlers;
    }

    /// <summary>

    /// Valid datepart values
    /// </summary>
    /// <returns></returns>






    private static Dictionary<string, string> InitializeDatepartKeywords()
    {

      #region Datepart Keywords
      //
      // valid datepart values

      //
      Dictionary<string, string> datepartKeywords = new Dictionary<string, string>(30, StringComparer.OrdinalIgnoreCase);
      datepartKeywords.Add("d", "%d");
      datepartKeywords.Add("day", "%d");
      datepartKeywords.Add("dayofyear", "%j");
      datepartKeywords.Add("dd", "%d");
      datepartKeywords.Add("dw", "%w");
      datepartKeywords.Add("dy", "%j");
      datepartKeywords.Add("hh", "%H");
      datepartKeywords.Add("hour", "%H");
      datepartKeywords.Add("m", "%m");
      datepartKeywords.Add("mi", "%M");
      datepartKeywords.Add("millisecond", "%f");
      datepartKeywords.Add("minute", "%M");
      datepartKeywords.Add("mm", "%m");
      datepartKeywords.Add("month", "%m");
      datepartKeywords.Add("ms", "%f");
      datepartKeywords.Add("n", "%M");
      datepartKeywords.Add("s", "%S");
      datepartKeywords.Add("second", "%S");
      datepartKeywords.Add("ss", "%S");
      datepartKeywords.Add("week", "%W");
      datepartKeywords.Add("weekday", "%w");
      datepartKeywords.Add("wk", "%W");
      datepartKeywords.Add("ww", "%W");
      datepartKeywords.Add("y", "%Y");
      datepartKeywords.Add("year", "%Y");
      datepartKeywords.Add("yy", "%Y");
      datepartKeywords.Add("yyyy", "%Y");
      return datepartKeywords;
      #endregion
    }


    /// <summary>
    /// Initializes the mapping from functions to T-SQL operators
    /// for all functions that translate to T-SQL operators
    /// </summary>
    /// <returns></returns>
    private static Dictionary<string, string> InitializeFunctionNameToOperatorDictionary()
    {
      Dictionary<string, string> functionNameToOperatorDictionary = new Dictionary<string, string>(5, StringComparer.Ordinal);
      functionNameToOperatorDictionary.Add("Concat", "||");    //canonical
      functionNameToOperatorDictionary.Add("CONCAT", "||");    //store
      functionNameToOperatorDictionary.Add("BitwiseAnd", "&");
      functionNameToOperatorDictionary.Add("BitwiseNot", "~");
      functionNameToOperatorDictionary.Add("BitwiseOr", "|");
      functionNameToOperatorDictionary.Add("BitwiseXor", "^");
      return functionNameToOperatorDictionary;
    }

    #endregion

    #region Constructor
    /// <summary>
    /// Basic constructor. 
    /// </summary>
    private SqlGenerator(SQLiteProviderManifest manifest)
    {
      _manifest = manifest;
    }
    #endregion

    #region Entry points
    /// <summary>
    /// General purpose static function that can be called from System.Data assembly
    /// </summary>
    /// <param name="sqlVersion">Server version</param>
    /// <param name="tree">command tree</param>
    /// <param name="parameters">Parameters to add to the command tree corresponding
    /// to constants in the command tree. Used only in ModificationCommandTrees.</param>
    /// <returns>The string representing the SQL to be executed.</returns>
    internal static string GenerateSql(SQLiteProviderManifest manifest, DbCommandTree tree, out List<DbParameter> parameters, out CommandType commandType)
    {
      commandType = CommandType.Text;

      //Handle Query
      DbQueryCommandTree queryCommandTree = tree as DbQueryCommandTree;
      if (queryCommandTree != null)
      {
        SqlGenerator sqlGen = new SqlGenerator(manifest);
        parameters = null;
        
        string sql = sqlGen.GenerateSql((DbQueryCommandTree)tree);

        return sql;
      }

      //Handle Function
      DbFunctionCommandTree DbFunctionCommandTree = tree as DbFunctionCommandTree;
      if (DbFunctionCommandTree != null)
      {
        SqlGenerator sqlGen = new SqlGenerator(manifest);
        parameters = null;

        string sql = sqlGen.GenerateFunctionSql(DbFunctionCommandTree, out commandType);

        return sql;
      }

      //Handle Insert
      DbInsertCommandTree insertCommandTree = tree as DbInsertCommandTree;
      if (insertCommandTree != null)
      {
        return DmlSqlGenerator.GenerateInsertSql(insertCommandTree, out parameters);
      }

      //Handle Delete
      DbDeleteCommandTree deleteCommandTree = tree as DbDeleteCommandTree;
      if (deleteCommandTree != null)
      {
        return DmlSqlGenerator.GenerateDeleteSql(deleteCommandTree, out parameters);
      }

      //Handle Update
      DbUpdateCommandTree updateCommandTree = tree as DbUpdateCommandTree;
      if (updateCommandTree != null)
      {
        return DmlSqlGenerator.GenerateUpdateSql(updateCommandTree, out parameters);
      }

      throw new NotSupportedException("Unrecognized command tree type");
    }
    #endregion

    StringBuilder _typeDefs = new StringBuilder();

    #region Driver Methods
    /// <summary>
    /// Translate a command tree to a SQL string.
    ///
    /// The input tree could be translated to either a SQL SELECT statement
    /// or a SELECT expression.  This choice is made based on the return type
    /// of the expression
    /// CollectionType => select statement
    /// non collection type => select expression
    /// </summary>
    /// <param name="tree"></param>
    /// <returns>The string representing the SQL to be executed.</returns>
    private string GenerateSql(DbQueryCommandTree tree)
    {
      // Tree Validation seems to have disappeared from the public method list in SP1 RC
      //tree.Validate();
      tree.GetType().InvokeMember("Validate", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.InvokeMethod, null, tree, null);

      selectStatementStack = new Stack<SqlSelectStatement>();
      isParentAJoinStack = new Stack<bool>();

      allExtentNames = new Dictionary<string, int>(StringComparer.OrdinalIgnoreCase);
      allColumnNames = new Dictionary<string, int>(StringComparer.OrdinalIgnoreCase);

      // Literals will not be converted to parameters.

      ISqlFragment result;
      if (MetadataHelpers.IsCollectionType(tree.Query.ResultType))
      {
        SqlSelectStatement sqlStatement = VisitExpressionEnsureSqlStatement(tree.Query);
        Debug.Assert(sqlStatement != null, "The outer most sql statment is null");
        sqlStatement.IsTopMost = true;
        result = sqlStatement;

      }
      else
      {
        SqlBuilder sqlBuilder = new SqlBuilder();
        sqlBuilder.Append("SELECT ");
        sqlBuilder.Append(tree.Query.Accept(this));

        result = sqlBuilder;
      }

      if (isVarRefSingle)
      {
        throw new NotSupportedException();
        // A DbVariableReferenceExpression has to be a child of DbPropertyExpression or MethodExpression
      }

      // Check that the parameter stacks are not leaking.
      Debug.Assert(selectStatementStack.Count == 0);
      Debug.Assert(isParentAJoinStack.Count == 0);

      if (_typeDefs.Length > 0)
      {
        _typeDefs.Insert(0x0, "TYPES ");
        _typeDefs.Append(";\r\n");
        _typeDefs.Append(WriteSql(result));
        return _typeDefs.ToString();
      }

      return WriteSql(result);
    }

    /// <summary>
    /// Translate a function command tree to a SQL string.
    /// </summary>
    private string GenerateFunctionSql(DbFunctionCommandTree tree, out CommandType commandType)
    {
      // Tree Validation seems to have disappeared from the public method list in SP1 RC
      //tree.Validate();
      tree.GetType().InvokeMember("Validate", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.InvokeMethod, null, tree, null);

      EdmFunction function = tree.EdmFunction;

      // We expect function to always have these properties
      string userCommandText = (string)function.MetadataProperties["CommandTextAttribute"].Value;
      string userSchemaName = (string)function.MetadataProperties["Schema"].Value;
      string userFuncName = (string)function.MetadataProperties["StoreFunctionNameAttribute"].Value;

      if (String.IsNullOrEmpty(userCommandText))
      {
        // build a quoted description of the function
        commandType = CommandType.StoredProcedure;

        // if the schema name is not explicitly given, it is assumed to be the metadata namespace
        string schemaName = String.IsNullOrEmpty(userSchemaName) ?
            function.NamespaceName : userSchemaName;

        // if the function store name is not explicitly given, it is assumed to be the metadata name
        string functionName = String.IsNullOrEmpty(userFuncName) ?
            function.Name : userFuncName;

        // quote elements of function text
        string quotedSchemaName = QuoteIdentifier(schemaName);
        string quotedFunctionName = QuoteIdentifier(functionName);

        // separator
        const string schemaSeparator = ".";

        // concatenate elements of function text
        string quotedFunctionText = quotedSchemaName + schemaSeparator + quotedFunctionName;

        return quotedFunctionText;
      }
      else
      {
        // if the user has specified the command text, pass it through verbatim and choose CommandType.Text
        commandType = CommandType.Text;
        return userCommandText;
      }
    }

    /// <summary>
    /// Convert the SQL fragments to a string.
    /// We have to setup the Stream for writing.
    /// </summary>
    /// <param name="sqlStatement"></param>
    /// <returns>A string representing the SQL to be executed.</returns>
    string WriteSql(ISqlFragment sqlStatement)
    {
      StringBuilder builder = new StringBuilder(1024);
      using (SqlWriter writer = new SqlWriter(builder))
      {
        sqlStatement.WriteSql(writer, this);
      }

      return builder.ToString();
    }
    #endregion

    #region DbExpressionVisitor Members

    /// <summary>
    /// Translate(left) AND Translate(right)
    /// </summary>
    /// <param name="e"></param>
    /// <returns>A <see cref="SqlBuilder"/>.</returns>
    public override ISqlFragment Visit(DbAndExpression e)
    {
      return VisitBinaryExpression(" AND ", e.Left, e.Right);
    }

    /// <summary>
    /// An apply is just like a join, so it shares the common join processing
    /// in <see cref="VisitJoinExpression"/>
    /// </summary>
    /// <param name="e"></param>
    /// <returns>A <see cref="SqlSelectStatement"/>.</returns>
    public override ISqlFragment Visit(DbApplyExpression e)
    {
      throw new NotSupportedException("APPLY joins are not supported");

      //List<DbExpressionBinding> inputs = new List<DbExpressionBinding>();
      //inputs.Add(e.Input);
      //inputs.Add(e.Apply);

      //string joinString;
      //switch (e.ExpressionKind)
      //{
      //  case DbExpressionKind.CrossApply:
      //    joinString = "CROSS APPLY";
      //    break;

      //  case DbExpressionKind.OuterApply:
      //    joinString = "OUTER APPLY";
      //    break;

      //  default:
      //    Debug.Assert(false);
      //    throw new InvalidOperationException();
      //}

      //// The join condition does not exist in this case, so we use null.
      //// We do not have a on clause, so we use JoinType.CrossJoin.
      //return VisitJoinExpression(inputs, DbExpressionKind.CrossJoin, joinString, null);
    }

    /// <summary>
    /// For binary expressions, we delegate to <see cref="VisitBinaryExpression"/>.
    /// We handle the other expressions directly.
    /// </summary>
    /// <param name="e"></param>
    /// <returns>A <see cref="SqlBuilder"/></returns>
    public override ISqlFragment Visit(DbArithmeticExpression e)
    {
      SqlBuilder result;

      switch (e.ExpressionKind)
      {
        case DbExpressionKind.Divide:
          result = VisitBinaryExpression(" / ", e.Arguments[0], e.Arguments[1]);
          break;
        case DbExpressionKind.Minus:
          result = VisitBinaryExpression(" - ", e.Arguments[0], e.Arguments[1]);
          break;
        case DbExpressionKind.Modulo:
          result = VisitBinaryExpression(" % ", e.Arguments[0], e.Arguments[1]);
          break;
        case DbExpressionKind.Multiply:
          result = VisitBinaryExpression(" * ", e.Arguments[0], e.Arguments[1]);
          break;
        case DbExpressionKind.Plus:
          result = VisitBinaryExpression(" + ", e.Arguments[0], e.Arguments[1]);
          break;

        case DbExpressionKind.UnaryMinus:
          result = new SqlBuilder();
          result.Append(" -(");
          result.Append(e.Arguments[0].Accept(this));
          result.Append(")");
          break;

        default:
          Debug.Assert(false);
          throw new InvalidOperationException();
      }

      return result;
    }

    /// <summary>
    /// If the ELSE clause is null, we do not write it out.
    /// </summary>
    /// <param name="e"></param>
    /// <returns>A <see cref="SqlBuilder"/></returns>
    public override ISqlFragment Visit(DbCaseExpression e)
    {
      SqlBuilder result = new SqlBuilder();

      Debug.Assert(e.When.Count == e.Then.Count);

      result.Append("CASE");
      for (int i = 0; i < e.When.Count; ++i)
      {
        result.Append(" WHEN (");
        result.Append(e.When[i].Accept(this));
        result.Append(") THEN ");
        result.Append(e.Then[i].Accept(this));
      }
      if (e.Else != null && !(e.Else is DbNullExpression))
      {
        result.Append(" ELSE ");
        result.Append(e.Else.Accept(this));
      }

      result.Append(" END");

      return result;
    }

    /// <summary>
    ///
    /// </summary>
    /// <param name="e"></param>
    /// <returns></returns>
    public override ISqlFragment Visit(DbCastExpression e)
    {
      SqlBuilder result = new SqlBuilder();
      result.Append(e.Argument.Accept(this));
      return result;
    }

    /// <summary>
    /// The parser generates Not(Equals(...)) for &lt;&gt;.
    /// </summary>
    /// <param name="e"></param>
    /// <returns>A <see cref="SqlBuilder"/>.</returns>
    public override ISqlFragment Visit(DbComparisonExpression e)
    {
      SqlBuilder result;
      switch (e.ExpressionKind)
      {
        case DbExpressionKind.Equals:
          //if (e.Left.ResultType.EdmType.Name == "String" && e.Right.ResultType.EdmType.Name == "String")
          //  result = VisitBinaryExpression(" LIKE ", e.Left, e.Right);
          //else
            result = VisitBinaryExpression(" = ", e.Left, e.Right);
          break;
        case DbExpressionKind.LessThan:
          result = VisitBinaryExpression(" < ", e.Left, e.Right);
          break;
        case DbExpressionKind.LessThanOrEquals:
          result = VisitBinaryExpression(" <= ", e.Left, e.Right);
          break;
        case DbExpressionKind.GreaterThan:
          result = VisitBinaryExpression(" > ", e.Left, e.Right);
          break;
        case DbExpressionKind.GreaterThanOrEquals:
          result = VisitBinaryExpression(" >= ", e.Left, e.Right);
          break;
        // The parser does not generate the expression kind below.
        case DbExpressionKind.NotEquals:
          result = VisitBinaryExpression(" <> ", e.Left, e.Right);
          break;

        default:
          Debug.Assert(false);  // The constructor should have prevented this
          throw new InvalidOperationException(String.Empty);
      }

      return result;
    }

    /// <summary>
    /// Constants will be send to the store as part of the generated TSQL, not as parameters
    /// </summary>
    /// <param name="e"></param>
    /// <returns>A <see cref="SqlBuilder"/>.  Strings are wrapped in single
    /// quotes and escaped.  Numbers are written literally.</returns>
    public override ISqlFragment Visit(DbConstantExpression e)
    {
      SqlBuilder result = new SqlBuilder();

      PrimitiveTypeKind typeKind;
      // Model Types can be (at the time of this implementation):
      //      Binary, Boolean, Byte, DateTime, Decimal, Double, Guid, Int16, Int32, Int64,Single, String
      if (MetadataHelpers.TryGetPrimitiveTypeKind(e.ResultType, out typeKind))
      {
        switch (typeKind)
        {
          case PrimitiveTypeKind.Int32:
            // default sql server type for integral values.
            result.Append(e.Value.ToString());
            break;

          case PrimitiveTypeKind.Binary:
            result.Append(" 0x");
            result.Append(ByteArrayToBinaryString((Byte[])e.Value));
            result.Append(" ");
            break;

          case PrimitiveTypeKind.Boolean:
            result.Append((bool)e.Value ? "1" : "0");
            break;

          case PrimitiveTypeKind.Byte:
            result.Append(e.Value.ToString());
            break;

          case PrimitiveTypeKind.DateTime:
            result.Append(EscapeSingleQuote(((System.DateTime)e.Value).ToString("yyyy-MM-dd HH:mm:ss.fff", CultureInfo.InvariantCulture), false /* IsUnicode */));
            break;

          case PrimitiveTypeKind.Decimal:
            string strDecimal = ((Decimal)e.Value).ToString(CultureInfo.InvariantCulture);
            // if the decimal value has no decimal part, cast as decimal to preserve type
            // if the number has precision > int64 max precision, it will be handled as decimal by sql server
            // and does not need cast. if precision is lest then 20, then cast using Max(literal precision, sql default precision)
            if (-1 == strDecimal.IndexOf('.') && (strDecimal.TrimStart(new char[] { '-' }).Length < 20))
            {
              byte precision = (Byte)strDecimal.Length;
              FacetDescription precisionFacetDescription;
              Debug.Assert(MetadataHelpers.TryGetTypeFacetDescriptionByName(e.ResultType.EdmType, "precision", out precisionFacetDescription), "Decimal primitive type must have Precision facet");
              if (MetadataHelpers.TryGetTypeFacetDescriptionByName(e.ResultType.EdmType, "precision", out precisionFacetDescription))
              {
                if (precisionFacetDescription.DefaultValue != null)
                {
                  precision = Math.Max(precision, (byte)precisionFacetDescription.DefaultValue);
                }
              }
              Debug.Assert(precision > 0, "Precision must be greater than zero");
              result.Append(strDecimal);
            }
            else
            {
              result.Append(strDecimal);
            }
            break;

          case PrimitiveTypeKind.Double:
            result.Append(((Double)e.Value).ToString(CultureInfo.InvariantCulture));
            break;

          case PrimitiveTypeKind.Guid:
            result.Append(EscapeSingleQuote(e.Value.ToString(), false /* IsUnicode */));
            break;

          case PrimitiveTypeKind.Int16:
            result.Append(e.Value.ToString());
            break;

          case PrimitiveTypeKind.Int64:
            result.Append(e.Value.ToString());
            break;

          case PrimitiveTypeKind.Single:
            result.Append(((Single)e.Value).ToString(CultureInfo.InvariantCulture));
            break;

          case PrimitiveTypeKind.String:
            bool isUnicode = MetadataHelpers.GetFacetValueOrDefault<bool>(e.ResultType, MetadataHelpers.UnicodeFacetName, true);
            result.Append(EscapeSingleQuote(e.Value as string, isUnicode));
            break;

          default:
            // all known scalar types should been handled already.
            throw new NotSupportedException();
        }
      }
      else
      {
        throw new NotSupportedException();
      }

      return result;

    }

    /// <summary>
    /// <see cref="DbDerefExpression"/> is illegal at this stage
    /// </summary>
    /// <param name="e"></param>
    /// <returns></returns>
    public override ISqlFragment Visit(DbDerefExpression e)
    {
      throw new NotSupportedException();
    }

    /// <summary>
    /// The DISTINCT has to be added to the beginning of SqlSelectStatement.Select,
    /// but it might be too late for that.  So, we use a flag on SqlSelectStatement
    /// instead, and add the "DISTINCT" in the second phase.
    /// </summary>
    /// <param name="e"></param>
    /// <returns>A <see cref="SqlSelectStatement"/></returns>
    public override ISqlFragment Visit(DbDistinctExpression e)
    {
      SqlSelectStatement result = VisitExpressionEnsureSqlStatement(e.Argument);

      if (!IsCompatible(result, e.ExpressionKind))
      {
        Symbol fromSymbol;
        TypeUsage inputType = MetadataHelpers.GetElementTypeUsage(e.Argument.ResultType);
        result = CreateNewSelectStatement(result, "DISTINCT", inputType, out fromSymbol);
        AddFromSymbol(result, "DISTINCT", fromSymbol, false);
      }

      result.IsDistinct = true;
      return result;
    }

    /// <summary>
    /// An element expression returns a scalar - so it is translated to
    /// ( Select ... )
    /// </summary>
    /// <param name="e"></param>
    /// <returns></returns>
    public override ISqlFragment Visit(DbElementExpression e)
    {
      SqlBuilder result = new SqlBuilder();
      result.Append("(");
      result.Append(VisitExpressionEnsureSqlStatement(e.Argument));
      result.Append(")");

      return result;
    }

    /// <summary>
    /// <see cref="Visit(DbUnionAllExpression)"/>
    /// </summary>
    /// <param name="e"></param>
    /// <returns></returns>
    public override ISqlFragment Visit(DbExceptExpression e)
    {
      return VisitSetOpExpression(e.Left, e.Right, "EXCEPT");
    }

    /// <summary>
    /// Only concrete expression types will be visited.
    /// </summary>
    /// <param name="e"></param>
    /// <returns></returns>
    public override ISqlFragment Visit(DbExpression e)
    {
      throw new InvalidOperationException();
    }

    /// <summary>
    ///
    /// </summary>
    /// <param name="e"></param>
    /// <returns>If we are in a Join context, returns a <see cref="SqlBuilder"/>
    /// with the extent name, otherwise, a new <see cref="SqlSelectStatement"/>
    /// with the From field set.</returns>
    public override ISqlFragment Visit(DbScanExpression e)
    {
      EntitySetBase target = e.Target;

      if (IsParentAJoin)
      {
        SqlBuilder result = new SqlBuilder();
        result.Append(GetTargetTSql(target));

        return result;
      }
      else
      {
        SqlSelectStatement result = new SqlSelectStatement();
        result.From.Append(GetTargetTSql(target));

        return result;
      }
    }


    /// <summary>
    /// Gets escaped TSql identifier describing this entity set.
    /// </summary>
    /// <returns></returns>
    internal static string GetTargetTSql(EntitySetBase entitySetBase)
    {
      // construct escaped T-SQL referencing entity set
      StringBuilder builder = new StringBuilder(50);
      string definingQuery = MetadataHelpers.TryGetValueForMetadataProperty<string>(entitySetBase, "DefiningQuery");
      if (!string.IsNullOrEmpty(definingQuery))
      {
        builder.Append("(");
        builder.Append(definingQuery);
        builder.Append(")");
      }
      else
      {
        string schemaName = MetadataHelpers.TryGetValueForMetadataProperty<string>(entitySetBase, "Schema");
        if (!string.IsNullOrEmpty(schemaName))
        {
          builder.Append(SqlGenerator.QuoteIdentifier(schemaName));
          builder.Append(".");
        }
        //else
        //{
        //  builder.Append(SqlGenerator.QuoteIdentifier(entitySetBase.EntityContainer.Name));
        //  builder.Append(".");
        //}

        string tableName = MetadataHelpers.TryGetValueForMetadataProperty<string>(entitySetBase, "Table");
        if (!string.IsNullOrEmpty(tableName))
        {
          builder.Append(SqlGenerator.QuoteIdentifier(tableName));
        }
        else
        {
          builder.Append(SqlGenerator.QuoteIdentifier(entitySetBase.Name));
        }
      }
      return builder.ToString();
    }

    /// <summary>
    /// The bodies of <see cref="Visit(DbFilterExpression)"/>, <see cref="Visit(DbGroupByExpression)"/>,
    /// <see cref="Visit(DbProjectExpression)"/>, <see cref="Visit(DbSortExpression)"/> are similar.
    /// Each does the following.
    /// <list type="number">
    /// <item> Visit the input expression</item>
    /// <item> Determine if the input's SQL statement can be reused, or a new
    /// one must be created.</item>
    /// <item>Create a new symbol table scope</item>
    /// <item>Push the Sql statement onto a stack, so that children can
    /// update the free variable list.</item>
    /// <item>Visit the non-input expression.</item>
    /// <item>Cleanup</item>
    /// </list>
    /// </summary>
    /// <param name="e"></param>
    /// <returns>A <see cref="SqlSelectStatement"/></returns>
    public override ISqlFragment Visit(DbFilterExpression e)
    {
      return VisitFilterExpression(e.Input, e.Predicate, false);
    }

    /// <summary>
    /// Lambda functions are not supported.
    /// The functions supported are:
    /// <list type="number">
    /// <item>Canonical Functions - We recognize these by their dataspace, it is DataSpace.CSpace</item>
    /// <item>Store Functions - We recognize these by the BuiltInAttribute and not being Canonical</item>
    /// <item>User-defined Functions - All the rest except for Lambda functions</item>
    /// </list>
    /// We handle Canonical and Store functions the same way: If they are in the list of functions 
    /// that need special handling, we invoke the appropriate handler, otherwise we translate them to
    /// FunctionName(arg1, arg2, ..., argn).
    /// We translate user-defined functions to NamespaceName.FunctionName(arg1, arg2, ..., argn).
    /// </summary>
    /// <param name="e"></param>
    /// <returns>A <see cref="SqlBuilder"/></returns>
    public override ISqlFragment Visit(DbFunctionExpression e)
    {
      // The check for a Lambda expression seems to have disappeared from the public method list in SP1 RC
      //if (e.IsLambda)
      //{
      //  throw new NotSupportedException();
      //}

      //
      // check if function requires special case processing, if so, delegates to it
      //
      if (IsSpecialBuiltInFunction(e))
      {
        return HandleSpecialBuiltInFunction(e);
      }

      if (IsSpecialCanonicalFunction(e))
      {
        return HandleSpecialCanonicalFunction(e);
      }

      return HandleFunctionDefault(e);
    }


    /// <summary>
    /// <see cref="DbEntityRefExpression"/> is illegal at this stage
    /// </summary>
    /// <param name="e"></param>
    /// <returns></returns>
    public override ISqlFragment Visit(DbEntityRefExpression e)
    {
      throw new NotSupportedException();
    }

    /// <summary>
    /// <see cref="DbRefKeyExpression"/> is illegal at this stage
    /// </summary>
    /// <param name="e"></param>
    /// <returns></returns>
    public override ISqlFragment Visit(DbRefKeyExpression e)
    {
      throw new NotSupportedException();
    }

    /// <summary>
    /// <see cref="Visit(DbFilterExpression)"/> for general details.
    /// We modify both the GroupBy and the Select fields of the SqlSelectStatement.
    /// GroupBy gets just the keys without aliases,
    /// and Select gets the keys and the aggregates with aliases.
    /// 
    /// Whenever there exists at least one aggregate with an argument that is not is not a simple
    /// <see cref="DbPropertyExpression"/>  over <see cref="DbVariableReferenceExpression"/>, 
    /// we create a nested query in which we alias the arguments to the aggregates. 
    /// That is due to the following two limitations of Sql Server:
    /// <list type="number">
    /// <item>If an expression being aggregated contains an outer reference, then that outer 
    /// reference must be the only column referenced in the expression </item>
    /// <item>Sql Server cannot perform an aggregate function on an expression containing 
    /// an aggregate or a subquery. </item>
    /// </list>
    /// 
    /// The default translation, without inner query is: 
    /// 
    ///     SELECT 
    ///         kexp1 AS key1, kexp2 AS key2,... kexpn AS keyn, 
    ///         aggf1(aexpr1) AS agg1, .. aggfn(aexprn) AS aggn
    ///     FROM input AS a
    ///     GROUP BY kexp1, kexp2, .. kexpn
    /// 
    /// When we inject an innner query, the equivalent translation is:
    /// 
    ///     SELECT 
    ///         key1 AS key1, key2 AS key2, .. keyn AS keys,  
    ///         aggf1(agg1) AS agg1, aggfn(aggn) AS aggn
    ///     FROM (
    ///             SELECT 
    ///                 kexp1 AS key1, kexp2 AS key2,... kexpn AS keyn, 
    ///                 aexpr1 AS agg1, .. aexprn AS aggn
    ///             FROM input AS a
    ///         ) as a
    ///     GROUP BY key1, key2, keyn
    /// 
    /// </summary>
    /// <param name="e"></param>
    /// <returns>A <see cref="SqlSelectStatement"/></returns>
    public override ISqlFragment Visit(DbGroupByExpression e)
    {
      Symbol fromSymbol;
      //SqlSelectStatement result = VisitInputExpression(e.Input.Expression,
      SqlSelectStatement innerQuery = VisitInputExpression(e.Input.Expression,
          e.Input.VariableName, e.Input.VariableType, out fromSymbol);

      // GroupBy is compatible with Filter and OrderBy
      // but not with Project, GroupBy
      if (!IsCompatible(innerQuery, e.ExpressionKind))
      {
        innerQuery = CreateNewSelectStatement(innerQuery, e.Input.VariableName, e.Input.VariableType, out fromSymbol);
      }

      selectStatementStack.Push(innerQuery);
      symbolTable.EnterScope();

      AddFromSymbol(innerQuery, e.Input.VariableName, fromSymbol);
      // This line is not present for other relational nodes.
      symbolTable.Add(e.Input.GroupVariableName, fromSymbol);


      // The enumerator is shared by both the keys and the aggregates,
      // so, we do not close it in between.
      RowType groupByType = MetadataHelpers.GetEdmType<RowType>(MetadataHelpers.GetEdmType<CollectionType>(e.ResultType).TypeUsage);

      //Whenever there exists at least one aggregate with an argument that is not simply a PropertyExpression 
      // over a VarRefExpression, we need a nested query in which we alias the arguments to the aggregates.
      bool needsInnerQuery = NeedsInnerQuery(e.Aggregates);

      SqlSelectStatement result;
      if (needsInnerQuery)
      {
        //Create the inner query
        result = CreateNewSelectStatement(innerQuery, e.Input.VariableName, e.Input.VariableType, false, out fromSymbol);
        AddFromSymbol(result, e.Input.VariableName, fromSymbol, false);
      }
      else
      {
        result = innerQuery;
      }

      using (IEnumerator<EdmProperty> members = groupByType.Properties.GetEnumerator())
      {
        members.MoveNext();
        Debug.Assert(result.Select.IsEmpty);

        string separator = "";

        foreach (DbExpression key in e.Keys)
        {
          EdmProperty member = members.Current;
          string alias = QuoteIdentifier(member.Name);

          result.GroupBy.Append(separator);

          ISqlFragment keySql = key.Accept(this);

          if (!needsInnerQuery)
          {
            //Default translation: Key AS Alias
            result.Select.Append(separator);
            result.Select.AppendLine();
            result.Select.Append(keySql);
            result.Select.Append(" AS ");
            result.Select.Append(alias);

            result.GroupBy.Append(keySql);
          }
          else
          {
            // The inner query contains the default translation Key AS Alias
            innerQuery.Select.Append(separator);
            innerQuery.Select.AppendLine();
            innerQuery.Select.Append(keySql);
            innerQuery.Select.Append(" AS ");
            innerQuery.Select.Append(alias);

            //The outer resulting query projects over the key aliased in the inner query: 
            //  fromSymbol.Alias AS Alias
            result.Select.Append(separator);
            result.Select.AppendLine();
            result.Select.Append(fromSymbol);
            result.Select.Append(".");
            result.Select.Append(alias);
            result.Select.Append(" AS ");
            result.Select.Append(alias);

            result.GroupBy.Append(alias);
          }

          separator = ", ";
          members.MoveNext();
        }

        foreach (DbAggregate aggregate in e.Aggregates)
        {
          EdmProperty member = members.Current;
          string alias = QuoteIdentifier(member.Name);

          Debug.Assert(aggregate.Arguments.Count == 1);
          ISqlFragment translatedAggregateArgument = aggregate.Arguments[0].Accept(this);

          object aggregateArgument;

          if (needsInnerQuery)
          {
            //In this case the argument to the aggratete is reference to the one projected out by the
            // inner query
            SqlBuilder wrappingAggregateArgument = new SqlBuilder();
            wrappingAggregateArgument.Append(fromSymbol);
            wrappingAggregateArgument.Append(".");
            wrappingAggregateArgument.Append(alias);
            aggregateArgument = wrappingAggregateArgument;

            innerQuery.Select.Append(separator);
            innerQuery.Select.AppendLine();
            innerQuery.Select.Append(translatedAggregateArgument);
            innerQuery.Select.Append(" AS ");
            innerQuery.Select.Append(alias);
          }
          else
          {
            aggregateArgument = translatedAggregateArgument;
          }

          ISqlFragment aggregateResult = VisitAggregate(aggregate, aggregateArgument);

          result.Select.Append(separator);
          result.Select.AppendLine();
          result.Select.Append(aggregateResult);
          result.Select.Append(" AS ");
          result.Select.Append(alias);

          separator = ", ";
          members.MoveNext();
        }
      }


      symbolTable.ExitScope();
      selectStatementStack.Pop();

      return result;
    }

    /// <summary>
    /// <see cref="Visit(DbUnionAllExpression)"/>
    /// </summary>
    /// <param name="e"></param>
    /// <returns></returns>
    public override ISqlFragment Visit(DbIntersectExpression e)
    {
      return VisitSetOpExpression(e.Left, e.Right, "INTERSECT");
    }

    /// <summary>
    /// Not(IsEmpty) has to be handled specially, so we delegate to
    /// <see cref="VisitIsEmptyExpression"/>.
    ///
    /// </summary>
    /// <param name="e"></param>
    /// <returns>A <see cref="SqlBuilder"/>.
    /// <code>[NOT] EXISTS( ... )</code>
    /// </returns>
    public override ISqlFragment Visit(DbIsEmptyExpression e)
    {
      return VisitIsEmptyExpression(e, false);
    }

    /// <summary>
    /// Not(IsNull) is handled specially, so we delegate to
    /// <see cref="VisitIsNullExpression"/>
    /// </summary>
    /// <param name="e"></param>
    /// <returns>A <see cref="SqlBuilder"/>
    /// <code>IS [NOT] NULL</code>
    /// </returns>
    public override ISqlFragment Visit(DbIsNullExpression e)
    {
      return VisitIsNullExpression(e, false);
    }

    /// <summary>
    /// <see cref="DbIsOfExpression"/> is illegal at this stage
    /// </summary>
    /// <param name="e"></param>
    /// <returns>A <see cref="SqlBuilder"/></returns>
    public override ISqlFragment Visit(DbIsOfExpression e)
    {
      throw new NotSupportedException();
    }

    /// <summary>
    /// <see cref="VisitJoinExpression"/>
    /// </summary>
    /// <param name="e"></param>
    /// <returns>A <see cref="SqlSelectStatement"/>.</returns>
    public override ISqlFragment Visit(DbCrossJoinExpression e)
    {
      return VisitJoinExpression(e.Inputs, e.ExpressionKind, "CROSS JOIN", null);
    }

    /// <summary>
    /// <see cref="VisitJoinExpression"/>
    /// </summary>
    /// <param name="e"></param>
    /// <returns>A <see cref="SqlSelectStatement"/>.</returns>
    public override ISqlFragment Visit(DbJoinExpression e)
    {
      #region Map join type to a string
      string joinString;
      switch (e.ExpressionKind)
      {
        case DbExpressionKind.FullOuterJoin:
          joinString = "FULL OUTER JOIN";
          break;

        case DbExpressionKind.InnerJoin:
          joinString = "INNER JOIN";
          break;

        case DbExpressionKind.LeftOuterJoin:
          joinString = "LEFT OUTER JOIN";
          break;

        default:
          Debug.Assert(false);
          joinString = null;
          break;
      }
      #endregion

      List<DbExpressionBinding> inputs = new List<DbExpressionBinding>(2);
      inputs.Add(e.Left);
      inputs.Add(e.Right);

      return VisitJoinExpression(inputs, e.ExpressionKind, joinString, e.JoinCondition);
    }

    /// <summary>
    ///
    /// </summary>
    /// <param name="e"></param>
    /// <returns>A <see cref="SqlBuilder"/></returns>
    public override ISqlFragment Visit(DbLikeExpression e)
    {
      SqlBuilder result = new SqlBuilder();
      result.Append(e.Argument.Accept(this));
      result.Append(" LIKE ");
      result.Append(e.Pattern.Accept(this));

      // if the ESCAPE expression is a DbNullExpression, then that's tantamount to 
      // not having an ESCAPE at all
      if (e.Escape.ExpressionKind != DbExpressionKind.Null)
      {
        result.Append(" ESCAPE ");
        result.Append(e.Escape.Accept(this));
      }

      return result;
    }

    /// <summary>
    ///  Translates to TOP expression.
    /// </summary>
    /// <param name="e"></param>
    /// <returns>A <see cref="SqlBuilder"/></returns>
    public override ISqlFragment Visit(DbLimitExpression e)
    {
      Debug.Assert(e.Limit is DbConstantExpression || e.Limit is DbParameterReferenceExpression, "DbLimitExpression.Limit is of invalid expression type");

      SqlSelectStatement result = VisitExpressionEnsureSqlStatement(e.Argument, false);
      Symbol fromSymbol;

      if (!IsCompatible(result, e.ExpressionKind))
      {
        TypeUsage inputType = MetadataHelpers.GetElementTypeUsage(e.Argument.ResultType);

        result = CreateNewSelectStatement(result, "top", inputType, out fromSymbol);
        AddFromSymbol(result, "top", fromSymbol, false);
      }

      ISqlFragment topCount = HandleCountExpression(e.Limit);

      result.Top = new TopClause(topCount, e.WithTies);
      return result;
    }

    /// <summary>
    /// DbNewInstanceExpression is allowed as a child of DbProjectExpression only.
    /// If anyone else is the parent, we throw.
    /// We also perform special casing for collections - where we could convert
    /// them into Unions
    ///
    /// <see cref="VisitNewInstanceExpression"/> for the actual implementation.
    ///
    /// </summary>
    /// <param name="e"></param>
    /// <returns></returns>
    public override ISqlFragment Visit(DbNewInstanceExpression e)
    {
      if (MetadataHelpers.IsCollectionType(e.ResultType))
      {
        return VisitCollectionConstructor(e);
      }
      throw new NotSupportedException();
    }

    /// <summary>
    /// The Not expression may cause the translation of its child to change.
    /// These children are
    /// <list type="bullet">
    /// <item><see cref="DbNotExpression"/>NOT(Not(x)) becomes x</item>
    /// <item><see cref="DbIsEmptyExpression"/>NOT EXISTS becomes EXISTS</item>
    /// <item><see cref="DbIsNullExpression"/>IS NULL becomes IS NOT NULL</item>
    /// <item><see cref="DbComparisonExpression"/>= becomes&lt;&gt; </item>
    /// </list>
    /// </summary>
    /// <param name="e"></param>
    /// <returns>A <see cref="SqlBuilder"/></returns>
    public override ISqlFragment Visit(DbNotExpression e)
    {
      // Flatten Not(Not(x)) to x.
      DbNotExpression notExpression = e.Argument as DbNotExpression;
      if (notExpression != null)
      {
        return notExpression.Argument.Accept(this);
      }

      DbIsEmptyExpression isEmptyExpression = e.Argument as DbIsEmptyExpression;
      if (isEmptyExpression != null)
      {
        return VisitIsEmptyExpression(isEmptyExpression, true);
      }

      DbIsNullExpression isNullExpression = e.Argument as DbIsNullExpression;
      if (isNullExpression != null)
      {
        return VisitIsNullExpression(isNullExpression, true);
      }

      DbComparisonExpression comparisonExpression = e.Argument as DbComparisonExpression;
      if (comparisonExpression != null)
      {
        if (comparisonExpression.ExpressionKind == DbExpressionKind.Equals)
        {
          return VisitBinaryExpression(" <> ", comparisonExpression.Left, comparisonExpression.Right);
        }
      }

      SqlBuilder result = new SqlBuilder();
      result.Append(" NOT (");
      result.Append(e.Argument.Accept(this));
      result.Append(")");

      return result;
    }

    /// <summary>
    /// </summary>
    /// <param name="e"></param>
    /// <returns><see cref="SqlBuilder"/></returns>
    public override ISqlFragment Visit(DbNullExpression e)
    {
      SqlBuilder result = new SqlBuilder();
      // always cast nulls - sqlserver doesn't like case expressions where the "then" clause is null
      result.Append("NULL");
      return result;
    }

    /// <summary>
    /// <see cref="DbOfTypeExpression"/> is illegal at this stage
    /// </summary>
    /// <param name="e"></param>
    /// <returns>A <see cref="SqlBuilder"/></returns>
    public override ISqlFragment Visit(DbOfTypeExpression e)
    {
      throw new NotSupportedException();
    }

    /// <summary>
    ///
    /// </summary>
    /// <param name="e"></param>
    /// <returns>A <see cref="SqlBuilder"/></returns>
    /// <seealso cref="Visit(DbAndExpression)"/>
    public override ISqlFragment Visit(DbOrExpression e)
    {
      return VisitBinaryExpression(" OR ", e.Left, e.Right);
    }

    /// <summary>
    ///
    /// </summary>
    /// <param name="e"></param>
    /// <returns>A <see cref="SqlBuilder"/></returns>
    public override ISqlFragment Visit(DbParameterReferenceExpression e)
    {
      SqlBuilder result = new SqlBuilder();
      // Do not quote this name.
      // We are not checking that e.Name has no illegal characters. e.g. space
      result.Append("@" + e.ParameterName);

      return result;
    }

    /// <summary>
    /// <see cref="Visit(DbFilterExpression)"/> for the general ideas.
    /// </summary>
    /// <param name="e"></param>
    /// <returns>A <see cref="SqlSelectStatement"/></returns>
    /// <seealso cref="Visit(DbFilterExpression)"/>
    public override ISqlFragment Visit(DbProjectExpression e)
    {
      Symbol fromSymbol;
      SqlSelectStatement result = VisitInputExpression(e.Input.Expression, e.Input.VariableName, e.Input.VariableType, out fromSymbol);

      // Project is compatible with Filter
      // but not with Project, GroupBy
      if (!IsCompatible(result, e.ExpressionKind))
      {
        result = CreateNewSelectStatement(result, e.Input.VariableName, e.Input.VariableType, out fromSymbol);
      }

      selectStatementStack.Push(result);
      symbolTable.EnterScope();

      AddFromSymbol(result, e.Input.VariableName, fromSymbol);

      // Project is the only node that can have DbNewInstanceExpression as a child
      // so we have to check it here.
      // We call VisitNewInstanceExpression instead of Visit(DbNewInstanceExpression), since
      // the latter throws.
      DbNewInstanceExpression newInstanceExpression = e.Projection as DbNewInstanceExpression;
      if (newInstanceExpression != null)
      {
        result.Select.Append(VisitNewInstanceExpression(newInstanceExpression));
      }
      else
      {
        result.Select.Append(e.Projection.Accept(this));
      }

      symbolTable.ExitScope();
      selectStatementStack.Pop();

      return result;
    }

    /// <summary>
    /// This method handles record flattening, which works as follows.
    /// consider an expression <c>Prop(y, Prop(x, Prop(d, Prop(c, Prop(b, Var(a)))))</c>
    /// where a,b,c are joins, d is an extent and x and y are fields.
    /// b has been flattened into a, and has its own SELECT statement.
    /// c has been flattened into b.
    /// d has been flattened into c.
    ///
    /// We visit the instance, so we reach Var(a) first.  This gives us a (join)symbol.
    /// Symbol(a).b gives us a join symbol, with a SELECT statement i.e. Symbol(b).
    /// From this point on , we need to remember Symbol(b) as the source alias,
    /// and then try to find the column.  So, we use a SymbolPair.
    ///
    /// We have reached the end when the symbol no longer points to a join symbol.
    /// </summary>
    /// <param name="e"></param>
    /// <returns>A <see cref="JoinSymbol"/> if we have not reached the first
    /// Join node that has a SELECT statement.
    /// A <see cref="SymbolPair"/> if we have seen the JoinNode, and it has
    /// a SELECT statement.
    /// A <see cref="SqlBuilder"/> with {Input}.propertyName otherwise.
    /// </returns>
    public override ISqlFragment Visit(DbPropertyExpression e)
    {
      SqlBuilder result;

      ISqlFragment instanceSql = e.Instance.Accept(this);

      // Since the DbVariableReferenceExpression is a proper child of ours, we can reset
      // isVarSingle.
      DbVariableReferenceExpression DbVariableReferenceExpression = e.Instance as DbVariableReferenceExpression;
      if (DbVariableReferenceExpression != null)
      {
        isVarRefSingle = false;
      }

      // We need to flatten, and have not yet seen the first nested SELECT statement.
      JoinSymbol joinSymbol = instanceSql as JoinSymbol;
      if (joinSymbol != null)
      {
        Debug.Assert(joinSymbol.NameToExtent.ContainsKey(e.Property.Name));
        if (joinSymbol.IsNestedJoin)
        {
          return new SymbolPair(joinSymbol, joinSymbol.NameToExtent[e.Property.Name]);
        }
        else
        {
          return joinSymbol.NameToExtent[e.Property.Name];
        }
      }

      // ---------------------------------------
      // We have seen the first nested SELECT statement, but not the column.
      SymbolPair symbolPair = instanceSql as SymbolPair;
      if (symbolPair != null)
      {
        JoinSymbol columnJoinSymbol = symbolPair.Column as JoinSymbol;
        if (columnJoinSymbol != null)
        {
          symbolPair.Column = columnJoinSymbol.NameToExtent[e.Property.Name];
          return symbolPair;
        }
        else
        {
          // symbolPair.Column has the base extent.
          // we need the symbol for the column, since it might have been renamed
          // when handling a JOIN.
          if (symbolPair.Column.Columns.ContainsKey(e.Property.Name))
          {
            result = new SqlBuilder();
            result.Append(symbolPair.Source);
            result.Append(".");
            result.Append(symbolPair.Column.Columns[e.Property.Name]);
            return result;
          }
        }
      }
      // ---------------------------------------

      result = new SqlBuilder();
      result.Append(instanceSql);
      result.Append(".");

      // At this point the column name cannot be renamed, so we do
      // not use a symbol.
      result.Append(QuoteIdentifier(e.Property.Name));

      return result;
    }

    /// <summary>
    /// Any(input, x) => Exists(Filter(input,x))
    /// All(input, x) => Not Exists(Filter(input, not(x))
    /// </summary>
    /// <param name="e"></param>
    /// <returns></returns>
    public override ISqlFragment Visit(DbQuantifierExpression e)
    {
      SqlBuilder result = new SqlBuilder();

      bool negatePredicate = (e.ExpressionKind == DbExpressionKind.All);
      if (e.ExpressionKind == DbExpressionKind.Any)
      {
        result.Append("EXISTS (");
      }
      else
      {
        Debug.Assert(e.ExpressionKind == DbExpressionKind.All);
        result.Append("NOT EXISTS (");
      }

      SqlSelectStatement filter = VisitFilterExpression(e.Input, e.Predicate, negatePredicate);
      if (filter.Select.IsEmpty)
      {
        AddDefaultColumns(filter);
      }

      result.Append(filter);
      result.Append(")");

      return result;
    }

    /// <summary>
    /// <see cref="DbRefExpression"/> is illegal at this stage
    /// </summary>
    /// <param name="e"></param>
    /// <returns></returns>
    public override ISqlFragment Visit(DbRefExpression e)
    {
      throw new NotSupportedException();
    }

    /// <summary>
    /// <see cref="DbRelationshipNavigationExpression"/> is illegal at this stage
    /// </summary>
    /// <param name="e"></param>
    /// <returns></returns>
    public override ISqlFragment Visit(DbRelationshipNavigationExpression e)
    {
      throw new NotSupportedException();
    }

    /// <summary>
    /// For Sql9 it translates to:
    /// SELECT Y.x1, Y.x2, ..., Y.xn
    /// FROM (
    ///     SELECT X.x1, X.x2, ..., X.xn, row_number() OVER (ORDER BY sk1, sk2, ...) AS [row_number] 
    ///     FROM input as X 
    ///     ) as Y
    /// WHERE Y.[row_number] > count 
    /// ORDER BY sk1, sk2, ...
    /// </summary>
    /// <param name="e"></param>
    /// <returns>A <see cref="SqlBuilder"/></returns>
    public override ISqlFragment Visit(DbSkipExpression e)
    {
      throw new NotSupportedException();
      //Debug.Assert(e.Count is DbConstantExpression || e.Count is DbParameterReferenceExpression, "DbSkipExpression.Count is of invalid expression type");

      ////Visit the input
      //Symbol fromSymbol;
      //SqlSelectStatement input = VisitInputExpression(e.Input.Expression, e.Input.VariableName, e.Input.VariableType, out fromSymbol);

      //// Skip is not compatible with anything that OrderBy is not compatible with, as well as with distinct
      //if (!IsCompatible(input, e.ExpressionKind))
      //{
      //  input = CreateNewSelectStatement(input, e.Input.VariableName, e.Input.VariableType, out fromSymbol);
      //}

      //selectStatementStack.Push(input);
      //symbolTable.EnterScope();

      //AddFromSymbol(input, e.Input.VariableName, fromSymbol);

      ////Add the default columns
      //Debug.Assert(input.Select.IsEmpty);
      //List<Symbol> inputColumns = AddDefaultColumns(input);

      //input.Select.Append(", row_number() OVER (ORDER BY ");
      //AddSortKeys(input.Select, e.SortOrder);
      //input.Select.Append(") AS ");

      //Symbol row_numberSymbol = new Symbol("row_number", null);

      //input.Select.Append(row_numberSymbol);

      ////The inner statement is complete, its scopes need not be valid any longer
      //symbolTable.ExitScope();
      //selectStatementStack.Pop();

      ////Create the resulting statement 
      ////See CreateNewSelectStatement, it is very similar

      //SqlSelectStatement result = new SqlSelectStatement();
      //result.From.Append("( ");
      //result.From.Append(input);
      //result.From.AppendLine();
      //result.From.Append(") ");

      ////Create a symbol for the input
      //Symbol resultFromSymbol = null;

      //if (input.FromExtents.Count == 1)
      //{
      //  JoinSymbol oldJoinSymbol = input.FromExtents[0] as JoinSymbol;
      //  if (oldJoinSymbol != null)
      //  {
      //    // Note: input.FromExtents will not do, since it might
      //    // just be an alias of joinSymbol, and we want an actual JoinSymbol.
      //    JoinSymbol newJoinSymbol = new JoinSymbol(e.Input.VariableName, e.Input.VariableType, oldJoinSymbol.ExtentList);
      //    // This indicates that the oldStatement is a blocking scope
      //    // i.e. it hides/renames extent columns
      //    newJoinSymbol.IsNestedJoin = true;
      //    newJoinSymbol.ColumnList = inputColumns;
      //    newJoinSymbol.FlattenedExtentList = oldJoinSymbol.FlattenedExtentList;

      //    resultFromSymbol = newJoinSymbol;
      //  }
      //}

      //if (resultFromSymbol == null)
      //{
      //  // This is just a simple extent/SqlSelectStatement,
      //  // and we can get the column list from the type.
      //  resultFromSymbol = new Symbol(e.Input.VariableName, e.Input.VariableType);
      //}
      ////Add the ORDER BY part
      //selectStatementStack.Push(result);
      //symbolTable.EnterScope();

      //AddFromSymbol(result, e.Input.VariableName, resultFromSymbol);

      ////Add the predicate 
      //result.Where.Append(resultFromSymbol);
      //result.Where.Append(".");
      //result.Where.Append(row_numberSymbol);
      //result.Where.Append(" > ");
      //result.Where.Append(HandaleCountExpression(e.Count));

      //AddSortKeys(result.OrderBy, e.SortOrder);

      //symbolTable.ExitScope();
      //selectStatementStack.Pop();

      //return result;
    }

    /// <summary>
    /// <see cref="Visit(DbFilterExpression)"/>
    /// </summary>
    /// <param name="e"></param>
    /// <returns>A <see cref="SqlSelectStatement"/></returns>
    /// <seealso cref="Visit(DbFilterExpression)"/>
    public override ISqlFragment Visit(DbSortExpression e)
    {
      Symbol fromSymbol;
      SqlSelectStatement result = VisitInputExpression(e.Input.Expression, e.Input.VariableName, e.Input.VariableType, out fromSymbol);

      // OrderBy is compatible with Filter
      // and nothing else
      if (!IsCompatible(result, e.ExpressionKind))
      {
        result = CreateNewSelectStatement(result, e.Input.VariableName, e.Input.VariableType, out fromSymbol);
      }

      selectStatementStack.Push(result);
      symbolTable.EnterScope();

      AddFromSymbol(result, e.Input.VariableName, fromSymbol);

      AddSortKeys(result.OrderBy, e.SortOrder);

      symbolTable.ExitScope();
      selectStatementStack.Pop();

      return result;
    }

    /// <summary>
    /// <see cref="DbTreatExpression"/> is illegal at this stage
    /// </summary>
    /// <param name="e"></param>
    /// <returns>A <see cref="SqlBuilder"/></returns>
    public override ISqlFragment Visit(DbTreatExpression e)
    {
      throw new NotSupportedException();
    }

    /// <summary>
    /// This code is shared by <see cref="Visit(DbExceptExpression)"/>
    /// and <see cref="Visit(DbIntersectExpression)"/>
    ///
    /// <see cref="VisitSetOpExpression"/>
    /// Since the left and right expression may not be Sql select statements,
    /// we must wrap them up to look like SQL select statements.
    /// </summary>
    /// <param name="e"></param>
    /// <returns></returns>
    public override ISqlFragment Visit(DbUnionAllExpression e)
    {
      return VisitSetOpExpression(e.Left, e.Right, "UNION ALL");
    }

    /// <summary>
    /// This method determines whether an extent from an outer scope(free variable)
    /// is used in the CurrentSelectStatement.
    ///
    /// An extent in an outer scope, if its symbol is not in the FromExtents
    /// of the CurrentSelectStatement.
    /// </summary>
    /// <param name="e"></param>
    /// <returns>A <see cref="Symbol"/>.</returns>
    public override ISqlFragment Visit(DbVariableReferenceExpression e)
    {
      if (isVarRefSingle)
      {
        throw new NotSupportedException();
        // A DbVariableReferenceExpression has to be a child of DbPropertyExpression or MethodExpression
        // This is also checked in GenerateSql(...) at the end of the visiting.
      }
      isVarRefSingle = true; // This will be reset by DbPropertyExpression or MethodExpression

      Symbol result = symbolTable.Lookup(e.VariableName);
      if (!CurrentSelectStatement.FromExtents.Contains(result))
      {
        CurrentSelectStatement.OuterExtents[result] = true;
      }

      return result;
    }

    #region Visits shared by multiple nodes
    /// <summary>
    /// Aggregates are not visited by the normal visitor walk.
    /// </summary>
    /// <param name="aggregate">The aggreate go be translated</param>
    /// <param name="aggregateArgument">The translated aggregate argument</param>
    /// <returns></returns>
    SqlBuilder VisitAggregate(DbAggregate aggregate, object aggregateArgument)
    {
      SqlBuilder aggregateResult = new SqlBuilder();
      DbFunctionAggregate functionAggregate = aggregate as DbFunctionAggregate;

      if (functionAggregate == null)
      {
        throw new NotSupportedException();
      }

      //The only aggregate function with different name is Big_Count
      //Note: If another such function is to be added, a dictionary should be created
      //if (MetadataHelpers.IsCanonicalFunction(functionAggregate.Function)
      //    && String.Equals(functionAggregate.Function.Name, "BigCount", StringComparison.Ordinal))
      //{
      //  aggregateResult.Append("COUNT_BIG");
      //}
      //else
      {
        WriteFunctionName(aggregateResult, functionAggregate.Function);
      }

      aggregateResult.Append("(");

      DbFunctionAggregate fnAggr = functionAggregate;
      if ((null != fnAggr) && (fnAggr.Distinct))
      {
        aggregateResult.Append("DISTINCT ");
      }

      aggregateResult.Append(aggregateArgument);

      aggregateResult.Append(")");
      return aggregateResult;
    }


    SqlBuilder VisitBinaryExpression(string op, DbExpression left, DbExpression right)
    {
      SqlBuilder result = new SqlBuilder();
      if (IsComplexExpression(left))
      {
        result.Append("(");
      }

      result.Append(left.Accept(this));

      if (IsComplexExpression(left))
      {
        result.Append(")");
      }

      result.Append(op);

      if (IsComplexExpression(right))
      {
        result.Append("(");
      }

      result.Append(right.Accept(this));

      if (IsComplexExpression(right))
      {
        result.Append(")");
      }

      return result;
    }

    /// <summary>
    /// This is called by the relational nodes.  It does the following
    /// <list>
    /// <item>If the input is not a SqlSelectStatement, it assumes that the input
    /// is a collection expression, and creates a new SqlSelectStatement </item>
    /// </list>
    /// </summary>
    /// <param name="inputExpression"></param>
    /// <param name="inputVarName"></param>
    /// <param name="inputVarType"></param>
    /// <param name="fromSymbol"></param>
    /// <returns>A <see cref="SqlSelectStatement"/> and the main fromSymbol
    /// for this select statement.</returns>
    SqlSelectStatement VisitInputExpression(DbExpression inputExpression,
        string inputVarName, TypeUsage inputVarType, out Symbol fromSymbol)
    {
      SqlSelectStatement result;
      ISqlFragment sqlFragment = inputExpression.Accept(this);
      result = sqlFragment as SqlSelectStatement;

      if (result == null)
      {
        result = new SqlSelectStatement();
        WrapNonQueryExtent(result, sqlFragment, inputExpression.ExpressionKind);
      }

      if (result.FromExtents.Count == 0)
      {
        // input was an extent
        fromSymbol = new Symbol(inputVarName, inputVarType);
      }
      else if (result.FromExtents.Count == 1)
      {
        // input was Filter/GroupBy/Project/OrderBy
        // we are likely to reuse this statement.
        fromSymbol = result.FromExtents[0];
      }
      else
      {
        // input was a join.
        // we are reusing the select statement produced by a Join node
        // we need to remove the original extents, and replace them with a
        // new extent with just the Join symbol.
        JoinSymbol joinSymbol = new JoinSymbol(inputVarName, inputVarType, result.FromExtents);
        joinSymbol.FlattenedExtentList = result.AllJoinExtents;

        fromSymbol = joinSymbol;
        result.FromExtents.Clear();
        result.FromExtents.Add(fromSymbol);
      }

      return result;
    }

    /// <summary>
    /// <see cref="Visit(DbIsEmptyExpression)"/>
    /// </summary>
    /// <param name="e"></param>
    /// <param name="negate">Was the parent a DbNotExpression?</param>
    /// <returns></returns>
    SqlBuilder VisitIsEmptyExpression(DbIsEmptyExpression e, bool negate)
    {
      SqlBuilder result = new SqlBuilder();
      if (!negate)
      {
        result.Append(" NOT");
      }
      result.Append(" EXISTS (");
      result.Append(VisitExpressionEnsureSqlStatement(e.Argument));
      result.AppendLine();
      result.Append(")");

      return result;
    }


    /// <summary>
    /// Translate a NewInstance(Element(X)) expression into
    ///   "select top(1) * from X"
    /// </summary>
    /// <param name="e"></param>
    /// <returns></returns>
    private ISqlFragment VisitCollectionConstructor(DbNewInstanceExpression e)
    {
      Debug.Assert(e.Arguments.Count <= 1);

      if (e.Arguments.Count == 1 && e.Arguments[0].ExpressionKind == DbExpressionKind.Element)
      {
        DbElementExpression elementExpr = e.Arguments[0] as DbElementExpression;
        SqlSelectStatement result = VisitExpressionEnsureSqlStatement(elementExpr.Argument);

        if (!IsCompatible(result, DbExpressionKind.Element))
        {
          Symbol fromSymbol;
          TypeUsage inputType = MetadataHelpers.GetElementTypeUsage(elementExpr.Argument.ResultType);

          result = CreateNewSelectStatement(result, "element", inputType, out fromSymbol);
          AddFromSymbol(result, "element", fromSymbol, false);
        }
        result.Top = new TopClause(1, false);
        return result;
      }


      // Otherwise simply build this out as a union-all ladder
      CollectionType collectionType = MetadataHelpers.GetEdmType<CollectionType>(e.ResultType);
      Debug.Assert(collectionType != null);
      bool isScalarElement = MetadataHelpers.IsPrimitiveType(collectionType.TypeUsage);

      SqlBuilder resultSql = new SqlBuilder();
      string separator = "";

      // handle empty table
      if (e.Arguments.Count == 0)
      {
        Debug.Assert(isScalarElement);
        resultSql.Append(" SELECT NULL");
        resultSql.Append(" AS X FROM (SELECT 1) AS Y WHERE 1=0");
      }

      foreach (DbExpression arg in e.Arguments)
      {
        resultSql.Append(separator);
        resultSql.Append(" SELECT ");
        resultSql.Append(arg.Accept(this));
        // For scalar elements, no alias is appended yet. Add this.
        if (isScalarElement)
        {
          resultSql.Append(" AS X ");
        }
        separator = " UNION ALL ";
      }

      return resultSql;
    }


    /// <summary>
    /// <see cref="Visit(DbIsNullExpression)"/>
    /// </summary>
    /// <param name="e"></param>
    /// <param name="negate">Was the parent a DbNotExpression?</param>
    /// <returns></returns>
    SqlBuilder VisitIsNullExpression(DbIsNullExpression e, bool negate)
    {
      SqlBuilder result = new SqlBuilder();
      result.Append(e.Argument.Accept(this));
      if (!negate)
      {
        result.Append(" IS NULL");
      }
      else
      {
        result.Append(" IS NOT NULL");
      }

      return result;
    }

    /// <summary>
    /// This handles the processing of join expressions.
    /// The extents on a left spine are flattened, while joins
    /// not on the left spine give rise to new nested sub queries.
    ///
    /// Joins work differently from the rest of the visiting, in that
    /// the parent (i.e. the join node) creates the SqlSelectStatement
    /// for the children to use.
    ///
    /// The "parameter" IsInJoinContext indicates whether a child extent should
    /// add its stuff to the existing SqlSelectStatement, or create a new SqlSelectStatement
    /// By passing true, we ask the children to add themselves to the parent join,
    /// by passing false, we ask the children to create new Select statements for
    /// themselves.
    ///
    /// This method is called from <see cref="Visit(DbApplyExpression)"/> and
    /// <see cref="Visit(DbJoinExpression)"/>.
    /// </summary>
    /// <param name="inputs"></param>
    /// <param name="joinKind"></param>
    /// <param name="joinString"></param>
    /// <param name="joinCondition"></param>
    /// <returns> A <see cref="SqlSelectStatement"/></returns>
    ISqlFragment VisitJoinExpression(IList<DbExpressionBinding> inputs, DbExpressionKind joinKind,
        string joinString, DbExpression joinCondition)
    {
      SqlSelectStatement result;
      // If the parent is not a join( or says that it is not),
      // we should create a new SqlSelectStatement.
      // otherwise, we add our child extents to the parent's FROM clause.
      if (!IsParentAJoin)
      {
        result = new SqlSelectStatement();
        result.AllJoinExtents = new List<Symbol>();
        selectStatementStack.Push(result);
      }
      else
      {
        result = CurrentSelectStatement;
      }

      // Process each of the inputs, and then the joinCondition if it exists.
      // It would be nice if we could call VisitInputExpression - that would
      // avoid some code duplication
      // but the Join postprocessing is messy and prevents this reuse.
      symbolTable.EnterScope();

      string separator = "";
      bool isLeftMostInput = true;
      int inputCount = inputs.Count;
      for (int idx = 0; idx < inputCount; idx++)
      {
        DbExpressionBinding input = inputs[idx];

        if (separator != "")
        {
          result.From.AppendLine();
        }
        result.From.Append(separator + " ");
        // Change this if other conditions are required
        // to force the child to produce a nested SqlStatement.
        bool needsJoinContext = (input.Expression.ExpressionKind == DbExpressionKind.Scan)
                                || (isLeftMostInput &&
                                    (IsJoinExpression(input.Expression)
                                     || IsApplyExpression(input.Expression)))
                                ;

        isParentAJoinStack.Push(needsJoinContext ? true : false);
        // if the child reuses our select statement, it will append the from
        // symbols to our FromExtents list.  So, we need to remember the
        // start of the child's entries.
        int fromSymbolStart = result.FromExtents.Count;

        ISqlFragment fromExtentFragment = input.Expression.Accept(this);

        isParentAJoinStack.Pop();

        ProcessJoinInputResult(fromExtentFragment, result, input, fromSymbolStart);
        separator = joinString;

        isLeftMostInput = false;
      }

      // Visit the on clause/join condition.
      switch (joinKind)
      {
        case DbExpressionKind.FullOuterJoin:
        case DbExpressionKind.InnerJoin:
        case DbExpressionKind.LeftOuterJoin:
          result.From.Append(" ON ");
          isParentAJoinStack.Push(false);
          result.From.Append(joinCondition.Accept(this));
          isParentAJoinStack.Pop();
          break;
      }

      symbolTable.ExitScope();

      if (!IsParentAJoin)
      {
        selectStatementStack.Pop();
      }

      return result;
    }

    /// <summary>
    /// This is called from <see cref="VisitJoinExpression"/>.
    ///
    /// This is responsible for maintaining the symbol table after visiting
    /// a child of a join expression.
    ///
    /// The child's sql statement may need to be completed.
    ///
    /// The child's result could be one of
    /// <list type="number">
    /// <item>The same as the parent's - this is treated specially.</item>
    /// <item>A sql select statement, which may need to be completed</item>
    /// <item>An extent - just copy it to the from clause</item>
    /// <item>Anything else (from a collection-valued expression) -
    /// unnest and copy it.</item>
    /// </list>
    ///
    /// If the input was a Join, we need to create a new join symbol,
    /// otherwise, we create a normal symbol.
    ///
    /// We then call AddFromSymbol to add the AS clause, and update the symbol table.
    ///
    ///
    ///
    /// If the child's result was the same as the parent's, we have to clean up
    /// the list of symbols in the FromExtents list, since this contains symbols from
    /// the children of both the parent and the child.
    /// The happens when the child visited is a Join, and is the leftmost child of
    /// the parent.
    /// </summary>
    /// <param name="fromExtentFragment"></param>
    /// <param name="result"></param>
    /// <param name="input"></param>
    /// <param name="fromSymbolStart"></param>
    void ProcessJoinInputResult(ISqlFragment fromExtentFragment, SqlSelectStatement result,
        DbExpressionBinding input, int fromSymbolStart)
    {
      Symbol fromSymbol = null;

      if (result != fromExtentFragment)
      {
        // The child has its own select statement, and is not reusing
        // our select statement.
        // This should look a lot like VisitInputExpression().
        SqlSelectStatement sqlSelectStatement = fromExtentFragment as SqlSelectStatement;
        if (sqlSelectStatement != null)
        {
          if (sqlSelectStatement.Select.IsEmpty)
          {
            List<Symbol> columns = AddDefaultColumns(sqlSelectStatement);

            if (IsJoinExpression(input.Expression)
                || IsApplyExpression(input.Expression))
            {
              List<Symbol> extents = sqlSelectStatement.FromExtents;
              JoinSymbol newJoinSymbol = new JoinSymbol(input.VariableName, input.VariableType, extents);
              newJoinSymbol.IsNestedJoin = true;
              newJoinSymbol.ColumnList = columns;

              fromSymbol = newJoinSymbol;
            }
            else
            {
              // this is a copy of the code in CreateNewSelectStatement.

              // if the oldStatement has a join as its input, ...
              // clone the join symbol, so that we "reuse" the
              // join symbol.  Normally, we create a new symbol - see the next block
              // of code.
              JoinSymbol oldJoinSymbol = sqlSelectStatement.FromExtents[0] as JoinSymbol;
              if (oldJoinSymbol != null)
              {
                // Note: sqlSelectStatement.FromExtents will not do, since it might
                // just be an alias of joinSymbol, and we want an actual JoinSymbol.
                JoinSymbol newJoinSymbol = new JoinSymbol(input.VariableName, input.VariableType, oldJoinSymbol.ExtentList);
                // This indicates that the sqlSelectStatement is a blocking scope
                // i.e. it hides/renames extent columns
                newJoinSymbol.IsNestedJoin = true;
                newJoinSymbol.ColumnList = columns;
                newJoinSymbol.FlattenedExtentList = oldJoinSymbol.FlattenedExtentList;

                fromSymbol = newJoinSymbol;
              }
            }

          }
          result.From.Append(" (");
          result.From.Append(sqlSelectStatement);
          result.From.Append(" )");
        }
        else if (input.Expression is DbScanExpression)
        {
          result.From.Append(fromExtentFragment);
        }
        else // bracket it
        {
          WrapNonQueryExtent(result, fromExtentFragment, input.Expression.ExpressionKind);
        }

        if (fromSymbol == null) // i.e. not a join symbol
        {
          fromSymbol = new Symbol(input.VariableName, input.VariableType);
        }


        AddFromSymbol(result, input.VariableName, fromSymbol);
        result.AllJoinExtents.Add(fromSymbol);
      }
      else // result == fromExtentFragment.  The child extents have been merged into the parent's.
      {
        // we are adding extents to the current sql statement via flattening.
        // We are replacing the child's extents with a single Join symbol.
        // The child's extents are all those following the index fromSymbolStart.
        //
        List<Symbol> extents = new List<Symbol>();

        // We cannot call extents.AddRange, since the is no simple way to
        // get the range of symbols fromSymbolStart..result.FromExtents.Count
        // from result.FromExtents.
        // We copy these symbols to create the JoinSymbol later.
        for (int i = fromSymbolStart; i < result.FromExtents.Count; ++i)
        {
          extents.Add(result.FromExtents[i]);
        }
        result.FromExtents.RemoveRange(fromSymbolStart, result.FromExtents.Count - fromSymbolStart);
        fromSymbol = new JoinSymbol(input.VariableName, input.VariableType, extents);
        result.FromExtents.Add(fromSymbol);
        // this Join Symbol does not have its own select statement, so we
        // do not set IsNestedJoin


        // We do not call AddFromSymbol(), since we do not want to add
        // "AS alias" to the FROM clause- it has been done when the extent was added earlier.
        symbolTable.Add(input.VariableName, fromSymbol);
      }
    }

    /// <summary>
    /// We assume that this is only called as a child of a Project.
    ///
    /// This replaces <see cref="Visit(DbNewInstanceExpression)"/>, since
    /// we do not allow DbNewInstanceExpression as a child of any node other than
    /// DbProjectExpression.
    ///
    /// We write out the translation of each of the columns in the record.
    /// </summary>
    /// <param name="e"></param>

    /// <returns>A <see cref="SqlBuilder"/></returns>
    ISqlFragment VisitNewInstanceExpression(DbNewInstanceExpression e)
    {
      SqlBuilder result = new SqlBuilder();
      RowType rowType = e.ResultType.EdmType as RowType;

      if (null != rowType)
      {
        _typeDefs.Length = 0;
        ReadOnlyMetadataCollection<EdmProperty> members = rowType.Properties;
        string separator = "";
        for (int i = 0; i < e.Arguments.Count; ++i)
        {
          DbExpression argument = e.Arguments[i];
          if (MetadataHelpers.IsRowType(argument.ResultType))
          {
            // We do not support nested records or other complex objects.
            throw new NotSupportedException();
          }

          EdmProperty member = members[i];
          _typeDefs.Append(separator);
          _typeDefs.Append(GetSqlPrimitiveType(member.TypeUsage));
          result.Append(separator);
          result.AppendLine();
          result.Append(argument.Accept(this));
          result.Append(" AS ");
          result.Append(QuoteIdentifier(member.Name));
          separator = ", ";
        }
      }
      else
      {
        //
        // Types other then RowType (such as UDTs for instance) are not supported.
        //
        throw new NotSupportedException();
      }

      return result;
    }

    ISqlFragment VisitSetOpExpression(DbExpression left, DbExpression right, string separator)
    {

      SqlSelectStatement leftSelectStatement = VisitExpressionEnsureSqlStatement(left);
      SqlSelectStatement rightSelectStatement = VisitExpressionEnsureSqlStatement(right);

      SqlBuilder setStatement = new SqlBuilder();
      setStatement.Append(leftSelectStatement);
      setStatement.AppendLine();
      setStatement.Append(separator); // e.g. UNION ALL
      setStatement.AppendLine();
      setStatement.Append(rightSelectStatement);

      return setStatement;
    }


    #endregion


    #region Function Handling Helpers
    /// <summary>
    /// Determines whether the given function is a built-in function that requires special handling
    /// </summary>
    /// <param name="e"></param>
    /// <returns></returns>
    private bool IsSpecialBuiltInFunction(DbFunctionExpression e)
    {
      return IsBuiltinFunction(e.Function) && _builtInFunctionHandlers.ContainsKey(e.Function.Name);
    }

    /// <summary>
    /// Determines whether the given function is a canonical function that requires special handling
    /// </summary>
    /// <param name="e"></param>
    /// <returns></returns>
    private bool IsSpecialCanonicalFunction(DbFunctionExpression e)
    {
      return MetadataHelpers.IsCanonicalFunction(e.Function) && _canonicalFunctionHandlers.ContainsKey(e.Function.Name);
    }

    /// <summary>
    /// Default handling for functions
    /// Translates them to FunctionName(arg1, arg2, ..., argn)
    /// </summary>
    /// <param name="e"></param>
    /// <returns></returns>
    private ISqlFragment HandleFunctionDefault(DbFunctionExpression e)
    {
      SqlBuilder result = new SqlBuilder();
      WriteFunctionName(result, e.Function);
      HandleFunctionArgumentsDefault(e, result);
      return result;
    }

    /// <summary>
    /// Default handling for functions with a given name.
    /// Translates them to functionName(arg1, arg2, ..., argn)
    /// </summary>
    /// <param name="e"></param>
    /// <param name="functionName"></param>
    /// <returns></returns>
    private ISqlFragment HandleFunctionDefaultGivenName(DbFunctionExpression e, string functionName)
    {
      SqlBuilder result = new SqlBuilder();
      result.Append(functionName);
      HandleFunctionArgumentsDefault(e, result);
      return result;
    }

    /// <summary>
    /// Default handling on function arguments
    /// Appends the list of arguments to the given result
    /// If the function is niladic it does not append anything,
    /// otherwise it appends (arg1, arg2, ..., argn)
    /// </summary>
    /// <param name="e"></param>
    /// <param name="result"></param>
    private void HandleFunctionArgumentsDefault(DbFunctionExpression e, SqlBuilder result)
    {
      bool isNiladicFunction = MetadataHelpers.TryGetValueForMetadataProperty<bool>(e.Function, "NiladicFunctionAttribute");
      if (isNiladicFunction && e.Arguments.Count > 0)
      {
        throw new InvalidOperationException("Niladic functions cannot have parameters");
      }

      if (!isNiladicFunction)
      {
        result.Append("(");
        string separator = "";
        foreach (DbExpression arg in e.Arguments)
        {
          result.Append(separator);
          result.Append(arg.Accept(this));
          separator = ", ";
        }
        result.Append(")");
      }
    }

    /// <summary>
    /// Handler for special built in functions
    /// </summary>
    /// <param name="e"></param>
    /// <returns></returns>
    private ISqlFragment HandleSpecialBuiltInFunction(DbFunctionExpression e)
    {
      return HandleSpecialFunction(_builtInFunctionHandlers, e);
    }

    /// <summary>
    /// Handler for special canonical functions
    /// </summary>
    /// <param name="e"></param>
    /// <returns></returns>
    private ISqlFragment HandleSpecialCanonicalFunction(DbFunctionExpression e)
    {
      return HandleSpecialFunction(_canonicalFunctionHandlers, e);
    }

    /// <summary>
    /// Dispatches the special function processing to the appropriate handler
    /// </summary>
    /// <param name="handlers"></param>
    /// <param name="e"></param>
    /// <returns></returns>
    private ISqlFragment HandleSpecialFunction(Dictionary<string, FunctionHandler> handlers, DbFunctionExpression e)
    {
      if (!handlers.ContainsKey(e.Function.Name))
        throw new InvalidOperationException("Special handling should be called only for functions in the list of special functions");

      return handlers[e.Function.Name](this, e);
    }

    /// <summary>
    /// Handles functions that are translated into TSQL operators.
    /// The given function should have one or two arguments. 
    /// Functions with one arguemnt are translated into 
    ///     op arg
    /// Functions with two arguments are translated into
    ///     arg0 op arg1
    /// Also, the arguments can be optionaly enclosed in parethesis
    /// </summary>
    /// <param name="e"></param>
    /// <param name="parenthesiseArguments">Whether the arguments should be enclosed in parethesis</param>
    /// <returns></returns>
    private ISqlFragment HandleSpecialFunctionToOperator(DbFunctionExpression e, bool parenthesiseArguments)
    {
      SqlBuilder result = new SqlBuilder();
      Debug.Assert(e.Arguments.Count > 0 && e.Arguments.Count <= 2, "There should be 1 or 2 arguments for operator");

      if (e.Arguments.Count > 1)
      {
        if (parenthesiseArguments)
        {
          result.Append("(");
        }
        result.Append(e.Arguments[0].Accept(this));
        if (parenthesiseArguments)
        {
          result.Append(")");
        }
      }
      result.Append(" ");
      Debug.Assert(_functionNameToOperatorDictionary.ContainsKey(e.Function.Name), "The function can not be mapped to an operator");
      result.Append(_functionNameToOperatorDictionary[e.Function.Name]);
      result.Append(" ");

      if (parenthesiseArguments)
      {
        result.Append("(");
      }
      result.Append(e.Arguments[e.Arguments.Count - 1].Accept(this));
      if (parenthesiseArguments)
      {
        result.Append(")");
      }
      return result;
    }


    /// <summary>
    /// <see cref="HandleSpecialFunctionToOperator"></see>
    /// </summary>
    /// <param name="sqlgen"></param>
    /// <param name="e"></param>
    /// <returns></returns>
    private static ISqlFragment HandleConcatFunction(SqlGenerator sqlgen, DbFunctionExpression e)
    {
      return sqlgen.HandleSpecialFunctionToOperator(e, false);
    }

    /// <summary>
    /// <see cref="HandleSpecialFunctionToOperator"></see>
    /// </summary>
    /// <param name="sqlgen"></param>
    /// <param name="e"></param>
    /// <returns></returns>
    private static ISqlFragment HandleCanonicalFunctionBitwise(SqlGenerator sqlgen, DbFunctionExpression e)
    {
      return sqlgen.HandleSpecialFunctionToOperator(e, true);
    }

    private static ISqlFragment HandleGetDateFunction(SqlGenerator sqlgen, DbFunctionExpression e)
    {
      SqlBuilder result = new SqlBuilder();
      Debug.Assert(e.Arguments.Count == 0, "Canonical getdate function should have no arguments");

      switch (sqlgen._manifest._dateFormat)
      {
        case SQLiteDateFormats.Ticks:
          result.Append("(STRFTIME('%s', 'now') * 10000000 + 621355968000000000)");
          break;
        case SQLiteDateFormats.JulianDay:
          result.Append("CAST(STRFTIME('%J', 'now') AS double)");
          break;
        default:
          result.Append("STRFTIME('%Y-%m-%d %H:%M:%S', 'now')");
          break;
      }

      return result;
    }

    private static ISqlFragment HandleGetUtcDateFunction(SqlGenerator sqlgen, DbFunctionExpression e)
    {
      SqlBuilder result = new SqlBuilder();
      Debug.Assert(e.Arguments.Count == 0, "Canonical getutcdate function should have no arguments");

      switch (sqlgen._manifest._dateFormat)
      {
        case SQLiteDateFormats.Ticks:
          result.Append("(STRFTIME('%s', 'now', 'utc') * 10000000 + 621355968000000000)");
          break;
        case SQLiteDateFormats.JulianDay:
          result.Append("CAST(STRFTIME('%J', 'now', 'utc') AS double)");
          break;
        default:
          result.Append("STRFTIME('%Y-%m-%d %H:%M:%S', 'now', 'utc')");
          break;
      }

      return result;
    }

    /// <summary>
    /// Handles special case in which datepart 'type' parameter is present. all the functions
    /// handles here have *only* the 1st parameter as datepart. datepart value is passed along
    /// the QP as string and has to be expanded as TSQL keyword.
    /// </summary>
    /// <param name="sqlgen"></param>
    /// <param name="e"></param>
    /// <returns></returns>
    private static ISqlFragment HandleDatepartDateFunction(SqlGenerator sqlgen, DbFunctionExpression e)
    {
      Debug.Assert(e.Arguments.Count == 2, "datepart function must have 2 arguments");

      DbConstantExpression constExpr = e.Arguments[0] as DbConstantExpression;
      if (null == constExpr)
      {
        throw new InvalidOperationException(String.Format("DATEPART argument to function '{0}.{1}' must be a literal string", e.Function.NamespaceName, e.Function.Name));
      }

      string datepart = constExpr.Value as string;
      if (null == datepart)
      {
        throw new InvalidOperationException(String.Format("DATEPART argument to function '{0}.{1}' must be a literal string", e.Function.NamespaceName, e.Function.Name));
      }

      SqlBuilder result = new SqlBuilder();

      //
      // check if datepart value is valid
      //
      string trans;
      if (!_datepartKeywords.TryGetValue(datepart, out trans))
      {
        throw new InvalidOperationException(String.Format("{0}' is not a valid value for DATEPART argument in '{1}.{2}' function", datepart, e.Function.NamespaceName, e.Function.Name));
      }

      if (trans != "%f")
      {
        result.Append("CAST(STRFTIME('");

        // expand the datepart literal as tsql kword
        result.Append(trans);
        result.Append("', ");

        switch (sqlgen._manifest._dateFormat)
        {
          case SQLiteDateFormats.Ticks:
            result.Append(String.Format("(({0} - 621355968000000000) / 10000000.0)", e.Arguments[1].Accept(sqlgen)));
            break;
          default:
            result.Append(e.Arguments[1].Accept(sqlgen));
            break;
        }

        result.Append(") AS integer)");
      }
      else
      {
        result.Append("CAST(SUBSTR(STRFTIME('%f', ");

        switch (sqlgen._manifest._dateFormat)
        {
          case SQLiteDateFormats.Ticks:
            result.Append(String.Format("(({0} - 621355968000000000) / 10000000.0)", e.Arguments[1].Accept(sqlgen)));
            break;
          default:
            result.Append(e.Arguments[1].Accept(sqlgen));
            break;
        }

        result.Append("), 4) AS integer)");
      }

      return result;
    }

    /// <summary>
    /// DateAdd(datetime, secondsToAdd) -> DATEADD ( seconds , number,  date)
    /// </summary>
    /// <param name="sqlgen"></param>
    /// <param name="e"></param>
    /// <returns></returns>
    private static ISqlFragment HandleCanonicalFunctionDateAdd(SqlGenerator sqlgen, DbFunctionExpression e)
    {
      SqlBuilder result = new SqlBuilder();
      Debug.Assert(e.Arguments.Count == 2, "Canonical datepart functions should have exactly two arguments");

      switch (sqlgen._manifest._dateFormat)
      {
        case SQLiteDateFormats.Ticks:
          result.Append(String.Format("(STRFTIME('%s', JULIANDAY({1}) + ({0} / 86400.0)) * 10000000 + 621355968000000000)", e.Arguments[0].Accept(sqlgen), e.Arguments[1].Accept(sqlgen)));
          break;
        case SQLiteDateFormats.JulianDay:
          result.Append(String.Format("CAST(STRFTIME('%J', JULIANDAY({1}) + ({0} / 86400.0)) AS double)", e.Arguments[0].Accept(sqlgen), e.Arguments[1].Accept(sqlgen)));
          break;
        default:
          result.Append(String.Format("STRFTIME('%Y-%m-%d %H:%M:%S', JULIANDAY({1}) + ({0} / 86400.0))", e.Arguments[0].Accept(sqlgen), e.Arguments[1].Accept(sqlgen)));
          break;
      }

      return result;
    }

    /// <summary>
    /// DateSubtract(datetime1, datetime2) -> DATEDIFF ( seconds , startdate , enddate ) 
    /// </summary>
    /// <param name="sqlgen"></param>
    /// <param name="e"></param>
    /// <returns></returns>
    private static ISqlFragment HandleCanonicalFunctionDateSubtract(SqlGenerator sqlgen, DbFunctionExpression e)
    {
      SqlBuilder result = new SqlBuilder();
      Debug.Assert(e.Arguments.Count == 2, "Canonical datepart functions should have exactly two arguments");

      switch (sqlgen._manifest._dateFormat)
      {
        case SQLiteDateFormats.Ticks:
          result.Append(String.Format("CAST((({0} - 621355968000000000) / 10000000.0)  - (({1} - 621355968000000000) / 10000000.0) * 86400.0 AS integer)", e.Arguments[0].Accept(sqlgen), e.Arguments[1].Accept(sqlgen)));
          break;
        default:
          result.Append(String.Format("CAST((JULIANDAY({1}) - JULIANDAY({0})) * 86400.0 AS integer)", e.Arguments[0].Accept(sqlgen), e.Arguments[1].Accept(sqlgen)));
          break;
      }

      return result;
    }

    /// <summary>
    /// Handler for canonical functions for extracting date parts. 
    /// For example:
    ///     Year(date) -> DATEPART( year, date)
    /// </summary>
    /// <param name="sqlgen"></param>
    /// <param name="e"></param>
    /// <returns></returns>
    private static ISqlFragment HandleCanonicalFunctionDatepart(SqlGenerator sqlgen, DbFunctionExpression e)
    {
      string trans;
      if (!_datepartKeywords.TryGetValue(e.Function.Name, out trans))
      {
        throw new InvalidOperationException(String.Format("{0}' is not a valid value for STRFTIME argument", e.Function.Name));
      }

      SqlBuilder result = new SqlBuilder();
      result.Append("CAST(STRFTIME('");
      result.Append(trans);
      result.Append("', ");

      Debug.Assert(e.Arguments.Count == 1, "Canonical datepart functions should have exactly one argument");

      switch (sqlgen._manifest._dateFormat)
      {
        case SQLiteDateFormats.Ticks:
          result.Append(String.Format("(({0} - 621355968000000000) / 10000000.0)", e.Arguments[0].Accept(sqlgen)));
          break;
        default:
          result.Append(e.Arguments[0].Accept(sqlgen));
          break;
      }

      result.Append(") AS integer)");

      return result;
    }

    /// <summary>
    ///  Function rename IndexOf -> CHARINDEX
    /// </summary>
    /// <param name="sqlgen"></param>
    /// <param name="e"></param>
    /// <returns></returns>
    private static ISqlFragment HandleCanonicalFunctionIndexOf(SqlGenerator sqlgen, DbFunctionExpression e)
    {
      return sqlgen.HandleFunctionDefaultGivenName(e, "CHARINDEX");
    }

    /// <summary>
    ///  Function rename NewGuid -> NEWID
    /// </summary>
    /// <param name="sqlgen"></param>
    /// <param name="e"></param>
    /// <returns></returns>
    private static ISqlFragment HandleCanonicalFunctionNewGuid(SqlGenerator sqlgen, DbFunctionExpression e)
    {
      SqlBuilder result = new SqlBuilder();
      result.Append("RANDOMBLOB(16)");
      return result;
    }

    /// <summary>
    ///  Length(arg) -> LEN(arg + '.') - LEN('.')
    /// </summary>
    /// <param name="sqlgen"></param>
    /// <param name="e"></param>
    /// <returns></returns>
    private static ISqlFragment HandleCanonicalFunctionLength(SqlGenerator sqlgen, DbFunctionExpression e)
    {
      SqlBuilder result = new SqlBuilder();

      result.Append("LENGTH(");

      Debug.Assert(e.Arguments.Count == 1, "Len should have one argument");
      result.Append(e.Arguments[0].Accept(sqlgen));

      result.Append(")");
      //result.Append(" + '.') - LEN('.')");

      return result;
    }

    /// <summary>
    /// Round(numericExpression) -> Round(numericExpression, 0);
    /// </summary>
    /// <param name="sqlgen"></param>
    /// <param name="e"></param>
    /// <returns></returns>
    private static ISqlFragment HandleCanonicalFunctionRound(SqlGenerator sqlgen, DbFunctionExpression e)
    {
      SqlBuilder result = new SqlBuilder();

      result.Append("ROUND(");

      Debug.Assert(e.Arguments.Count == 1, "Round should have one argument");
      result.Append(e.Arguments[0].Accept(sqlgen));

      result.Append(", 0)");

      return result;
    }

    /// <summary>
    /// TRIM(string) -> LTRIM(RTRIM(string))
    /// </summary>
    /// <param name="sqlgen"></param>
    /// <param name="e"></param>
    /// <returns></returns>
    private static ISqlFragment HandleCanonicalFunctionTrim(SqlGenerator sqlgen, DbFunctionExpression e)
    {
      SqlBuilder result = new SqlBuilder();

      result.Append("TRIM(");

      Debug.Assert(e.Arguments.Count == 1, "Trim should have one argument");
      result.Append(e.Arguments[0].Accept(sqlgen));

      result.Append(")");

      return result;
    }

    /// <summary>
    ///  Function rename ToLower -> LOWER
    /// </summary>
    /// <param name="sqlgen"></param>
    /// <param name="e"></param>
    /// <returns></returns>
    private static ISqlFragment HandleCanonicalFunctionToLower(SqlGenerator sqlgen, DbFunctionExpression e)
    {
      return sqlgen.HandleFunctionDefaultGivenName(e, "LOWER");
    }

    /// <summary>
    ///  Function rename ToUpper -> UPPER
    /// </summary>
    /// <param name="sqlgen"></param>
    /// <param name="e"></param>
    /// <returns></returns>
    private static ISqlFragment HandleCanonicalFunctionToUpper(SqlGenerator sqlgen, DbFunctionExpression e)
    {
      return sqlgen.HandleFunctionDefaultGivenName(e, "UPPER");
    }

    #endregion


    #endregion

    #region Helper methods for the DbExpressionVisitor
    /// <summary>
    /// <see cref="AddDefaultColumns"/>
    /// Add the column names from the referenced extent/join to the
    /// select statement.
    ///
    /// If the symbol is a JoinSymbol, we recursively visit all the extents,
    /// halting at real extents and JoinSymbols that have an associated SqlSelectStatement.
    ///
    /// The column names for a real extent can be derived from its type.
    /// The column names for a Join Select statement can be got from the
    /// list of columns that was created when the Join's select statement
    /// was created.
    ///
    /// We do the following for each column.
    /// <list type="number">
    /// <item>Add the SQL string for each column to the SELECT clause</item>
    /// <item>Add the column to the list of columns - so that it can
    /// become part of the "type" of a JoinSymbol</item>
    /// <item>Check if the column name collides with a previous column added
    /// to the same select statement.  Flag both the columns for renaming if true.</item>
    /// <item>Add the column to a name lookup dictionary for collision detection.</item>
    /// </list>
    /// </summary>
    /// <param name="selectStatement">The select statement that started off as SELECT *</param>
    /// <param name="symbol">The symbol containing the type information for
    /// the columns to be added.</param>
    /// <param name="columnList">Columns that have been added to the Select statement.
    /// This is created in <see cref="AddDefaultColumns"/>.</param>
    /// <param name="columnDictionary">A dictionary of the columns above.</param>
    /// <param name="separator">Comma or nothing, depending on whether the SELECT
    /// clause is empty.</param>
    void AddColumns(SqlSelectStatement selectStatement, Symbol symbol,
        List<Symbol> columnList, Dictionary<string, Symbol> columnDictionary, ref string separator)
    {

      JoinSymbol joinSymbol = symbol as JoinSymbol;
      if (joinSymbol != null)
      {
        if (!joinSymbol.IsNestedJoin)
        {
          // Recurse if the join symbol is a collection of flattened extents
          foreach (Symbol sym in joinSymbol.ExtentList)
          {
            // if sym is ScalarType means we are at base case in the
            // recursion and there are not columns to add, just skip
            if (MetadataHelpers.IsPrimitiveType(sym.Type))
            {
              continue;
            }

            AddColumns(selectStatement, sym, columnList, columnDictionary, ref separator);
          }
        }
        else
        {
          foreach (Symbol joinColumn in joinSymbol.ColumnList)
          {
            // we write tableName.columnName
            // rather than tableName.columnName as alias
            // since the column name is unique (by the way we generate new column names)
            //
            // We use the symbols for both the table and the column,
            // since they are subject to renaming.
            selectStatement.Select.Append(separator);
            selectStatement.Select.Append(symbol);
            selectStatement.Select.Append(".");
            selectStatement.Select.Append(joinColumn);

            // check for name collisions.  If there is,
            // flag both the colliding symbols.
            if (columnDictionary.ContainsKey(joinColumn.Name))
            {
              columnDictionary[joinColumn.Name].NeedsRenaming = true; // the original symbol
              joinColumn.NeedsRenaming = true; // the current symbol.
            }
            else
            {
              columnDictionary[joinColumn.Name] = joinColumn;
            }

            columnList.Add(joinColumn);

            separator = ", ";
          }
        }
      }
      else
      {
        // This is a non-join extent/select statement, and the CQT type has
        // the relevant column information.

        // The type could be a record type(e.g. Project(...),
        // or an entity type ( e.g. EntityExpression(...)
        // so, we check whether it is a structuralType.

        // Consider an expression of the form J(a, b=P(E))
        // The inner P(E) would have been translated to a SQL statement
        // We should not use the raw names from the type, but the equivalent
        // symbols (they are present in symbol.Columns) if they exist.
        //
        // We add the new columns to the symbol's columns if they do
        // not already exist.
        //

        foreach (EdmProperty property in MetadataHelpers.GetProperties(symbol.Type))
        {
          string recordMemberName = property.Name;
          // Since all renaming happens in the second phase
          // we lose nothing by setting the next column name index to 0
          // many times.
          allColumnNames[recordMemberName] = 0;

          // Create a new symbol/reuse existing symbol for the column
          Symbol columnSymbol;
          if (!symbol.Columns.TryGetValue(recordMemberName, out columnSymbol))
          {
            // we do not care about the types of columns, so we pass null
            // when construction the symbol.
            columnSymbol = new Symbol(recordMemberName, null);
            symbol.Columns.Add(recordMemberName, columnSymbol);
          }

          selectStatement.Select.Append(separator);
          selectStatement.Select.Append(symbol);
          selectStatement.Select.Append(".");

          // We use the actual name before the "AS", the new name goes
          // after the AS.
          selectStatement.Select.Append(QuoteIdentifier(recordMemberName));

          selectStatement.Select.Append(" AS ");
          selectStatement.Select.Append(columnSymbol);

          // Check for column name collisions.
          if (columnDictionary.ContainsKey(recordMemberName))
          {
            columnDictionary[recordMemberName].NeedsRenaming = true;
            columnSymbol.NeedsRenaming = true;
          }
          else
          {
            columnDictionary[recordMemberName] = symbol.Columns[recordMemberName];
          }

          columnList.Add(columnSymbol);

          separator = ", ";
        }
      }
    }

    /// <summary>
    /// Expands Select * to "select the_list_of_columns"
    /// If the columns are taken from an extent, they are written as
    /// {original_column_name AS Symbol(original_column)} to allow renaming.
    ///
    /// If the columns are taken from a Join, they are written as just
    /// {original_column_name}, since there cannot be a name collision.
    ///
    /// We concatenate the columns from each of the inputs to the select statement.
    /// Since the inputs may be joins that are flattened, we need to recurse.
    /// The inputs are inferred from the symbols in FromExtents.
    /// </summary>
    /// <param name="selectStatement"></param>
    /// <returns></returns>
    List<Symbol> AddDefaultColumns(SqlSelectStatement selectStatement)
    {
      // This is the list of columns added in this select statement
      // This forms the "type" of the Select statement, if it has to
      // be expanded in another SELECT *
      List<Symbol> columnList = new List<Symbol>();

      // A lookup for the previous set of columns to aid column name
      // collision detection.
      Dictionary<string, Symbol> columnDictionary = new Dictionary<string, Symbol>(StringComparer.OrdinalIgnoreCase);

      string separator = "";
      // The Select should usually be empty before we are called,
      // but we do not mind if it is not.
      if (!selectStatement.Select.IsEmpty)
      {
        separator = ", ";
      }

      foreach (Symbol symbol in selectStatement.FromExtents)
      {
        AddColumns(selectStatement, symbol, columnList, columnDictionary, ref separator);
      }

      return columnList;
    }

    /// <summary>
    /// <see cref="AddFromSymbol(SqlSelectStatement, string, Symbol, bool)"/>
    /// </summary>
    /// <param name="selectStatement"></param>
    /// <param name="inputVarName"></param>
    /// <param name="fromSymbol"></param>
    void AddFromSymbol(SqlSelectStatement selectStatement, string inputVarName, Symbol fromSymbol)
    {
      AddFromSymbol(selectStatement, inputVarName, fromSymbol, true);
    }

    /// <summary>
    /// This method is called after the input to a relational node is visited.
    /// <see cref="Visit(DbProjectExpression)"/> and <see cref="ProcessJoinInputResult"/>
    /// There are 2 scenarios
    /// <list type="number">
    /// <item>The fromSymbol is new i.e. the select statement has just been
    /// created, or a join extent has been added.</item>
    /// <item>The fromSymbol is old i.e. we are reusing a select statement.</item>
    /// </list>
    ///
    /// If we are not reusing the select statement, we have to complete the
    /// FROM clause with the alias
    /// <code>
    /// -- if the input was an extent
    /// FROM = [SchemaName].[TableName]
    /// -- if the input was a Project
    /// FROM = (SELECT ... FROM ... WHERE ...)
    /// </code>
    ///
    /// These become
    /// <code>
    /// -- if the input was an extent
    /// FROM = [SchemaName].[TableName] AS alias
    /// -- if the input was a Project
    /// FROM = (SELECT ... FROM ... WHERE ...) AS alias
    /// </code>
    /// and look like valid FROM clauses.
    ///
    /// Finally, we have to add the alias to the global list of aliases used,
    /// and also to the current symbol table.
    /// </summary>
    /// <param name="selectStatement"></param>
    /// <param name="inputVarName">The alias to be used.</param>
    /// <param name="fromSymbol"></param>
    /// <param name="addToSymbolTable"></param>
    void AddFromSymbol(SqlSelectStatement selectStatement, string inputVarName, Symbol fromSymbol, bool addToSymbolTable)
    {

      // the first check is true if this is a new statement
      // the second check is true if we are in a join - we do not
      // check if we are in a join context.
      // We do not want to add "AS alias" if it has been done already
      // e.g. when we are reusing the Sql statement.
      if (selectStatement.FromExtents.Count == 0 || fromSymbol != selectStatement.FromExtents[0])
      {
        selectStatement.FromExtents.Add(fromSymbol);
        selectStatement.From.Append(" AS ");
        selectStatement.From.Append(fromSymbol);

        // We have this inside the if statement, since
        // we only want to add extents that are actually used.
        allExtentNames[fromSymbol.Name] = 0;
      }

      if (addToSymbolTable)
      {
        symbolTable.Add(inputVarName, fromSymbol);
      }
    }

    /// <summary>
    /// Translates a list of SortClauses.
    /// Used in the translation of OrderBy 
    /// </summary>
    /// <param name="orderByClause">The SqlBuilder to which the sort keys should be appended</param>
    /// <param name="sortKeys"></param>
    void AddSortKeys(SqlBuilder orderByClause, IList<DbSortClause> sortKeys)
    {
      string separator = "";
      foreach (DbSortClause sortClause in sortKeys)
      {
        orderByClause.Append(separator);
        orderByClause.Append(sortClause.Expression.Accept(this));
        Debug.Assert(sortClause.Collation != null);
        if (!String.IsNullOrEmpty(sortClause.Collation))
        {
          orderByClause.Append(" COLLATE ");
          orderByClause.Append(sortClause.Collation);
        }

        orderByClause.Append(sortClause.Ascending ? " ASC" : " DESC");

        separator = ", ";
      }
    }

    /// <summary>
    /// <see cref="CreateNewSelectStatement(SqlSelectStatement oldStatement, string inputVarName, TypeUsage inputVarType, bool finalizeOldStatement, out Symbol fromSymbol) "/>
    /// </summary>
    /// <param name="oldStatement"></param>
    /// <param name="inputVarName"></param>
    /// <param name="inputVarType"></param>
    /// <param name="fromSymbol"></param>
    /// <returns>A new select statement, with the old one as the from clause.</returns>
    SqlSelectStatement CreateNewSelectStatement(SqlSelectStatement oldStatement,
        string inputVarName, TypeUsage inputVarType, out Symbol fromSymbol)
    {
      return CreateNewSelectStatement(oldStatement, inputVarName, inputVarType, true, out fromSymbol);
    }


    /// <summary>
    /// This is called after a relational node's input has been visited, and the
    /// input's sql statement cannot be reused.  <see cref="Visit(DbProjectExpression)"/>
    ///
    /// When the input's sql statement cannot be reused, we create a new sql
    /// statement, with the old one as the from clause of the new statement.
    ///
    /// The old statement must be completed i.e. if it has an empty select list,
    /// the list of columns must be projected out.
    ///
    /// If the old statement being completed has a join symbol as its from extent,
    /// the new statement must have a clone of the join symbol as its extent.
    /// We cannot reuse the old symbol, but the new select statement must behave
    /// as though it is working over the "join" record.
    /// </summary>
    /// <param name="oldStatement"></param>
    /// <param name="inputVarName"></param>
    /// <param name="inputVarType"></param>
    /// <param name="finalizeOldStatement"></param>
    /// <param name="fromSymbol"></param>
    /// <returns>A new select statement, with the old one as the from clause.</returns>
    SqlSelectStatement CreateNewSelectStatement(SqlSelectStatement oldStatement,
        string inputVarName, TypeUsage inputVarType, bool finalizeOldStatement, out Symbol fromSymbol)
    {
      fromSymbol = null;

      // Finalize the old statement
      if (finalizeOldStatement && oldStatement.Select.IsEmpty)
      {
        List<Symbol> columns = AddDefaultColumns(oldStatement);

        // Thid could not have been called from a join node.
        Debug.Assert(oldStatement.FromExtents.Count == 1);

        // if the oldStatement has a join as its input, ...
        // clone the join symbol, so that we "reuse" the
        // join symbol.  Normally, we create a new symbol - see the next block
        // of code.
        JoinSymbol oldJoinSymbol = oldStatement.FromExtents[0] as JoinSymbol;
        if (oldJoinSymbol != null)
        {
          // Note: oldStatement.FromExtents will not do, since it might
          // just be an alias of joinSymbol, and we want an actual JoinSymbol.
          JoinSymbol newJoinSymbol = new JoinSymbol(inputVarName, inputVarType, oldJoinSymbol.ExtentList);
          // This indicates that the oldStatement is a blocking scope
          // i.e. it hides/renames extent columns
          newJoinSymbol.IsNestedJoin = true;
          newJoinSymbol.ColumnList = columns;
          newJoinSymbol.FlattenedExtentList = oldJoinSymbol.FlattenedExtentList;

          fromSymbol = newJoinSymbol;
        }
      }

      if (fromSymbol == null)
      {
        // This is just a simple extent/SqlSelectStatement,
        // and we can get the column list from the type.
        fromSymbol = new Symbol(inputVarName, inputVarType);
      }

      // Observe that the following looks like the body of Visit(ExtentExpression).
      SqlSelectStatement selectStatement = new SqlSelectStatement();
      selectStatement.From.Append("( ");
      selectStatement.From.Append(oldStatement);
      selectStatement.From.AppendLine();
      selectStatement.From.Append(") ");


      return selectStatement;
    }


    /// <summary>
    /// Before we embed a string literal in a SQL string, we should
    /// convert all ' to '', and enclose the whole string in single quotes.
    /// </summary>
    /// <param name="s"></param>
    /// <param name="isUnicode"></param>
    /// <returns>The escaped sql string.</returns>
    private static string EscapeSingleQuote(string s, bool isUnicode)
    {
      return "'" + s.Replace("'", "''") + "'";
    }

    /// <summary>
    /// Returns the sql primitive/native type name. 
    /// It will include size, precision or scale depending on type information present in the 
    /// type facets
    /// </summary>
    /// <param name="type"></param>
    /// <returns></returns>
    private string GetSqlPrimitiveType(TypeUsage type)
    {
      PrimitiveType primitiveType = MetadataHelpers.GetEdmType<PrimitiveType>(type);

      string typeName = primitiveType.Name;
      bool isUnicode = true;
      bool isFixedLength = false;
      int maxLength = 0;
      string length = "max";
      bool preserveSeconds = true;
      byte decimalPrecision = 0;
      byte decimalScale = 0;

      switch (primitiveType.PrimitiveTypeKind)
      {
        case PrimitiveTypeKind.Binary:
          maxLength = MetadataHelpers.GetFacetValueOrDefault<int>(type, MetadataHelpers.MaxLengthFacetName, MetadataHelpers.BinaryMaxMaxLength);
          if (maxLength == MetadataHelpers.BinaryMaxMaxLength)
          {
            length = "max";
          }
          else
          {
            length = maxLength.ToString(CultureInfo.InvariantCulture);
          }
          isFixedLength = MetadataHelpers.GetFacetValueOrDefault<bool>(type, MetadataHelpers.FixedLengthFacetName, false);
          typeName = (isFixedLength ? "binary(" : "varbinary(") + length + ")";
          break;

        case PrimitiveTypeKind.String:
          // Question: How do we handle ntext?
          isUnicode = MetadataHelpers.GetFacetValueOrDefault<bool>(type, MetadataHelpers.UnicodeFacetName, true);
          isFixedLength = MetadataHelpers.GetFacetValueOrDefault<bool>(type, MetadataHelpers.FixedLengthFacetName, false);
          maxLength = MetadataHelpers.GetFacetValueOrDefault<int>(type, MetadataHelpers.MaxLengthFacetName, Int32.MinValue);
          if (maxLength == Int32.MinValue)
          {
            length = "max";
          }
          else
          {
            length = maxLength.ToString(CultureInfo.InvariantCulture);
          }
          if (isUnicode && !isFixedLength && maxLength > 4000)
            length = "max";
          if (!isUnicode && !isFixedLength && maxLength > 8000)
            length = "max";
          if (isFixedLength)
          {
            typeName = (isUnicode ? "nchar(" : "char(") + length + ")";
          }
          else
          {
            typeName = (isUnicode ? "nvarchar(" : "varchar(") + length + ")";
          }
          break;

        case PrimitiveTypeKind.DateTime:
          preserveSeconds = MetadataHelpers.GetFacetValueOrDefault<bool>(type, MetadataHelpers.PreserveSecondsFacetName, false);
          typeName = preserveSeconds ? "datetime" : "smalldatetime";
          break;

        case PrimitiveTypeKind.Decimal:
          decimalPrecision = MetadataHelpers.GetFacetValueOrDefault<byte>(type, MetadataHelpers.PrecisionFacetName, 18);
          Debug.Assert(decimalPrecision > 0, "decimal precision must be greater than zero");
          decimalScale = MetadataHelpers.GetFacetValueOrDefault<byte>(type, MetadataHelpers.ScaleFacetName, 0);
          Debug.Assert(decimalPrecision >= decimalScale, "decimalPrecision must be greater or equal to decimalScale");
          Debug.Assert(decimalPrecision <= 53, "decimalPrecision must be less than or equal to 53");
          typeName = typeName + "(" + decimalPrecision + "," + decimalScale + ")";
          break;

        case PrimitiveTypeKind.Int32:
          typeName = "int";
          break;

        case PrimitiveTypeKind.Int64:
          typeName = "bigint";
          break;

        case PrimitiveTypeKind.Int16:
          typeName = "smallint";
          break;

        case PrimitiveTypeKind.Byte:
          typeName = "tinyint";
          break;

        case PrimitiveTypeKind.Boolean:
          typeName = "bit";
          break;

        case PrimitiveTypeKind.Single:
          typeName = "real";
          break;

        case PrimitiveTypeKind.Double:
          typeName = "float";
          break;

        case PrimitiveTypeKind.Guid:
          typeName = "uniqueidentifier";
          break;

        default:
          throw new NotSupportedException("Unsupported EdmType: " + primitiveType.PrimitiveTypeKind);
      }

      return typeName;
    }

    /// <summary>
    /// Handles the expression represending DbLimitExpression.Limit and DbSkipExpression.Count.
    /// If it is a constant expression, it simply does to string thus avoiding casting it to the specific value
    /// (which would be done if <see cref="Visit(DbConstantExpression)"/> is called)
    /// </summary>
    /// <param name="e"></param>
    /// <returns></returns>
    private ISqlFragment HandleCountExpression(DbExpression e)
    {
      ISqlFragment result;

      if (e.ExpressionKind == DbExpressionKind.Constant)
      {
        //For constant expression we should not cast the value, 
        // thus we don't go throught the default DbConstantExpression handling
        SqlBuilder sqlBuilder = new SqlBuilder();
        sqlBuilder.Append(((DbConstantExpression)e).Value.ToString());
        result = sqlBuilder;
      }
      else
      {
        result = e.Accept(this);
      }

      return result;
    }

    /// <summary>
    /// This is used to determine if a particular expression is an Apply operation.
    /// This is only the case when the DbExpressionKind is CrossApply or OuterApply.
    /// </summary>
    /// <param name="e"></param>
    /// <returns></returns>
    bool IsApplyExpression(DbExpression e)
    {
      return (DbExpressionKind.CrossApply == e.ExpressionKind || DbExpressionKind.OuterApply == e.ExpressionKind);
    }

    /// <summary>
    /// This is used to determine if a particular expression is a Join operation.
    /// This is true for DbCrossJoinExpression and DbJoinExpression, the
    /// latter of which may have one of several different ExpressionKinds.
    /// </summary>
    /// <param name="e"></param>
    /// <returns></returns>
    bool IsJoinExpression(DbExpression e)
    {
      return (DbExpressionKind.CrossJoin == e.ExpressionKind ||
              DbExpressionKind.FullOuterJoin == e.ExpressionKind ||
              DbExpressionKind.InnerJoin == e.ExpressionKind ||
              DbExpressionKind.LeftOuterJoin == e.ExpressionKind);
    }

    /// <summary>
    /// This is used to determine if a calling expression needs to place
    /// round brackets around the translation of the expression e.
    ///
    /// Constants, parameters and properties do not require brackets,
    /// everything else does.
    /// </summary>
    /// <param name="e"></param>
    /// <returns>true, if the expression needs brackets </returns>
    bool IsComplexExpression(DbExpression e)
    {
      switch (e.ExpressionKind)
      {
        case DbExpressionKind.Constant:
        case DbExpressionKind.ParameterReference:
        case DbExpressionKind.Property:
          return false;

        default:
          return true;
      }
    }

    /// <summary>
    /// Determine if the owner expression can add its unique sql to the input's
    /// SqlSelectStatement
    /// </summary>
    /// <param name="result">The SqlSelectStatement of the input to the relational node.</param>
    /// <param name="expressionKind">The kind of the expression node(not the input's)</param>
    /// <returns></returns>
    bool IsCompatible(SqlSelectStatement result, DbExpressionKind expressionKind)
    {
      switch (expressionKind)
      {
        case DbExpressionKind.Distinct:
          return result.Top == null
            // The projection after distinct may not project all 
            // columns used in the Order By
              && result.OrderBy.IsEmpty;

        case DbExpressionKind.Filter:
          return result.Select.IsEmpty
                  && result.Where.IsEmpty
                  && result.GroupBy.IsEmpty
                  && result.Top == null;

        case DbExpressionKind.GroupBy:
          return result.Select.IsEmpty
                  && result.GroupBy.IsEmpty
                  && result.OrderBy.IsEmpty
                  && result.Top == null;

        case DbExpressionKind.Limit:
        case DbExpressionKind.Element:
          return result.Top == null;

        case DbExpressionKind.Project:
          return result.Select.IsEmpty
                  && result.GroupBy.IsEmpty;

        case DbExpressionKind.Skip:
          return result.Select.IsEmpty
                  && result.GroupBy.IsEmpty
                  && result.OrderBy.IsEmpty
                  && !result.IsDistinct;

        case DbExpressionKind.Sort:
          return result.Select.IsEmpty
                  && result.GroupBy.IsEmpty
                  && result.OrderBy.IsEmpty;

        default:
          Debug.Assert(false);
          throw new InvalidOperationException();
      }

    }

    /// <summary>
    /// We use the normal box quotes for SQL server.  We do not deal with ANSI quotes
    /// i.e. double quotes.
    /// </summary>
    /// <param name="name"></param>
    /// <returns></returns>
    internal static string QuoteIdentifier(string name)
    {


      Debug.Assert(!String.IsNullOrEmpty(name));
      // We assume that the names are not quoted to begin with.
      return "[" + name.Replace("]", "]]") + "]";
    }

    /// <summary>
    /// Simply calls <see cref="VisitExpressionEnsureSqlStatement(DbExpression, bool)"/>
    /// with addDefaultColumns set to true
    /// </summary>
    /// <param name="e"></param>
    /// <returns></returns>
    SqlSelectStatement VisitExpressionEnsureSqlStatement(DbExpression e)
    {
      return VisitExpressionEnsureSqlStatement(e, true);
    }

    /// <summary>
    /// This is called from <see cref="GenerateSql(DbQueryCommandTree)"/> and nodes which require a
    /// select statement as an argument e.g. <see cref="Visit(DbIsEmptyExpression)"/>,
    /// <see cref="Visit(DbUnionAllExpression)"/>.
    ///
    /// SqlGenerator needs its child to have a proper alias if the child is
    /// just an extent or a join.
    ///
    /// The normal relational nodes result in complete valid SQL statements.
    /// For the rest, we need to treat them as there was a dummy
    /// <code>
    /// -- originally {expression}
    /// -- change that to
    /// SELECT *
    /// FROM {expression} as c
    /// </code>
    /// 
    /// DbLimitExpression needs to start the statement but not add the default columns
    /// </summary>
    /// <param name="e"></param>
    /// <param name="addDefaultColumns"></param>
    /// <returns></returns>
    SqlSelectStatement VisitExpressionEnsureSqlStatement(DbExpression e, bool addDefaultColumns)
    {
      Debug.Assert(MetadataHelpers.IsCollectionType(e.ResultType));

      SqlSelectStatement result;
      switch (e.ExpressionKind)
      {
        case DbExpressionKind.Project:
        case DbExpressionKind.Filter:
        case DbExpressionKind.GroupBy:
        case DbExpressionKind.Sort:
          result = e.Accept(this) as SqlSelectStatement;
          break;

        default:
          Symbol fromSymbol;
          string inputVarName = "c";  // any name will do - this is my random choice.
          symbolTable.EnterScope();

          TypeUsage type = null;
          switch (e.ExpressionKind)
          {
            case DbExpressionKind.Scan:
            case DbExpressionKind.CrossJoin:
            case DbExpressionKind.FullOuterJoin:
            case DbExpressionKind.InnerJoin:
            case DbExpressionKind.LeftOuterJoin:
            case DbExpressionKind.CrossApply:
            case DbExpressionKind.OuterApply:
              type = MetadataHelpers.GetElementTypeUsage(e.ResultType);
              break;

            default:
              Debug.Assert(MetadataHelpers.IsCollectionType(e.ResultType));
              type = MetadataHelpers.GetEdmType<CollectionType>(e.ResultType).TypeUsage;
              break;
          }

          result = VisitInputExpression(e, inputVarName, type, out fromSymbol);
          AddFromSymbol(result, inputVarName, fromSymbol);
          symbolTable.ExitScope();
          break;
      }

      if (addDefaultColumns && result.Select.IsEmpty)
      {
        AddDefaultColumns(result);
      }

      return result;
    }

    /// <summary>
    /// This method is called by <see cref="Visit(DbFilterExpression)"/> and
    /// <see cref="Visit(DbQuantifierExpression)"/>
    ///
    /// </summary>
    /// <param name="input"></param>
    /// <param name="predicate"></param>
    /// <param name="negatePredicate">This is passed from <see cref="Visit(DbQuantifierExpression)"/>
    /// in the All(...) case.</param>
    /// <returns></returns>
    SqlSelectStatement VisitFilterExpression(DbExpressionBinding input, DbExpression predicate, bool negatePredicate)
    {
      Symbol fromSymbol;
      SqlSelectStatement result = VisitInputExpression(input.Expression,
          input.VariableName, input.VariableType, out fromSymbol);

      // Filter is compatible with OrderBy
      // but not with Project, another Filter or GroupBy
      if (!IsCompatible(result, DbExpressionKind.Filter))
      {
        result = CreateNewSelectStatement(result, input.VariableName, input.VariableType, out fromSymbol);
      }

      selectStatementStack.Push(result);
      symbolTable.EnterScope();

      AddFromSymbol(result, input.VariableName, fromSymbol);

      if (negatePredicate)
      {
        result.Where.Append("NOT (");
      }
      result.Where.Append(predicate.Accept(this));
      if (negatePredicate)
      {
        result.Where.Append(")");
      }

      symbolTable.ExitScope();
      selectStatementStack.Pop();

      return result;
    }

    /// <summary>
    /// If the sql fragment for an input expression is not a SqlSelect statement
    /// or other acceptable form (e.g. an extent as a SqlBuilder), we need
    /// to wrap it in a form acceptable in a FROM clause.  These are
    /// primarily the
    /// <list type="bullet">
    /// <item>The set operation expressions - union all, intersect, except</item>
    /// <item>TVFs, which are conceptually similar to tables</item>
    /// </list>
    /// </summary>
    /// <param name="result"></param>
    /// <param name="sqlFragment"></param>
    /// <param name="expressionKind"></param>
    void WrapNonQueryExtent(SqlSelectStatement result, ISqlFragment sqlFragment, DbExpressionKind expressionKind)
    {
      switch (expressionKind)
      {
        case DbExpressionKind.Function:
          // TVF
          result.From.Append(sqlFragment);
          break;

        default:
          result.From.Append(" (");
          result.From.Append(sqlFragment);
          result.From.Append(")");
          break;
      }
    }

    /// <summary>
    /// Is this a builtin function (ie) does it have the builtinAttribute specified?
    /// </summary>
    /// <param name="function"></param>
    /// <returns></returns>
    private static bool IsBuiltinFunction(EdmFunction function)
    {
      return MetadataHelpers.TryGetValueForMetadataProperty<bool>(function, "BuiltInAttribute");
    }

    /// <summary>
    ///
    /// </summary>
    /// <param name="function"></param>
    /// <param name="result"></param>
    void WriteFunctionName(SqlBuilder result, EdmFunction function)
    {
      string storeFunctionName = MetadataHelpers.TryGetValueForMetadataProperty<string>(function, "StoreFunctionNameAttribute");

      if (string.IsNullOrEmpty(storeFunctionName))
      {
        storeFunctionName = function.Name;
      }

      // If the function is a builtin (ie) the BuiltIn attribute has been
      // specified, then, the function name should not be quoted; additionally,
      // no namespace should be used.
      if (IsBuiltinFunction(function))
      {
        if (function.NamespaceName == "Edm")
        {
          switch (storeFunctionName.ToUpperInvariant())
          {
            default:
              result.Append(storeFunctionName);
              break;
          }

        }
        else
        {
          result.Append(storeFunctionName);
        }

      }
      else
      {
        // Should we actually support this?
        result.Append(QuoteIdentifier((string)function.MetadataProperties["Schema"].Value ?? "dbo"));
        result.Append(".");
        result.Append(QuoteIdentifier(storeFunctionName));
      }
    }

    static string ByteArrayToBinaryString(Byte[] binaryArray)
    {
      StringBuilder sb = new StringBuilder(binaryArray.Length * 2);
      for (int i = 0; i < binaryArray.Length; i++)
      {
        sb.Append(hexDigits[(binaryArray[i] & 0xF0) >> 4]).Append(hexDigits[binaryArray[i] & 0x0F]);
      }
      return sb.ToString();
    }

    /// <summary>
    /// Helper method for the Group By visitor
    /// Returns true if at least one of the aggregates in the given list
    /// has an argument that is not a <see cref="DbPropertyExpression"/> 
    /// over <see cref="DbVariableReferenceExpression"/>
    /// </summary>
    /// <param name="aggregates"></param>
    /// <returns></returns>
    static bool NeedsInnerQuery(IList<DbAggregate> aggregates)
    {
      foreach (DbAggregate aggregate in aggregates)
      {
        Debug.Assert(aggregate.Arguments.Count == 1);
        if (!IsPropertyOverVarRef(aggregate.Arguments[0]))
        {
          return true;
        }
      }
      return false;
    }

    /// <summary>
    /// Determines whether the given expression is a <see cref="DbPropertyExpression"/> 
    /// over <see cref="DbVariableReferenceExpression"/>
    /// </summary>
    /// <param name="expression"></param>
    /// <returns></returns>
    static bool IsPropertyOverVarRef(DbExpression expression)
    {
      DbPropertyExpression propertyExpression = expression as DbPropertyExpression;
      if (propertyExpression == null)
      {
        return false;
      }
      DbVariableReferenceExpression varRefExpression = propertyExpression.Instance as DbVariableReferenceExpression;
      if (varRefExpression == null)
      {
        return false;
      }
      return true;
    }

    #endregion
  }

}

Changes to System.Data.SQLite.Linq/SQLiteProviderManifest.cs.
1
2
3
4
5
6
7
8

9
10
11
12
13
14
15
16
17
18
19
20

21
22


23
24
25
26
27








28
29







30
31
32
33
34
35
36
37
38
39
40
41
42


43
44
45
46
47
48
49
50


51
52
53
54
55
56

57


58

59

60














61
62
63







64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81

82
83

84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104

105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120

121
122
123
124
125
126

127
128
129
130
131
132

133
134
135
136
137
138

139
140
141
142
143





144
145
146
147
148
149
150
151
152
153
154
155
156

157
158

159
160
161


162
163
164
165
166
167
168
/********************************************************
 * ADO.NET 2.0 Data Provider for SQLite Version 3.X
 * Written by Robert Simpson (robert@blackcastlesoft.com)
 * 
 * Released to the public domain, use at your own risk!
 ********************************************************/

namespace System.Data.SQLite

{
  using System;
  using System.Data;
  using System.Reflection;
  using System.IO;
  using System.Xml;
  using System.Collections.Generic;
  using System.Collections.ObjectModel;
  using System.Data.EntityModel.SchemaObjectModel;
  using System.Data.EntityModel;
  using System.Data.Common;
  using System.Data.Entity;

  using System.Data.Metadata.Edm;



  /// <summary>
  /// The Provider Manifest for SQL Server
  /// </summary>
  internal class SQLiteProviderManifest : DbXmlEnabledProviderManifest
  {








    internal SQLiteDateFormats _dateFormat;








    /// <summary>
    /// Constructs the provider manifest.
    /// </summary>
    /// <remarks>
    /// We pass the token as a DateTimeFormat enum text, because all the datetime functions
    /// are vastly different depending on how the user is opening the connection
    /// </remarks>
    /// <param name="manifestToken">A token used to infer the capabilities of the store</param>
    public SQLiteProviderManifest(string manifestToken)
      : base(SQLiteProviderManifest.GetProviderManifest())
    {
      _dateFormat = (SQLiteDateFormats)Enum.Parse(typeof(SQLiteDateFormats), manifestToken, true);
    }



    internal static XmlReader GetProviderManifest()
    {
      return GetXmlResource("System.Data.SQLite.Resources.SQLiteProviderServices.ProviderManifest.xml");
    }

    /// <summary>
    /// Returns manifest information for the provider


    /// </summary>
    /// <param name="informationType">The name of the information to be retrieved.</param>
    /// <returns>An XmlReader at the begining of the information requested.</returns>
    protected override XmlReader GetDbInformation(string informationType)
    {
      if (informationType == DbProviderManifest.StoreSchemaDefinition)

        return GetStoreSchemaDescription();


      else if (informationType == DbProviderManifest.StoreSchemaMapping)

        return GetStoreSchemaMapping();

      else if (informationType == DbProviderManifest.ConceptualSchemaDefinition)














        return null;

      throw new ProviderIncompatibleException(String.Format("SQLite does not support this information type '{0}'.", informationType));







    }

    /// <summary>
    /// This method takes a type and a set of facets and returns the best mapped equivalent type 
    /// in EDM.
    /// </summary>
    /// <param name="storeType">A TypeUsage encapsulating a store type and a set of facets</param>
    /// <returns>A TypeUsage encapsulating an EDM type and a set of facets</returns>
    public override TypeUsage GetEdmType(TypeUsage storeType)
    {
      if (storeType == null)
      {
        throw new ArgumentNullException("storeType");
      }

      string storeTypeName = storeType.EdmType.Name.ToLowerInvariant();
      //if (!base.StoreTypeNameToEdmPrimitiveType.ContainsKey(storeTypeName))
      //{

      //  switch (storeTypeName)
      //  {

      //    case "integer":
      //      return TypeUsage.CreateDefaultTypeUsage(PrimitiveType.GetEdmPrimitiveType(PrimitiveTypeKind.Int64));
      //    default:
      //      throw new ArgumentException(String.Format("SQLite does not support the type '{0}'.", storeTypeName));
      //  }
      //}

      PrimitiveType edmPrimitiveType;
      
      if (base.StoreTypeNameToEdmPrimitiveType.TryGetValue(storeTypeName, out edmPrimitiveType) == false)
        throw new ArgumentException(String.Format("SQLite does not support the type '{0}'.", storeTypeName));

      int maxLength = 0;
      bool isUnicode = true;
      bool isFixedLen = false;
      bool isUnbounded = true;

      PrimitiveTypeKind newPrimitiveTypeKind;

      switch (storeTypeName)
      {

        case "tinyint":
        case "smallint":
        case "integer":
        case "bit":
        case "uniqueidentifier":
        case "int":
        case "float":
        case "real":
          return TypeUsage.CreateDefaultTypeUsage(edmPrimitiveType);

        case "varchar":
          newPrimitiveTypeKind = PrimitiveTypeKind.String;
          isUnbounded = !TypeHelpers.TryGetMaxLength(storeType, out maxLength);
          isUnicode = false;
          isFixedLen = false;
          break;

        case "char":
          newPrimitiveTypeKind = PrimitiveTypeKind.String;
          isUnbounded = !TypeHelpers.TryGetMaxLength(storeType, out maxLength);
          isUnicode = false;
          isFixedLen = true;
          break;

        case "nvarchar":
          newPrimitiveTypeKind = PrimitiveTypeKind.String;
          isUnbounded = !TypeHelpers.TryGetMaxLength(storeType, out maxLength);
          isUnicode = true;
          isFixedLen = false;
          break;

        case "nchar":
          newPrimitiveTypeKind = PrimitiveTypeKind.String;
          isUnbounded = !TypeHelpers.TryGetMaxLength(storeType, out maxLength);
          isUnicode = true;
          isFixedLen = true;
          break;

        case "blob":
          newPrimitiveTypeKind = PrimitiveTypeKind.Binary;
          isUnbounded = !TypeHelpers.TryGetMaxLength(storeType, out maxLength);
          isFixedLen = false;
          break;





        case "decimal":
          {
            byte precision;
            byte scale;
            if (TypeHelpers.TryGetPrecision(storeType, out precision) && TypeHelpers.TryGetScale(storeType, out scale))
            {
              return TypeUsage.CreateDecimalTypeUsage(edmPrimitiveType, precision, scale);
            }
            else
            {
              return TypeUsage.CreateDecimalTypeUsage(edmPrimitiveType);
            }
          }

        case "datetime":
          return TypeUsage.CreateDateTimeTypeUsage(edmPrimitiveType, null);

        default:
          throw new NotSupportedException(String.Format("SQLite does not support the type '{0}'.", storeTypeName));
      }



      switch (newPrimitiveTypeKind)
      {
        case PrimitiveTypeKind.String:
          if (!isUnbounded)
          {
            return TypeUsage.CreateStringTypeUsage(edmPrimitiveType, isUnicode, isFixedLen, maxLength);
|
|
|
<
<
<
|
<
>
|
|
|
|
|
|
|
|
|
|
|
|
>
|

>
>





>
>
>
>
>
>
>
>


>
>
>
>
>
>
>

|

<
<
<
<






>
>







|
>
>






>

>
>
|
>

>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
|
|
>
>
>
>
>
>
>
















|
<
>
|
<
>
|
|
|
|
<
<
|
<
|
|
|










>






<
<








>






>






>






>





>
>
>
>
>













>


>

|

>
>







1
2
3



4

5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47




48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121

122
123

124
125
126
127
128


129

130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149


150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
//---------------------------------------------------------------------
// <copyright file="SampleProviderManifest.cs" company="Microsoft">
//      Copyright (c) Microsoft Corporation.  All rights reserved.



// </copyright>

//---------------------------------------------------------------------

using System.Collections.Generic;
using System.Xml;
using System.Collections.ObjectModel;
using System.Data.EntityModel.SchemaObjectModel;
using System.Data.EntityModel;
using System.Data.Common;
using System.Diagnostics;
using System.Data.Entity;
using System.Data.Metadata.Edm;
using System;
using System.Data;
using System.Reflection;
using System.IO;

namespace System.Data.SQLite
{
  /// <summary>
  /// The Provider Manifest for SQL Server
  /// </summary>
  internal class SQLiteProviderManifest : DbXmlEnabledProviderManifest
  {
    #region Private Fields

    /// <summary>
    /// maximum size of sql server unicode 
    /// </summary>
    private const int varcharMaxSize = Int32.MaxValue;
    private const int nvarcharMaxSize = Int32.MaxValue;
    private const int binaryMaxSize = Int32.MaxValue;
    internal SQLiteDateFormats _dateFormat;

    private System.Collections.ObjectModel.ReadOnlyCollection<PrimitiveType> _primitiveTypes = null;
    private System.Collections.ObjectModel.ReadOnlyCollection<EdmFunction> _functions = null;

    #endregion

    #region Constructors

    /// <summary>
    /// Constructor
    /// </summary>




    /// <param name="manifestToken">A token used to infer the capabilities of the store</param>
    public SQLiteProviderManifest(string manifestToken)
      : base(SQLiteProviderManifest.GetProviderManifest())
    {
      _dateFormat = (SQLiteDateFormats)Enum.Parse(typeof(SQLiteDateFormats), manifestToken, true);
    }

    #endregion

    internal static XmlReader GetProviderManifest()
    {
      return GetXmlResource("System.Data.SQLite.Resources.SQLiteProviderServices.ProviderManifest.xml");
    }

    /// <summary>
    /// Providers should override this to return information specific to their provider.  
    /// 
    /// This method should never return null.
    /// </summary>
    /// <param name="informationType">The name of the information to be retrieved.</param>
    /// <returns>An XmlReader at the begining of the information requested.</returns>
    protected override XmlReader GetDbInformation(string informationType)
    {
      if (informationType == DbProviderManifest.StoreSchemaDefinition)
      {
        return GetStoreSchemaDescription();
      }

      if (informationType == DbProviderManifest.StoreSchemaMapping)
      {
        return GetStoreSchemaMapping();
      }

      throw new ProviderIncompatibleException(String.Format("The provider returned null for the informationType '{0}'.", informationType));
    }

    public override System.Collections.ObjectModel.ReadOnlyCollection<PrimitiveType> GetStoreTypes()
    {
      if (_primitiveTypes == null)
      {
        List<PrimitiveType> primitiveTypes = new List<PrimitiveType>(base.GetStoreTypes());
        PrimitiveType newt;

        newt = PrimitiveType.GetEdmPrimitiveType(PrimitiveTypeKind.Int64);

        _primitiveTypes = primitiveTypes.AsReadOnly();
      }
      return _primitiveTypes;
    }

    public override System.Collections.ObjectModel.ReadOnlyCollection<EdmFunction> GetStoreFunctions()
    {
      if (this._functions == null)
      {
        this._functions = base.GetStoreFunctions();
      }
      return this._functions;
    }

    /// <summary>
    /// This method takes a type and a set of facets and returns the best mapped equivalent type 
    /// in EDM.
    /// </summary>
    /// <param name="storeType">A TypeUsage encapsulating a store type and a set of facets</param>
    /// <returns>A TypeUsage encapsulating an EDM type and a set of facets</returns>
    public override TypeUsage GetEdmType(TypeUsage storeType)
    {
      if (storeType == null)
      {
        throw new ArgumentNullException("storeType");
      }

      string storeTypeName = storeType.EdmType.Name.ToLowerInvariant();
      if (!base.StoreTypeNameToEdmPrimitiveType.ContainsKey(storeTypeName))

      {
        switch (storeTypeName)

        {
          case "integer":
            return TypeUsage.CreateDefaultTypeUsage(PrimitiveType.GetEdmPrimitiveType(PrimitiveTypeKind.Int64));
          default:
            throw new ArgumentException(String.Format("The underlying provider does not support the type '{0}'.", storeTypeName));


        }

      }

      PrimitiveType edmPrimitiveType = base.StoreTypeNameToEdmPrimitiveType[storeTypeName];

      int maxLength = 0;
      bool isUnicode = true;
      bool isFixedLen = false;
      bool isUnbounded = true;

      PrimitiveTypeKind newPrimitiveTypeKind;

      switch (storeTypeName)
      {
        // for some types we just go with simple type usage with no facets
        case "tinyint":
        case "smallint":
        case "integer":
        case "bit":
        case "uniqueidentifier":
        case "int":


          return TypeUsage.CreateDefaultTypeUsage(edmPrimitiveType);

        case "varchar":
          newPrimitiveTypeKind = PrimitiveTypeKind.String;
          isUnbounded = !TypeHelpers.TryGetMaxLength(storeType, out maxLength);
          isUnicode = false;
          isFixedLen = false;
          break;

        case "char":
          newPrimitiveTypeKind = PrimitiveTypeKind.String;
          isUnbounded = !TypeHelpers.TryGetMaxLength(storeType, out maxLength);
          isUnicode = false;
          isFixedLen = true;
          break;

        case "nvarchar":
          newPrimitiveTypeKind = PrimitiveTypeKind.String;
          isUnbounded = !TypeHelpers.TryGetMaxLength(storeType, out maxLength);
          isUnicode = true;
          isFixedLen = false;
          break;

        case "nchar":
          newPrimitiveTypeKind = PrimitiveTypeKind.String;
          isUnbounded = !TypeHelpers.TryGetMaxLength(storeType, out maxLength);
          isUnicode = true;
          isFixedLen = true;
          break;

        case "blob":
          newPrimitiveTypeKind = PrimitiveTypeKind.Binary;
          isUnbounded = !TypeHelpers.TryGetMaxLength(storeType, out maxLength);
          isFixedLen = false;
          break;

        case "float":
        case "real":
          return TypeUsage.CreateDefaultTypeUsage(edmPrimitiveType);

        case "decimal":
          {
            byte precision;
            byte scale;
            if (TypeHelpers.TryGetPrecision(storeType, out precision) && TypeHelpers.TryGetScale(storeType, out scale))
            {
              return TypeUsage.CreateDecimalTypeUsage(edmPrimitiveType, precision, scale);
            }
            else
            {
              return TypeUsage.CreateDecimalTypeUsage(edmPrimitiveType);
            }
          }

        case "datetime":
          return TypeUsage.CreateDateTimeTypeUsage(edmPrimitiveType, null);

        default:
          throw new NotSupportedException(String.Format("The underlying provider does not support the type '{0}'.", storeTypeName));
      }

      Debug.Assert(newPrimitiveTypeKind == PrimitiveTypeKind.String || newPrimitiveTypeKind == PrimitiveTypeKind.Binary, "at this point only string and binary types should be present");

      switch (newPrimitiveTypeKind)
      {
        case PrimitiveTypeKind.String:
          if (!isUnbounded)
          {
            return TypeUsage.CreateStringTypeUsage(edmPrimitiveType, isUnicode, isFixedLen, maxLength);
177
178
179
180
181
182
183
184
185
186
187
188
189

190
191
192
193
194
195

196


197
198
199

200

201
202
203
204
205
206
207

208
209

210
211

212
213

214
215

216
217

218
219

220
221

222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237

238
239
240
241
242
243
244
245
246
247

248

249
250
251

252


253

254

255
256
257


258
259
260
261
262
263
264
265
266
267
268
269
270
271
272

273

274
275
276

277

278

279

280
281
282
283
284

285

286
287
288

289

290

291

292
293
294
295

296
297













298
299
300
301
302
303
304
            return TypeUsage.CreateBinaryTypeUsage(edmPrimitiveType, isFixedLen, maxLength);
          }
          else
          {
            return TypeUsage.CreateBinaryTypeUsage(edmPrimitiveType, isFixedLen);
          }
        default:
          throw new NotSupportedException(String.Format("SQLite does not support the type '{0}'.", storeTypeName));
      }
    }

    /// <summary>
    /// This method takes a type and a set of facets and returns the best mapped equivalent type 

    /// </summary>
    /// <param name="storeType">A TypeUsage encapsulating an EDM type and a set of facets</param>
    /// <returns>A TypeUsage encapsulating a store type and a set of facets</returns>
    public override TypeUsage GetStoreType(TypeUsage edmType)
    {
      if (edmType == null)

        throw new ArgumentNullException("edmType");



      PrimitiveType primitiveType = edmType.EdmType as PrimitiveType;
      if (primitiveType == null)

        throw new ArgumentException(String.Format("SQLite does not support the type '{0}'.", edmType));


      ReadOnlyMetadataCollection<Facet> facets = edmType.Facets;

      switch (primitiveType.PrimitiveTypeKind)
      {
        case PrimitiveTypeKind.Boolean:
          return TypeUsage.CreateDefaultTypeUsage(StoreTypeNameToStorePrimitiveType["bit"]);

        case PrimitiveTypeKind.Byte:
          return TypeUsage.CreateDefaultTypeUsage(StoreTypeNameToStorePrimitiveType["tinyint"]);

        case PrimitiveTypeKind.Int16:
          return TypeUsage.CreateDefaultTypeUsage(StoreTypeNameToStorePrimitiveType["smallint"]);

        case PrimitiveTypeKind.Int32:
          return TypeUsage.CreateDefaultTypeUsage(StoreTypeNameToStorePrimitiveType["int"]);

        case PrimitiveTypeKind.Int64:
          return TypeUsage.CreateDefaultTypeUsage(StoreTypeNameToStorePrimitiveType["integer"]);

        case PrimitiveTypeKind.Guid:
          return TypeUsage.CreateDefaultTypeUsage(StoreTypeNameToStorePrimitiveType["uniqueidentifier"]);

        case PrimitiveTypeKind.Double:
          return TypeUsage.CreateDefaultTypeUsage(StoreTypeNameToStorePrimitiveType["float"]);

        case PrimitiveTypeKind.Single:
          return TypeUsage.CreateDefaultTypeUsage(StoreTypeNameToStorePrimitiveType["real"]);

        case PrimitiveTypeKind.Decimal: // decimal, numeric, smallmoney, money
          {
            byte precision;
            if (!TypeHelpers.TryGetPrecision(edmType, out precision))
            {
              precision = 18;
            }

            byte scale;
            if (!TypeHelpers.TryGetScale(edmType, out scale))
            {
              scale = 0;
            }

            return TypeUsage.CreateDecimalTypeUsage(StoreTypeNameToStorePrimitiveType["decimal"], precision, scale);
          }

        case PrimitiveTypeKind.Binary: // binary, varbinary, varbinary(max), image, timestamp, rowversion
          {
            bool isFixedLength = null != facets["FixedLength"].Value && (bool)facets["FixedLength"].Value;
            Facet f = facets["MaxLength"];

            bool isMaxLength = f.IsUnbounded || null == f.Value || (int)f.Value > Int32.MaxValue;
            int maxLength = !isMaxLength ? (int)f.Value : Int32.MinValue;

            TypeUsage tu;
            if (isFixedLength)

              tu = TypeUsage.CreateBinaryTypeUsage(StoreTypeNameToStorePrimitiveType["blob"], true, maxLength);

            else
            {
              if (isMaxLength)

                tu = TypeUsage.CreateBinaryTypeUsage(StoreTypeNameToStorePrimitiveType["blob"], false);


              else

                tu = TypeUsage.CreateBinaryTypeUsage(StoreTypeNameToStorePrimitiveType["blob"], false, maxLength);

            }
            return tu;
          }


        case PrimitiveTypeKind.String: // char, nchar, varchar, nvarchar, varchar(max), nvarchar(max), ntext, text
          {
            bool isUnicode = null == facets["Unicode"].Value || (bool)facets["Unicode"].Value;
            bool isFixedLength = null != facets["FixedLength"].Value && (bool)facets["FixedLength"].Value;
            Facet f = facets["MaxLength"];
            // maxlen is true if facet value is unbounded, the value is bigger than the limited string sizes *or* the facet
            // value is null. this is needed since functions still have maxlength facet value as null
            bool isMaxLength = f.IsUnbounded || null == f.Value || (int)f.Value > (isUnicode ? Int32.MaxValue : Int32.MaxValue);
            int maxLength = !isMaxLength ? (int)f.Value : Int32.MinValue;

            TypeUsage tu;

            if (isUnicode)
            {
              if (isFixedLength)

                tu = TypeUsage.CreateStringTypeUsage(StoreTypeNameToStorePrimitiveType["nchar"], true, true, maxLength);

              else
              {
                if (isMaxLength)

                  tu = TypeUsage.CreateStringTypeUsage(StoreTypeNameToStorePrimitiveType["nvarchar"], true, false);

                else

                  tu = TypeUsage.CreateStringTypeUsage(StoreTypeNameToStorePrimitiveType["nvarchar"], true, false, maxLength);

              }
            }
            else
            {
              if (isFixedLength)

                tu = TypeUsage.CreateStringTypeUsage(StoreTypeNameToStorePrimitiveType["char"], false, true, maxLength);

              else
              {
                if (isMaxLength)

                  tu = TypeUsage.CreateStringTypeUsage(StoreTypeNameToStorePrimitiveType["varchar"], false, false);

                else

                  tu = TypeUsage.CreateStringTypeUsage(StoreTypeNameToStorePrimitiveType["varchar"], false, false, maxLength);

              }
            }
            return tu;
          }

        case PrimitiveTypeKind.DateTime: // datetime, smalldatetime
          return TypeUsage.CreateDefaultTypeUsage(StoreTypeNameToStorePrimitiveType["datetime"]);













        default:
          throw new NotSupportedException(String.Format("There is no store type corresponding to the EDM type '{0}' of primitive type '{1}'.", edmType, primitiveType.PrimitiveTypeKind));
      }
    }

    private XmlReader GetStoreSchemaMapping()
    {







|





>






>

>
>



>
|
>







>


>


>


>


>


>


>


>














|

>





|




>
|
>



>

>
>

>

>



>
>
|






|







>

>



>

>

>

>





>

>



>

>

>

>




>

|
>
>
>
>
>
>
>
>
>
>
>
>
>







227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
            return TypeUsage.CreateBinaryTypeUsage(edmPrimitiveType, isFixedLen, maxLength);
          }
          else
          {
            return TypeUsage.CreateBinaryTypeUsage(edmPrimitiveType, isFixedLen);
          }
        default:
          throw new NotSupportedException(String.Format("The underlying provider does not support the type '{0}'.", storeTypeName));
      }
    }

    /// <summary>
    /// This method takes a type and a set of facets and returns the best mapped equivalent type 
    /// in SQL Server, taking the store version into consideration.
    /// </summary>
    /// <param name="storeType">A TypeUsage encapsulating an EDM type and a set of facets</param>
    /// <returns>A TypeUsage encapsulating a store type and a set of facets</returns>
    public override TypeUsage GetStoreType(TypeUsage edmType)
    {
      if (edmType == null)
      {
        throw new ArgumentNullException("edmType");
      }
      System.Diagnostics.Debug.Assert(edmType.EdmType.BuiltInTypeKind == BuiltInTypeKind.PrimitiveType);

      PrimitiveType primitiveType = edmType.EdmType as PrimitiveType;
      if (primitiveType == null)
      {
        throw new ArgumentException(String.Format("The underlying provider does not support the type '{0}'.", edmType));
      }

      ReadOnlyMetadataCollection<Facet> facets = edmType.Facets;

      switch (primitiveType.PrimitiveTypeKind)
      {
        case PrimitiveTypeKind.Boolean:
          return TypeUsage.CreateDefaultTypeUsage(StoreTypeNameToStorePrimitiveType["bit"]);

        case PrimitiveTypeKind.Byte:
          return TypeUsage.CreateDefaultTypeUsage(StoreTypeNameToStorePrimitiveType["tinyint"]);

        case PrimitiveTypeKind.Int16:
          return TypeUsage.CreateDefaultTypeUsage(StoreTypeNameToStorePrimitiveType["smallint"]);

        case PrimitiveTypeKind.Int32:
          return TypeUsage.CreateDefaultTypeUsage(StoreTypeNameToStorePrimitiveType["int"]);

        case PrimitiveTypeKind.Int64:
          return TypeUsage.CreateDefaultTypeUsage(StoreTypeNameToStorePrimitiveType["integer"]);

        case PrimitiveTypeKind.Guid:
          return TypeUsage.CreateDefaultTypeUsage(StoreTypeNameToStorePrimitiveType["uniqueidentifier"]);

        case PrimitiveTypeKind.Double:
          return TypeUsage.CreateDefaultTypeUsage(StoreTypeNameToStorePrimitiveType["float"]);

        case PrimitiveTypeKind.Single:
          return TypeUsage.CreateDefaultTypeUsage(StoreTypeNameToStorePrimitiveType["real"]);

        case PrimitiveTypeKind.Decimal: // decimal, numeric, smallmoney, money
          {
            byte precision;
            if (!TypeHelpers.TryGetPrecision(edmType, out precision))
            {
              precision = 18;
            }

            byte scale;
            if (!TypeHelpers.TryGetScale(edmType, out scale))
            {
              scale = 0;
            }

            return TypeUsage.CreateDecimalTypeUsage(StoreTypeNameToStorePrimitiveType["extDecimal"], precision, scale);
          }

        case PrimitiveTypeKind.Binary: // binary, varbinary, varbinary(max), image, timestamp, rowversion
          {
            bool isFixedLength = null != facets["FixedLength"].Value && (bool)facets["FixedLength"].Value;
            Facet f = facets["MaxLength"];

            bool isMaxLength = f.IsUnbounded || null == f.Value || (int)f.Value > binaryMaxSize;
            int maxLength = !isMaxLength ? (int)f.Value : Int32.MinValue;

            TypeUsage tu;
            if (isFixedLength)
            {
              tu = TypeUsage.CreateBinaryTypeUsage(StoreTypeNameToStorePrimitiveType["binary"], true, maxLength);
            }
            else
            {
              if (isMaxLength)
              {
                tu = TypeUsage.CreateBinaryTypeUsage(StoreTypeNameToStorePrimitiveType["blob"], false);
                System.Diagnostics.Debug.Assert(tu.Facets["MaxLength"].Description.IsConstant, "varbinary(max) is not constant!");
              }
              else
              {
                tu = TypeUsage.CreateBinaryTypeUsage(StoreTypeNameToStorePrimitiveType["blob"], false, maxLength);
              }
            }
            return tu;
          }

        case PrimitiveTypeKind.String:
          // char, nchar, varchar, nvarchar, varchar(max), nvarchar(max), ntext, text, xml
          {
            bool isUnicode = null == facets["Unicode"].Value || (bool)facets["Unicode"].Value;
            bool isFixedLength = null != facets["FixedLength"].Value && (bool)facets["FixedLength"].Value;
            Facet f = facets["MaxLength"];
            // maxlen is true if facet value is unbounded, the value is bigger than the limited string sizes *or* the facet
            // value is null. this is needed since functions still have maxlength facet value as null
            bool isMaxLength = f.IsUnbounded || null == f.Value || (int)f.Value > (isUnicode ? nvarcharMaxSize : varcharMaxSize);
            int maxLength = !isMaxLength ? (int)f.Value : Int32.MinValue;

            TypeUsage tu;

            if (isUnicode)
            {
              if (isFixedLength)
              {
                tu = TypeUsage.CreateStringTypeUsage(StoreTypeNameToStorePrimitiveType["nchar"], true, true, maxLength);
              }
              else
              {
                if (isMaxLength)
                {
                  tu = TypeUsage.CreateStringTypeUsage(StoreTypeNameToStorePrimitiveType["nvarchar"], true, false);
                }
                else
                {
                  tu = TypeUsage.CreateStringTypeUsage(StoreTypeNameToStorePrimitiveType["nvarchar"], true, false, maxLength);
                }
              }
            }
            else
            {
              if (isFixedLength)
              {
                tu = TypeUsage.CreateStringTypeUsage(StoreTypeNameToStorePrimitiveType["char"], false, true, maxLength);
              }
              else
              {
                if (isMaxLength)
                {
                  tu = TypeUsage.CreateStringTypeUsage(StoreTypeNameToStorePrimitiveType["varchar"], false, false);
                }
                else
                {
                  tu = TypeUsage.CreateStringTypeUsage(StoreTypeNameToStorePrimitiveType["varchar"], false, false, maxLength);
                }
              }
            }
            return tu;
          }

        case PrimitiveTypeKind.DateTime: // datetime, smalldatetime

          Facet preserveSecondsFacet;
          bool preserveSeconds;
          if (edmType.Facets.TryGetValue("PreserveSeconds", true, out preserveSecondsFacet) && null != preserveSecondsFacet.Value)
          {
            preserveSeconds = (bool)preserveSecondsFacet.Value;
          }
          else
          {
            preserveSeconds = true;
          }

          return TypeUsage.CreateDefaultTypeUsage(preserveSeconds ? StoreTypeNameToStorePrimitiveType["datetime"] : StoreTypeNameToStorePrimitiveType["smalldatetime"]);

        default:
          throw new NotSupportedException(String.Format("There is no store type corresponding to the EDM type '{0}' of primitive type '{1}'.", edmType, primitiveType.PrimitiveTypeKind));
      }
    }

    private XmlReader GetStoreSchemaMapping()
    {
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
    internal static XmlReader GetXmlResource(string resourceName)
    {
      Assembly executingAssembly = Assembly.GetExecutingAssembly();
      Stream stream = executingAssembly.GetManifestResourceStream(resourceName);
      return XmlReader.Create(stream);
    }

    private static class TypeHelpers
    {
      public static bool TryGetPrecision(TypeUsage tu, out byte precision)
      {
        Facet f;

        precision = 0;
        if (tu.Facets.TryGetValue("Precision", false, out f))







|







413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
    internal static XmlReader GetXmlResource(string resourceName)
    {
      Assembly executingAssembly = Assembly.GetExecutingAssembly();
      Stream stream = executingAssembly.GetManifestResourceStream(resourceName);
      return XmlReader.Create(stream);
    }

    class TypeHelpers
    {
      public static bool TryGetPrecision(TypeUsage tu, out byte precision)
      {
        Facet f;

        precision = 0;
        if (tu.Facets.TryGetValue("Precision", false, out f))
Changes to System.Data.SQLite.Linq/SQLiteProviderServices.cs.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/********************************************************
 * ADO.NET 2.0 Data Provider for SQLite Version 3.X
 * Written by Robert Simpson (robert@blackcastlesoft.com)
 * 
 * Released to the public domain, use at your own risk!
 ********************************************************/

namespace System.Data.SQLite
{
  using System;
  using System.Data.Common;
  using System.Data.Common.CommandTrees;
  using System.Data.Metadata.Edm;
  using System.Diagnostics;
<
<
<
<
<
<
<














1
2
3
4
5
6
7







namespace System.Data.SQLite
{
  using System;
  using System.Data.Common;
  using System.Data.Common.CommandTrees;
  using System.Data.Metadata.Edm;
  using System.Diagnostics;
163
164
165
166
167
168
169


170
171
172
173
174
175
176
    private static DbType GetSqlDbType(TypeUsage type, bool isOutParam, out int? size)
    {
      // only supported for primitive type
      PrimitiveTypeKind primitiveTypeKind = MetadataHelpers.GetPrimitiveTypeKind(type);

      size = default(int?);



      switch (primitiveTypeKind)
      {
        case PrimitiveTypeKind.Binary:
          // for output parameters, ensure there is space...
          size = GetParameterSize(type, isOutParam);
          return GetBinaryDbType(type);








>
>







156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
    private static DbType GetSqlDbType(TypeUsage type, bool isOutParam, out int? size)
    {
      // only supported for primitive type
      PrimitiveTypeKind primitiveTypeKind = MetadataHelpers.GetPrimitiveTypeKind(type);

      size = default(int?);


      // TODO add logic for Xml here
      switch (primitiveTypeKind)
      {
        case PrimitiveTypeKind.Binary:
          // for output parameters, ensure there is space...
          size = GetParameterSize(type, isOutParam);
          return GetBinaryDbType(type);

253
254
255
256
257
258
259

260




261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281

282
283
284
285
286
287
288
    /// </summary>
    private static DbType GetStringDbType(TypeUsage type)
    {
      Debug.Assert(type.EdmType.BuiltInTypeKind == BuiltInTypeKind.PrimitiveType &&
        PrimitiveTypeKind.String == ((PrimitiveType)type.EdmType).PrimitiveTypeKind, "only valid for string type");

      DbType dbType;






      // Specific type depends on whether the string is a unicode string and whether it is a fixed length string.
      // By default, assume widest type (unicode) and most common type (variable length)
      bool unicode;
      bool fixedLength;
      if (!MetadataHelpers.TryGetIsFixedLength(type, out fixedLength))
      {
        fixedLength = false;
      }

      if (!MetadataHelpers.TryGetIsUnicode(type, out unicode))
      {
        unicode = true;
      }

      if (fixedLength)
      {
        dbType = (unicode ? DbType.StringFixedLength : DbType.AnsiStringFixedLength);
      }
      else
      {
        dbType = (unicode ? DbType.String : DbType.AnsiString);

      }
      return dbType;
    }

    /// <summary>
    /// Chooses the appropriate DbType for the given binary type.
    /// </summary>







>
|
>
>
>
>
|
|
|
|
|
|
|
|

|
|
|
|

|
|
|
|
|
|
|
>







248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
    /// </summary>
    private static DbType GetStringDbType(TypeUsage type)
    {
      Debug.Assert(type.EdmType.BuiltInTypeKind == BuiltInTypeKind.PrimitiveType &&
        PrimitiveTypeKind.String == ((PrimitiveType)type.EdmType).PrimitiveTypeKind, "only valid for string type");

      DbType dbType;
      if (type.EdmType.Name.ToLowerInvariant() == "xml")
      {
        dbType = DbType.Xml;
      }
      else
      {
        // Specific type depends on whether the string is a unicode string and whether it is a fixed length string.
        // By default, assume widest type (unicode) and most common type (variable length)
        bool unicode;
        bool fixedLength;
        if (!MetadataHelpers.TryGetIsFixedLength(type, out fixedLength))
        {
          fixedLength = false;
        }

        if (!MetadataHelpers.TryGetIsUnicode(type, out unicode))
        {
          unicode = true;
        }

        if (fixedLength)
        {
          dbType = (unicode ? DbType.StringFixedLength : DbType.AnsiStringFixedLength);
        }
        else
        {
          dbType = (unicode ? DbType.String : DbType.AnsiString);
        }
      }
      return dbType;
    }

    /// <summary>
    /// Chooses the appropriate DbType for the given binary type.
    /// </summary>
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329

      return DbType.Binary;
      //            return fixedLength ? DbType.Binary : DbType.VarBinary;
    }

    #region ISQLiteSchemaExtensions Members

    /// <summary>
    /// Creates temporary tables on the connection so schema information can be queried
    /// </summary>
    /// <remarks>
    /// There's a lot of work involved in getting schema information out of SQLite, but LINQ expects to
    /// be able to query on schema tables.  Therefore we need to "fake" it by generating temporary tables
    /// filled with the schema of the current connection.  We get away with making this information static
    /// because schema information seems to always be queried on a new connection object, so the schema is
    /// always fresh.
    /// </remarks>
    /// <param name="cnn">The connection upon which to build the schema tables</param>
    void ISQLiteSchemaExtensions.BuildTempSchema(SQLiteConnection cnn)
    {
      string[] arr = new string[] { "TABLES", "COLUMNS", "VIEWS", "VIEWCOLUMNS", "INDEXES", "INDEXCOLUMNS", "FOREIGNKEYS", "CATALOGS" };

      using (DataTable table = cnn.GetSchema("Tables", new string[] { "temp", null, String.Format("SCHEMA{0}", arr[0]) }))
      {
        if (table.Rows.Count > 0) return;
      }

      for (int n = 0; n < arr.Length; n++)
      {
        using (DataTable table = cnn.GetSchema(arr[n]))







<
<
<
<
<
<
<
<
<
<
<




|







301
302
303
304
305
306
307











308
309
310
311
312
313
314
315
316
317
318
319

      return DbType.Binary;
      //            return fixedLength ? DbType.Binary : DbType.VarBinary;
    }

    #region ISQLiteSchemaExtensions Members












    void ISQLiteSchemaExtensions.BuildTempSchema(SQLiteConnection cnn)
    {
      string[] arr = new string[] { "TABLES", "COLUMNS", "VIEWS", "VIEWCOLUMNS", "INDEXES", "INDEXCOLUMNS", "FOREIGNKEYS", "CATALOGS" };

      using (DataTable table = cnn.GetSchema("Tables", new string[] { "TEMP", null, String.Format("SCHEMA{0}", arr[0]) }))
      {
        if (table.Rows.Count > 0) return;
      }

      for (int n = 0; n < arr.Length; n++)
      {
        using (DataTable table = cnn.GetSchema(arr[n]))
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
        cmd.ExecuteNonQuery();

        cmd.CommandText = Properties.Resources.SQL_CONSTRAINTCOLUMNS;
        cmd.ExecuteNonQuery();
      }
    }

    /// <summary>
    /// Turn a datatable into a table in the temporary database for the connection
    /// </summary>
    /// <param name="cnn">The connection to make the temporary table in</param>
    /// <param name="table">The table to write out</param>
    /// <param name="dest">The temporary table name to write to</param>
    private void DataTableToTable(SQLiteConnection cnn, DataTable table, string dest)
    {
      StringBuilder sql = new StringBuilder();
      SQLiteCommandBuilder builder = new SQLiteCommandBuilder();

      using (SQLiteCommand cmd = cnn.CreateCommand())
      using (DataTable source = new DataTable())







<
<
<
<
<
<







328
329
330
331
332
333
334






335
336
337
338
339
340
341
        cmd.ExecuteNonQuery();

        cmd.CommandText = Properties.Resources.SQL_CONSTRAINTCOLUMNS;
        cmd.ExecuteNonQuery();
      }
    }







    private void DataTableToTable(SQLiteConnection cnn, DataTable table, string dest)
    {
      StringBuilder sql = new StringBuilder();
      SQLiteCommandBuilder builder = new SQLiteCommandBuilder();

      using (SQLiteCommand cmd = cnn.CreateCommand())
      using (DataTable source = new DataTable())
378
379
380
381
382
383
384



385
386
387
388
389
390
391
392
393
394
395

          adp.Fill(source);

          foreach (DataRow row in table.Rows)
          {
            object[] arr = row.ItemArray;




            source.Rows.Add(arr);
          }
          adp.Update(source);
        }
      }
    }

    #endregion
  }
}








>
>
>











362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382

          adp.Fill(source);

          foreach (DataRow row in table.Rows)
          {
            object[] arr = row.ItemArray;

            //for (int n = 0; n < arr.Length; n++)
            //  if (arr[n] is string) arr[n] = ((string)arr[n]).ToLower();

            source.Rows.Add(arr);
          }
          adp.Update(source);
        }
      }
    }

    #endregion
  }
}

Changes to System.Data.SQLite.Linq/System.Data.SQLite.Linq.csproj.
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
    <SignAssembly>true</SignAssembly>
    <AssemblyOriginatorKeyFile>..\System.Data.SQLite\System.Data.SQLite.snk</AssemblyOriginatorKeyFile>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>..\bin\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
    <PlatformTarget>AnyCPU</PlatformTarget>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <DebugType>none</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>..\bin\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
    <PlatformTarget>AnyCPU</PlatformTarget>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="System" />







|






|

|







16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
    <SignAssembly>true</SignAssembly>
    <AssemblyOriginatorKeyFile>..\System.Data.SQLite\System.Data.SQLite.snk</AssemblyOriginatorKeyFile>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>..\bin\Designer\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
    <PlatformTarget>AnyCPU</PlatformTarget>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>..\bin\Designer\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
    <PlatformTarget>AnyCPU</PlatformTarget>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="System" />
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
      <DependentUpon>Resources.resx</DependentUpon>
    </Compile>
    <Compile Include="SQL Generation\DmlSqlGenerator.cs" />
    <Compile Include="SQL Generation\ISqlFragment.cs" />
    <Compile Include="SQL Generation\JoinSymbol.cs" />
    <Compile Include="SQL Generation\MetadataHelpers.cs" />
    <Compile Include="SQL Generation\SqlBuilder.cs" />
    <Compile Include="SQL Generation\SqlChecker.cs" />
    <Compile Include="SQL Generation\SqlGenerator.cs" />
    <Compile Include="SQL Generation\SqlSelectStatement.cs" />
    <Compile Include="SQL Generation\SqlWriter.cs" />
    <Compile Include="SQL Generation\Symbol.cs" />
    <Compile Include="SQL Generation\SymbolPair.cs" />
    <Compile Include="SQL Generation\SymbolTable.cs" />
    <Compile Include="SQL Generation\TopClause.cs" />







<







59
60
61
62
63
64
65

66
67
68
69
70
71
72
      <DependentUpon>Resources.resx</DependentUpon>
    </Compile>
    <Compile Include="SQL Generation\DmlSqlGenerator.cs" />
    <Compile Include="SQL Generation\ISqlFragment.cs" />
    <Compile Include="SQL Generation\JoinSymbol.cs" />
    <Compile Include="SQL Generation\MetadataHelpers.cs" />
    <Compile Include="SQL Generation\SqlBuilder.cs" />

    <Compile Include="SQL Generation\SqlGenerator.cs" />
    <Compile Include="SQL Generation\SqlSelectStatement.cs" />
    <Compile Include="SQL Generation\SqlWriter.cs" />
    <Compile Include="SQL Generation\Symbol.cs" />
    <Compile Include="SQL Generation\SymbolPair.cs" />
    <Compile Include="SQL Generation\SymbolTable.cs" />
    <Compile Include="SQL Generation\TopClause.cs" />
Changes to System.Data.SQLite/AssemblyInfo.cs.
20
21
22
23
24
25
26

27
28
29
30
31
32
33
[assembly: AssemblyCopyright("Public Domain")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

#if PLATFORM_COMPACTFRAMEWORK && RETARGETABLE
[assembly: AssemblyFlags(AssemblyNameFlags.Retargetable)]
#endif


//  Setting ComVisible to false makes the types in this assembly not visible 
//  to COM componenets.  If you need to access a type in this assembly from 
//  COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
[assembly: CLSCompliant(true)]
[assembly: InternalsVisibleTo("System.Data.SQLite.Linq, PublicKey=002400000480000094000000060200000024000052534131000400000100010005a288de5687c4e1b621ddff5d844727418956997f475eb829429e411aff3e93f97b70de698b972640925bdd44280df0a25a843266973704137cbb0e7441c1fe7cae4e2440ae91ab8cde3933febcb1ac48dd33b40e13c421d8215c18a4349a436dd499e3c385cc683015f886f6c10bd90115eb2bd61b67750839e3a19941dc9c")]







>







20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
[assembly: AssemblyCopyright("Public Domain")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

#if PLATFORM_COMPACTFRAMEWORK && RETARGETABLE
[assembly: AssemblyFlags(AssemblyNameFlags.Retargetable)]
#endif


//  Setting ComVisible to false makes the types in this assembly not visible 
//  to COM componenets.  If you need to access a type in this assembly from 
//  COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
[assembly: CLSCompliant(true)]
[assembly: InternalsVisibleTo("System.Data.SQLite.Linq, PublicKey=002400000480000094000000060200000024000052534131000400000100010005a288de5687c4e1b621ddff5d844727418956997f475eb829429e411aff3e93f97b70de698b972640925bdd44280df0a25a843266973704137cbb0e7441c1fe7cae4e2440ae91ab8cde3933febcb1ac48dd33b40e13c421d8215c18a4349a436dd499e3c385cc683015f886f6c10bd90115eb2bd61b67750839e3a19941dc9c")]
43
44
45
46
47
48
49
50
51
52
53
//      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.59.0")]
#if !PLATFORM_COMPACTFRAMEWORK
[assembly: AssemblyFileVersion("1.0.59.0")]
#endif







|

|

44
45
46
47
48
49
50
51
52
53
54
//      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.56.0")]
#if !PLATFORM_COMPACTFRAMEWORK
[assembly: AssemblyFileVersion("1.0.56.0")]
#endif
Changes to System.Data.SQLite/LINQ/SQLiteFactory_Linq.cs.
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
    }

    [ReflectionPermission(SecurityAction.Assert, MemberAccess = true)]
    private object GetSQLiteProviderServicesInstance()
    {
      if (_sqliteServices == null)
      {
        Type type = Type.GetType("System.Data.SQLite.SQLiteProviderServices, System.Data.SQLite.Linq, Version=2.0.38.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139", false);
        if (type != null)
        {
          FieldInfo field = type.GetField("Instance", BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Instance);
          _sqliteServices = field.GetValue(null);
        }
      }
      return _sqliteServices;







|







41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
    }

    [ReflectionPermission(SecurityAction.Assert, MemberAccess = true)]
    private object GetSQLiteProviderServicesInstance()
    {
      if (_sqliteServices == null)
      {
        Type type = Type.GetType("System.Data.SQLite.SQLiteProviderServices, System.Data.SQLite.Linq, Version=2.0.36.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139", false);
        if (type != null)
        {
          FieldInfo field = type.GetField("Instance", BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Instance);
          _sqliteServices = field.GetValue(null);
        }
      }
      return _sqliteServices;
Changes to System.Data.SQLite/SQLiteBase.cs.
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39

  /// <summary>
  /// This internal class provides the foundation of SQLite support.  It defines all the abstract members needed to implement
  /// a SQLite data provider, and inherits from SQLiteConvert which allows for simple translations of string to and from SQLite.
  /// </summary>
  internal abstract class SQLiteBase : SQLiteConvert, IDisposable
  {
    static SQLiteBase()
    {
#if !SQLITE_STANDARD
      UnsafeNativeMethods.sqlite3_initialize_interop();
#endif
    }

    internal SQLiteBase(SQLiteDateFormats fmt)
      : base(fmt) { }

    static internal object _lock = new object();

    /// <summary>
    /// Returns a string representing the active version of SQLite
    /// </summary>
    internal abstract string Version { get; }
    /// <summary>
    /// Returns the number of changes the last executing insert/update caused.
    /// </summary>







<
<
<
<
<
<
<



<
<







14
15
16
17
18
19
20







21
22
23


24
25
26
27
28
29
30

  /// <summary>
  /// This internal class provides the foundation of SQLite support.  It defines all the abstract members needed to implement
  /// a SQLite data provider, and inherits from SQLiteConvert which allows for simple translations of string to and from SQLite.
  /// </summary>
  internal abstract class SQLiteBase : SQLiteConvert, IDisposable
  {







    internal SQLiteBase(SQLiteDateFormats fmt)
      : base(fmt) { }



    /// <summary>
    /// Returns a string representing the active version of SQLite
    /// </summary>
    internal abstract string Version { get; }
    /// <summary>
    /// Returns the number of changes the last executing insert/update caused.
    /// </summary>
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
#else
      return UTF8ToString(UnsafeNativeMethods.sqlite3_errmsg(db), -1);
#endif
    }

    internal static void FinalizeStatement(SQLiteStatementHandle stmt)
    {
      lock (_lock)
      {
#if !SQLITE_STANDARD
        int n = UnsafeNativeMethods.sqlite3_finalize_interop(stmt);
#else
      int n = UnsafeNativeMethods.sqlite3_finalize(stmt);
#endif
        if (n > 0) throw new SQLiteException(n, null);
      }
    }

    internal static void CloseConnection(SQLiteConnectionHandle db)
    {
      lock (_lock)
      {
#if !SQLITE_STANDARD
        int n = UnsafeNativeMethods.sqlite3_close_interop(db);
#else
      ResetConnection(db);
      int n = UnsafeNativeMethods.sqlite3_close(db);
#endif
        if (n > 0) throw new SQLiteException(n, SQLiteLastError(db));
      }
    }

    internal static void ResetConnection(SQLiteConnectionHandle db)
    {
      lock (_lock)
      {
        IntPtr stmt = IntPtr.Zero;

        do
        {
          stmt = UnsafeNativeMethods.sqlite3_next_stmt(db, stmt);
          if (stmt != IntPtr.Zero)
          {
#if !SQLITE_STANDARD
            UnsafeNativeMethods.sqlite3_reset_interop(stmt);
#else
          UnsafeNativeMethods.sqlite3_reset(stmt);
#endif
          }
        } while (stmt != IntPtr.Zero);

        // Not overly concerned with the return value from a rollback.
        UnsafeNativeMethods.sqlite3_exec(db, ToUTF8("ROLLBACK"), IntPtr.Zero, IntPtr.Zero, out stmt);
      }
    }
  }

  internal interface ISQLiteSchemaExtensions
  {
    void BuildTempSchema(SQLiteConnection cnn);
  }







<
<

|



|
<




<
<

|




|
<




<
<
|

|
|
|
|
|

|



|
|

|
|
<







182
183
184
185
186
187
188


189
190
191
192
193
194

195
196
197
198


199
200
201
202
203
204
205

206
207
208
209


210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226

227
228
229
230
231
232
233
#else
      return UTF8ToString(UnsafeNativeMethods.sqlite3_errmsg(db), -1);
#endif
    }

    internal static void FinalizeStatement(SQLiteStatementHandle stmt)
    {


#if !SQLITE_STANDARD
      int n = UnsafeNativeMethods.sqlite3_finalize_interop(stmt);
#else
      int n = UnsafeNativeMethods.sqlite3_finalize(stmt);
#endif
      if (n > 0) throw new SQLiteException(n, null);

    }

    internal static void CloseConnection(SQLiteConnectionHandle db)
    {


#if !SQLITE_STANDARD
      int n = UnsafeNativeMethods.sqlite3_close_interop(db);
#else
      ResetConnection(db);
      int n = UnsafeNativeMethods.sqlite3_close(db);
#endif
      if (n > 0) throw new SQLiteException(n, SQLiteLastError(db));

    }

    internal static void ResetConnection(SQLiteConnectionHandle db)
    {


      IntPtr stmt = IntPtr.Zero;

      do
      {
        stmt = UnsafeNativeMethods.sqlite3_next_stmt(db, stmt);
        if (stmt != IntPtr.Zero)
        {
#if !SQLITE_STANDARD
          UnsafeNativeMethods.sqlite3_reset_interop(stmt);
#else
          UnsafeNativeMethods.sqlite3_reset(stmt);
#endif
        }
      } while (stmt != IntPtr.Zero);

      // Not overly concerned with the return value from a rollback.
      UnsafeNativeMethods.sqlite3_exec(db, ToUTF8("ROLLBACK"), IntPtr.Zero, IntPtr.Zero, out stmt);

    }
  }

  internal interface ISQLiteSchemaExtensions
  {
    void BuildTempSchema(SQLiteConnection cnn);
  }
Changes to System.Data.SQLite/SQLiteCommand.cs.
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
  using System.Collections.Generic;
  using System.ComponentModel;

  /// <summary>
  /// SQLite implementation of DbCommand.
  /// </summary>
#if !PLATFORM_COMPACTFRAMEWORK
  [Designer("SQLite.Designer.SQLiteCommandDesigner, SQLite.Designer, Version=1.0.36.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139"), ToolboxItem(true)]
#endif
  public sealed class SQLiteCommand : DbCommand, ICloneable
  {
    /// <summary>
    /// The command text this command is based on
    /// </summary>
    private string _commandText;







|







13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
  using System.Collections.Generic;
  using System.ComponentModel;

  /// <summary>
  /// SQLite implementation of DbCommand.
  /// </summary>
#if !PLATFORM_COMPACTFRAMEWORK
  [Designer("SQLite.Designer.SQLiteCommandDesigner, SQLite.Designer, Version=1.0.35.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139"), ToolboxItem(true)]
#endif
  public sealed class SQLiteCommand : DbCommand, ICloneable
  {
    /// <summary>
    /// The command text this command is based on
    /// </summary>
    private string _commandText;
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
    public SQLiteCommand(string commandText, SQLiteConnection connection, SQLiteTransaction transaction)
    {
      _statementList = null;
      _activeReader = null;
      _commandTimeout = 30;
      _parameterCollection = new SQLiteParameterCollection(this);
      _designTimeVisible = true;
      _updateRowSource = UpdateRowSource.None;
      _transaction = null;

      if (commandText != null)
        CommandText = commandText;

      if (connection != null)
      {







|







126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
    public SQLiteCommand(string commandText, SQLiteConnection connection, SQLiteTransaction transaction)
    {
      _statementList = null;
      _activeReader = null;
      _commandTimeout = 30;
      _parameterCollection = new SQLiteParameterCollection(this);
      _designTimeVisible = true;
      _updateRowSource = UpdateRowSource.FirstReturnedRecord;
      _transaction = null;

      if (commandText != null)
        CommandText = commandText;

      if (connection != null)
      {
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
    public override void Prepare()
    {
    }

    /// <summary>
    /// Sets the method the SQLiteCommandBuilder uses to determine how to update inserted or updated rows in a DataTable.
    /// </summary>
    [DefaultValue(UpdateRowSource.None)]
    public override UpdateRowSource UpdatedRowSource
    {
      get
      {
        return _updateRowSource;
      }
      set







|







593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
    public override void Prepare()
    {
    }

    /// <summary>
    /// Sets the method the SQLiteCommandBuilder uses to determine how to update inserted or updated rows in a DataTable.
    /// </summary>
    [DefaultValue(UpdateRowSource.FirstReturnedRecord)]
    public override UpdateRowSource UpdatedRowSource
    {
      get
      {
        return _updateRowSource;
      }
      set
Changes to System.Data.SQLite/SQLiteConnection.cs.
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
    /// <description>N</description>
    /// <description>Serializable</description>
    /// </item>
    /// </list>
    /// </remarks>
#if !PLATFORM_COMPACTFRAMEWORK
    [RefreshProperties(RefreshProperties.All), DefaultValue("")]
    [Editor("SQLite.Designer.SQLiteConnectionStringEditor, SQLite.Designer, Version=1.0.36.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139", "System.Drawing.Design.UITypeEditor, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
#endif
    public override string ConnectionString
    {
      get
      {
        return _connectionString;
      }







|







623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
    /// <description>N</description>
    /// <description>Serializable</description>
    /// </item>
    /// </list>
    /// </remarks>
#if !PLATFORM_COMPACTFRAMEWORK
    [RefreshProperties(RefreshProperties.All), DefaultValue("")]
    [Editor("SQLite.Designer.SQLiteConnectionStringEditor, SQLite.Designer, Version=1.0.35.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139", "System.Drawing.Design.UITypeEditor, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
#endif
    public override string ConnectionString
    {
      get
      {
        return _connectionString;
      }
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
          if (String.Compare(defValue, "Default", StringComparison.OrdinalIgnoreCase) != 0)
          {
            cmd.CommandText = String.Format(CultureInfo.InvariantCulture, "PRAGMA journal_mode={0}", defValue);
            cmd.ExecuteNonQuery();
          }
        }

        if (_commitHandler != null)
          _sql.SetCommitHook(_commitCallback);

        if (_updateHandler != null)
          _sql.SetUpdateHook(_updateCallback);

        if (_rollbackHandler != null)
          _sql.SetRollbackHook(_rollbackCallback);

#if !PLATFORM_COMPACTFRAMEWORK
        if (Transactions.Transaction.Current != null && SQLiteConvert.ToBoolean(FindKey(opts, "Enlist", Boolean.TrueString)) == true)
          EnlistTransaction(Transactions.Transaction.Current);
#endif
      }
      catch (SQLiteException)
      {







<
<
<
<
<
<
<
<
<







897
898
899
900
901
902
903









904
905
906
907
908
909
910
          if (String.Compare(defValue, "Default", StringComparison.OrdinalIgnoreCase) != 0)
          {
            cmd.CommandText = String.Format(CultureInfo.InvariantCulture, "PRAGMA journal_mode={0}", defValue);
            cmd.ExecuteNonQuery();
          }
        }










#if !PLATFORM_COMPACTFRAMEWORK
        if (Transactions.Transaction.Current != null && SQLiteConvert.ToBoolean(FindKey(opts, "Enlist", Boolean.TrueString)) == true)
          EnlistTransaction(Transactions.Transaction.Current);
#endif
      }
      catch (SQLiteException)
      {
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
                    row["COLUMN_NAME"] = schemaRow[SchemaTableColumn.BaseColumnName];
                    row["VIEW_COLUMN_NAME"] = viewRow[SchemaTableColumn.ColumnName];
                    row["COLUMN_HASDEFAULT"] = (viewRow[SchemaTableOptionalColumn.DefaultValue] != DBNull.Value);
                    row["COLUMN_DEFAULT"] = viewRow[SchemaTableOptionalColumn.DefaultValue];
                    row["ORDINAL_POSITION"] = viewRow[SchemaTableColumn.ColumnOrdinal];
                    row["IS_NULLABLE"] = viewRow[SchemaTableColumn.AllowDBNull];
                    row["DATA_TYPE"] = viewRow["DataTypeName"]; // SQLiteConvert.DbTypeToType((DbType)viewRow[SchemaTableColumn.ProviderType]).ToString();
                    row["EDM_TYPE"] = SQLiteConvert.DbTypeToTypeName((DbType)viewRow[SchemaTableColumn.ProviderType]).ToString().ToLower(CultureInfo.InvariantCulture);
                    row["CHARACTER_MAXIMUM_LENGTH"] = viewRow[SchemaTableColumn.ColumnSize];
                    row["TABLE_SCHEMA"] = viewRow[SchemaTableColumn.BaseSchemaName];
                    row["PRIMARY_KEY"] = viewRow[SchemaTableColumn.IsKey];
                    row["AUTOINCREMENT"] = viewRow[SchemaTableOptionalColumn.IsAutoIncrement];
                    row["COLLATION_NAME"] = viewRow["CollationType"];
                    row["UNIQUE"] = viewRow[SchemaTableColumn.IsUnique];
                    tbl.Rows.Add(row);







|







2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
                    row["COLUMN_NAME"] = schemaRow[SchemaTableColumn.BaseColumnName];
                    row["VIEW_COLUMN_NAME"] = viewRow[SchemaTableColumn.ColumnName];
                    row["COLUMN_HASDEFAULT"] = (viewRow[SchemaTableOptionalColumn.DefaultValue] != DBNull.Value);
                    row["COLUMN_DEFAULT"] = viewRow[SchemaTableOptionalColumn.DefaultValue];
                    row["ORDINAL_POSITION"] = viewRow[SchemaTableColumn.ColumnOrdinal];
                    row["IS_NULLABLE"] = viewRow[SchemaTableColumn.AllowDBNull];
                    row["DATA_TYPE"] = viewRow["DataTypeName"]; // SQLiteConvert.DbTypeToType((DbType)viewRow[SchemaTableColumn.ProviderType]).ToString();
                    row["EDM_TYPE"] = SQLiteConvert.DbTypeToTypeName((DbType)viewRow[SchemaTableColumn.ProviderType]).ToString();
                    row["CHARACTER_MAXIMUM_LENGTH"] = viewRow[SchemaTableColumn.ColumnSize];
                    row["TABLE_SCHEMA"] = viewRow[SchemaTableColumn.BaseSchemaName];
                    row["PRIMARY_KEY"] = viewRow[SchemaTableColumn.IsKey];
                    row["AUTOINCREMENT"] = viewRow[SchemaTableOptionalColumn.IsAutoIncrement];
                    row["COLLATION_NAME"] = viewRow["CollationType"];
                    row["UNIQUE"] = viewRow[SchemaTableColumn.IsUnique];
                    tbl.Rows.Add(row);
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131

2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
        while (rdTables.Read())
        {
          if (String.IsNullOrEmpty(strTable) || String.Compare(strTable, rdTables.GetString(2), true, CultureInfo.InvariantCulture) == 0)
          {
            try
            {
              using (SQLiteCommandBuilder builder = new SQLiteCommandBuilder())
              //using (SQLiteCommand cmdTable = new SQLiteCommand(String.Format(CultureInfo.InvariantCulture, "SELECT * FROM [{0}].[{1}]", strCatalog, rdTables.GetString(2)), this))
              //using (SQLiteDataReader rdTable = cmdTable.ExecuteReader(CommandBehavior.SchemaOnly))
              using (SQLiteCommand cmdKey = new SQLiteCommand(String.Format(CultureInfo.InvariantCulture, "PRAGMA [{0}].foreign_key_list([{1}])", strCatalog, rdTables.GetString(2)), this))
              using (SQLiteDataReader rdKey = cmdKey.ExecuteReader())
              {
                while (rdKey.Read())
                {
                  row = tbl.NewRow();
                  row["CONSTRAINT_CATALOG"] = strCatalog;
                  row["CONSTRAINT_NAME"] = String.Format(CultureInfo.InvariantCulture, "FK_{0}_{1}", rdTables[2], rdKey.GetInt32(0));
                  row["TABLE_CATALOG"] = strCatalog;
                  row["TABLE_NAME"] = builder.UnquoteIdentifier(rdTables.GetString(2));
                  row["CONSTRAINT_TYPE"] = "FOREIGN KEY";
                  row["IS_DEFERRABLE"] = false;
                  row["INITIALLY_DEFERRED"] = false;
                  row["FKEY_FROM_COLUMN"] = builder.UnquoteIdentifier(rdKey[3].ToString());

                  row["FKEY_TO_CATALOG"] = strCatalog;
                  row["FKEY_TO_TABLE"] = builder.UnquoteIdentifier(rdKey[2].ToString());
                  row["FKEY_TO_COLUMN"] = builder.UnquoteIdentifier(rdKey[4].ToString());
                  row["FKEY_FROM_ORDINAL_POSITION"] = rdKey[1];

                  if (String.IsNullOrEmpty(strKeyName) || String.Compare(strKeyName, row["CONSTRAINT_NAME"].ToString(), true, CultureInfo.InvariantCulture) == 0)
                    tbl.Rows.Add(row);
                }
              }
            }
            catch (SQLiteException)







|
|







|






>



<







2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126

2127
2128
2129
2130
2131
2132
2133
        while (rdTables.Read())
        {
          if (String.IsNullOrEmpty(strTable) || String.Compare(strTable, rdTables.GetString(2), true, CultureInfo.InvariantCulture) == 0)
          {
            try
            {
              using (SQLiteCommandBuilder builder = new SQLiteCommandBuilder())
              using (SQLiteCommand cmdTable = new SQLiteCommand(String.Format(CultureInfo.InvariantCulture, "SELECT * FROM [{0}].[{1}]", strCatalog, rdTables.GetString(2)), this))
              using (SQLiteDataReader rdTable = cmdTable.ExecuteReader(CommandBehavior.SchemaOnly))
              using (SQLiteCommand cmdKey = new SQLiteCommand(String.Format(CultureInfo.InvariantCulture, "PRAGMA [{0}].foreign_key_list([{1}])", strCatalog, rdTables.GetString(2)), this))
              using (SQLiteDataReader rdKey = cmdKey.ExecuteReader())
              {
                while (rdKey.Read())
                {
                  row = tbl.NewRow();
                  row["CONSTRAINT_CATALOG"] = strCatalog;
                  row["CONSTRAINT_NAME"] = String.Format(CultureInfo.InvariantCulture, "FK_{0}_{1}_{2}", rdTables[2], rdKey[3], rdKey[4]);
                  row["TABLE_CATALOG"] = strCatalog;
                  row["TABLE_NAME"] = builder.UnquoteIdentifier(rdTables.GetString(2));
                  row["CONSTRAINT_TYPE"] = "FOREIGN KEY";
                  row["IS_DEFERRABLE"] = false;
                  row["INITIALLY_DEFERRED"] = false;
                  row["FKEY_FROM_COLUMN"] = builder.UnquoteIdentifier(rdKey[3].ToString());
                  row["FKEY_FROM_ORDINAL_POSITION"] = rdTable.GetOrdinal(row["FKEY_FROM_COLUMN"].ToString());
                  row["FKEY_TO_CATALOG"] = strCatalog;
                  row["FKEY_TO_TABLE"] = builder.UnquoteIdentifier(rdKey[2].ToString());
                  row["FKEY_TO_COLUMN"] = builder.UnquoteIdentifier(rdKey[4].ToString());


                  if (String.IsNullOrEmpty(strKeyName) || String.Compare(strKeyName, row["CONSTRAINT_NAME"].ToString(), true, CultureInfo.InvariantCulture) == 0)
                    tbl.Rows.Add(row);
                }
              }
            }
            catch (SQLiteException)
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
    public event SQLiteUpdateEventHandler Update
    {
      add
      {
        if (_updateHandler == null)
        {
          _updateCallback = new SQLiteUpdateCallback(UpdateCallback);
          if (_sql != null) _sql.SetUpdateHook(_updateCallback);
        }
        _updateHandler += value;
      }
      remove
      {
        _updateHandler -= value;
        if (_updateHandler == null)
        {
          if (_sql != null) _sql.SetUpdateHook(null);
          _updateCallback = null;
        }
      }
    }

    private void UpdateCallback(IntPtr puser, int type, IntPtr database, IntPtr table, Int64 rowid)
    {







|








|







2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
    public event SQLiteUpdateEventHandler Update
    {
      add
      {
        if (_updateHandler == null)
        {
          _updateCallback = new SQLiteUpdateCallback(UpdateCallback);
          _sql.SetUpdateHook(_updateCallback);
        }
        _updateHandler += value;
      }
      remove
      {
        _updateHandler -= value;
        if (_updateHandler == null)
        {
          _sql.SetUpdateHook(null);
          _updateCallback = null;
        }
      }
    }

    private void UpdateCallback(IntPtr puser, int type, IntPtr database, IntPtr table, Int64 rowid)
    {
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
    public event SQLiteCommitHandler Commit
    {
      add
      {
        if (_commitHandler == null)
        {
          _commitCallback = new SQLiteCommitCallback(CommitCallback);
          if (_sql != null) _sql.SetCommitHook(_commitCallback);
        }
        _commitHandler += value;
      }
      remove
      {
        _commitHandler -= value;
        if (_commitHandler == null)
        {
          if (_sql != null) _sql.SetCommitHook(null);
          _commitCallback = null;
        }
      }
    }

    /// <summary>
    /// This event is raised whenever SQLite is committing a transaction.
    /// Return non-zero to trigger a rollback
    /// </summary>
    public event EventHandler RollBack
    {
      add
      {
        if (_rollbackHandler == null)
        {
          _rollbackCallback = new SQLiteRollbackCallback(RollbackCallback);
          if (_sql != null) _sql.SetRollbackHook(_rollbackCallback);
        }
        _rollbackHandler += value;
      }
      remove
      {
        _rollbackHandler -= value;
        if (_rollbackHandler == null)
        {
          if (_sql != null) _sql.SetRollbackHook(null);
          _rollbackCallback = null;
        }
      }
    }


    private int CommitCallback(IntPtr parg)







|








|
















|








|







2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
    public event SQLiteCommitHandler Commit
    {
      add
      {
        if (_commitHandler == null)
        {
          _commitCallback = new SQLiteCommitCallback(CommitCallback);
          _sql.SetCommitHook(_commitCallback);
        }
        _commitHandler += value;
      }
      remove
      {
        _commitHandler -= value;
        if (_commitHandler == null)
        {
          _sql.SetCommitHook(null);
          _commitCallback = null;
        }
      }
    }

    /// <summary>
    /// This event is raised whenever SQLite is committing a transaction.
    /// Return non-zero to trigger a rollback
    /// </summary>
    public event EventHandler RollBack
    {
      add
      {
        if (_rollbackHandler == null)
        {
          _rollbackCallback = new SQLiteRollbackCallback(RollbackCallback);
          _sql.SetRollbackHook(_rollbackCallback);
        }
        _rollbackHandler += value;
      }
      remove
      {
        _rollbackHandler -= value;
        if (_rollbackHandler == null)
        {
          _sql.SetRollbackHook(null);
          _rollbackCallback = null;
        }
      }
    }


    private int CommitCallback(IntPtr parg)
Changes to System.Data.SQLite/SQLiteDataAdapter.cs.
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
  using System.ComponentModel;

  /// <summary>
  /// SQLite implementation of DbDataAdapter.
  /// </summary>
#if !PLATFORM_COMPACTFRAMEWORK
  [DefaultEvent("RowUpdated")]
  [ToolboxItem("SQLite.Designer.SQLiteDataAdapterToolboxItem, SQLite.Designer, Version=1.0.36.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139")]
  [Designer("Microsoft.VSDesigner.Data.VS.SqlDataAdapterDesigner, Microsoft.VSDesigner, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
#endif
  public sealed class SQLiteDataAdapter : DbDataAdapter
  {
    private static object _updatingEventPH = new object();
    private static object _updatedEventPH = new object();








|







13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
  using System.ComponentModel;

  /// <summary>
  /// SQLite implementation of DbDataAdapter.
  /// </summary>
#if !PLATFORM_COMPACTFRAMEWORK
  [DefaultEvent("RowUpdated")]
  [ToolboxItem("SQLite.Designer.SQLiteDataAdapterToolboxItem, SQLite.Designer, Version=1.0.35.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139")]
  [Designer("Microsoft.VSDesigner.Data.VS.SqlDataAdapterDesigner, Microsoft.VSDesigner, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
#endif
  public sealed class SQLiteDataAdapter : DbDataAdapter
  {
    private static object _updatingEventPH = new object();
    private static object _updatedEventPH = new object();

Changes to System.Data.SQLite/SQLiteDataReader.cs.
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
    /// <returns>decimal</returns>
    public override decimal GetDecimal(int i)
    {
      if (i >= VisibleFieldCount && _keyInfo != null)
        return _keyInfo.GetDecimal(i - VisibleFieldCount);

      VerifyType(i, DbType.Decimal);
      return Convert.ToDecimal(_activeStatement._sql.GetText(_activeStatement, i), CultureInfo.InvariantCulture);
    }

    /// <summary>
    /// Returns the column as a double
    /// </summary>
    /// <param name="i">The index of the column to retrieve</param>
    /// <returns>double</returns>







|







398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
    /// <returns>decimal</returns>
    public override decimal GetDecimal(int i)
    {
      if (i >= VisibleFieldCount && _keyInfo != null)
        return _keyInfo.GetDecimal(i - VisibleFieldCount);

      VerifyType(i, DbType.Decimal);
      return Convert.ToDecimal(_activeStatement._sql.GetText(_activeStatement, i));
    }

    /// <summary>
    /// Returns the column as a double
    /// </summary>
    /// <param name="i">The index of the column to retrieve</param>
    /// <returns>double</returns>
608
609
610
611
612
613
614

615
616
617
618
619
620
621
        row[SchemaTableColumn.IsLong] = false;
        row[SchemaTableColumn.AllowDBNull] = true;
        row[SchemaTableOptionalColumn.IsReadOnly] = false;
        row[SchemaTableOptionalColumn.IsRowVersion] = false;
        row[SchemaTableColumn.IsUnique] = false;
        row[SchemaTableColumn.IsKey] = false;
        row[SchemaTableOptionalColumn.IsAutoIncrement] = false;

        row[SchemaTableColumn.DataType] = GetFieldType(n);
        row[SchemaTableOptionalColumn.IsHidden] = false;

        strColumn = _command.Connection._sql.ColumnOriginalName(_activeStatement, n);
        if (String.IsNullOrEmpty(strColumn) == false) row[SchemaTableColumn.BaseColumnName] = strColumn;

        row[SchemaTableColumn.IsExpression] = String.IsNullOrEmpty(strColumn);







>







608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
        row[SchemaTableColumn.IsLong] = false;
        row[SchemaTableColumn.AllowDBNull] = true;
        row[SchemaTableOptionalColumn.IsReadOnly] = false;
        row[SchemaTableOptionalColumn.IsRowVersion] = false;
        row[SchemaTableColumn.IsUnique] = false;
        row[SchemaTableColumn.IsKey] = false;
        row[SchemaTableOptionalColumn.IsAutoIncrement] = false;
        row[SchemaTableOptionalColumn.IsReadOnly] = false;
        row[SchemaTableColumn.DataType] = GetFieldType(n);
        row[SchemaTableOptionalColumn.IsHidden] = false;

        strColumn = _command.Connection._sql.ColumnOriginalName(_activeStatement, n);
        if (String.IsNullOrEmpty(strColumn) == false) row[SchemaTableColumn.BaseColumnName] = strColumn;

        row[SchemaTableColumn.IsExpression] = String.IsNullOrEmpty(strColumn);
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746

747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
              foreach (DataRow rowColumnIndex in tblIndexColumns.Rows)
              {
                if (String.Compare((string)rowColumnIndex["COLUMN_NAME"], strColumn, true, CultureInfo.InvariantCulture) == 0)
                {
                  if (tblIndexColumns.Rows.Count == 1 && (bool)row[SchemaTableColumn.AllowDBNull] == false)
                    row[SchemaTableColumn.IsUnique] = rowIndexes["UNIQUE"];

                  // If its an integer primary key and the only primary key in the table, then its a rowid alias and is autoincrement
                  // NOTE:  Currently commented out because this is not always the desired behavior.  For example, a 1:1 relationship with
                  //        another table, where the other table is autoincrement, but this one is not, and uses the rowid from the other.
                  //        It is safer to only set Autoincrement on tables where we're SURE the user specified AUTOINCREMENT, even if its a rowid column.

                  if (tblIndexColumns.Rows.Count == 1 && (bool)rowIndexes["PRIMARY_KEY"] == true && String.IsNullOrEmpty(dataType) == false &&
                    String.Compare(dataType, "integer", true, CultureInfo.InvariantCulture) == 0)
                  {
                    //  row[SchemaTableOptionalColumn.IsAutoIncrement] = true;
                  }

                  break;
                }
              }
            }
          }


          if (String.IsNullOrEmpty(dataType))
          {
            TypeAffinity affin;
            dataType = _activeStatement._sql.ColumnType(_activeStatement, n, out affin);
          }

          if (String.IsNullOrEmpty(dataType) == false)
            row["DataTypeName"] = dataType;
        }
        tbl.Rows.Add(row);
      }

      if (_keyInfo != null)
        _keyInfo.AppendSchemaTable(tbl);

      tbl.AcceptChanges();







<
<
<
<
<
<
<
<
<
<
<





|
>
|
|
|
|
|

|
|
|







724
725
726
727
728
729
730











731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
              foreach (DataRow rowColumnIndex in tblIndexColumns.Rows)
              {
                if (String.Compare((string)rowColumnIndex["COLUMN_NAME"], strColumn, true, CultureInfo.InvariantCulture) == 0)
                {
                  if (tblIndexColumns.Rows.Count == 1 && (bool)row[SchemaTableColumn.AllowDBNull] == false)
                    row[SchemaTableColumn.IsUnique] = rowIndexes["UNIQUE"];












                  break;
                }
              }
            }
          }
        }

        if (String.IsNullOrEmpty(dataType))
        {
          TypeAffinity affin;
          dataType = _activeStatement._sql.ColumnType(_activeStatement, n, out affin);
        }

        if (String.IsNullOrEmpty(dataType) == false)
          row["DataTypeName"] = dataType;

        tbl.Rows.Add(row);
      }

      if (_keyInfo != null)
        _keyInfo.AppendSchemaTable(tbl);

      tbl.AcceptChanges();
Changes to System.Data.SQLite/SQLiteFunction.cs.
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
  /// information in member variables of user-defined function classes.
  /// 
  /// For aggregate functions, always create and store your per-statement data in the contextData object on the 1st step.  This data will
  /// be automatically freed for you (and Dispose() called if the item supports IDisposable) when the statement completes.
  /// </remarks>
  public abstract class SQLiteFunction : IDisposable
  {
    private class AggregateData
    {
      internal int _count = 1;
      internal object _data = null;
    }

    /// <summary>
    /// The base connection this function is attached to
    /// </summary>
    internal SQLiteBase              _base;

    /// <summary>
    /// Internal array used to keep track of aggregate function context data
    /// </summary>
    private Dictionary<long, AggregateData> _contextDataList;

    /// <summary>
    /// Holds a reference to the callback function for user functions
    /// </summary>
    private SQLiteCallback  _InvokeFunc;
    /// <summary>
    /// Holds a reference to the callbakc function for stepping in an aggregate function







<
<
<
<
<
<








|







27
28
29
30
31
32
33






34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
  /// information in member variables of user-defined function classes.
  /// 
  /// For aggregate functions, always create and store your per-statement data in the contextData object on the 1st step.  This data will
  /// be automatically freed for you (and Dispose() called if the item supports IDisposable) when the statement completes.
  /// </remarks>
  public abstract class SQLiteFunction : IDisposable
  {






    /// <summary>
    /// The base connection this function is attached to
    /// </summary>
    internal SQLiteBase              _base;

    /// <summary>
    /// Internal array used to keep track of aggregate function context data
    /// </summary>
    private Dictionary<long, object> _contextDataList;

    /// <summary>
    /// Holds a reference to the callback function for user functions
    /// </summary>
    private SQLiteCallback  _InvokeFunc;
    /// <summary>
    /// Holds a reference to the callbakc function for stepping in an aggregate function
67
68
69
70
71
72
73


74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
    private SQLiteCollation _CompareFunc16;

    /// <summary>
    /// Current context of the current callback.  Only valid during a callback
    /// </summary>
    internal IntPtr _context;



    /// <summary>
    /// This static list contains all the user-defined functions declared using the proper attributes.
    /// </summary>
    private static List<SQLiteFunctionAttribute> _registeredFunctions = new List<SQLiteFunctionAttribute>();

    /// <summary>
    /// Internal constructor, initializes the function's internal variables.
    /// </summary>
    protected SQLiteFunction()
    {
      _contextDataList = new Dictionary<long, AggregateData>();
    }

    /// <summary>
    /// Returns a reference to the underlying connection's SQLiteConvert class, which can be used to convert
    /// strings and DateTime's into the current connection's encoding schema.
    /// </summary>
    public SQLiteConvert SQLiteConvert







>
>










|







61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
    private SQLiteCollation _CompareFunc16;

    /// <summary>
    /// Current context of the current callback.  Only valid during a callback
    /// </summary>
    internal IntPtr _context;

    private int _count = 1;

    /// <summary>
    /// This static list contains all the user-defined functions declared using the proper attributes.
    /// </summary>
    private static List<SQLiteFunctionAttribute> _registeredFunctions = new List<SQLiteFunctionAttribute>();

    /// <summary>
    /// Internal constructor, initializes the function's internal variables.
    /// </summary>
    protected SQLiteFunction()
    {
      _contextDataList = new Dictionary<long, object>();
    }

    /// <summary>
    /// Returns a reference to the underlying connection's SQLiteConvert class, which can be used to convert
    /// strings and DateTime's into the current connection's encoding schema.
    /// </summary>
    public SQLiteConvert SQLiteConvert
305
306
307
308
309
310
311

312
313

314
315
316
317
318
319
320
321
322
323
324
325

326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341

342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
    /// binary searches can be done to find the data.
    /// </remarks>
    /// <param name="context">A raw context pointer</param>
    /// <param name="nArgs">Number of arguments passed in</param>
    /// <param name="argsptr">A pointer to the array of arguments</param>
    internal void StepCallback(IntPtr context, int nArgs, IntPtr argsptr)
    {

      long nAux;
      AggregateData data;


      nAux = (long)_base.AggregateContext(context);
      if (_contextDataList.TryGetValue(nAux, out data) == false)
      {
        data = new AggregateData();
        _contextDataList[nAux] = data;
      }

      try
      {
        _context = context;
        Step(ConvertParams(nArgs, argsptr), data._count, ref data._data);

      }
      finally
      {
        data._count++;
      }
    }

    /// <summary>
    /// An internal aggregate Final function callback, which wraps the context pointer and calls the virtual Final() method.
    /// </summary>
    /// <param name="context">A raw context pointer</param>
    internal void FinalCallback(IntPtr context)
    {
      long n = (long)_base.AggregateContext(context);
      object obj = null;


      if (_contextDataList.ContainsKey(n))
      {
        obj = _contextDataList[n]._data;
        _contextDataList.Remove(n);
      }

      _context = context;
      SetReturnValue(context, Final(obj));

      IDisposable disp = obj as IDisposable;
      if (disp != null) disp.Dispose();
    }

    /// <summary>
    /// Placeholder for a user-defined disposal routine
    /// </summary>
    /// <param name="disposing">True if the object is being disposed explicitly</param>
    protected virtual void Dispose(bool disposing)
    {
      if (disposing)
      {
        IDisposable disp;

        foreach (KeyValuePair<long, AggregateData> kv in _contextDataList)
        {
          disp = kv.Value._data as IDisposable;
          if (disp != null)
            disp.Dispose();
        }
        _contextDataList.Clear();

        _InvokeFunc = null;
        _StepFunc = null;







>

<
>


<
<
<
|
<




|
>



|












>


|




















|

|







301
302
303
304
305
306
307
308
309

310
311
312



313

314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
    /// binary searches can be done to find the data.
    /// </remarks>
    /// <param name="context">A raw context pointer</param>
    /// <param name="nArgs">Number of arguments passed in</param>
    /// <param name="argsptr">A pointer to the array of arguments</param>
    internal void StepCallback(IntPtr context, int nArgs, IntPtr argsptr)
    {
      int n = _count;
      long nAux;

      object obj = null;

      nAux = (long)_base.AggregateContext(context);



      if (n > 1) obj = _contextDataList[nAux];


      try
      {
        _context = context;
        Step(ConvertParams(nArgs, argsptr), n, ref obj);
        _contextDataList[nAux] = obj;
      }
      finally
      {
        _count++;
      }
    }

    /// <summary>
    /// An internal aggregate Final function callback, which wraps the context pointer and calls the virtual Final() method.
    /// </summary>
    /// <param name="context">A raw context pointer</param>
    internal void FinalCallback(IntPtr context)
    {
      long n = (long)_base.AggregateContext(context);
      object obj = null;

      _count = 1;
      if (_contextDataList.ContainsKey(n))
      {
        obj = _contextDataList[n];
        _contextDataList.Remove(n);
      }

      _context = context;
      SetReturnValue(context, Final(obj));

      IDisposable disp = obj as IDisposable;
      if (disp != null) disp.Dispose();
    }

    /// <summary>
    /// Placeholder for a user-defined disposal routine
    /// </summary>
    /// <param name="disposing">True if the object is being disposed explicitly</param>
    protected virtual void Dispose(bool disposing)
    {
      if (disposing)
      {
        IDisposable disp;

        foreach (KeyValuePair<long, object> kv in _contextDataList)
        {
          disp = kv.Value as IDisposable;
          if (disp != null)
            disp.Dispose();
        }
        _contextDataList.Clear();

        _InvokeFunc = null;
        _StepFunc = null;
Changes to System.Data.SQLite/SQLiteStatement.cs.
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
        case DbType.Guid:
          if (_command.Connection._binaryGuid == true)
            _sql.Bind_Blob(this, index, ((Guid)obj).ToByteArray());
          else
            _sql.Bind_Text(this, index, obj.ToString());

          break;
        case DbType.Decimal: // Dont store decimal as double ... loses precision
          _sql.Bind_Text(this, index, Convert.ToDecimal(obj, CultureInfo.CurrentCulture).ToString(CultureInfo.InvariantCulture));
          break;
        default:
          _sql.Bind_Text(this, index, obj.ToString());
          break;
      }
    }

    internal string[] TypeDefinitions







<
<
<







205
206
207
208
209
210
211



212
213
214
215
216
217
218
        case DbType.Guid:
          if (_command.Connection._binaryGuid == true)
            _sql.Bind_Blob(this, index, ((Guid)obj).ToByteArray());
          else
            _sql.Bind_Text(this, index, obj.ToString());

          break;



        default:
          _sql.Bind_Text(this, index, obj.ToString());
          break;
      }
    }

    internal string[] TypeDefinitions
Changes to System.Data.SQLite/SR.Designer.cs.
1
2
3
4
5
6
7
8
9
10
11
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:2.0.50727.3053
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace System.Data.SQLite {



|







1
2
3
4
5
6
7
8
9
10
11
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:2.0.50727.1433
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace System.Data.SQLite {
Changes to System.Data.SQLite/SR.resx.
1
2
3
4
5
6
7
8
9
10
<?xml version="1.0" encoding="utf-8"?>
<root>
  <!-- 
    Microsoft ResX Schema 
    
    Version 2.0
    
    The primary goals of this format is to allow a simple XML format 
    that is mostly human readable. The generation and parsing of the 
    various data types are done through the TypeConverter classes 


|







1
2
3
4
5
6
7
8
9
10
<?xml version="1.0" encoding="utf-8"?>
<root>
	<!-- 
    Microsoft ResX Schema 
    
    Version 2.0
    
    The primary goals of this format is to allow a simple XML format 
    that is mostly human readable. The generation and parsing of the 
    various data types are done through the TypeConverter classes 
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
            : and then encoded with base64 encoding.

    mimetype: application/x-microsoft.net.object.bytearray.base64
    value   : The object must be serialized into a byte array 
            : using a System.ComponentModel.TypeConverter
            : and then encoded with base64 encoding.
    -->
  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
    <xsd:element name="root" msdata:IsDataSet="true">
      <xsd:complexType>
        <xsd:choice maxOccurs="unbounded">
          <xsd:element name="metadata">
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element name="value" type="xsd:string" minOccurs="0" />
              </xsd:sequence>
              <xsd:attribute name="name" use="required" type="xsd:string" />
              <xsd:attribute name="type" type="xsd:string" />
              <xsd:attribute name="mimetype" type="xsd:string" />
              <xsd:attribute ref="xml:space" />
            </xsd:complexType>
          </xsd:element>
          <xsd:element name="assembly">
            <xsd:complexType>
              <xsd:attribute name="alias" type="xsd:string" />
              <xsd:attribute name="name" type="xsd:string" />
            </xsd:complexType>
          </xsd:element>
          <xsd:element name="data">
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
              </xsd:sequence>
              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
              <xsd:attribute ref="xml:space" />
            </xsd:complexType>
          </xsd:element>
          <xsd:element name="resheader">
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
              </xsd:sequence>
              <xsd:attribute name="name" type="xsd:string" use="required" />
            </xsd:complexType>
          </xsd:element>
        </xsd:choice>
      </xsd:complexType>
    </xsd:element>
  </xsd:schema>
  <resheader name="resmimetype">
    <value>text/microsoft-resx</value>
  </resheader>
  <resheader name="version">
    <value>2.0</value>
  </resheader>
  <resheader name="reader">
    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
  </resheader>
  <resheader name="writer">
    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
  </resheader>
  <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
  <data name="DataTypes" type="System.Resources.ResXFileRef, System.Windows.Forms">
    <value>datatypes.xml;System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
  </data>
  <data name="Keywords" xml:space="preserve">
    <value>ALL,ALTER,AND,AS,AUTOINCREMENT,BETWEEN,BY,CASE,CHECK,COLLATE,COMMIT,CONSTRAINT,CREATE,CROSS,DEFAULT,DEFERRABLE,DELETE,DISTINCT,DROP,ELSE,ESCAPE,EXCEPT,FOREIGN,FROM,FULL,GROUP,HAVING,IN,INDEX,INNER,INSERT,INTERSECT,INTO,IS,ISNULL,JOIN,LEFT,LIMIT,NATURAL,NOT,NOTNULL,NULL,ON,OR,ORDER,OUTER,PRIMARY,REFERENCES,RIGHT,ROLLBACK,SELECT,SET,TABLE,THEN,TO,TRANSACTION,UNION,UNIQUE,UPDATE,USING,VALUES,WHEN,WHERE</value>
  </data>
  <data name="MetaDataCollections" type="System.Resources.ResXFileRef, System.Windows.Forms">
    <value>metadatacollections.xml;System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
  </data>
</root>







|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<
<
<
<
<
<
<
<
<
<
<
<
|
|
|
|
|


|
|
|
|
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107












108
109
110
111
112
113
114
115
116
117
118
            : and then encoded with base64 encoding.

    mimetype: application/x-microsoft.net.object.bytearray.base64
    value   : The object must be serialized into a byte array 
            : using a System.ComponentModel.TypeConverter
            : and then encoded with base64 encoding.
    -->
	<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
		<xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
		<xsd:element name="root" msdata:IsDataSet="true">
			<xsd:complexType>
				<xsd:choice maxOccurs="unbounded">
					<xsd:element name="metadata">
						<xsd:complexType>
							<xsd:sequence>
								<xsd:element name="value" type="xsd:string" minOccurs="0"/>
							</xsd:sequence>
							<xsd:attribute name="name" use="required" type="xsd:string"/>
							<xsd:attribute name="type" type="xsd:string"/>
							<xsd:attribute name="mimetype" type="xsd:string"/>
							<xsd:attribute ref="xml:space"/>
						</xsd:complexType>
					</xsd:element>
					<xsd:element name="assembly">
						<xsd:complexType>
							<xsd:attribute name="alias" type="xsd:string"/>
							<xsd:attribute name="name" type="xsd:string"/>
						</xsd:complexType>
					</xsd:element>
					<xsd:element name="data">
						<xsd:complexType>
							<xsd:sequence>
								<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
								<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2"/>
							</xsd:sequence>
							<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1"/>
							<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3"/>
							<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4"/>
							<xsd:attribute ref="xml:space"/>
						</xsd:complexType>
					</xsd:element>
					<xsd:element name="resheader">
						<xsd:complexType>
							<xsd:sequence>
								<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
							</xsd:sequence>
							<xsd:attribute name="name" type="xsd:string" use="required"/>
						</xsd:complexType>
					</xsd:element>
				</xsd:choice>
			</xsd:complexType>
		</xsd:element>
	</xsd:schema>












	<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
	<data name="DataTypes" type="System.Resources.ResXFileRef, System.Windows.Forms">
		<value>datatypes.xml;System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
	</data>
	<data name="Keywords" xml:space="preserve">
    <value>ALL,ALTER,AND,AS,AUTOINCREMENT,BETWEEN,BY,CASE,CHECK,COLLATE,COMMIT,CONSTRAINT,CREATE,CROSS,DEFAULT,DEFERRABLE,DELETE,DISTINCT,DROP,ELSE,ESCAPE,EXCEPT,FOREIGN,FROM,FULL,GROUP,HAVING,IN,INDEX,INNER,INSERT,INTERSECT,INTO,IS,ISNULL,JOIN,LEFT,LIMIT,NATURAL,NOT,NOTNULL,NULL,ON,OR,ORDER,OUTER,PRIMARY,REFERENCES,RIGHT,ROLLBACK,SELECT,SET,TABLE,THEN,TO,TRANSACTION,UNION,UNIQUE,UPDATE,USING,VALUES,WHEN,WHERE</value>
  </data>
	<data name="MetaDataCollections" type="System.Resources.ResXFileRef, System.Windows.Forms">
		<value>metadatacollections.xml;System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
	</data>
	<resheader name="resmimetype"><value>text/microsoft-resx</value></resheader><resheader name="version"><value>2.0</value></resheader><resheader name="reader"><value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader><resheader name="writer"><value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader></root>
Changes to System.Data.SQLite/System.Data.SQLite.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45

46

47
48




49








50



51
52


53
54


55
56
57








58
59


60
61
62
63
64
65
66
67
68
69
70
71
72
73
74






75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93

94
95
96
97
98
99
100
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProductVersion>9.0.30729</ProductVersion>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>{AC139951-261A-4463-B6FA-AEBC25283A66}</ProjectGuid>
    <OutputType>Library</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>System.Data.SQLite</RootNamespace>
    <AssemblyName>System.Data.SQLite</AssemblyName>
    <ProjectTypeGuids>{4D628B5B-2FBC-4AA6-8C16-197242AEB884};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
    <PlatformFamilyName>WindowsCE</PlatformFamilyName>
    <PlatformID>E2BECB1F-8C8C-41ba-B736-9BE7D946A398</PlatformID>
    <OSVersion>5.00</OSVersion>
    <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
    <FormFactorID>
    </FormFactorID>
    <SignAssembly>true</SignAssembly>
    <AssemblyOriginatorKeyFile>System.Data.SQLite.CF.snk</AssemblyOriginatorKeyFile>
    <DeployDirSuffix>testce</DeployDirSuffix>
    <DeployDirPrefix>%25CSIDL_PROGRAM_FILES%25</DeployDirPrefix>
    <RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent>
    <FileUpgradeFlags>
    </FileUpgradeFlags>
    <OldToolsVersion>2.0</OldToolsVersion>
    <NativePlatformName>Windows CE</NativePlatformName>
    <UpgradeBackupLocation>
    </UpgradeBackupLocation>
    <DelaySign>false</DelaySign>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>..\bin\CompactFramework\</OutputPath>
    <DefineConstants>TRACE;DEBUG;PocketPC;PLATFORM_COMPACTFRAMEWORK;USE_INTEROP_DLL</DefineConstants>
    <NoStdLib>true</NoStdLib>
    <NoConfig>true</NoConfig>
    <ErrorReport>prompt</ErrorReport>
    <FileAlignment>512</FileAlignment>
    <WarningLevel>4</WarningLevel>
    <DocumentationFile>
    </DocumentationFile>
    <GenerateSerializationAssemblies>off</GenerateSerializationAssemblies>

    <AllowUnsafeBlocks>false</AllowUnsafeBlocks>

  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">




    <DebugType>none</DebugType>








    <Optimize>true</Optimize>



    <OutputPath>..\bin\CompactFramework\</OutputPath>
    <DefineConstants>PocketPC;PLATFORM_COMPACTFRAMEWORK</DefineConstants>


    <NoStdLib>true</NoStdLib>
    <NoConfig>true</NoConfig>


    <ErrorReport>prompt</ErrorReport>
    <FileAlignment>512</FileAlignment>
    <WarningLevel>4</WarningLevel>








    <GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
    <AllowUnsafeBlocks>false</AllowUnsafeBlocks>


  </PropertyGroup>
  <ItemGroup>
    <Reference Include="mscorlib" />
    <Reference Include="System">
      <Private>False</Private>
    </Reference>
    <Reference Include="System.Data">
      <Private>False</Private>
    </Reference>
    <Reference Include="System.Xml">
      <Private>False</Private>
    </Reference>
  </ItemGroup>
  <ItemGroup>
    <Compile Include="AssemblyInfo.cs" />






    <Compile Include="SQLite3.cs" />
    <Compile Include="SQLite3_UTF16.cs" />
    <Compile Include="SQLiteBase.cs" />
    <Compile Include="SQLiteCommand.cs">
      <SubType>Component</SubType>
    </Compile>
    <Compile Include="SQLiteCommandBuilder.cs">
      <SubType>Component</SubType>
    </Compile>
    <Compile Include="SQLiteConnection.cs">
      <SubType>Component</SubType>
    </Compile>
    <Compile Include="SQLiteConnectionPool.cs" />
    <Compile Include="SQLiteConnectionStringBuilder.cs" />
    <Compile Include="SQLiteConvert.cs" />
    <Compile Include="SQLiteDataAdapter.cs">
      <SubType>Component</SubType>
    </Compile>
    <Compile Include="SQLiteDataReader.cs" />

    <Compile Include="SQLiteException.cs" />
    <Compile Include="SQLiteFactory.cs" />
    <Compile Include="SQLiteFunction.cs" />
    <Compile Include="SQLiteFunctionAttribute.cs" />
    <Compile Include="SQLiteKeyReader.cs" />
    <Compile Include="SQLiteMetaDataCollectionNames.cs" />
    <Compile Include="SQLiteParameter.cs" />




|

|




<
<
<
<

<
<

|
<
<




<


<





|
|
<
<

<




>

>


>
>
>
>

>
>
>
>
>
>
>
>

>
>
>
|
|
>
>
|
<
>
>

<
<
>
>
>
>
>
>
>
>

<
>
>


|
|
<
<
|
<
<
|
<
<



>
>
>
>
>
>



















>







1
2
3
4
5
6
7
8
9
10
11




12


13
14


15
16
17
18

19
20

21
22
23
24
25
26
27


28

29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59

60
61
62


63
64
65
66
67
68
69
70
71

72
73
74
75
76
77


78


79


80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProductVersion>9.0.30703</ProductVersion>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>{AC139952-261A-4463-B6FA-AEBC25283A66}</ProjectGuid>
    <OutputType>Library</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>System.Data.SQLite</RootNamespace>
    <AssemblyName>System.Data.SQLite</AssemblyName>




    <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>


    <SignAssembly>true</SignAssembly>
    <AssemblyOriginatorKeyFile>System.Data.SQLite.snk</AssemblyOriginatorKeyFile>


    <RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent>
    <FileUpgradeFlags>
    </FileUpgradeFlags>
    <OldToolsVersion>2.0</OldToolsVersion>

    <UpgradeBackupLocation>
    </UpgradeBackupLocation>

  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>..\bin\</OutputPath>
    <DefineConstants>TRACE;DEBUG;USE_INTEROP_DLL</DefineConstants>


    <ErrorReport>prompt</ErrorReport>

    <WarningLevel>4</WarningLevel>
    <DocumentationFile>
    </DocumentationFile>
    <GenerateSerializationAssemblies>off</GenerateSerializationAssemblies>
    <FileAlignment>512</FileAlignment>
    <AllowUnsafeBlocks>false</AllowUnsafeBlocks>
    <PlatformTarget>x86</PlatformTarget>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <DebugSymbols>false</DebugSymbols>
    <OutputPath>bin\</OutputPath>
    <DefineConstants>
    </DefineConstants>
    <DebugType>none</DebugType>
    <PlatformTarget>AnyCPU</PlatformTarget>
    <CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
    <CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
    <GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
    <ErrorReport>prompt</ErrorReport>
    <FileAlignment>512</FileAlignment>
    <DocumentationFile>..\bin\System.Data.SQLite.XML</DocumentationFile>
    <AllowUnsafeBlocks>false</AllowUnsafeBlocks>
    <Optimize>true</Optimize>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'StockDebug|AnyCPU' ">
    <DebugSymbols>true</DebugSymbols>
    <OutputPath>..\bin\ManagedOnly\</OutputPath>
    <DefineConstants>TRACE;DEBUG;USE_INTEROP_DLL;SQLITE_STANDARD</DefineConstants>
    <DebugType>full</DebugType>
    <PlatformTarget>x86</PlatformTarget>
    <CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>

    <CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
    <GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
    <ErrorReport>prompt</ErrorReport>


  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'StockRelease|AnyCPU' ">
    <OutputPath>..\bin\ManagedOnly\</OutputPath>
    <DocumentationFile>..\bin\ManagedOnly\System.Data.SQLite.XML</DocumentationFile>
    <Optimize>true</Optimize>
    <PlatformTarget>AnyCPU</PlatformTarget>
    <CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
    <CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
    <GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>

    <ErrorReport>prompt</ErrorReport>
    <DefineConstants>SQLITE_STANDARD</DefineConstants>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="System" />
    <Reference Include="System.Data" />


    <Reference Include="System.Transactions" />


    <Reference Include="System.Xml" />


  </ItemGroup>
  <ItemGroup>
    <Compile Include="AssemblyInfo.cs" />
    <Compile Include="LINQ\SQLiteConnection_Linq.cs">
      <SubType>Component</SubType>
    </Compile>
    <Compile Include="LINQ\SQLiteFactory_Linq.cs">
      <SubType>Code</SubType>
    </Compile>
    <Compile Include="SQLite3.cs" />
    <Compile Include="SQLite3_UTF16.cs" />
    <Compile Include="SQLiteBase.cs" />
    <Compile Include="SQLiteCommand.cs">
      <SubType>Component</SubType>
    </Compile>
    <Compile Include="SQLiteCommandBuilder.cs">
      <SubType>Component</SubType>
    </Compile>
    <Compile Include="SQLiteConnection.cs">
      <SubType>Component</SubType>
    </Compile>
    <Compile Include="SQLiteConnectionPool.cs" />
    <Compile Include="SQLiteConnectionStringBuilder.cs" />
    <Compile Include="SQLiteConvert.cs" />
    <Compile Include="SQLiteDataAdapter.cs">
      <SubType>Component</SubType>
    </Compile>
    <Compile Include="SQLiteDataReader.cs" />
    <Compile Include="SQLiteEnlistment.cs" />
    <Compile Include="SQLiteException.cs" />
    <Compile Include="SQLiteFactory.cs" />
    <Compile Include="SQLiteFunction.cs" />
    <Compile Include="SQLiteFunctionAttribute.cs" />
    <Compile Include="SQLiteKeyReader.cs" />
    <Compile Include="SQLiteMetaDataCollectionNames.cs" />
    <Compile Include="SQLiteParameter.cs" />
120
121
122
123
124
125
126





127
128
129
130
131
132
133
134
135
136

137
138

139
140
141
142
143
144
  </ItemGroup>
  <ItemGroup>
    <None Include="DataTypes.xml" />
  </ItemGroup>
  <ItemGroup>
    <None Include="MetaDataCollections.xml" />
  </ItemGroup>





  <ItemGroup>
    <Folder Include="Properties\" />
  </ItemGroup>
  <Import Condition="'$(TargetFrameworkVersion)' == 'v1.0'" Project="$(MSBuildBinPath)\Microsoft.CompactFramework.CSharp.v1.targets" />
  <Import Condition="'$(TargetFrameworkVersion)' == 'v2.0'" Project="$(MSBuildBinPath)\Microsoft.CompactFramework.CSharp.targets" />
  <ProjectExtensions>
    <VisualStudio>
      <FlavorProperties GUID="{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}">
        <HostingProcess disable="1" />
      </FlavorProperties>

    </VisualStudio>
  </ProjectExtensions>

  <PropertyGroup>
    <PostBuildEvent>
    </PostBuildEvent>
  </PropertyGroup>
  <Import Condition="'$(TargetFrameworkVersion)' == 'v3.5'" Project="$(MSBuildBinPath)\Microsoft.CompactFramework.CSharp.targets" />
</Project>







>
>
>
>
>



|
|
|
<
<
|
|
>
|
<
>

|
<

<

135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152


153
154
155
156

157
158
159

160

161
  </ItemGroup>
  <ItemGroup>
    <None Include="DataTypes.xml" />
  </ItemGroup>
  <ItemGroup>
    <None Include="MetaDataCollections.xml" />
  </ItemGroup>
  <ItemGroup>
    <EmbeddedResource Include="SQLiteCommand.bmp" />
    <EmbeddedResource Include="SQLiteConnection.bmp" />
    <EmbeddedResource Include="SQLiteDataAdapter.bmp" />
  </ItemGroup>
  <ItemGroup>
    <Folder Include="Properties\" />
  </ItemGroup>
  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
       Other similar extension points exist, see Microsoft.Common.targets.


  <Target Name="BeforeBuild">
  </Target>
  <Target Name="AfterBuild">
  </Target>

  -->
  <PropertyGroup>
    <PostBuildEvent>"$(SolutionDir)bin\tools\mergebin.exe" /p:"$(TargetPath)" &gt;"$(SolutionDir)SQLite.Interop\merge_full.h"</PostBuildEvent>

  </PropertyGroup>

</Project>
Changes to System.Data.SQLite/UnsafeNativeMethods.cs.
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39

#if !PLATFORM_COMPACTFRAMEWORK
  [SuppressUnmanagedCodeSecurity]
#endif
  internal static class UnsafeNativeMethods
  {
#if !SQLITE_STANDARD

#if !USE_INTEROP_DLL

#if !PLATFORM_COMPACTFRAMEWORK
    private const string SQLITE_DLL = "System.Data.SQLite.DLL";
#else
    internal const string SQLITE_DLL = "SQLite.Interop.059.DLL";
#endif // PLATFORM_COMPACTFRAMEWORK

#else
    private const string SQLITE_DLL = "SQLite.Interop.DLL";
#endif // USE_INTEROP_DLL

#else
    private const string SQLITE_DLL = "sqlite3";
#endif

    // This section uses interop calls that also fetch text length to optimize conversion.  
    // When using the standard dll, we can replace these calls with normal sqlite calls and do unoptimized conversions instead afterwards
    #region interop added textlength calls







<

<
<


<
<
<
<

|
<







13
14
15
16
17
18
19

20


21
22




23
24

25
26
27
28
29
30
31

#if !PLATFORM_COMPACTFRAMEWORK
  [SuppressUnmanagedCodeSecurity]
#endif
  internal static class UnsafeNativeMethods
  {
#if !SQLITE_STANDARD

#if !USE_INTEROP_DLL


    private const string SQLITE_DLL = "System.Data.SQLite.DLL";
#else




    private const string SQLITE_DLL = "SQLite.Interop.DLL";
#endif

#else
    private const string SQLITE_DLL = "sqlite3";
#endif

    // This section uses interop calls that also fetch text length to optimize conversion.  
    // When using the standard dll, we can replace these calls with normal sqlite calls and do unoptimized conversions instead afterwards
    #region interop added textlength calls
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
    internal static extern int sqlite3_open_interop(byte[] utf8Filename, int flags, out IntPtr db);

    [DllImport(SQLITE_DLL)]
    internal static extern int sqlite3_open16_interop(byte[] utf8Filename, int flags, out IntPtr db);

    [DllImport(SQLITE_DLL)]
    internal static extern int sqlite3_reset_interop(IntPtr stmt);

    [DllImport(SQLITE_DLL)]
    internal static extern int sqlite3_initialize_interop();

#endif

    #endregion

    // The standard api call equivalents of the above interop calls
    #region standard versions of interop functions








<
<
<
<







106
107
108
109
110
111
112




113
114
115
116
117
118
119
    internal static extern int sqlite3_open_interop(byte[] utf8Filename, int flags, out IntPtr db);

    [DllImport(SQLITE_DLL)]
    internal static extern int sqlite3_open16_interop(byte[] utf8Filename, int flags, out IntPtr db);

    [DllImport(SQLITE_DLL)]
    internal static extern int sqlite3_reset_interop(IntPtr stmt);




#endif

    #endregion

    // The standard api call equivalents of the above interop calls
    #region standard versions of interop functions

Deleted bin/CompactFramework/SQLite.Interop.059.DLL.

cannot compute difference between binary files

Deleted bin/CompactFramework/SQLite.Interop.059.exp.

cannot compute difference between binary files

Deleted bin/CompactFramework/SQLite.Interop.059.lib.

cannot compute difference between binary files

Changes to bin/CompactFramework/System.Data.SQLite.DLL.

cannot compute difference between binary files

Added bin/CompactFramework/System.Data.SQLite.lib.

cannot compute difference between binary files

Changes to bin/CompactFramework/testce.exe.

cannot compute difference between binary files

Changes to bin/Designer/SQLite.Designer.dll.

cannot compute difference between binary files

Added bin/Designer/SQLite.Designer.pdb.

cannot compute difference between binary files

Added bin/Designer/System.Data.SQLite.Linq.dll.

cannot compute difference between binary files

Added bin/Designer/System.Data.SQLite.Linq.pdb.

cannot compute difference between binary files

Changes to bin/Designer/install.exe.

cannot compute difference between binary files

Added bin/Designer/install.pdb.

cannot compute difference between binary files

Changes to bin/ManagedOnly/System.Data.SQLite.dll.

cannot compute difference between binary files

Changes to bin/System.Data.SQLite.dll.

cannot compute difference between binary files

Changes to bin/System.Data.SQLite.lib.

cannot compute difference between binary files

Changes to bin/itanium/System.Data.SQLite.DLL.

cannot compute difference between binary files

Changes to bin/itanium/System.Data.SQLite.lib.

cannot compute difference between binary files

Changes to bin/test.exe.

cannot compute difference between binary files

Changes to bin/x64/System.Data.SQLite.DLL.

cannot compute difference between binary files

Changes to bin/x64/System.Data.SQLite.lib.

cannot compute difference between binary files

Changes to readme.htm.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title></title>
  </head>
  <body>
    ADO.NET 2.0/3.5 SQLite Data Provider<br>
    Version 1.0.59.0 September 22, 2008<br>
    Using SQLite 3.6.3<br>
    Written by Robert Simpson (<a href="mailto:robert@blackcastlesoft.com">robert@blackcastlesoft.com</a>)<br>
    Released to the public domain, use at your own risk!<br>
    Official provider website:&nbsp; <a href="http://sqlite.phxsoftware.com">http://sqlite.phxsoftware.com</a><br />
    <br>
    The latest version can be downloaded <a href="http://sourceforge.net/projects/sqlite-dotnet2">
      here</a>
    <br>






|
|
|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title></title>
  </head>
  <body>
    ADO.NET 2.0 SQLite Data Provider<br>
    Version 1.0.56.0 August 11, 2008<br>
    Using SQLite 3.6.1<br>
    Written by Robert Simpson (<a href="mailto:robert@blackcastlesoft.com">robert@blackcastlesoft.com</a>)<br>
    Released to the public domain, use at your own risk!<br>
    Official provider website:&nbsp; <a href="http://sqlite.phxsoftware.com">http://sqlite.phxsoftware.com</a><br />
    <br>
    The latest version can be downloaded <a href="http://sourceforge.net/projects/sqlite-dotnet2">
      here</a>
    <br>
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
      Visual Studio 2005/2008 Design-Time Support, works with all versions of VS2005/2008,
        including
      all Express Editions of VS2005.&nbsp; You can add a SQLite 
      database to the Servers list, design queries with the Query Designer, 
      drag-and-drop tables onto a Typed DataSet, etc.<LI>
        Full SQLite schema editing inside Visual Studio.&nbsp;
        You can create/edit tables, views, triggers, indexes, check constraints and foreign keys.<LI>
      Single file redistributable (except on Compact Framework).&nbsp; The core sqlite3 codebase and the ADO.NET wrapper 
      are combined into one multi-module assembly.
      <LI>
              Binaries included for Itanium, x64, x86 and ARM processors.<LI>
      DbProviderFactory support.
      <LI>
        Full support for ATTACH'ed databases.&nbsp; Exposed as <I>Catalogs</I>
      in the schema.&nbsp; When cloning a connection, all attached databases are 







|







38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
      Visual Studio 2005/2008 Design-Time Support, works with all versions of VS2005/2008,
        including
      all Express Editions of VS2005.&nbsp; You can add a SQLite 
      database to the Servers list, design queries with the Query Designer, 
      drag-and-drop tables onto a Typed DataSet, etc.<LI>
        Full SQLite schema editing inside Visual Studio.&nbsp;
        You can create/edit tables, views, triggers, indexes, check constraints and foreign keys.<LI>
      Single file redistributable.&nbsp; The core sqlite3 codebase and the ADO.NET wrapper 
      are combined into one multi-module assembly.
      <LI>
              Binaries included for Itanium, x64, x86 and ARM processors.<LI>
      DbProviderFactory support.
      <LI>
        Full support for ATTACH'ed databases.&nbsp; Exposed as <I>Catalogs</I>
      in the schema.&nbsp; When cloning a connection, all attached databases are 
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
        attributes in an assembly, therefore all user-defined collating sequences and 
        functions must be explicitly registered.</STRONG>&nbsp; See the <STRONG>testce</STRONG>
      sample application for an example of how to explicitly register user-defined 
      collating sequences and functions.</p>
    <h2>
      <b><A name="redist"></A>Distributing The SQLite Engine and ADO.NET Assembly</b></h2>
    <P>
      On the desktop, only the <STRONG>System.Data.SQLite.DLL</STRONG> file needs to be distributed with your 
      application(s).&nbsp; This DLL contains both the managed wrapper and the native 
      SQLite3 codebase.&nbsp; For the Compact Framework, you will have to distribute 
      both the CF version of System.Data.SQLite.DLL, as well as the 
      SQLite.Interop.XXX.DLL.&nbsp; This is a breaking change as of 1.0.59.0.&nbsp; 
      Recent Windows Mobile frameworks are not supporting the mixed CF assembly I was 
      building prior to this version.</P>
    <H2><B>Development Notes Regarding the SQLite 3 Source Code</B></H2>
    <p>
      The core sqlite engine is compiled directly from the unmodified source code available
      at the sqlite.org website.&nbsp; Several additional pieces are compiled on top of
      it to extend its functionality, but the core engine's source is not changed.</p>
    <p></p>
    <p>
      <b>Version History</b></p>
    <p><b>1.0.59.0 - September 22, 2008</b></p>
    <ul>
      <li>Code merge with SQLite 3.6.3.&nbsp; Solves 
        a couple different EF issues that were either giving inconsistent results or 
        crashing the engine.</li>
      <li>Fixed the parsing of literal binaries in the EF SqlGen code.&nbsp; SQLite now 
        passes nearly all the testcases in 
        <a href="http://sqlite.phxsoftware.com/forums/p/1377/5921.aspx#5921">Microsoft's EF Query Samples</a> application -- 
        the exception being the <i>datetimeoffset </i>and<i> time</i> constants tests, and tests 
        that use the <i>APPLY </i>keyword which are unsupported for now.</li>
      <li>Revamped the Compact Framework mixed-mode assembly.&nbsp; Tired of playing cat 
        and mouse with the Compact Framework&#39;s support for mixed-mode assemblies.&nbsp; 
        The CF build now requires that you distribute both the System.Data.SQLite 
        library and the paired SQLite.Interop.XXX library.&nbsp;&nbsp; The XXX denotes 
        the build number of the library.</li>
      <li>Implemented a workaround for Vista&#39;s overzealous caching by turning off 
        FILE_FLAG_RANDOM_ACCESS for OS versions above XP.&nbsp; This is implemented 
        as a custom (default override) VFS in the interop.c file, so no changes are made 
        to the SQLite source code.</li>
      <li>Fixed some registry issues in the designer install.exe, which prevented some 
        design-time stuff from working on the Compact Framework when .NET 3.5 was 
        installed.</li>
    </ul>
    <p><b>1.0.58.0 - August 30, 2008</b></p>
    <ul>
      <li>Code merge with SQLite 3.6.2.&nbsp; If only I&#39;d waited one more day to release 
        57!&nbsp; Several LINQ issues have been resolved with this engine release 
        relating to deeply-nested subqueries that the EF SqlGen creates.</li>
      <li>The Rollback SQLiteConnection event no longer requires an open connection in 
        order to subscribe to it.&nbsp; Missed this one in the 57 release.</li>
    </ul>
    <p><b>1.0.57.0 - August 29, 2008</b></p>
    <ul>
      <li>Compiled against 3.6.1 with checkin
        <a href="http://www.sqlite.org/cvstrac/tktview?tn=3300">#3300</a> resolved, 
        which fixes an Entity Framework bug I was seeing.&nbsp; I currently have 3 other 
        tickets out on the engine, which are not yet resolved and relate to EF.</li>
      <li>Fixed decimal types to store and fetch using InvariantCulture.&nbsp; If you&#39;re 
        using decimal datatypes in your database and were affected by the 56 release, 
        please issue an UPDATE &lt;table&gt; SET &lt;column&gt; = REPLACE(&lt;column&gt;, &#39;,&#39;, &#39;.&#39;);&nbsp; 
        to fix the decimal separators.&nbsp; Apologies for not testing that more 
        thoroughly before releasing 56.</li>
      <li>Too many LINQ fixes to list.&nbsp; Fixed views so they generate, 
        fixed the LIMIT clause, implemented additional functionality and removed unnecessary code.</li>
      <li>Fixed foreign key names in the designer so viewing the SQL script on a new 
        unsaved table after renaming it in the properties toolwindow will reflect in the 
        script properly.</li>
      <li>Fixed the Update and Commit events on SQLiteConnection so they don&#39;t require 
        the connection to be opened first.</li>
      <li>Fixed userdef aggregate functions so they play nice with each other when 
        appearing multiple times in the same statement.</li>
      <li>Fixed the editing and saving of default values in the table designer.</li>
      <li>Fixed ForeignKeys schema to support multi-column foreign keys.&nbsp; Also 
        hacked support for them in the table designer, provided two foreign keys in the 
        designer have the same name and reference the same foreign table and different 
        columns.&nbsp; Will implement first-class support for this in the next release.</li>
    </ul>
    <p><b>1.0.56.0 - August 11, 2008</b></p>
    <ul>
      <li>Fixed a bug in the table designer when designing new tables, wherein you had to 
        save the table first before being able to create indexes and foreign keys.</li>
      <li>Tweaks to decimal type handling.&nbsp; The &#39;decimal&#39; type can&#39;t be represented 
        by Int64 or Double (without loss of precision) in SQLite, so we have to fudge it 
        by treating it like a string and converting it back and forth in the provider.&nbsp; 







|

|
<
<
<
<








<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







107
108
109
110
111
112
113
114
115
116




117
118
119
120
121
122
123
124

























































125
126
127
128
129
130
131
        attributes in an assembly, therefore all user-defined collating sequences and 
        functions must be explicitly registered.</STRONG>&nbsp; See the <STRONG>testce</STRONG>
      sample application for an example of how to explicitly register user-defined 
      collating sequences and functions.</p>
    <h2>
      <b><A name="redist"></A>Distributing The SQLite Engine and ADO.NET Assembly</b></h2>
    <P>
      Only the <STRONG>System.Data.SQLite.DLL</STRONG> file needs to be distributed with your 
      application(s).&nbsp; This DLL contains both the managed wrapper and the native 
      SQLite3 codebase.</P>




    <H2><B>Development Notes Regarding the SQLite 3 Source Code</B></H2>
    <p>
      The core sqlite engine is compiled directly from the unmodified source code available
      at the sqlite.org website.&nbsp; Several additional pieces are compiled on top of
      it to extend its functionality, but the core engine's source is not changed.</p>
    <p></p>
    <p>
      <b>Version History</b></p>

























































    <p><b>1.0.56.0 - August 11, 2008</b></p>
    <ul>
      <li>Fixed a bug in the table designer when designing new tables, wherein you had to 
        save the table first before being able to create indexes and foreign keys.</li>
      <li>Tweaks to decimal type handling.&nbsp; The &#39;decimal&#39; type can&#39;t be represented 
        by Int64 or Double (without loss of precision) in SQLite, so we have to fudge it 
        by treating it like a string and converting it back and forth in the provider.&nbsp; 
Changes to test/TestCases.cs.
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
      if (_fact.GetType().Name.IndexOf("SQLite", StringComparison.OrdinalIgnoreCase) == -1)
        throw new InconclusiveException("Not a SQLite database");
    }

    //[Test(Sequence = 1)]
    internal void ParseTest()
    {
      DataTable tbl = _cnn.GetSchema("ViewColumns");
      DataTable tbl2 = _cnn.GetSchema("Views");

      using (DbCommand cmd = _cnn.CreateCommand())
      {
        cmd.Parameters.Add(cmd.CreateParameter());
        cmd.Parameters[0].Value = 1;

        cmd.Parameters.Add(cmd.CreateParameter());
        cmd.Parameters[1].Value = 1;

        cmd.CommandText = "select * from sqlite_master limit ? offset ?";
        object obj = cmd.ExecuteScalar();

        cmd.CommandText = @"
CREATE TEMP TABLE A(ID INTEGER, BID INTEGER);CREATE TEMP TABLE B(ID INTEGER, MYVAL VARCHAR);
INSERT INTO A (ID, BID) VALUES(2, 1);
INSERT INTO B (ID, MYVAL) VALUES(1,'TEST');
";
        cmd.ExecuteNonQuery();
        
        cmd.CommandText = "select *, (select 1 as c from b where b.id = a.bid) from a;";
        using (DbDataReader reader = cmd.ExecuteReader())
        {
          reader.Read();
        }

        cmd.CommandText = "select a.id as aa from a where (select 1 from (select 1 where 1 = aa));";
        using (DbDataReader reader = cmd.ExecuteReader())
        {
          reader.Read();
        }
        
        cmd.CommandText = "select *, (select count(c) from (select 1 as c from b where b.id = a.bid)) from a;";
        using (DbDataReader reader = cmd.ExecuteReader())
        {
          reader.Read();
        }
      }
    }

    [Test(Sequence = 39)]
    internal void MultipleFunctions()
    {
      using (DbCommand cmd = _cnn.CreateCommand())
      {
        cmd.CommandText = "SELECT MYCOUNT(Field1), MYCOUNT(Field2) FROM TestCase";
        using (DbDataReader reader = cmd.ExecuteReader())
        {
          reader.Read();
        }
      }
    }

    [Test(Sequence = 8)]
    internal void FunctionWithCollation()







<
<
<


<
<
<
<
<
<
<
<
<













<
<
<
<
<
<



<
<
<
<
<
<
<
<
<
<
<
<
<







59
60
61
62
63
64
65



66
67









68
69
70
71
72
73
74
75
76
77
78
79
80






81
82
83













84
85
86
87
88
89
90
      if (_fact.GetType().Name.IndexOf("SQLite", StringComparison.OrdinalIgnoreCase) == -1)
        throw new InconclusiveException("Not a SQLite database");
    }

    //[Test(Sequence = 1)]
    internal void ParseTest()
    {



      using (DbCommand cmd = _cnn.CreateCommand())
      {









        cmd.CommandText = @"
CREATE TEMP TABLE A(ID INTEGER, BID INTEGER);CREATE TEMP TABLE B(ID INTEGER, MYVAL VARCHAR);
INSERT INTO A (ID, BID) VALUES(2, 1);
INSERT INTO B (ID, MYVAL) VALUES(1,'TEST');
";
        cmd.ExecuteNonQuery();
        
        cmd.CommandText = "select *, (select 1 as c from b where b.id = a.bid) from a;";
        using (DbDataReader reader = cmd.ExecuteReader())
        {
          reader.Read();
        }







        cmd.CommandText = "select *, (select count(c) from (select 1 as c from b where b.id = a.bid)) from a;";
        using (DbDataReader reader = cmd.ExecuteReader())
        {













          reader.Read();
        }
      }
    }

    [Test(Sequence = 8)]
    internal void FunctionWithCollation()
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
        if (_fact.GetType().Name.IndexOf("SQLite", StringComparison.OrdinalIgnoreCase) == -1)
          cmd.CommandText = "create table datatypetest(id bigint identity primary key, myvalue sql_variant, datetimevalue datetime, decimalvalue decimal)";
        else
          cmd.CommandText = "create table datatypetest(id integer primary key, myvalue sql_variant, datetimevalue datetime, decimalvalue decimal)";

        cmd.ExecuteNonQuery();

        System.Globalization.CultureInfo oldculture = System.Threading.Thread.CurrentThread.CurrentCulture;
        System.Globalization.CultureInfo olduiculture = System.Threading.Thread.CurrentThread.CurrentUICulture;

        // Insert using a different current culture
        System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("es-ES");
        System.Threading.Thread.CurrentThread.CurrentUICulture = System.Threading.Thread.CurrentThread.CurrentCulture;

        try
        {
          cmd.CommandText = "insert into datatypetest(myvalue, datetimevalue, decimalvalue) values(@p1,@p2,@p3)";
          DbParameter p1 = cmd.CreateParameter();
          DbParameter p2 = cmd.CreateParameter();
          DbParameter p3 = cmd.CreateParameter();

          cmd.Parameters.Add(p1);
          cmd.Parameters.Add(p2);
          cmd.Parameters.Add(p3);

          p1.ParameterName = "@p1";
          p2.ParameterName = "@p2";
          p3.ParameterName = "@p3";

          p1.Value = 1;
          p2.Value = new DateTime(1753, 1, 1);
          p3.Value = (Decimal)1.05;
          cmd.ExecuteNonQuery();

          p1.ResetDbType();
          p2.ResetDbType();
          p3.ResetDbType();

          p1.Value = "One";
          p2.Value = "2001-01-01";
          p3.Value = (Decimal)1.0;
          cmd.ExecuteNonQuery();

          p1.ResetDbType();
          p2.ResetDbType();
          p3.ResetDbType();

          p1.Value = 1.01;
          p2.Value = now;
          p3.Value = (Decimal)9.91;
          cmd.ExecuteNonQuery();

          // Read using a different current culture
          System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-US");
          System.Threading.Thread.CurrentThread.CurrentUICulture = System.Threading.Thread.CurrentThread.CurrentCulture;

          cmd.CommandText = "select myvalue, datetimevalue, decimalvalue from datatypetest";
          cmd.Parameters.Clear();
          using (DbDataReader reader = cmd.ExecuteReader())
          {
            for (int n = 0; n < 3; n++)
            {
              reader.Read();
              if (reader.GetValue(1).GetType() != reader.GetDateTime(1).GetType()) throw new Exception("DateTime type non-match");
              if (reader.GetValue(2).GetType() != reader.GetDecimal(2).GetType()) throw new Exception("Decimal type non-match");

              switch (n)
              {
                case 0:
                  if (reader.GetValue(0).GetType() != typeof(long)) throw new Exception("long type non-match");

                  if (reader.GetValue(0).Equals((long)1) == false) throw new Exception("long value non-match");
                  if (reader.GetValue(1).Equals(new DateTime(1753, 1, 1)) == false) throw new Exception(String.Format("DateTime value non-match expected {0} got {1}", new DateTime(1753, 1, 1), reader.GetValue(1)));
                  if (reader.GetValue(2).Equals((Decimal)1.05) == false) throw new Exception("Decimal value non-match");

                  if (reader.GetValue(0).Equals(reader.GetInt64(0)) == false) throw new Exception(String.Format("long value failed to match itself, {0} and {1}", reader.GetValue(0), reader.GetInt64(0)));
                  if (reader.GetValue(1).Equals(reader.GetDateTime(1)) == false) throw new Exception(String.Format("DateTime failed to match itself {0} and {1}", reader.GetValue(1), reader.GetDateTime(1)));
                  if (reader.GetValue(2).Equals(reader.GetDecimal(2)) == false) throw new Exception(String.Format("Decimal failed to match itself {0} and {1}", reader.GetValue(2), reader.GetDecimal(2)));
                  break;
                case 1:
                  if (reader.GetValue(0).GetType() != typeof(string)) throw new Exception("String type non-match");
                  if (reader.GetValue(0).Equals("One") == false) throw new Exception("String value non-match");
                  if (reader.GetValue(1).Equals(new DateTime(2001, 1, 1)) == false) throw new Exception(String.Format("DateTime value non-match expected {0} got {1}", new DateTime(2001, 1, 1), reader.GetValue(1)));
                  if (reader.GetValue(2).Equals((Decimal)1.0) == false) throw new Exception("Decimal value non-match");

                  if (reader.GetString(0) != "One") throw new Exception("String value non-match");
                  if (reader.GetValue(1).Equals(reader.GetDateTime(1)) == false) throw new Exception(String.Format("DateTime failed to match itself {0} and {1}", reader.GetValue(1), reader.GetDateTime(1)));
                  if (reader.GetValue(2).Equals(reader.GetDecimal(2)) == false) throw new Exception(String.Format("Decimal failed to match itself {0} and {1}", reader.GetValue(2), reader.GetDecimal(2)));
                  break;
                case 2:
                  if (reader.GetValue(0).GetType() != typeof(double)) throw new Exception("Double type non-match");
                  if (reader.GetValue(0).Equals(1.01) == false) throw new Exception("Double value non-match");
                  if (reader.GetValue(1).Equals(now) == false) throw new Exception(String.Format("DateTime value non-match, expected {0} got {1}", now, reader.GetValue(1)));
                  if (reader.GetValue(2).Equals((Decimal)9.91) == false) throw new Exception("Decimal value non-match");

                  if (reader.GetDouble(0) != 1.01) throw new Exception("Double value non-match");
                  if (reader.GetValue(1).Equals(reader.GetDateTime(1)) == false) throw new Exception(String.Format("DateTime failed to match itself {0} and {1}", reader.GetValue(1), reader.GetDateTime(1)));
                  if (reader.GetValue(2).Equals(reader.GetDecimal(2)) == false) throw new Exception(String.Format("Decimal failed to match itself {0} and {1}", reader.GetValue(2), reader.GetDecimal(2)));
                  break;
              }
            }
          }
        }
        finally
        {
          System.Threading.Thread.CurrentThread.CurrentCulture = oldculture;
          System.Threading.Thread.CurrentThread.CurrentUICulture = olduiculture;
        }
      }
    }

    /// <summary>
    /// This is an mean ugly test that leaves a lot of open datareaders out on many connections
    /// to see if the database can survive being cloned a lot and disposed while active readers are up.







<
<
<
<
<
<
<
<
<
|
|
|
|

|
|
|

|
|
|

|
|
|
|

|
|
|

|
|
|
|

|
|
|

|
|
|
|
<
<
<
<

|
|
|
|
|
|
|
|
|

|
|
|
|

|
|
|

|
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
|

|
|
|
|
|
|
<
<
<
<
<
<







533
534
535
536
537
538
539









540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574




575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620






621
622
623
624
625
626
627
        if (_fact.GetType().Name.IndexOf("SQLite", StringComparison.OrdinalIgnoreCase) == -1)
          cmd.CommandText = "create table datatypetest(id bigint identity primary key, myvalue sql_variant, datetimevalue datetime, decimalvalue decimal)";
        else
          cmd.CommandText = "create table datatypetest(id integer primary key, myvalue sql_variant, datetimevalue datetime, decimalvalue decimal)";

        cmd.ExecuteNonQuery();










        cmd.CommandText = "insert into datatypetest(myvalue, datetimevalue, decimalvalue) values(@p1,@p2,@p3)";
        DbParameter p1 = cmd.CreateParameter();
        DbParameter p2 = cmd.CreateParameter();
        DbParameter p3 = cmd.CreateParameter();

        cmd.Parameters.Add(p1);
        cmd.Parameters.Add(p2);
        cmd.Parameters.Add(p3);

        p1.ParameterName = "@p1";
        p2.ParameterName = "@p2";
        p3.ParameterName = "@p3";

        p1.Value = 1;
        p2.Value = new DateTime(1753, 1, 1);
        p3.Value = (Decimal)1.05;
        cmd.ExecuteNonQuery();

        p1.ResetDbType();
        p2.ResetDbType();
        p3.ResetDbType();

        p1.Value = "One";
        p2.Value = "2001-01-01";
        p3.Value = (Decimal)1.0;
        cmd.ExecuteNonQuery();

        p1.ResetDbType();
        p2.ResetDbType();
        p3.ResetDbType();

        p1.Value = 1.01;
        p2.Value = now;
        p3.Value = (Decimal)9.91;
        cmd.ExecuteNonQuery();





        cmd.CommandText = "select myvalue, datetimevalue, decimalvalue from datatypetest";
        cmd.Parameters.Clear();
        using (DbDataReader reader = cmd.ExecuteReader())
        {
          for (int n = 0; n < 3; n++)
          {
            reader.Read();
            if (reader.GetValue(1).GetType() != reader.GetDateTime(1).GetType()) throw new Exception("DateTime type non-match");
            if (reader.GetValue(2).GetType() != reader.GetDecimal(2).GetType()) throw new Exception("Decimal type non-match");

            switch (n)
            {
              case 0:
                if (reader.GetValue(0).GetType() != typeof(long)) throw new Exception("long type non-match");

                if (reader.GetValue(0).Equals((long)1) == false) throw new Exception("long value non-match");
                if (reader.GetValue(1).Equals(new DateTime(1753, 1, 1)) == false) throw new Exception(String.Format("DateTime value non-match expected {0} got {1}", new DateTime(1753, 1, 1), reader.GetValue(1)));
                if (reader.GetValue(2).Equals((Decimal)1.05) == false) throw new Exception("Decimal value non-match");

                if (reader.GetValue(0).Equals(reader.GetInt64(0)) == false) throw new Exception(String.Format("long value failed to match itself, {0} and {1}", reader.GetValue(0), reader.GetInt64(0)));
                if (reader.GetValue(1).Equals(reader.GetDateTime(1)) == false) throw new Exception(String.Format("DateTime failed to match itself {0} and {1}", reader.GetValue(1), reader.GetDateTime(1)));
                if (reader.GetValue(2).Equals(reader.GetDecimal(2)) == false) throw new Exception(String.Format("Decimal failed to match itself {0} and {1}", reader.GetValue(2), reader.GetDecimal(2)));
                break;
              case 1:
                if (reader.GetValue(0).GetType() != typeof(string)) throw new Exception("String type non-match");
                if (reader.GetValue(0).Equals("One") == false) throw new Exception("String value non-match");
                if (reader.GetValue(1).Equals(new DateTime(2001, 1, 1)) == false) throw new Exception(String.Format("DateTime value non-match expected {0} got {1}", new DateTime(2001, 1, 1), reader.GetValue(1)));
                if (reader.GetValue(2).Equals((Decimal)1.0) == false) throw new Exception("Decimal value non-match");

                if (reader.GetString(0) != "One") throw new Exception("String value non-match");
                if (reader.GetValue(1).Equals(reader.GetDateTime(1)) == false) throw new Exception(String.Format("DateTime failed to match itself {0} and {1}", reader.GetValue(1), reader.GetDateTime(1)));
                if (reader.GetValue(2).Equals(reader.GetDecimal(2)) == false) throw new Exception(String.Format("Decimal failed to match itself {0} and {1}", reader.GetValue(2), reader.GetDecimal(2)));
                break;
              case 2:
                if (reader.GetValue(0).GetType() != typeof(double)) throw new Exception("Double type non-match");
                if (reader.GetValue(0).Equals(1.01) == false) throw new Exception("Double value non-match");
                if (reader.GetValue(1).Equals(now) == false) throw new Exception(String.Format("DateTime value non-match, expected {0} got {1}", now, reader.GetValue(1)));
                if (reader.GetValue(2).Equals((Decimal)9.91) == false) throw new Exception("Decimal value non-match");

                if (reader.GetDouble(0) != 1.01) throw new Exception("Double value non-match");
                if (reader.GetValue(1).Equals(reader.GetDateTime(1)) == false) throw new Exception(String.Format("DateTime failed to match itself {0} and {1}", reader.GetValue(1), reader.GetDateTime(1)));
                if (reader.GetValue(2).Equals(reader.GetDecimal(2)) == false) throw new Exception(String.Format("Decimal failed to match itself {0} and {1}", reader.GetValue(2), reader.GetDecimal(2)));
                break;
            }
          }






        }
      }
    }

    /// <summary>
    /// This is an mean ugly test that leaves a lot of open datareaders out on many connections
    /// to see if the database can survive being cloned a lot and disposed while active readers are up.
Changes to test/TestCasesDialog.cs.
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
      using (DataTable tbl = DbProviderFactories.GetFactoryClasses())
      {
        foreach (DataRow row in tbl.Rows)
        {
          string prov = row[2].ToString();

          if (prov.IndexOf("SQLite", 0, StringComparison.OrdinalIgnoreCase) != -1
            || prov.IndexOf("SqlClient", 0, StringComparison.OrdinalIgnoreCase) != -1
            )
            _provider.Items.Add(prov);
          if (prov == "System.Data.SQLite") _provider.SelectedItem = prov;
        }
      }
      _connectionString.Text = "Data Source=Test.db3;Pooling=true;FailIfMissing=false";
    }







|







20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
      using (DataTable tbl = DbProviderFactories.GetFactoryClasses())
      {
        foreach (DataRow row in tbl.Rows)
        {
          string prov = row[2].ToString();

          if (prov.IndexOf("SQLite", 0, StringComparison.OrdinalIgnoreCase) != -1
            //|| prov.IndexOf("SqlClient", 0, StringComparison.OrdinalIgnoreCase) != -1
            )
            _provider.Items.Add(prov);
          if (prov == "System.Data.SQLite") _provider.SelectedItem = prov;
        }
      }
      _connectionString.Text = "Data Source=Test.db3;Pooling=true;FailIfMissing=false";
    }
Changes to test/test.csproj.
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
    <PlatformTarget>Itanium</PlatformTarget>
    <CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
    <CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
  </PropertyGroup>
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProductVersion>9.0.30729</ProductVersion>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>{E27B1B1E-19C0-45E8-AA74-B6E1C041A130}</ProjectGuid>
    <OutputType>WinExe</OutputType>
    <RootNamespace>test</RootNamespace>
    <AssemblyName>test</AssemblyName>
    <WarningLevel>4</WarningLevel>
    <IsWebBootstrapper>true</IsWebBootstrapper>







|







52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
    <PlatformTarget>Itanium</PlatformTarget>
    <CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
    <CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
  </PropertyGroup>
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProductVersion>9.0.30428</ProductVersion>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>{E27B1B1E-19C0-45E8-AA74-B6E1C041A130}</ProjectGuid>
    <OutputType>WinExe</OutputType>
    <RootNamespace>test</RootNamespace>
    <AssemblyName>test</AssemblyName>
    <WarningLevel>4</WarningLevel>
    <IsWebBootstrapper>true</IsWebBootstrapper>
Changes to testce/testce.csproj.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProductVersion>9.0.30729</ProductVersion>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>{B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}</ProjectGuid>
    <OutputType>WinExe</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>test</RootNamespace>
    <AssemblyName>testce</AssemblyName>
    <ProjectTypeGuids>{4D628B5B-2FBC-4AA6-8C16-197242AEB884};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
    <PlatformFamilyName>PocketPC</PlatformFamilyName>
    <PlatformID>b2c48bd2-963d-4549-9169-1fa021dce484</PlatformID>
    <OSVersion>5.02</OSVersion>
    <DeployDirSuffix>testce</DeployDirSuffix>
    <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
    <FormFactorID>
    </FormFactorID>
    <StartupObject>
    </StartupObject>
    <DeployDirPrefix>%25CSIDL_PROGRAM_FILES%25</DeployDirPrefix>
    <FileUpgradeFlags>
    </FileUpgradeFlags>
    <OldToolsVersion>2.0</OldToolsVersion>
    <NativePlatformName>Windows Mobile 6 Professional SDK</NativePlatformName>
    <UpgradeBackupLocation>
    </UpgradeBackupLocation>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>




|








|
|










|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProductVersion>9.0.30428</ProductVersion>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>{B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}</ProjectGuid>
    <OutputType>WinExe</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>test</RootNamespace>
    <AssemblyName>testce</AssemblyName>
    <ProjectTypeGuids>{4D628B5B-2FBC-4AA6-8C16-197242AEB884};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
    <PlatformFamilyName>PocketPC</PlatformFamilyName>
    <PlatformID>3C41C503-53EF-4c2a-8DD4-A8217CAD115E</PlatformID>
    <OSVersion>4.20</OSVersion>
    <DeployDirSuffix>testce</DeployDirSuffix>
    <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
    <FormFactorID>
    </FormFactorID>
    <StartupObject>
    </StartupObject>
    <DeployDirPrefix>%25CSIDL_PROGRAM_FILES%25</DeployDirPrefix>
    <FileUpgradeFlags>
    </FileUpgradeFlags>
    <OldToolsVersion>2.0</OldToolsVersion>
    <NativePlatformName>Pocket PC 2003</NativePlatformName>
    <UpgradeBackupLocation>
    </UpgradeBackupLocation>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
Changes to testlinq/App.Config.
1
2
3
4
5
6
7
8
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <connectionStrings>
    <add name="northwindEntities" connectionString="metadata=res://*/NorthwindModel.csdl|res://*/NorthwindModel.ssdl|res://*/NorthwindModel.msl;provider=System.Data.SQLite;provider connection string=&quot;data source=c:\src\sqlite.net\testlinq\northwind.db&quot;" providerName="System.Data.EntityClient" />
    <add name="northwindEntities1" connectionString="metadata=res://*/Model1.csdl|res://*/Model1.ssdl|res://*/Model1.msl;provider=System.Data.SQLite;provider connection string=&quot;data source=c:\src\sqlite.net\testlinq\northwind.db&quot;" providerName="System.Data.EntityClient" />
    <add name="northwindEFEntities" connectionString="metadata=res://*/NorthwindModel.csdl|res://*/NorthwindModel.ssdl|res://*/NorthwindModel.msl;provider=System.Data.SQLite;provider connection string=&quot;data source=C:\Src\SQLite.NET\testlinq\northwindEF.db&quot;" providerName="System.Data.EntityClient" />
  </connectionStrings>
</configuration>




<
<


1
2
3
4


5
6
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <connectionStrings>
    <add name="northwindEntities" connectionString="metadata=res://*/NorthwindModel.csdl|res://*/NorthwindModel.ssdl|res://*/NorthwindModel.msl;provider=System.Data.SQLite;provider connection string=&quot;data source=c:\src\sqlite.net\testlinq\northwind.db&quot;" providerName="System.Data.EntityClient" />


  </connectionStrings>
</configuration>
Changes to testlinq/NorthwindModel.Designer.cs.
1
2
3
4
5
6
7
8
9
10
11
12
13
14

15
16

17
18

19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71















72
73
74
75
76
77
78
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:2.0.50727.3053
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

[assembly: global::System.Data.Objects.DataClasses.EdmSchemaAttribute()]
[assembly: global::System.Data.Objects.DataClasses.EdmRelationshipAttribute("northwindEFModel", "FK_Products_CategoryID_CategoryID", "Categories", global::System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(testlinq.Categories), "Products", global::System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(testlinq.Products))]
[assembly: global::System.Data.Objects.DataClasses.EdmRelationshipAttribute("northwindEFModel", "FK_Orders_CustomerID_CustomerID", "Customers", global::System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(testlinq.Customers), "Orders", global::System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(testlinq.Orders))]
[assembly: global::System.Data.Objects.DataClasses.EdmRelationshipAttribute("northwindEFModel", "FK_InternationalOrders_OrderID_OrderID", "Orders", global::System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(testlinq.Orders), "InternationalOrders", global::System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(testlinq.InternationalOrders))]

[assembly: global::System.Data.Objects.DataClasses.EdmRelationshipAttribute("northwindEFModel", "FK_OrderDetails_OrderID_OrderID", "Orders", global::System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(testlinq.Orders), "OrderDetails", global::System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(testlinq.OrderDetails))]
[assembly: global::System.Data.Objects.DataClasses.EdmRelationshipAttribute("northwindEFModel", "FK_OrderDetails_ProductID_ProductID", "Products", global::System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(testlinq.Products), "OrderDetails", global::System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(testlinq.OrderDetails))]

[assembly: global::System.Data.Objects.DataClasses.EdmRelationshipAttribute("northwindEFModel", "FK_Products_SupplierID_SupplierID", "Suppliers", global::System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(testlinq.Suppliers), "Products", global::System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(testlinq.Products))]
[assembly: global::System.Data.Objects.DataClasses.EdmRelationshipAttribute("northwindEFModel", "FK_Territories_RegionID_RegionID", "Regions", global::System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(testlinq.Regions), "Territories", global::System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(testlinq.Territories))]

[assembly: global::System.Data.Objects.DataClasses.EdmRelationshipAttribute("northwindEFModel", "EmployeesTerritories", "Employees", global::System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(testlinq.Employees), "Territories", global::System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(testlinq.Territories))]

// Original file name:
// Generation date: 8/25/2008 8:54:05 AM
namespace testlinq
{
    
    /// <summary>
    /// There are no comments for northwindEFEntities in the schema.
    /// </summary>
    public partial class northwindEFEntities : global::System.Data.Objects.ObjectContext
    {
        /// <summary>
        /// Initializes a new northwindEFEntities object using the connection string found in the 'northwindEFEntities' section of the application configuration file.
        /// </summary>
        public northwindEFEntities() : 
                base("name=northwindEFEntities", "northwindEFEntities")
        {
            this.OnContextCreated();
        }
        /// <summary>
        /// Initialize a new northwindEFEntities object.
        /// </summary>
        public northwindEFEntities(string connectionString) : 
                base(connectionString, "northwindEFEntities")
        {
            this.OnContextCreated();
        }
        /// <summary>
        /// Initialize a new northwindEFEntities object.
        /// </summary>
        public northwindEFEntities(global::System.Data.EntityClient.EntityConnection connection) : 
                base(connection, "northwindEFEntities")
        {
            this.OnContextCreated();
        }
        partial void OnContextCreated();
        /// <summary>
        /// There are no comments for Categories in the schema.
        /// </summary>
        public global::System.Data.Objects.ObjectQuery<Categories> Categories
        {
            get
            {
                if ((this._Categories == null))
                {
                    this._Categories = base.CreateQuery<Categories>("[Categories]");
                }
                return this._Categories;
            }
        }
        private global::System.Data.Objects.ObjectQuery<Categories> _Categories;
        /// <summary>















        /// There are no comments for Customers in the schema.
        /// </summary>
        public global::System.Data.Objects.ObjectQuery<Customers> Customers
        {
            get
            {
                if ((this._Customers == null))











|
|
|
>
|
|
>
|
|
>
|


|




|

|


|

|
|




|

|
|




|

|
|




















>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:2.0.50727.3053
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

[assembly: global::System.Data.Objects.DataClasses.EdmSchemaAttribute()]
[assembly: global::System.Data.Objects.DataClasses.EdmRelationshipAttribute("northwindModel", "FK_Products_CategoryID_CategoryID", "Categories", global::System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(testlinq.Categories), "Products", global::System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(testlinq.Products))]
[assembly: global::System.Data.Objects.DataClasses.EdmRelationshipAttribute("northwindModel", "FK_Orders_CustomerID_CustomerID", "Customers", global::System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(testlinq.Customers), "Orders", global::System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(testlinq.Orders))]
[assembly: global::System.Data.Objects.DataClasses.EdmRelationshipAttribute("northwindModel", "FK_Employees_ReportsTo_EmployeeID", "Employees", global::System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(testlinq.Employees), "Employees1", global::System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(testlinq.Employees))]
[assembly: global::System.Data.Objects.DataClasses.EdmRelationshipAttribute("northwindModel", "FK_Orders_EmployeeID_EmployeeID", "Employees", global::System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(testlinq.Employees), "Orders", global::System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(testlinq.Orders))]
[assembly: global::System.Data.Objects.DataClasses.EdmRelationshipAttribute("northwindModel", "FK_Order_Details_OrderID_OrderID", "Orders", global::System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(testlinq.Orders), "Order_Details", global::System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(testlinq.Order_Details))]
[assembly: global::System.Data.Objects.DataClasses.EdmRelationshipAttribute("northwindModel", "FK_Order_Details_ProductID_ProductID", "Products", global::System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(testlinq.Products), "Order_Details", global::System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(testlinq.Order_Details))]
[assembly: global::System.Data.Objects.DataClasses.EdmRelationshipAttribute("northwindModel", "FK_Orders_ShipVia_ShipperID", "Shippers", global::System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(testlinq.Shippers), "Orders", global::System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(testlinq.Orders))]
[assembly: global::System.Data.Objects.DataClasses.EdmRelationshipAttribute("northwindModel", "FK_Products_SupplierID_SupplierID", "Suppliers", global::System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(testlinq.Suppliers), "Products", global::System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(testlinq.Products))]
[assembly: global::System.Data.Objects.DataClasses.EdmRelationshipAttribute("northwindModel", "FK_Territories_RegionID_RegionID", "Region", global::System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(testlinq.Region), "Territories", global::System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(testlinq.Territories))]
[assembly: global::System.Data.Objects.DataClasses.EdmRelationshipAttribute("northwindModel", "CustomerCustomerDemo", "Customers", global::System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(testlinq.Customers), "CustomerDemographics", global::System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(testlinq.CustomerDemographics))]
[assembly: global::System.Data.Objects.DataClasses.EdmRelationshipAttribute("northwindModel", "EmployeeTerritories", "Employees", global::System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(testlinq.Employees), "Territories", global::System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(testlinq.Territories))]

// Original file name:
// Generation date: 8/11/2008 1:35:38 PM
namespace testlinq
{
    
    /// <summary>
    /// There are no comments for northwindEntities in the schema.
    /// </summary>
    public partial class northwindEntities : global::System.Data.Objects.ObjectContext
    {
        /// <summary>
        /// Initializes a new northwindEntities object using the connection string found in the 'northwindEntities' section of the application configuration file.
        /// </summary>
        public northwindEntities() : 
                base("name=northwindEntities", "northwindEntities")
        {
            this.OnContextCreated();
        }
        /// <summary>
        /// Initialize a new northwindEntities object.
        /// </summary>
        public northwindEntities(string connectionString) : 
                base(connectionString, "northwindEntities")
        {
            this.OnContextCreated();
        }
        /// <summary>
        /// Initialize a new northwindEntities object.
        /// </summary>
        public northwindEntities(global::System.Data.EntityClient.EntityConnection connection) : 
                base(connection, "northwindEntities")
        {
            this.OnContextCreated();
        }
        partial void OnContextCreated();
        /// <summary>
        /// There are no comments for Categories in the schema.
        /// </summary>
        public global::System.Data.Objects.ObjectQuery<Categories> Categories
        {
            get
            {
                if ((this._Categories == null))
                {
                    this._Categories = base.CreateQuery<Categories>("[Categories]");
                }
                return this._Categories;
            }
        }
        private global::System.Data.Objects.ObjectQuery<Categories> _Categories;
        /// <summary>
        /// There are no comments for CustomerDemographics in the schema.
        /// </summary>
        public global::System.Data.Objects.ObjectQuery<CustomerDemographics> CustomerDemographics
        {
            get
            {
                if ((this._CustomerDemographics == null))
                {
                    this._CustomerDemographics = base.CreateQuery<CustomerDemographics>("[CustomerDemographics]");
                }
                return this._CustomerDemographics;
            }
        }
        private global::System.Data.Objects.ObjectQuery<CustomerDemographics> _CustomerDemographics;
        /// <summary>
        /// There are no comments for Customers in the schema.
        /// </summary>
        public global::System.Data.Objects.ObjectQuery<Customers> Customers
        {
            get
            {
                if ((this._Customers == null))
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190















191
192
193
194
195
196
197
                    this._Employees = base.CreateQuery<Employees>("[Employees]");
                }
                return this._Employees;
            }
        }
        private global::System.Data.Objects.ObjectQuery<Employees> _Employees;
        /// <summary>
        /// There are no comments for InternationalOrders in the schema.
        /// </summary>
        public global::System.Data.Objects.ObjectQuery<InternationalOrders> InternationalOrders
        {
            get
            {
                if ((this._InternationalOrders == null))
                {
                    this._InternationalOrders = base.CreateQuery<InternationalOrders>("[InternationalOrders]");
                }
                return this._InternationalOrders;
            }
        }
        private global::System.Data.Objects.ObjectQuery<InternationalOrders> _InternationalOrders;
        /// <summary>
        /// There are no comments for OrderDetails in the schema.
        /// </summary>
        public global::System.Data.Objects.ObjectQuery<OrderDetails> OrderDetails
        {
            get
            {
                if ((this._OrderDetails == null))
                {
                    this._OrderDetails = base.CreateQuery<OrderDetails>("[OrderDetails]");
                }
                return this._OrderDetails;
            }
        }
        private global::System.Data.Objects.ObjectQuery<OrderDetails> _OrderDetails;
        /// <summary>
        /// There are no comments for Orders in the schema.
        /// </summary>
        public global::System.Data.Objects.ObjectQuery<Orders> Orders
        {
            get
            {
                if ((this._Orders == null))
                {
                    this._Orders = base.CreateQuery<Orders>("[Orders]");
                }
                return this._Orders;
            }
        }
        private global::System.Data.Objects.ObjectQuery<Orders> _Orders;
        /// <summary>
        /// There are no comments for PreviousEmployees in the schema.
        /// </summary>
        public global::System.Data.Objects.ObjectQuery<PreviousEmployees> PreviousEmployees
        {
            get
            {
                if ((this._PreviousEmployees == null))
                {
                    this._PreviousEmployees = base.CreateQuery<PreviousEmployees>("[PreviousEmployees]");
                }
                return this._PreviousEmployees;
            }
        }
        private global::System.Data.Objects.ObjectQuery<PreviousEmployees> _PreviousEmployees;
        /// <summary>
        /// There are no comments for Products in the schema.
        /// </summary>
        public global::System.Data.Objects.ObjectQuery<Products> Products
        {
            get
            {
                if ((this._Products == null))
                {
                    this._Products = base.CreateQuery<Products>("[Products]");
                }
                return this._Products;
            }
        }
        private global::System.Data.Objects.ObjectQuery<Products> _Products;
        /// <summary>
        /// There are no comments for Regions in the schema.
        /// </summary>
        public global::System.Data.Objects.ObjectQuery<Regions> Regions
        {
            get
            {
                if ((this._Regions == null))
                {
                    this._Regions = base.CreateQuery<Regions>("[Regions]");
                }
                return this._Regions;
            }
        }
        private global::System.Data.Objects.ObjectQuery<Regions> _Regions;















        /// <summary>
        /// There are no comments for Suppliers in the schema.
        /// </summary>
        public global::System.Data.Objects.ObjectQuery<Suppliers> Suppliers
        {
            get
            {







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|

|



|

|

|


|
















<
<
<
<
<
<
<
<
<
<
<
<
<
<
<















|

|



|

|

|


|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







113
114
115
116
117
118
119















120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149















150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
                    this._Employees = base.CreateQuery<Employees>("[Employees]");
                }
                return this._Employees;
            }
        }
        private global::System.Data.Objects.ObjectQuery<Employees> _Employees;
        /// <summary>















        /// There are no comments for Order_Details in the schema.
        /// </summary>
        public global::System.Data.Objects.ObjectQuery<Order_Details> Order_Details
        {
            get
            {
                if ((this._Order_Details == null))
                {
                    this._Order_Details = base.CreateQuery<Order_Details>("[Order_Details]");
                }
                return this._Order_Details;
            }
        }
        private global::System.Data.Objects.ObjectQuery<Order_Details> _Order_Details;
        /// <summary>
        /// There are no comments for Orders in the schema.
        /// </summary>
        public global::System.Data.Objects.ObjectQuery<Orders> Orders
        {
            get
            {
                if ((this._Orders == null))
                {
                    this._Orders = base.CreateQuery<Orders>("[Orders]");
                }
                return this._Orders;
            }
        }
        private global::System.Data.Objects.ObjectQuery<Orders> _Orders;
        /// <summary>















        /// There are no comments for Products in the schema.
        /// </summary>
        public global::System.Data.Objects.ObjectQuery<Products> Products
        {
            get
            {
                if ((this._Products == null))
                {
                    this._Products = base.CreateQuery<Products>("[Products]");
                }
                return this._Products;
            }
        }
        private global::System.Data.Objects.ObjectQuery<Products> _Products;
        /// <summary>
        /// There are no comments for Region in the schema.
        /// </summary>
        public global::System.Data.Objects.ObjectQuery<Region> Region
        {
            get
            {
                if ((this._Region == null))
                {
                    this._Region = base.CreateQuery<Region>("[Region]");
                }
                return this._Region;
            }
        }
        private global::System.Data.Objects.ObjectQuery<Region> _Region;
        /// <summary>
        /// There are no comments for Shippers in the schema.
        /// </summary>
        public global::System.Data.Objects.ObjectQuery<Shippers> Shippers
        {
            get
            {
                if ((this._Shippers == null))
                {
                    this._Shippers = base.CreateQuery<Shippers>("[Shippers]");
                }
                return this._Shippers;
            }
        }
        private global::System.Data.Objects.ObjectQuery<Shippers> _Shippers;
        /// <summary>
        /// There are no comments for Suppliers in the schema.
        /// </summary>
        public global::System.Data.Objects.ObjectQuery<Suppliers> Suppliers
        {
            get
            {
221
222
223
224
225
226
227







228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282







283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
        /// <summary>
        /// There are no comments for Categories in the schema.
        /// </summary>
        public void AddToCategories(Categories categories)
        {
            base.AddObject("Categories", categories);
        }







        /// <summary>
        /// There are no comments for Customers in the schema.
        /// </summary>
        public void AddToCustomers(Customers customers)
        {
            base.AddObject("Customers", customers);
        }
        /// <summary>
        /// There are no comments for Employees in the schema.
        /// </summary>
        public void AddToEmployees(Employees employees)
        {
            base.AddObject("Employees", employees);
        }
        /// <summary>
        /// There are no comments for InternationalOrders in the schema.
        /// </summary>
        public void AddToInternationalOrders(InternationalOrders internationalOrders)
        {
            base.AddObject("InternationalOrders", internationalOrders);
        }
        /// <summary>
        /// There are no comments for OrderDetails in the schema.
        /// </summary>
        public void AddToOrderDetails(OrderDetails orderDetails)
        {
            base.AddObject("OrderDetails", orderDetails);
        }
        /// <summary>
        /// There are no comments for Orders in the schema.
        /// </summary>
        public void AddToOrders(Orders orders)
        {
            base.AddObject("Orders", orders);
        }
        /// <summary>
        /// There are no comments for PreviousEmployees in the schema.
        /// </summary>
        public void AddToPreviousEmployees(PreviousEmployees previousEmployees)
        {
            base.AddObject("PreviousEmployees", previousEmployees);
        }
        /// <summary>
        /// There are no comments for Products in the schema.
        /// </summary>
        public void AddToProducts(Products products)
        {
            base.AddObject("Products", products);
        }
        /// <summary>
        /// There are no comments for Regions in the schema.
        /// </summary>
        public void AddToRegions(Regions regions)
        {
            base.AddObject("Regions", regions);







        }
        /// <summary>
        /// There are no comments for Suppliers in the schema.
        /// </summary>
        public void AddToSuppliers(Suppliers suppliers)
        {
            base.AddObject("Suppliers", suppliers);
        }
        /// <summary>
        /// There are no comments for Territories in the schema.
        /// </summary>
        public void AddToTerritories(Territories territories)
        {
            base.AddObject("Territories", territories);
        }
    }
    /// <summary>
    /// There are no comments for northwindEFModel.Categories in the schema.
    /// </summary>
    /// <KeyProperties>
    /// CategoryID
    /// </KeyProperties>
    [global::System.Data.Objects.DataClasses.EdmEntityTypeAttribute(NamespaceName="northwindEFModel", Name="Categories")]
    [global::System.Runtime.Serialization.DataContractAttribute(IsReference=true)]
    [global::System.Serializable()]
    public partial class Categories : global::System.Data.Objects.DataClasses.EntityObject
    {
        /// <summary>
        /// Create a new Categories object.
        /// </summary>







>
>
>
>
>
>
>















<
<
<
<
<
<
<
|

|

|








<
<
<
<
<
<
<








|

|

|
>
>
>
>
>
>
>

















|




|







224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252







253
254
255
256
257
258
259
260
261
262
263
264
265







266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
        /// <summary>
        /// There are no comments for Categories in the schema.
        /// </summary>
        public void AddToCategories(Categories categories)
        {
            base.AddObject("Categories", categories);
        }
        /// <summary>
        /// There are no comments for CustomerDemographics in the schema.
        /// </summary>
        public void AddToCustomerDemographics(CustomerDemographics customerDemographics)
        {
            base.AddObject("CustomerDemographics", customerDemographics);
        }
        /// <summary>
        /// There are no comments for Customers in the schema.
        /// </summary>
        public void AddToCustomers(Customers customers)
        {
            base.AddObject("Customers", customers);
        }
        /// <summary>
        /// There are no comments for Employees in the schema.
        /// </summary>
        public void AddToEmployees(Employees employees)
        {
            base.AddObject("Employees", employees);
        }
        /// <summary>







        /// There are no comments for Order_Details in the schema.
        /// </summary>
        public void AddToOrder_Details(Order_Details order_Details)
        {
            base.AddObject("Order_Details", order_Details);
        }
        /// <summary>
        /// There are no comments for Orders in the schema.
        /// </summary>
        public void AddToOrders(Orders orders)
        {
            base.AddObject("Orders", orders);
        }







        /// <summary>
        /// There are no comments for Products in the schema.
        /// </summary>
        public void AddToProducts(Products products)
        {
            base.AddObject("Products", products);
        }
        /// <summary>
        /// There are no comments for Region in the schema.
        /// </summary>
        public void AddToRegion(Region region)
        {
            base.AddObject("Region", region);
        }
        /// <summary>
        /// There are no comments for Shippers in the schema.
        /// </summary>
        public void AddToShippers(Shippers shippers)
        {
            base.AddObject("Shippers", shippers);
        }
        /// <summary>
        /// There are no comments for Suppliers in the schema.
        /// </summary>
        public void AddToSuppliers(Suppliers suppliers)
        {
            base.AddObject("Suppliers", suppliers);
        }
        /// <summary>
        /// There are no comments for Territories in the schema.
        /// </summary>
        public void AddToTerritories(Territories territories)
        {
            base.AddObject("Territories", territories);
        }
    }
    /// <summary>
    /// There are no comments for northwindModel.Categories in the schema.
    /// </summary>
    /// <KeyProperties>
    /// CategoryID
    /// </KeyProperties>
    [global::System.Data.Objects.DataClasses.EdmEntityTypeAttribute(NamespaceName="northwindModel", Name="Categories")]
    [global::System.Runtime.Serialization.DataContractAttribute(IsReference=true)]
    [global::System.Serializable()]
    public partial class Categories : global::System.Data.Objects.DataClasses.EntityObject
    {
        /// <summary>
        /// Create a new Categories object.
        /// </summary>
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425

























































































426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
        }
        private byte[] _Picture;
        partial void OnPictureChanging(byte[] value);
        partial void OnPictureChanged();
        /// <summary>
        /// There are no comments for Products in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmRelationshipNavigationPropertyAttribute("northwindEFModel", "FK_Products_CategoryID_CategoryID", "Products")]
        [global::System.Xml.Serialization.XmlIgnoreAttribute()]
        [global::System.Xml.Serialization.SoapIgnoreAttribute()]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public global::System.Data.Objects.DataClasses.EntityCollection<Products> Products
        {
            get
            {
                return ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedCollection<Products>("northwindEFModel.FK_Products_CategoryID_CategoryID", "Products");

























































































            }
            set
            {
                if ((value != null))
                {
                    ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.InitializeRelatedCollection<Products>("northwindEFModel.FK_Products_CategoryID_CategoryID", "Products", value);
                }
            }
        }
    }
    /// <summary>
    /// There are no comments for northwindEFModel.Customers in the schema.
    /// </summary>
    /// <KeyProperties>
    /// CustomerID
    /// </KeyProperties>
    [global::System.Data.Objects.DataClasses.EdmEntityTypeAttribute(NamespaceName="northwindEFModel", Name="Customers")]
    [global::System.Runtime.Serialization.DataContractAttribute(IsReference=true)]
    [global::System.Serializable()]
    public partial class Customers : global::System.Data.Objects.DataClasses.EntityObject
    {
        /// <summary>
        /// Create a new Customers object.
        /// </summary>







|







|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>





|





|




|







413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
        }
        private byte[] _Picture;
        partial void OnPictureChanging(byte[] value);
        partial void OnPictureChanged();
        /// <summary>
        /// There are no comments for Products in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmRelationshipNavigationPropertyAttribute("northwindModel", "FK_Products_CategoryID_CategoryID", "Products")]
        [global::System.Xml.Serialization.XmlIgnoreAttribute()]
        [global::System.Xml.Serialization.SoapIgnoreAttribute()]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public global::System.Data.Objects.DataClasses.EntityCollection<Products> Products
        {
            get
            {
                return ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedCollection<Products>("northwindModel.FK_Products_CategoryID_CategoryID", "Products");
            }
            set
            {
                if ((value != null))
                {
                    ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.InitializeRelatedCollection<Products>("northwindModel.FK_Products_CategoryID_CategoryID", "Products", value);
                }
            }
        }
    }
    /// <summary>
    /// There are no comments for northwindModel.CustomerDemographics in the schema.
    /// </summary>
    /// <KeyProperties>
    /// CustomerTypeID
    /// </KeyProperties>
    [global::System.Data.Objects.DataClasses.EdmEntityTypeAttribute(NamespaceName="northwindModel", Name="CustomerDemographics")]
    [global::System.Runtime.Serialization.DataContractAttribute(IsReference=true)]
    [global::System.Serializable()]
    public partial class CustomerDemographics : global::System.Data.Objects.DataClasses.EntityObject
    {
        /// <summary>
        /// Create a new CustomerDemographics object.
        /// </summary>
        /// <param name="customerTypeID">Initial value of CustomerTypeID.</param>
        public static CustomerDemographics CreateCustomerDemographics(string customerTypeID)
        {
            CustomerDemographics customerDemographics = new CustomerDemographics();
            customerDemographics.CustomerTypeID = customerTypeID;
            return customerDemographics;
        }
        /// <summary>
        /// There are no comments for Property CustomerTypeID in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public string CustomerTypeID
        {
            get
            {
                return this._CustomerTypeID;
            }
            set
            {
                this.OnCustomerTypeIDChanging(value);
                this.ReportPropertyChanging("CustomerTypeID");
                this._CustomerTypeID = global::System.Data.Objects.DataClasses.StructuralObject.SetValidValue(value, false);
                this.ReportPropertyChanged("CustomerTypeID");
                this.OnCustomerTypeIDChanged();
            }
        }
        private string _CustomerTypeID;
        partial void OnCustomerTypeIDChanging(string value);
        partial void OnCustomerTypeIDChanged();
        /// <summary>
        /// There are no comments for Property CustomerDesc in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmScalarPropertyAttribute()]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public string CustomerDesc
        {
            get
            {
                return this._CustomerDesc;
            }
            set
            {
                this.OnCustomerDescChanging(value);
                this.ReportPropertyChanging("CustomerDesc");
                this._CustomerDesc = global::System.Data.Objects.DataClasses.StructuralObject.SetValidValue(value, true);
                this.ReportPropertyChanged("CustomerDesc");
                this.OnCustomerDescChanged();
            }
        }
        private string _CustomerDesc;
        partial void OnCustomerDescChanging(string value);
        partial void OnCustomerDescChanged();
        /// <summary>
        /// There are no comments for Customers in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmRelationshipNavigationPropertyAttribute("northwindModel", "CustomerCustomerDemo", "Customers")]
        [global::System.Xml.Serialization.XmlIgnoreAttribute()]
        [global::System.Xml.Serialization.SoapIgnoreAttribute()]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public global::System.Data.Objects.DataClasses.EntityCollection<Customers> Customers
        {
            get
            {
                return ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedCollection<Customers>("northwindModel.CustomerCustomerDemo", "Customers");
            }
            set
            {
                if ((value != null))
                {
                    ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.InitializeRelatedCollection<Customers>("northwindModel.CustomerCustomerDemo", "Customers", value);
                }
            }
        }
    }
    /// <summary>
    /// There are no comments for northwindModel.Customers in the schema.
    /// </summary>
    /// <KeyProperties>
    /// CustomerID
    /// </KeyProperties>
    [global::System.Data.Objects.DataClasses.EdmEntityTypeAttribute(NamespaceName="northwindModel", Name="Customers")]
    [global::System.Runtime.Serialization.DataContractAttribute(IsReference=true)]
    [global::System.Serializable()]
    public partial class Customers : global::System.Data.Objects.DataClasses.EntityObject
    {
        /// <summary>
        /// Create a new Customers object.
        /// </summary>
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723





















724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
        }
        private string _Fax;
        partial void OnFaxChanging(string value);
        partial void OnFaxChanged();
        /// <summary>
        /// There are no comments for Orders in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmRelationshipNavigationPropertyAttribute("northwindEFModel", "FK_Orders_CustomerID_CustomerID", "Orders")]
        [global::System.Xml.Serialization.XmlIgnoreAttribute()]
        [global::System.Xml.Serialization.SoapIgnoreAttribute()]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public global::System.Data.Objects.DataClasses.EntityCollection<Orders> Orders
        {
            get
            {
                return ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedCollection<Orders>("northwindEFModel.FK_Orders_CustomerID_CustomerID", "Orders");





















            }
            set
            {
                if ((value != null))
                {
                    ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.InitializeRelatedCollection<Orders>("northwindEFModel.FK_Orders_CustomerID_CustomerID", "Orders", value);
                }
            }
        }
    }
    /// <summary>
    /// There are no comments for northwindEFModel.Employees in the schema.
    /// </summary>
    /// <KeyProperties>
    /// EmployeeID
    /// </KeyProperties>
    [global::System.Data.Objects.DataClasses.EdmEntityTypeAttribute(NamespaceName="northwindEFModel", Name="Employees")]
    [global::System.Runtime.Serialization.DataContractAttribute(IsReference=true)]
    [global::System.Serializable()]
    public partial class Employees : global::System.Data.Objects.DataClasses.EntityObject
    {
        /// <summary>
        /// Create a new Employees object.
        /// </summary>







|







|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>





|





|




|







800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
        }
        private string _Fax;
        partial void OnFaxChanging(string value);
        partial void OnFaxChanged();
        /// <summary>
        /// There are no comments for Orders in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmRelationshipNavigationPropertyAttribute("northwindModel", "FK_Orders_CustomerID_CustomerID", "Orders")]
        [global::System.Xml.Serialization.XmlIgnoreAttribute()]
        [global::System.Xml.Serialization.SoapIgnoreAttribute()]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public global::System.Data.Objects.DataClasses.EntityCollection<Orders> Orders
        {
            get
            {
                return ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedCollection<Orders>("northwindModel.FK_Orders_CustomerID_CustomerID", "Orders");
            }
            set
            {
                if ((value != null))
                {
                    ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.InitializeRelatedCollection<Orders>("northwindModel.FK_Orders_CustomerID_CustomerID", "Orders", value);
                }
            }
        }
        /// <summary>
        /// There are no comments for CustomerDemographics in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmRelationshipNavigationPropertyAttribute("northwindModel", "CustomerCustomerDemo", "CustomerDemographics")]
        [global::System.Xml.Serialization.XmlIgnoreAttribute()]
        [global::System.Xml.Serialization.SoapIgnoreAttribute()]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public global::System.Data.Objects.DataClasses.EntityCollection<CustomerDemographics> CustomerDemographics
        {
            get
            {
                return ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedCollection<CustomerDemographics>("northwindModel.CustomerCustomerDemo", "CustomerDemographics");
            }
            set
            {
                if ((value != null))
                {
                    ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.InitializeRelatedCollection<CustomerDemographics>("northwindModel.CustomerCustomerDemo", "CustomerDemographics", value);
                }
            }
        }
    }
    /// <summary>
    /// There are no comments for northwindModel.Employees in the schema.
    /// </summary>
    /// <KeyProperties>
    /// EmployeeID
    /// </KeyProperties>
    [global::System.Data.Objects.DataClasses.EdmEntityTypeAttribute(NamespaceName="northwindModel", Name="Employees")]
    [global::System.Runtime.Serialization.DataContractAttribute(IsReference=true)]
    [global::System.Serializable()]
    public partial class Employees : global::System.Data.Objects.DataClasses.EntityObject
    {
        /// <summary>
        /// Create a new Employees object.
        /// </summary>
1143
1144
1145
1146
1147
1148
1149
1150















































































1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
                this.ReportPropertyChanged("PhotoPath");
                this.OnPhotoPathChanged();
            }
        }
        private string _PhotoPath;
        partial void OnPhotoPathChanging(string value);
        partial void OnPhotoPathChanged();
        /// <summary>















































































        /// There are no comments for Territories in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmRelationshipNavigationPropertyAttribute("northwindEFModel", "EmployeesTerritories", "Territories")]
        [global::System.Xml.Serialization.XmlIgnoreAttribute()]
        [global::System.Xml.Serialization.SoapIgnoreAttribute()]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public global::System.Data.Objects.DataClasses.EntityCollection<Territories> Territories
        {
            get
            {
                return ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedCollection<Territories>("northwindEFModel.EmployeesTerritories", "Territories");
            }
            set
            {
                if ((value != null))
                {
                    ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.InitializeRelatedCollection<Territories>("northwindEFModel.EmployeesTerritories", "Territories", value);
                }
            }
        }
    }
    /// <summary>
    /// There are no comments for northwindEFModel.InternationalOrders in the schema.
    /// </summary>
    /// <KeyProperties>
    /// OrderID
    /// </KeyProperties>
    [global::System.Data.Objects.DataClasses.EdmEntityTypeAttribute(NamespaceName="northwindEFModel", Name="InternationalOrders")]
    [global::System.Runtime.Serialization.DataContractAttribute(IsReference=true)]
    [global::System.Serializable()]
    public partial class InternationalOrders : global::System.Data.Objects.DataClasses.EntityObject
    {
        /// <summary>
        /// Create a new InternationalOrders object.
        /// </summary>
        /// <param name="orderID">Initial value of OrderID.</param>
        /// <param name="customsDescription">Initial value of CustomsDescription.</param>
        /// <param name="exciseTax">Initial value of ExciseTax.</param>
        public static InternationalOrders CreateInternationalOrders(long orderID, string customsDescription, decimal exciseTax)
        {
            InternationalOrders internationalOrders = new InternationalOrders();
            internationalOrders.OrderID = orderID;
            internationalOrders.CustomsDescription = customsDescription;
            internationalOrders.ExciseTax = exciseTax;
            return internationalOrders;
        }
        /// <summary>
        /// There are no comments for Property OrderID in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public long OrderID
        {
            get
            {
                return this._OrderID;
            }
            set
            {
                this.OnOrderIDChanging(value);
                this.ReportPropertyChanging("OrderID");
                this._OrderID = global::System.Data.Objects.DataClasses.StructuralObject.SetValidValue(value);
                this.ReportPropertyChanged("OrderID");
                this.OnOrderIDChanged();
            }
        }
        private long _OrderID;
        partial void OnOrderIDChanging(long value);
        partial void OnOrderIDChanged();
        /// <summary>
        /// There are no comments for Property CustomsDescription in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmScalarPropertyAttribute(IsNullable=false)]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public string CustomsDescription
        {
            get
            {
                return this._CustomsDescription;
            }
            set
            {
                this.OnCustomsDescriptionChanging(value);
                this.ReportPropertyChanging("CustomsDescription");
                this._CustomsDescription = global::System.Data.Objects.DataClasses.StructuralObject.SetValidValue(value, false);
                this.ReportPropertyChanged("CustomsDescription");
                this.OnCustomsDescriptionChanged();
            }
        }
        private string _CustomsDescription;
        partial void OnCustomsDescriptionChanging(string value);
        partial void OnCustomsDescriptionChanged();
        /// <summary>
        /// There are no comments for Property ExciseTax in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmScalarPropertyAttribute(IsNullable=false)]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public decimal ExciseTax
        {
            get
            {
                return this._ExciseTax;
            }
            set
            {
                this.OnExciseTaxChanging(value);
                this.ReportPropertyChanging("ExciseTax");
                this._ExciseTax = global::System.Data.Objects.DataClasses.StructuralObject.SetValidValue(value);
                this.ReportPropertyChanged("ExciseTax");
                this.OnExciseTaxChanged();
            }
        }
        private decimal _ExciseTax;
        partial void OnExciseTaxChanging(decimal value);
        partial void OnExciseTaxChanged();
        /// <summary>
        /// There are no comments for Orders in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmRelationshipNavigationPropertyAttribute("northwindEFModel", "FK_InternationalOrders_OrderID_OrderID", "Orders")]
        [global::System.Xml.Serialization.XmlIgnoreAttribute()]
        [global::System.Xml.Serialization.SoapIgnoreAttribute()]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public Orders Orders
        {
            get
            {
                return ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedReference<Orders>("northwindEFModel.FK_InternationalOrders_OrderID_OrderID", "Orders").Value;
            }
            set
            {
                ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedReference<Orders>("northwindEFModel.FK_InternationalOrders_OrderID_OrderID", "Orders").Value = value;
            }
        }
        /// <summary>
        /// There are no comments for Orders in the schema.
        /// </summary>
        [global::System.ComponentModel.BrowsableAttribute(false)]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public global::System.Data.Objects.DataClasses.EntityReference<Orders> OrdersReference
        {
            get
            {
                return ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedReference<Orders>("northwindEFModel.FK_InternationalOrders_OrderID_OrderID", "Orders");
            }
            set
            {
                if ((value != null))
                {
                    ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.InitializeRelatedReference<Orders>("northwindEFModel.FK_InternationalOrders_OrderID_OrderID", "Orders", value);
                }
            }
        }
    }
    /// <summary>
    /// There are no comments for northwindEFModel.OrderDetails in the schema.
    /// </summary>
    /// <KeyProperties>
    /// OrderID
    /// ProductID
    /// </KeyProperties>
    [global::System.Data.Objects.DataClasses.EdmEntityTypeAttribute(NamespaceName="northwindEFModel", Name="OrderDetails")]
    [global::System.Runtime.Serialization.DataContractAttribute(IsReference=true)]
    [global::System.Serializable()]
    public partial class OrderDetails : global::System.Data.Objects.DataClasses.EntityObject
    {
        /// <summary>
        /// Create a new OrderDetails object.
        /// </summary>
        /// <param name="orderID">Initial value of OrderID.</param>
        /// <param name="productID">Initial value of ProductID.</param>
        /// <param name="unitPrice">Initial value of UnitPrice.</param>
        /// <param name="quantity">Initial value of Quantity.</param>
        /// <param name="discount">Initial value of Discount.</param>
        public static OrderDetails CreateOrderDetails(long orderID, long productID, decimal unitPrice, short quantity, float discount)
        {
            OrderDetails orderDetails = new OrderDetails();
            orderDetails.OrderID = orderID;
            orderDetails.ProductID = productID;
            orderDetails.UnitPrice = unitPrice;
            orderDetails.Quantity = quantity;
            orderDetails.Discount = discount;
            return orderDetails;
        }
        /// <summary>
        /// There are no comments for Property OrderID in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public long OrderID








>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>


|







|





|





<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|





|


|


|






|

|
|
|
|
|
|
|







1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364




































































































































1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
                this.ReportPropertyChanged("PhotoPath");
                this.OnPhotoPathChanged();
            }
        }
        private string _PhotoPath;
        partial void OnPhotoPathChanging(string value);
        partial void OnPhotoPathChanged();
        /// <summary>
        /// There are no comments for Employees1 in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmRelationshipNavigationPropertyAttribute("northwindModel", "FK_Employees_ReportsTo_EmployeeID", "Employees1")]
        [global::System.Xml.Serialization.XmlIgnoreAttribute()]
        [global::System.Xml.Serialization.SoapIgnoreAttribute()]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public global::System.Data.Objects.DataClasses.EntityCollection<Employees> Employees1
        {
            get
            {
                return ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedCollection<Employees>("northwindModel.FK_Employees_ReportsTo_EmployeeID", "Employees1");
            }
            set
            {
                if ((value != null))
                {
                    ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.InitializeRelatedCollection<Employees>("northwindModel.FK_Employees_ReportsTo_EmployeeID", "Employees1", value);
                }
            }
        }
        /// <summary>
        /// There are no comments for Employees2 in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmRelationshipNavigationPropertyAttribute("northwindModel", "FK_Employees_ReportsTo_EmployeeID", "Employees")]
        [global::System.Xml.Serialization.XmlIgnoreAttribute()]
        [global::System.Xml.Serialization.SoapIgnoreAttribute()]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public Employees Employees2
        {
            get
            {
                return ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedReference<Employees>("northwindModel.FK_Employees_ReportsTo_EmployeeID", "Employees").Value;
            }
            set
            {
                ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedReference<Employees>("northwindModel.FK_Employees_ReportsTo_EmployeeID", "Employees").Value = value;
            }
        }
        /// <summary>
        /// There are no comments for Employees2 in the schema.
        /// </summary>
        [global::System.ComponentModel.BrowsableAttribute(false)]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public global::System.Data.Objects.DataClasses.EntityReference<Employees> Employees2Reference
        {
            get
            {
                return ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedReference<Employees>("northwindModel.FK_Employees_ReportsTo_EmployeeID", "Employees");
            }
            set
            {
                if ((value != null))
                {
                    ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.InitializeRelatedReference<Employees>("northwindModel.FK_Employees_ReportsTo_EmployeeID", "Employees", value);
                }
            }
        }
        /// <summary>
        /// There are no comments for Orders in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmRelationshipNavigationPropertyAttribute("northwindModel", "FK_Orders_EmployeeID_EmployeeID", "Orders")]
        [global::System.Xml.Serialization.XmlIgnoreAttribute()]
        [global::System.Xml.Serialization.SoapIgnoreAttribute()]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public global::System.Data.Objects.DataClasses.EntityCollection<Orders> Orders
        {
            get
            {
                return ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedCollection<Orders>("northwindModel.FK_Orders_EmployeeID_EmployeeID", "Orders");
            }
            set
            {
                if ((value != null))
                {
                    ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.InitializeRelatedCollection<Orders>("northwindModel.FK_Orders_EmployeeID_EmployeeID", "Orders", value);
                }
            }
        }
        /// <summary>
        /// There are no comments for Territories in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmRelationshipNavigationPropertyAttribute("northwindModel", "EmployeeTerritories", "Territories")]
        [global::System.Xml.Serialization.XmlIgnoreAttribute()]
        [global::System.Xml.Serialization.SoapIgnoreAttribute()]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public global::System.Data.Objects.DataClasses.EntityCollection<Territories> Territories
        {
            get
            {
                return ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedCollection<Territories>("northwindModel.EmployeeTerritories", "Territories");
            }
            set
            {
                if ((value != null))
                {
                    ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.InitializeRelatedCollection<Territories>("northwindModel.EmployeeTerritories", "Territories", value);
                }
            }
        }
    }
    /// <summary>




































































































































    /// There are no comments for northwindModel.Order_Details in the schema.
    /// </summary>
    /// <KeyProperties>
    /// OrderID
    /// ProductID
    /// </KeyProperties>
    [global::System.Data.Objects.DataClasses.EdmEntityTypeAttribute(NamespaceName="northwindModel", Name="Order_Details")]
    [global::System.Runtime.Serialization.DataContractAttribute(IsReference=true)]
    [global::System.Serializable()]
    public partial class Order_Details : global::System.Data.Objects.DataClasses.EntityObject
    {
        /// <summary>
        /// Create a new Order_Details object.
        /// </summary>
        /// <param name="orderID">Initial value of OrderID.</param>
        /// <param name="productID">Initial value of ProductID.</param>
        /// <param name="unitPrice">Initial value of UnitPrice.</param>
        /// <param name="quantity">Initial value of Quantity.</param>
        /// <param name="discount">Initial value of Discount.</param>
        public static Order_Details CreateOrder_Details(long orderID, long productID, decimal unitPrice, short quantity, float discount)
        {
            Order_Details order_Details = new Order_Details();
            order_Details.OrderID = orderID;
            order_Details.ProductID = productID;
            order_Details.UnitPrice = unitPrice;
            order_Details.Quantity = quantity;
            order_Details.Discount = discount;
            return order_Details;
        }
        /// <summary>
        /// There are no comments for Property OrderID in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public long OrderID
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
        }
        private float _Discount;
        partial void OnDiscountChanging(float value);
        partial void OnDiscountChanged();
        /// <summary>
        /// There are no comments for Orders in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmRelationshipNavigationPropertyAttribute("northwindEFModel", "FK_OrderDetails_OrderID_OrderID", "Orders")]
        [global::System.Xml.Serialization.XmlIgnoreAttribute()]
        [global::System.Xml.Serialization.SoapIgnoreAttribute()]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public Orders Orders
        {
            get
            {
                return ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedReference<Orders>("northwindEFModel.FK_OrderDetails_OrderID_OrderID", "Orders").Value;
            }
            set
            {
                ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedReference<Orders>("northwindEFModel.FK_OrderDetails_OrderID_OrderID", "Orders").Value = value;
            }
        }
        /// <summary>
        /// There are no comments for Orders in the schema.
        /// </summary>
        [global::System.ComponentModel.BrowsableAttribute(false)]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public global::System.Data.Objects.DataClasses.EntityReference<Orders> OrdersReference
        {
            get
            {
                return ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedReference<Orders>("northwindEFModel.FK_OrderDetails_OrderID_OrderID", "Orders");
            }
            set
            {
                if ((value != null))
                {
                    ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.InitializeRelatedReference<Orders>("northwindEFModel.FK_OrderDetails_OrderID_OrderID", "Orders", value);
                }
            }
        }
        /// <summary>
        /// There are no comments for Products in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmRelationshipNavigationPropertyAttribute("northwindEFModel", "FK_OrderDetails_ProductID_ProductID", "Products")]
        [global::System.Xml.Serialization.XmlIgnoreAttribute()]
        [global::System.Xml.Serialization.SoapIgnoreAttribute()]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public Products Products
        {
            get
            {
                return ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedReference<Products>("northwindEFModel.FK_OrderDetails_ProductID_ProductID", "Products").Value;
            }
            set
            {
                ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedReference<Products>("northwindEFModel.FK_OrderDetails_ProductID_ProductID", "Products").Value = value;
            }
        }
        /// <summary>
        /// There are no comments for Products in the schema.
        /// </summary>
        [global::System.ComponentModel.BrowsableAttribute(false)]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public global::System.Data.Objects.DataClasses.EntityReference<Products> ProductsReference
        {
            get
            {
                return ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedReference<Products>("northwindEFModel.FK_OrderDetails_ProductID_ProductID", "Products");
            }
            set
            {
                if ((value != null))
                {
                    ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.InitializeRelatedReference<Products>("northwindEFModel.FK_OrderDetails_ProductID_ProductID", "Products", value);
                }
            }
        }
    }
    /// <summary>
    /// There are no comments for northwindEFModel.Orders in the schema.
    /// </summary>
    /// <KeyProperties>
    /// OrderID
    /// </KeyProperties>
    [global::System.Data.Objects.DataClasses.EdmEntityTypeAttribute(NamespaceName="northwindEFModel", Name="Orders")]
    [global::System.Runtime.Serialization.DataContractAttribute(IsReference=true)]
    [global::System.Serializable()]
    public partial class Orders : global::System.Data.Objects.DataClasses.EntityObject
    {
        /// <summary>
        /// Create a new Orders object.
        /// </summary>







|







|



|











|





|






|







|



|











|





|





|




|







1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
        }
        private float _Discount;
        partial void OnDiscountChanging(float value);
        partial void OnDiscountChanged();
        /// <summary>
        /// There are no comments for Orders in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmRelationshipNavigationPropertyAttribute("northwindModel", "FK_Order_Details_OrderID_OrderID", "Orders")]
        [global::System.Xml.Serialization.XmlIgnoreAttribute()]
        [global::System.Xml.Serialization.SoapIgnoreAttribute()]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public Orders Orders
        {
            get
            {
                return ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedReference<Orders>("northwindModel.FK_Order_Details_OrderID_OrderID", "Orders").Value;
            }
            set
            {
                ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedReference<Orders>("northwindModel.FK_Order_Details_OrderID_OrderID", "Orders").Value = value;
            }
        }
        /// <summary>
        /// There are no comments for Orders in the schema.
        /// </summary>
        [global::System.ComponentModel.BrowsableAttribute(false)]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public global::System.Data.Objects.DataClasses.EntityReference<Orders> OrdersReference
        {
            get
            {
                return ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedReference<Orders>("northwindModel.FK_Order_Details_OrderID_OrderID", "Orders");
            }
            set
            {
                if ((value != null))
                {
                    ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.InitializeRelatedReference<Orders>("northwindModel.FK_Order_Details_OrderID_OrderID", "Orders", value);
                }
            }
        }
        /// <summary>
        /// There are no comments for Products in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmRelationshipNavigationPropertyAttribute("northwindModel", "FK_Order_Details_ProductID_ProductID", "Products")]
        [global::System.Xml.Serialization.XmlIgnoreAttribute()]
        [global::System.Xml.Serialization.SoapIgnoreAttribute()]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public Products Products
        {
            get
            {
                return ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedReference<Products>("northwindModel.FK_Order_Details_ProductID_ProductID", "Products").Value;
            }
            set
            {
                ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedReference<Products>("northwindModel.FK_Order_Details_ProductID_ProductID", "Products").Value = value;
            }
        }
        /// <summary>
        /// There are no comments for Products in the schema.
        /// </summary>
        [global::System.ComponentModel.BrowsableAttribute(false)]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public global::System.Data.Objects.DataClasses.EntityReference<Products> ProductsReference
        {
            get
            {
                return ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedReference<Products>("northwindModel.FK_Order_Details_ProductID_ProductID", "Products");
            }
            set
            {
                if ((value != null))
                {
                    ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.InitializeRelatedReference<Products>("northwindModel.FK_Order_Details_ProductID_ProductID", "Products", value);
                }
            }
        }
    }
    /// <summary>
    /// There are no comments for northwindModel.Orders in the schema.
    /// </summary>
    /// <KeyProperties>
    /// OrderID
    /// </KeyProperties>
    [global::System.Data.Objects.DataClasses.EdmEntityTypeAttribute(NamespaceName="northwindModel", Name="Orders")]
    [global::System.Runtime.Serialization.DataContractAttribute(IsReference=true)]
    [global::System.Serializable()]
    public partial class Orders : global::System.Data.Objects.DataClasses.EntityObject
    {
        /// <summary>
        /// Create a new Orders object.
        /// </summary>
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
                this.OnOrderIDChanged();
            }
        }
        private long _OrderID;
        partial void OnOrderIDChanging(long value);
        partial void OnOrderIDChanged();
        /// <summary>
        /// There are no comments for Property EmployeeID in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmScalarPropertyAttribute()]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public global::System.Nullable<long> EmployeeID
        {
            get
            {
                return this._EmployeeID;
            }
            set
            {
                this.OnEmployeeIDChanging(value);
                this.ReportPropertyChanging("EmployeeID");
                this._EmployeeID = global::System.Data.Objects.DataClasses.StructuralObject.SetValidValue(value);
                this.ReportPropertyChanged("EmployeeID");
                this.OnEmployeeIDChanged();
            }
        }
        private global::System.Nullable<long> _EmployeeID;
        partial void OnEmployeeIDChanging(global::System.Nullable<long> value);
        partial void OnEmployeeIDChanged();
        /// <summary>
        /// There are no comments for Property OrderDate in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmScalarPropertyAttribute()]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public global::System.Nullable<global::System.DateTime> OrderDate
        {
            get







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







1622
1623
1624
1625
1626
1627
1628























1629
1630
1631
1632
1633
1634
1635
                this.OnOrderIDChanged();
            }
        }
        private long _OrderID;
        partial void OnOrderIDChanging(long value);
        partial void OnOrderIDChanged();
        /// <summary>























        /// There are no comments for Property OrderDate in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmScalarPropertyAttribute()]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public global::System.Nullable<global::System.DateTime> OrderDate
        {
            get
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848


























































1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
        }
        private string _ShipCountry;
        partial void OnShipCountryChanging(string value);
        partial void OnShipCountryChanged();
        /// <summary>
        /// There are no comments for Customers in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmRelationshipNavigationPropertyAttribute("northwindEFModel", "FK_Orders_CustomerID_CustomerID", "Customers")]
        [global::System.Xml.Serialization.XmlIgnoreAttribute()]
        [global::System.Xml.Serialization.SoapIgnoreAttribute()]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public Customers Customers
        {
            get
            {
                return ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedReference<Customers>("northwindEFModel.FK_Orders_CustomerID_CustomerID", "Customers").Value;
            }
            set
            {
                ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedReference<Customers>("northwindEFModel.FK_Orders_CustomerID_CustomerID", "Customers").Value = value;
            }
        }
        /// <summary>
        /// There are no comments for Customers in the schema.
        /// </summary>
        [global::System.ComponentModel.BrowsableAttribute(false)]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public global::System.Data.Objects.DataClasses.EntityReference<Customers> CustomersReference
        {
            get
            {
                return ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedReference<Customers>("northwindEFModel.FK_Orders_CustomerID_CustomerID", "Customers");


























































            }
            set
            {
                if ((value != null))
                {
                    ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.InitializeRelatedReference<Customers>("northwindEFModel.FK_Orders_CustomerID_CustomerID", "Customers", value);
                }
            }
        }
        /// <summary>
        /// There are no comments for InternationalOrders in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmRelationshipNavigationPropertyAttribute("northwindEFModel", "FK_InternationalOrders_OrderID_OrderID", "InternationalOrders")]
        [global::System.Xml.Serialization.XmlIgnoreAttribute()]
        [global::System.Xml.Serialization.SoapIgnoreAttribute()]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public InternationalOrders InternationalOrders
        {
            get
            {
                return ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedReference<InternationalOrders>("northwindEFModel.FK_InternationalOrders_OrderID_OrderID", "InternationalOrders").Value;
            }
            set
            {
                ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedReference<InternationalOrders>("northwindEFModel.FK_InternationalOrders_OrderID_OrderID", "InternationalOrders").Value = value;
            }
        }
        /// <summary>
        /// There are no comments for InternationalOrders in the schema.
        /// </summary>
        [global::System.ComponentModel.BrowsableAttribute(false)]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public global::System.Data.Objects.DataClasses.EntityReference<InternationalOrders> InternationalOrdersReference
        {
            get
            {
                return ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedReference<InternationalOrders>("northwindEFModel.FK_InternationalOrders_OrderID_OrderID", "InternationalOrders");
            }
            set
            {
                if ((value != null))
                {
                    ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.InitializeRelatedReference<InternationalOrders>("northwindEFModel.FK_InternationalOrders_OrderID_OrderID", "InternationalOrders", value);
                }
            }
        }
        /// <summary>
        /// There are no comments for OrderDetails in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmRelationshipNavigationPropertyAttribute("northwindEFModel", "FK_OrderDetails_OrderID_OrderID", "OrderDetails")]
        [global::System.Xml.Serialization.XmlIgnoreAttribute()]
        [global::System.Xml.Serialization.SoapIgnoreAttribute()]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public global::System.Data.Objects.DataClasses.EntityCollection<OrderDetails> OrderDetails
        {
            get
            {
                return ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedCollection<OrderDetails>("northwindEFModel.FK_OrderDetails_OrderID_OrderID", "OrderDetails");
            }
            set
            {
                if ((value != null))
                {
                    ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.InitializeRelatedCollection<OrderDetails>("northwindEFModel.FK_OrderDetails_OrderID_OrderID", "OrderDetails", value);
                }
            }
        }
    }
    /// <summary>
    /// There are no comments for northwindEFModel.PreviousEmployees in the schema.
    /// </summary>
    /// <KeyProperties>
    /// EmployeeID
    /// </KeyProperties>
    [global::System.Data.Objects.DataClasses.EdmEntityTypeAttribute(NamespaceName="northwindEFModel", Name="PreviousEmployees")]
    [global::System.Runtime.Serialization.DataContractAttribute(IsReference=true)]
    [global::System.Serializable()]
    public partial class PreviousEmployees : global::System.Data.Objects.DataClasses.EntityObject
    {
        /// <summary>
        /// Create a new PreviousEmployees object.
        /// </summary>
        /// <param name="employeeID">Initial value of EmployeeID.</param>
        /// <param name="lastName">Initial value of LastName.</param>
        /// <param name="firstName">Initial value of FirstName.</param>
        public static PreviousEmployees CreatePreviousEmployees(long employeeID, string lastName, string firstName)
        {
            PreviousEmployees previousEmployees = new PreviousEmployees();
            previousEmployees.EmployeeID = employeeID;
            previousEmployees.LastName = lastName;
            previousEmployees.FirstName = firstName;
            return previousEmployees;
        }
        /// <summary>
        /// There are no comments for Property EmployeeID in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public long EmployeeID
        {
            get
            {
                return this._EmployeeID;
            }
            set
            {
                this.OnEmployeeIDChanging(value);
                this.ReportPropertyChanging("EmployeeID");
                this._EmployeeID = global::System.Data.Objects.DataClasses.StructuralObject.SetValidValue(value);
                this.ReportPropertyChanged("EmployeeID");
                this.OnEmployeeIDChanged();
            }
        }
        private long _EmployeeID;
        partial void OnEmployeeIDChanging(long value);
        partial void OnEmployeeIDChanged();
        /// <summary>
        /// There are no comments for Property LastName in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmScalarPropertyAttribute(IsNullable=false)]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public string LastName
        {
            get
            {
                return this._LastName;
            }
            set
            {
                this.OnLastNameChanging(value);
                this.ReportPropertyChanging("LastName");
                this._LastName = global::System.Data.Objects.DataClasses.StructuralObject.SetValidValue(value, false);
                this.ReportPropertyChanged("LastName");
                this.OnLastNameChanged();
            }
        }
        private string _LastName;
        partial void OnLastNameChanging(string value);
        partial void OnLastNameChanged();
        /// <summary>
        /// There are no comments for Property FirstName in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmScalarPropertyAttribute(IsNullable=false)]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public string FirstName
        {
            get
            {
                return this._FirstName;
            }
            set
            {
                this.OnFirstNameChanging(value);
                this.ReportPropertyChanging("FirstName");
                this._FirstName = global::System.Data.Objects.DataClasses.StructuralObject.SetValidValue(value, false);
                this.ReportPropertyChanged("FirstName");
                this.OnFirstNameChanged();
            }
        }
        private string _FirstName;
        partial void OnFirstNameChanging(string value);
        partial void OnFirstNameChanged();
        /// <summary>
        /// There are no comments for Property Title in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmScalarPropertyAttribute()]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public string Title
        {
            get
            {
                return this._Title;
            }
            set
            {
                this.OnTitleChanging(value);
                this.ReportPropertyChanging("Title");
                this._Title = global::System.Data.Objects.DataClasses.StructuralObject.SetValidValue(value, true);
                this.ReportPropertyChanged("Title");
                this.OnTitleChanged();
            }
        }
        private string _Title;
        partial void OnTitleChanging(string value);
        partial void OnTitleChanged();
        /// <summary>
        /// There are no comments for Property TitleOfCourtesy in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmScalarPropertyAttribute()]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public string TitleOfCourtesy
        {
            get
            {
                return this._TitleOfCourtesy;
            }
            set
            {
                this.OnTitleOfCourtesyChanging(value);
                this.ReportPropertyChanging("TitleOfCourtesy");
                this._TitleOfCourtesy = global::System.Data.Objects.DataClasses.StructuralObject.SetValidValue(value, true);
                this.ReportPropertyChanged("TitleOfCourtesy");
                this.OnTitleOfCourtesyChanged();
            }
        }
        private string _TitleOfCourtesy;
        partial void OnTitleOfCourtesyChanging(string value);
        partial void OnTitleOfCourtesyChanged();
        /// <summary>
        /// There are no comments for Property BirthDate in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmScalarPropertyAttribute()]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public global::System.Nullable<global::System.DateTime> BirthDate
        {
            get
            {
                return this._BirthDate;
            }
            set
            {
                this.OnBirthDateChanging(value);
                this.ReportPropertyChanging("BirthDate");
                this._BirthDate = global::System.Data.Objects.DataClasses.StructuralObject.SetValidValue(value);
                this.ReportPropertyChanged("BirthDate");
                this.OnBirthDateChanged();
            }
        }
        private global::System.Nullable<global::System.DateTime> _BirthDate;
        partial void OnBirthDateChanging(global::System.Nullable<global::System.DateTime> value);
        partial void OnBirthDateChanged();
        /// <summary>
        /// There are no comments for Property HireDate in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmScalarPropertyAttribute()]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public global::System.Nullable<global::System.DateTime> HireDate
        {
            get
            {
                return this._HireDate;
            }
            set
            {
                this.OnHireDateChanging(value);
                this.ReportPropertyChanging("HireDate");
                this._HireDate = global::System.Data.Objects.DataClasses.StructuralObject.SetValidValue(value);
                this.ReportPropertyChanged("HireDate");
                this.OnHireDateChanged();
            }
        }
        private global::System.Nullable<global::System.DateTime> _HireDate;
        partial void OnHireDateChanging(global::System.Nullable<global::System.DateTime> value);
        partial void OnHireDateChanged();
        /// <summary>
        /// There are no comments for Property Address in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmScalarPropertyAttribute()]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public string Address
        {
            get
            {
                return this._Address;
            }
            set
            {
                this.OnAddressChanging(value);
                this.ReportPropertyChanging("Address");
                this._Address = global::System.Data.Objects.DataClasses.StructuralObject.SetValidValue(value, true);
                this.ReportPropertyChanged("Address");
                this.OnAddressChanged();
            }
        }
        private string _Address;
        partial void OnAddressChanging(string value);
        partial void OnAddressChanged();
        /// <summary>
        /// There are no comments for Property City in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmScalarPropertyAttribute()]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public string City
        {
            get
            {
                return this._City;
            }
            set
            {
                this.OnCityChanging(value);
                this.ReportPropertyChanging("City");
                this._City = global::System.Data.Objects.DataClasses.StructuralObject.SetValidValue(value, true);
                this.ReportPropertyChanged("City");
                this.OnCityChanged();
            }
        }
        private string _City;
        partial void OnCityChanging(string value);
        partial void OnCityChanged();
        /// <summary>
        /// There are no comments for Property Region in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmScalarPropertyAttribute()]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public string Region
        {
            get
            {
                return this._Region;
            }
            set
            {
                this.OnRegionChanging(value);
                this.ReportPropertyChanging("Region");
                this._Region = global::System.Data.Objects.DataClasses.StructuralObject.SetValidValue(value, true);
                this.ReportPropertyChanged("Region");
                this.OnRegionChanged();
            }
        }
        private string _Region;
        partial void OnRegionChanging(string value);
        partial void OnRegionChanged();
        /// <summary>
        /// There are no comments for Property PostalCode in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmScalarPropertyAttribute()]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public string PostalCode
        {
            get
            {
                return this._PostalCode;
            }
            set
            {
                this.OnPostalCodeChanging(value);
                this.ReportPropertyChanging("PostalCode");
                this._PostalCode = global::System.Data.Objects.DataClasses.StructuralObject.SetValidValue(value, true);
                this.ReportPropertyChanged("PostalCode");
                this.OnPostalCodeChanged();
            }
        }
        private string _PostalCode;
        partial void OnPostalCodeChanging(string value);
        partial void OnPostalCodeChanged();
        /// <summary>
        /// There are no comments for Property Country in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmScalarPropertyAttribute()]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public string Country
        {
            get
            {
                return this._Country;
            }
            set
            {
                this.OnCountryChanging(value);
                this.ReportPropertyChanging("Country");
                this._Country = global::System.Data.Objects.DataClasses.StructuralObject.SetValidValue(value, true);
                this.ReportPropertyChanged("Country");
                this.OnCountryChanged();
            }
        }
        private string _Country;
        partial void OnCountryChanging(string value);
        partial void OnCountryChanged();
        /// <summary>
        /// There are no comments for Property HomePhone in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmScalarPropertyAttribute()]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public string HomePhone
        {
            get
            {
                return this._HomePhone;
            }
            set
            {
                this.OnHomePhoneChanging(value);
                this.ReportPropertyChanging("HomePhone");
                this._HomePhone = global::System.Data.Objects.DataClasses.StructuralObject.SetValidValue(value, true);
                this.ReportPropertyChanged("HomePhone");
                this.OnHomePhoneChanged();
            }
        }
        private string _HomePhone;
        partial void OnHomePhoneChanging(string value);
        partial void OnHomePhoneChanged();
        /// <summary>
        /// There are no comments for Property Extension in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmScalarPropertyAttribute()]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public string Extension
        {
            get
            {
                return this._Extension;
            }
            set
            {
                this.OnExtensionChanging(value);
                this.ReportPropertyChanging("Extension");
                this._Extension = global::System.Data.Objects.DataClasses.StructuralObject.SetValidValue(value, true);
                this.ReportPropertyChanged("Extension");
                this.OnExtensionChanged();
            }
        }
        private string _Extension;
        partial void OnExtensionChanging(string value);
        partial void OnExtensionChanged();
        /// <summary>
        /// There are no comments for Property Photo in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmScalarPropertyAttribute()]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public byte[] Photo
        {
            get
            {
                return global::System.Data.Objects.DataClasses.StructuralObject.GetValidValue(this._Photo);
            }
            set
            {
                this.OnPhotoChanging(value);
                this.ReportPropertyChanging("Photo");
                this._Photo = global::System.Data.Objects.DataClasses.StructuralObject.SetValidValue(value, true);
                this.ReportPropertyChanged("Photo");
                this.OnPhotoChanged();
            }
        }
        private byte[] _Photo;
        partial void OnPhotoChanging(byte[] value);
        partial void OnPhotoChanged();
        /// <summary>
        /// There are no comments for Property Notes in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmScalarPropertyAttribute()]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public string Notes
        {
            get
            {
                return this._Notes;
            }
            set
            {
                this.OnNotesChanging(value);
                this.ReportPropertyChanging("Notes");
                this._Notes = global::System.Data.Objects.DataClasses.StructuralObject.SetValidValue(value, true);
                this.ReportPropertyChanged("Notes");
                this.OnNotesChanged();
            }
        }
        private string _Notes;
        partial void OnNotesChanging(string value);
        partial void OnNotesChanged();
        /// <summary>
        /// There are no comments for Property PhotoPath in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmScalarPropertyAttribute()]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public string PhotoPath
        {
            get
            {
                return this._PhotoPath;
            }
            set
            {
                this.OnPhotoPathChanging(value);
                this.ReportPropertyChanging("PhotoPath");
                this._PhotoPath = global::System.Data.Objects.DataClasses.StructuralObject.SetValidValue(value, true);
                this.ReportPropertyChanged("PhotoPath");
                this.OnPhotoPathChanged();
            }
        }
        private string _PhotoPath;
        partial void OnPhotoPathChanging(string value);
        partial void OnPhotoPathChanged();
    }
    /// <summary>
    /// There are no comments for northwindEFModel.Products in the schema.
    /// </summary>
    /// <KeyProperties>
    /// ProductID
    /// </KeyProperties>
    [global::System.Data.Objects.DataClasses.EdmEntityTypeAttribute(NamespaceName="northwindEFModel", Name="Products")]
    [global::System.Runtime.Serialization.DataContractAttribute(IsReference=true)]
    [global::System.Serializable()]
    public partial class Products : global::System.Data.Objects.DataClasses.EntityObject
    {
        /// <summary>
        /// Create a new Products object.
        /// </summary>







|







|



|











|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>





|




|

|



|



|



|



|



|



|





|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<





|


|

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|







1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986





















1987
1988
1989
1990
1991
1992
1993
1994
1995
1996

































































































































































































































































































































































































































1997
1998
1999
2000
2001
2002
2003
2004
        }
        private string _ShipCountry;
        partial void OnShipCountryChanging(string value);
        partial void OnShipCountryChanged();
        /// <summary>
        /// There are no comments for Customers in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmRelationshipNavigationPropertyAttribute("northwindModel", "FK_Orders_CustomerID_CustomerID", "Customers")]
        [global::System.Xml.Serialization.XmlIgnoreAttribute()]
        [global::System.Xml.Serialization.SoapIgnoreAttribute()]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public Customers Customers
        {
            get
            {
                return ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedReference<Customers>("northwindModel.FK_Orders_CustomerID_CustomerID", "Customers").Value;
            }
            set
            {
                ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedReference<Customers>("northwindModel.FK_Orders_CustomerID_CustomerID", "Customers").Value = value;
            }
        }
        /// <summary>
        /// There are no comments for Customers in the schema.
        /// </summary>
        [global::System.ComponentModel.BrowsableAttribute(false)]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public global::System.Data.Objects.DataClasses.EntityReference<Customers> CustomersReference
        {
            get
            {
                return ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedReference<Customers>("northwindModel.FK_Orders_CustomerID_CustomerID", "Customers");
            }
            set
            {
                if ((value != null))
                {
                    ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.InitializeRelatedReference<Customers>("northwindModel.FK_Orders_CustomerID_CustomerID", "Customers", value);
                }
            }
        }
        /// <summary>
        /// There are no comments for Employees in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmRelationshipNavigationPropertyAttribute("northwindModel", "FK_Orders_EmployeeID_EmployeeID", "Employees")]
        [global::System.Xml.Serialization.XmlIgnoreAttribute()]
        [global::System.Xml.Serialization.SoapIgnoreAttribute()]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public Employees Employees
        {
            get
            {
                return ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedReference<Employees>("northwindModel.FK_Orders_EmployeeID_EmployeeID", "Employees").Value;
            }
            set
            {
                ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedReference<Employees>("northwindModel.FK_Orders_EmployeeID_EmployeeID", "Employees").Value = value;
            }
        }
        /// <summary>
        /// There are no comments for Employees in the schema.
        /// </summary>
        [global::System.ComponentModel.BrowsableAttribute(false)]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public global::System.Data.Objects.DataClasses.EntityReference<Employees> EmployeesReference
        {
            get
            {
                return ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedReference<Employees>("northwindModel.FK_Orders_EmployeeID_EmployeeID", "Employees");
            }
            set
            {
                if ((value != null))
                {
                    ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.InitializeRelatedReference<Employees>("northwindModel.FK_Orders_EmployeeID_EmployeeID", "Employees", value);
                }
            }
        }
        /// <summary>
        /// There are no comments for Order_Details in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmRelationshipNavigationPropertyAttribute("northwindModel", "FK_Order_Details_OrderID_OrderID", "Order_Details")]
        [global::System.Xml.Serialization.XmlIgnoreAttribute()]
        [global::System.Xml.Serialization.SoapIgnoreAttribute()]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public global::System.Data.Objects.DataClasses.EntityCollection<Order_Details> Order_Details
        {
            get
            {
                return ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedCollection<Order_Details>("northwindModel.FK_Order_Details_OrderID_OrderID", "Order_Details");
            }
            set
            {
                if ((value != null))
                {
                    ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.InitializeRelatedCollection<Order_Details>("northwindModel.FK_Order_Details_OrderID_OrderID", "Order_Details", value);
                }
            }
        }
        /// <summary>
        /// There are no comments for Shippers in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmRelationshipNavigationPropertyAttribute("northwindModel", "FK_Orders_ShipVia_ShipperID", "Shippers")]
        [global::System.Xml.Serialization.XmlIgnoreAttribute()]
        [global::System.Xml.Serialization.SoapIgnoreAttribute()]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public Shippers Shippers
        {
            get
            {
                return ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedReference<Shippers>("northwindModel.FK_Orders_ShipVia_ShipperID", "Shippers").Value;
            }
            set
            {
                ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedReference<Shippers>("northwindModel.FK_Orders_ShipVia_ShipperID", "Shippers").Value = value;
            }
        }
        /// <summary>
        /// There are no comments for Shippers in the schema.
        /// </summary>
        [global::System.ComponentModel.BrowsableAttribute(false)]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public global::System.Data.Objects.DataClasses.EntityReference<Shippers> ShippersReference
        {
            get
            {
                return ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedReference<Shippers>("northwindModel.FK_Orders_ShipVia_ShipperID", "Shippers");
            }
            set
            {
                if ((value != null))
                {
                    ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.InitializeRelatedReference<Shippers>("northwindModel.FK_Orders_ShipVia_ShipperID", "Shippers", value);





















                }
            }
        }
    }
    /// <summary>
    /// There are no comments for northwindModel.Products in the schema.
    /// </summary>
    /// <KeyProperties>
    /// ProductID
    /// </KeyProperties>

































































































































































































































































































































































































































    [global::System.Data.Objects.DataClasses.EdmEntityTypeAttribute(NamespaceName="northwindModel", Name="Products")]
    [global::System.Runtime.Serialization.DataContractAttribute(IsReference=true)]
    [global::System.Serializable()]
    public partial class Products : global::System.Data.Objects.DataClasses.EntityObject
    {
        /// <summary>
        /// Create a new Products object.
        /// </summary>
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
                this.OnDiscontinuedChanged();
            }
        }
        private bool _Discontinued;
        partial void OnDiscontinuedChanging(bool value);
        partial void OnDiscontinuedChanged();
        /// <summary>
        /// There are no comments for Property DiscontinuedDate in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmScalarPropertyAttribute()]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public global::System.Nullable<global::System.DateTime> DiscontinuedDate
        {
            get
            {
                return this._DiscontinuedDate;
            }
            set
            {
                this.OnDiscontinuedDateChanging(value);
                this.ReportPropertyChanging("DiscontinuedDate");
                this._DiscontinuedDate = global::System.Data.Objects.DataClasses.StructuralObject.SetValidValue(value);
                this.ReportPropertyChanged("DiscontinuedDate");
                this.OnDiscontinuedDateChanged();
            }
        }
        private global::System.Nullable<global::System.DateTime> _DiscontinuedDate;
        partial void OnDiscontinuedDateChanging(global::System.Nullable<global::System.DateTime> value);
        partial void OnDiscontinuedDateChanged();
        /// <summary>
        /// There are no comments for Categories in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmRelationshipNavigationPropertyAttribute("northwindEFModel", "FK_Products_CategoryID_CategoryID", "Categories")]
        [global::System.Xml.Serialization.XmlIgnoreAttribute()]
        [global::System.Xml.Serialization.SoapIgnoreAttribute()]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public Categories Categories
        {
            get
            {
                return ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedReference<Categories>("northwindEFModel.FK_Products_CategoryID_CategoryID", "Categories").Value;
            }
            set
            {
                ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedReference<Categories>("northwindEFModel.FK_Products_CategoryID_CategoryID", "Categories").Value = value;
            }
        }
        /// <summary>
        /// There are no comments for Categories in the schema.
        /// </summary>
        [global::System.ComponentModel.BrowsableAttribute(false)]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public global::System.Data.Objects.DataClasses.EntityReference<Categories> CategoriesReference
        {
            get
            {
                return ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedReference<Categories>("northwindEFModel.FK_Products_CategoryID_CategoryID", "Categories");
            }
            set
            {
                if ((value != null))
                {
                    ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.InitializeRelatedReference<Categories>("northwindEFModel.FK_Products_CategoryID_CategoryID", "Categories", value);
                }
            }
        }
        /// <summary>
        /// There are no comments for OrderDetails in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmRelationshipNavigationPropertyAttribute("northwindEFModel", "FK_OrderDetails_ProductID_ProductID", "OrderDetails")]
        [global::System.Xml.Serialization.XmlIgnoreAttribute()]
        [global::System.Xml.Serialization.SoapIgnoreAttribute()]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public global::System.Data.Objects.DataClasses.EntityCollection<OrderDetails> OrderDetails
        {
            get
            {
                return ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedCollection<OrderDetails>("northwindEFModel.FK_OrderDetails_ProductID_ProductID", "OrderDetails");
            }
            set
            {
                if ((value != null))
                {
                    ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.InitializeRelatedCollection<OrderDetails>("northwindEFModel.FK_OrderDetails_ProductID_ProductID", "OrderDetails", value);
                }
            }
        }
        /// <summary>
        /// There are no comments for Suppliers in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmRelationshipNavigationPropertyAttribute("northwindEFModel", "FK_Products_SupplierID_SupplierID", "Suppliers")]
        [global::System.Xml.Serialization.XmlIgnoreAttribute()]
        [global::System.Xml.Serialization.SoapIgnoreAttribute()]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public Suppliers Suppliers
        {
            get
            {
                return ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedReference<Suppliers>("northwindEFModel.FK_Products_SupplierID_SupplierID", "Suppliers").Value;
            }
            set
            {
                ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedReference<Suppliers>("northwindEFModel.FK_Products_SupplierID_SupplierID", "Suppliers").Value = value;
            }
        }
        /// <summary>
        /// There are no comments for Suppliers in the schema.
        /// </summary>
        [global::System.ComponentModel.BrowsableAttribute(false)]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public global::System.Data.Objects.DataClasses.EntityReference<Suppliers> SuppliersReference
        {
            get
            {
                return ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedReference<Suppliers>("northwindEFModel.FK_Products_SupplierID_SupplierID", "Suppliers");
            }
            set
            {
                if ((value != null))
                {
                    ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.InitializeRelatedReference<Suppliers>("northwindEFModel.FK_Products_SupplierID_SupplierID", "Suppliers", value);
                }
            }
        }
    }
    /// <summary>
    /// There are no comments for northwindEFModel.Regions in the schema.
    /// </summary>
    /// <KeyProperties>
    /// RegionID
    /// </KeyProperties>
    [global::System.Data.Objects.DataClasses.EdmEntityTypeAttribute(NamespaceName="northwindEFModel", Name="Regions")]
    [global::System.Runtime.Serialization.DataContractAttribute(IsReference=true)]
    [global::System.Serializable()]
    public partial class Regions : global::System.Data.Objects.DataClasses.EntityObject
    {
        /// <summary>
        /// Create a new Regions object.
        /// </summary>
        /// <param name="regionID">Initial value of RegionID.</param>
        /// <param name="regionDescription">Initial value of RegionDescription.</param>
        public static Regions CreateRegions(long regionID, string regionDescription)
        {
            Regions regions = new Regions();
            regions.RegionID = regionID;
            regions.RegionDescription = regionDescription;
            return regions;
        }
        /// <summary>
        /// There are no comments for Property RegionID in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public long RegionID







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<


|







|



|











|





|




|

|



|



|





|






|







|



|











|





|





|




|


|


|



|

|
|
|
|







2194
2195
2196
2197
2198
2199
2200























2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
                this.OnDiscontinuedChanged();
            }
        }
        private bool _Discontinued;
        partial void OnDiscontinuedChanging(bool value);
        partial void OnDiscontinuedChanged();
        /// <summary>























        /// There are no comments for Categories in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmRelationshipNavigationPropertyAttribute("northwindModel", "FK_Products_CategoryID_CategoryID", "Categories")]
        [global::System.Xml.Serialization.XmlIgnoreAttribute()]
        [global::System.Xml.Serialization.SoapIgnoreAttribute()]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public Categories Categories
        {
            get
            {
                return ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedReference<Categories>("northwindModel.FK_Products_CategoryID_CategoryID", "Categories").Value;
            }
            set
            {
                ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedReference<Categories>("northwindModel.FK_Products_CategoryID_CategoryID", "Categories").Value = value;
            }
        }
        /// <summary>
        /// There are no comments for Categories in the schema.
        /// </summary>
        [global::System.ComponentModel.BrowsableAttribute(false)]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public global::System.Data.Objects.DataClasses.EntityReference<Categories> CategoriesReference
        {
            get
            {
                return ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedReference<Categories>("northwindModel.FK_Products_CategoryID_CategoryID", "Categories");
            }
            set
            {
                if ((value != null))
                {
                    ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.InitializeRelatedReference<Categories>("northwindModel.FK_Products_CategoryID_CategoryID", "Categories", value);
                }
            }
        }
        /// <summary>
        /// There are no comments for Order_Details in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmRelationshipNavigationPropertyAttribute("northwindModel", "FK_Order_Details_ProductID_ProductID", "Order_Details")]
        [global::System.Xml.Serialization.XmlIgnoreAttribute()]
        [global::System.Xml.Serialization.SoapIgnoreAttribute()]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public global::System.Data.Objects.DataClasses.EntityCollection<Order_Details> Order_Details
        {
            get
            {
                return ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedCollection<Order_Details>("northwindModel.FK_Order_Details_ProductID_ProductID", "Order_Details");
            }
            set
            {
                if ((value != null))
                {
                    ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.InitializeRelatedCollection<Order_Details>("northwindModel.FK_Order_Details_ProductID_ProductID", "Order_Details", value);
                }
            }
        }
        /// <summary>
        /// There are no comments for Suppliers in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmRelationshipNavigationPropertyAttribute("northwindModel", "FK_Products_SupplierID_SupplierID", "Suppliers")]
        [global::System.Xml.Serialization.XmlIgnoreAttribute()]
        [global::System.Xml.Serialization.SoapIgnoreAttribute()]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public Suppliers Suppliers
        {
            get
            {
                return ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedReference<Suppliers>("northwindModel.FK_Products_SupplierID_SupplierID", "Suppliers").Value;
            }
            set
            {
                ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedReference<Suppliers>("northwindModel.FK_Products_SupplierID_SupplierID", "Suppliers").Value = value;
            }
        }
        /// <summary>
        /// There are no comments for Suppliers in the schema.
        /// </summary>
        [global::System.ComponentModel.BrowsableAttribute(false)]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public global::System.Data.Objects.DataClasses.EntityReference<Suppliers> SuppliersReference
        {
            get
            {
                return ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedReference<Suppliers>("northwindModel.FK_Products_SupplierID_SupplierID", "Suppliers");
            }
            set
            {
                if ((value != null))
                {
                    ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.InitializeRelatedReference<Suppliers>("northwindModel.FK_Products_SupplierID_SupplierID", "Suppliers", value);
                }
            }
        }
    }
    /// <summary>
    /// There are no comments for northwindModel.Region in the schema.
    /// </summary>
    /// <KeyProperties>
    /// RegionID
    /// </KeyProperties>
    [global::System.Data.Objects.DataClasses.EdmEntityTypeAttribute(NamespaceName="northwindModel", Name="Region")]
    [global::System.Runtime.Serialization.DataContractAttribute(IsReference=true)]
    [global::System.Serializable()]
    public partial class Region : global::System.Data.Objects.DataClasses.EntityObject
    {
        /// <summary>
        /// Create a new Region object.
        /// </summary>
        /// <param name="regionID">Initial value of RegionID.</param>
        /// <param name="regionDescription">Initial value of RegionDescription.</param>
        public static Region CreateRegion(long regionID, string regionDescription)
        {
            Region region = new Region();
            region.RegionID = regionID;
            region.RegionDescription = regionDescription;
            return region;
        }
        /// <summary>
        /// There are no comments for Property RegionID in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public long RegionID
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742


















































































































2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
        }
        private string _RegionDescription;
        partial void OnRegionDescriptionChanging(string value);
        partial void OnRegionDescriptionChanged();
        /// <summary>
        /// There are no comments for Territories in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmRelationshipNavigationPropertyAttribute("northwindEFModel", "FK_Territories_RegionID_RegionID", "Territories")]
        [global::System.Xml.Serialization.XmlIgnoreAttribute()]
        [global::System.Xml.Serialization.SoapIgnoreAttribute()]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public global::System.Data.Objects.DataClasses.EntityCollection<Territories> Territories
        {
            get
            {
                return ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedCollection<Territories>("northwindEFModel.FK_Territories_RegionID_RegionID", "Territories");


















































































































            }
            set
            {
                if ((value != null))
                {
                    ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.InitializeRelatedCollection<Territories>("northwindEFModel.FK_Territories_RegionID_RegionID", "Territories", value);
                }
            }
        }
    }
    /// <summary>
    /// There are no comments for northwindEFModel.Suppliers in the schema.
    /// </summary>
    /// <KeyProperties>
    /// SupplierID
    /// </KeyProperties>
    [global::System.Data.Objects.DataClasses.EdmEntityTypeAttribute(NamespaceName="northwindEFModel", Name="Suppliers")]
    [global::System.Runtime.Serialization.DataContractAttribute(IsReference=true)]
    [global::System.Serializable()]
    public partial class Suppliers : global::System.Data.Objects.DataClasses.EntityObject
    {
        /// <summary>
        /// Create a new Suppliers object.
        /// </summary>







|







|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>





|





|




|







2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
        }
        private string _RegionDescription;
        partial void OnRegionDescriptionChanging(string value);
        partial void OnRegionDescriptionChanged();
        /// <summary>
        /// There are no comments for Territories in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmRelationshipNavigationPropertyAttribute("northwindModel", "FK_Territories_RegionID_RegionID", "Territories")]
        [global::System.Xml.Serialization.XmlIgnoreAttribute()]
        [global::System.Xml.Serialization.SoapIgnoreAttribute()]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public global::System.Data.Objects.DataClasses.EntityCollection<Territories> Territories
        {
            get
            {
                return ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedCollection<Territories>("northwindModel.FK_Territories_RegionID_RegionID", "Territories");
            }
            set
            {
                if ((value != null))
                {
                    ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.InitializeRelatedCollection<Territories>("northwindModel.FK_Territories_RegionID_RegionID", "Territories", value);
                }
            }
        }
    }
    /// <summary>
    /// There are no comments for northwindModel.Shippers in the schema.
    /// </summary>
    /// <KeyProperties>
    /// ShipperID
    /// </KeyProperties>
    [global::System.Data.Objects.DataClasses.EdmEntityTypeAttribute(NamespaceName="northwindModel", Name="Shippers")]
    [global::System.Runtime.Serialization.DataContractAttribute(IsReference=true)]
    [global::System.Serializable()]
    public partial class Shippers : global::System.Data.Objects.DataClasses.EntityObject
    {
        /// <summary>
        /// Create a new Shippers object.
        /// </summary>
        /// <param name="shipperID">Initial value of ShipperID.</param>
        /// <param name="companyName">Initial value of CompanyName.</param>
        public static Shippers CreateShippers(long shipperID, string companyName)
        {
            Shippers shippers = new Shippers();
            shippers.ShipperID = shipperID;
            shippers.CompanyName = companyName;
            return shippers;
        }
        /// <summary>
        /// There are no comments for Property ShipperID in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public long ShipperID
        {
            get
            {
                return this._ShipperID;
            }
            set
            {
                this.OnShipperIDChanging(value);
                this.ReportPropertyChanging("ShipperID");
                this._ShipperID = global::System.Data.Objects.DataClasses.StructuralObject.SetValidValue(value);
                this.ReportPropertyChanged("ShipperID");
                this.OnShipperIDChanged();
            }
        }
        private long _ShipperID;
        partial void OnShipperIDChanging(long value);
        partial void OnShipperIDChanged();
        /// <summary>
        /// There are no comments for Property CompanyName in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmScalarPropertyAttribute(IsNullable=false)]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public string CompanyName
        {
            get
            {
                return this._CompanyName;
            }
            set
            {
                this.OnCompanyNameChanging(value);
                this.ReportPropertyChanging("CompanyName");
                this._CompanyName = global::System.Data.Objects.DataClasses.StructuralObject.SetValidValue(value, false);
                this.ReportPropertyChanged("CompanyName");
                this.OnCompanyNameChanged();
            }
        }
        private string _CompanyName;
        partial void OnCompanyNameChanging(string value);
        partial void OnCompanyNameChanged();
        /// <summary>
        /// There are no comments for Property Phone in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmScalarPropertyAttribute()]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public string Phone
        {
            get
            {
                return this._Phone;
            }
            set
            {
                this.OnPhoneChanging(value);
                this.ReportPropertyChanging("Phone");
                this._Phone = global::System.Data.Objects.DataClasses.StructuralObject.SetValidValue(value, true);
                this.ReportPropertyChanged("Phone");
                this.OnPhoneChanged();
            }
        }
        private string _Phone;
        partial void OnPhoneChanging(string value);
        partial void OnPhoneChanged();
        /// <summary>
        /// There are no comments for Orders in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmRelationshipNavigationPropertyAttribute("northwindModel", "FK_Orders_ShipVia_ShipperID", "Orders")]
        [global::System.Xml.Serialization.XmlIgnoreAttribute()]
        [global::System.Xml.Serialization.SoapIgnoreAttribute()]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public global::System.Data.Objects.DataClasses.EntityCollection<Orders> Orders
        {
            get
            {
                return ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedCollection<Orders>("northwindModel.FK_Orders_ShipVia_ShipperID", "Orders");
            }
            set
            {
                if ((value != null))
                {
                    ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.InitializeRelatedCollection<Orders>("northwindModel.FK_Orders_ShipVia_ShipperID", "Orders", value);
                }
            }
        }
    }
    /// <summary>
    /// There are no comments for northwindModel.Suppliers in the schema.
    /// </summary>
    /// <KeyProperties>
    /// SupplierID
    /// </KeyProperties>
    [global::System.Data.Objects.DataClasses.EdmEntityTypeAttribute(NamespaceName="northwindModel", Name="Suppliers")]
    [global::System.Runtime.Serialization.DataContractAttribute(IsReference=true)]
    [global::System.Serializable()]
    public partial class Suppliers : global::System.Data.Objects.DataClasses.EntityObject
    {
        /// <summary>
        /// Create a new Suppliers object.
        /// </summary>
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
        }
        private string _HomePage;
        partial void OnHomePageChanging(string value);
        partial void OnHomePageChanged();
        /// <summary>
        /// There are no comments for Products in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmRelationshipNavigationPropertyAttribute("northwindEFModel", "FK_Products_SupplierID_SupplierID", "Products")]
        [global::System.Xml.Serialization.XmlIgnoreAttribute()]
        [global::System.Xml.Serialization.SoapIgnoreAttribute()]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public global::System.Data.Objects.DataClasses.EntityCollection<Products> Products
        {
            get
            {
                return ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedCollection<Products>("northwindEFModel.FK_Products_SupplierID_SupplierID", "Products");
            }
            set
            {
                if ((value != null))
                {
                    ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.InitializeRelatedCollection<Products>("northwindEFModel.FK_Products_SupplierID_SupplierID", "Products", value);
                }
            }
        }
    }
    /// <summary>
    /// There are no comments for northwindEFModel.Territories in the schema.
    /// </summary>
    /// <KeyProperties>
    /// TerritoryID
    /// </KeyProperties>
    [global::System.Data.Objects.DataClasses.EdmEntityTypeAttribute(NamespaceName="northwindEFModel", Name="Territories")]
    [global::System.Runtime.Serialization.DataContractAttribute(IsReference=true)]
    [global::System.Serializable()]
    public partial class Territories : global::System.Data.Objects.DataClasses.EntityObject
    {
        /// <summary>
        /// Create a new Territories object.
        /// </summary>
        /// <param name="territoryID">Initial value of TerritoryID.</param>
        /// <param name="territoryDescription">Initial value of TerritoryDescription.</param>
        public static Territories CreateTerritories(long territoryID, string territoryDescription)
        {
            Territories territories = new Territories();
            territories.TerritoryID = territoryID;
            territories.TerritoryDescription = territoryDescription;
            return territories;
        }
        /// <summary>
        /// There are no comments for Property TerritoryID in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public long TerritoryID
        {
            get
            {
                return this._TerritoryID;
            }
            set
            {
                this.OnTerritoryIDChanging(value);
                this.ReportPropertyChanging("TerritoryID");
                this._TerritoryID = global::System.Data.Objects.DataClasses.StructuralObject.SetValidValue(value);
                this.ReportPropertyChanged("TerritoryID");
                this.OnTerritoryIDChanged();
            }
        }
        private long _TerritoryID;
        partial void OnTerritoryIDChanging(long value);
        partial void OnTerritoryIDChanged();
        /// <summary>
        /// There are no comments for Property TerritoryDescription in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmScalarPropertyAttribute(IsNullable=false)]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public string TerritoryDescription







|







|





|





|




|









|











|









|




|
|







2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
        }
        private string _HomePage;
        partial void OnHomePageChanging(string value);
        partial void OnHomePageChanged();
        /// <summary>
        /// There are no comments for Products in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmRelationshipNavigationPropertyAttribute("northwindModel", "FK_Products_SupplierID_SupplierID", "Products")]
        [global::System.Xml.Serialization.XmlIgnoreAttribute()]
        [global::System.Xml.Serialization.SoapIgnoreAttribute()]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public global::System.Data.Objects.DataClasses.EntityCollection<Products> Products
        {
            get
            {
                return ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedCollection<Products>("northwindModel.FK_Products_SupplierID_SupplierID", "Products");
            }
            set
            {
                if ((value != null))
                {
                    ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.InitializeRelatedCollection<Products>("northwindModel.FK_Products_SupplierID_SupplierID", "Products", value);
                }
            }
        }
    }
    /// <summary>
    /// There are no comments for northwindModel.Territories in the schema.
    /// </summary>
    /// <KeyProperties>
    /// TerritoryID
    /// </KeyProperties>
    [global::System.Data.Objects.DataClasses.EdmEntityTypeAttribute(NamespaceName="northwindModel", Name="Territories")]
    [global::System.Runtime.Serialization.DataContractAttribute(IsReference=true)]
    [global::System.Serializable()]
    public partial class Territories : global::System.Data.Objects.DataClasses.EntityObject
    {
        /// <summary>
        /// Create a new Territories object.
        /// </summary>
        /// <param name="territoryID">Initial value of TerritoryID.</param>
        /// <param name="territoryDescription">Initial value of TerritoryDescription.</param>
        public static Territories CreateTerritories(string territoryID, string territoryDescription)
        {
            Territories territories = new Territories();
            territories.TerritoryID = territoryID;
            territories.TerritoryDescription = territoryDescription;
            return territories;
        }
        /// <summary>
        /// There are no comments for Property TerritoryID in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public string TerritoryID
        {
            get
            {
                return this._TerritoryID;
            }
            set
            {
                this.OnTerritoryIDChanging(value);
                this.ReportPropertyChanging("TerritoryID");
                this._TerritoryID = global::System.Data.Objects.DataClasses.StructuralObject.SetValidValue(value, false);
                this.ReportPropertyChanged("TerritoryID");
                this.OnTerritoryIDChanged();
            }
        }
        private string _TerritoryID;
        partial void OnTerritoryIDChanging(string value);
        partial void OnTerritoryIDChanged();
        /// <summary>
        /// There are no comments for Property TerritoryDescription in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmScalarPropertyAttribute(IsNullable=false)]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public string TerritoryDescription
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
                this.OnTerritoryDescriptionChanged();
            }
        }
        private string _TerritoryDescription;
        partial void OnTerritoryDescriptionChanging(string value);
        partial void OnTerritoryDescriptionChanged();
        /// <summary>
        /// There are no comments for Regions in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmRelationshipNavigationPropertyAttribute("northwindEFModel", "FK_Territories_RegionID_RegionID", "Regions")]
        [global::System.Xml.Serialization.XmlIgnoreAttribute()]
        [global::System.Xml.Serialization.SoapIgnoreAttribute()]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public Regions Regions
        {
            get
            {
                return ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedReference<Regions>("northwindEFModel.FK_Territories_RegionID_RegionID", "Regions").Value;
            }
            set
            {
                ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedReference<Regions>("northwindEFModel.FK_Territories_RegionID_RegionID", "Regions").Value = value;
            }
        }
        /// <summary>
        /// There are no comments for Regions in the schema.
        /// </summary>
        [global::System.ComponentModel.BrowsableAttribute(false)]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public global::System.Data.Objects.DataClasses.EntityReference<Regions> RegionsReference
        {
            get
            {
                return ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedReference<Regions>("northwindEFModel.FK_Territories_RegionID_RegionID", "Regions");
            }
            set
            {
                if ((value != null))
                {
                    ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.InitializeRelatedReference<Regions>("northwindEFModel.FK_Territories_RegionID_RegionID", "Regions", value);
                }
            }
        }
        /// <summary>
        /// There are no comments for Employees in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmRelationshipNavigationPropertyAttribute("northwindEFModel", "EmployeesTerritories", "Employees")]
        [global::System.Xml.Serialization.XmlIgnoreAttribute()]
        [global::System.Xml.Serialization.SoapIgnoreAttribute()]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public global::System.Data.Objects.DataClasses.EntityCollection<Employees> Employees
        {
            get
            {
                return ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedCollection<Employees>("northwindEFModel.EmployeesTerritories", "Employees");
            }
            set
            {
                if ((value != null))
                {
                    ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.InitializeRelatedCollection<Employees>("northwindEFModel.EmployeesTerritories", "Employees", value);
                }
            }
        }
    }
}







|

|



|



|



|



|



|



|





|






|







|





|





2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
                this.OnTerritoryDescriptionChanged();
            }
        }
        private string _TerritoryDescription;
        partial void OnTerritoryDescriptionChanging(string value);
        partial void OnTerritoryDescriptionChanged();
        /// <summary>
        /// There are no comments for Region in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmRelationshipNavigationPropertyAttribute("northwindModel", "FK_Territories_RegionID_RegionID", "Region")]
        [global::System.Xml.Serialization.XmlIgnoreAttribute()]
        [global::System.Xml.Serialization.SoapIgnoreAttribute()]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public Region Region
        {
            get
            {
                return ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedReference<Region>("northwindModel.FK_Territories_RegionID_RegionID", "Region").Value;
            }
            set
            {
                ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedReference<Region>("northwindModel.FK_Territories_RegionID_RegionID", "Region").Value = value;
            }
        }
        /// <summary>
        /// There are no comments for Region in the schema.
        /// </summary>
        [global::System.ComponentModel.BrowsableAttribute(false)]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public global::System.Data.Objects.DataClasses.EntityReference<Region> RegionReference
        {
            get
            {
                return ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedReference<Region>("northwindModel.FK_Territories_RegionID_RegionID", "Region");
            }
            set
            {
                if ((value != null))
                {
                    ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.InitializeRelatedReference<Region>("northwindModel.FK_Territories_RegionID_RegionID", "Region", value);
                }
            }
        }
        /// <summary>
        /// There are no comments for Employees in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmRelationshipNavigationPropertyAttribute("northwindModel", "EmployeeTerritories", "Employees")]
        [global::System.Xml.Serialization.XmlIgnoreAttribute()]
        [global::System.Xml.Serialization.SoapIgnoreAttribute()]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public global::System.Data.Objects.DataClasses.EntityCollection<Employees> Employees
        {
            get
            {
                return ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedCollection<Employees>("northwindModel.EmployeeTerritories", "Employees");
            }
            set
            {
                if ((value != null))
                {
                    ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.InitializeRelatedCollection<Employees>("northwindModel.EmployeeTerritories", "Employees", value);
                }
            }
        }
    }
}
Changes to testlinq/NorthwindModel.edmx.
1
2
3
4
5
6
7
8
9


10
11
12
13
14
15
16
17
18

19
20












21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44








45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66















67
68
69
70
71
72
73
74
75
76
77
78
<?xml version="1.0" encoding="utf-8"?>
<edmx:Edmx Version="1.0" xmlns:edmx="http://schemas.microsoft.com/ado/2007/06/edmx">
  <!-- EF Runtime content -->
  <edmx:Runtime>
    <!-- SSDL content -->
    <edmx:StorageModels>
    <Schema Namespace="northwindEFModel.Store" Alias="Self" Provider="System.Data.SQLite" ProviderManifestToken="ISO8601" xmlns:store="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator" xmlns="http://schemas.microsoft.com/ado/2006/04/edm/ssdl">
        <EntityContainer Name="northwindEFModelStoreContainer">
          <EntitySet Name="Categories" EntityType="northwindEFModel.Store.Categories" store:Type="Tables" />


          <EntitySet Name="Customers" EntityType="northwindEFModel.Store.Customers" store:Type="Tables" />
          <EntitySet Name="Employees" EntityType="northwindEFModel.Store.Employees" store:Type="Tables" />
          <EntitySet Name="EmployeesTerritories" EntityType="northwindEFModel.Store.EmployeesTerritories" store:Type="Tables" />
          <EntitySet Name="InternationalOrders" EntityType="northwindEFModel.Store.InternationalOrders" store:Type="Tables" />
          <EntitySet Name="OrderDetails" EntityType="northwindEFModel.Store.OrderDetails" store:Type="Tables" />
          <EntitySet Name="Orders" EntityType="northwindEFModel.Store.Orders" store:Type="Tables" />
          <EntitySet Name="PreviousEmployees" EntityType="northwindEFModel.Store.PreviousEmployees" store:Type="Tables" />
          <EntitySet Name="Products" EntityType="northwindEFModel.Store.Products" store:Type="Tables" />
          <EntitySet Name="Regions" EntityType="northwindEFModel.Store.Regions" store:Type="Tables" />

          <EntitySet Name="Suppliers" EntityType="northwindEFModel.Store.Suppliers" store:Type="Tables" />
          <EntitySet Name="Territories" EntityType="northwindEFModel.Store.Territories" store:Type="Tables" />












          <AssociationSet Name="FK_EmployeesTerritories_EmployeeID_EmployeeID" Association="northwindEFModel.Store.FK_EmployeesTerritories_EmployeeID_EmployeeID">
            <End Role="Employees" EntitySet="Employees" />
            <End Role="EmployeesTerritories" EntitySet="EmployeesTerritories" />
          </AssociationSet>
          <AssociationSet Name="FK_EmployeesTerritories_TerritoryID_TerritoryID" Association="northwindEFModel.Store.FK_EmployeesTerritories_TerritoryID_TerritoryID">
            <End Role="Territories" EntitySet="Territories" />
            <End Role="EmployeesTerritories" EntitySet="EmployeesTerritories" />
          </AssociationSet>
          <AssociationSet Name="FK_InternationalOrders_OrderID_OrderID" Association="northwindEFModel.Store.FK_InternationalOrders_OrderID_OrderID">
            <End Role="Orders" EntitySet="Orders" />
            <End Role="InternationalOrders" EntitySet="InternationalOrders" />
          </AssociationSet>
          <AssociationSet Name="FK_OrderDetails_OrderID_OrderID" Association="northwindEFModel.Store.FK_OrderDetails_OrderID_OrderID">
            <End Role="Orders" EntitySet="Orders" />
            <End Role="OrderDetails" EntitySet="OrderDetails" />
          </AssociationSet>
          <AssociationSet Name="FK_OrderDetails_ProductID_ProductID" Association="northwindEFModel.Store.FK_OrderDetails_ProductID_ProductID">
            <End Role="Products" EntitySet="Products" />
            <End Role="OrderDetails" EntitySet="OrderDetails" />
          </AssociationSet>
          <AssociationSet Name="FK_Orders_CustomerID_CustomerID" Association="northwindEFModel.Store.FK_Orders_CustomerID_CustomerID">
            <End Role="Customers" EntitySet="Customers" />
            <End Role="Orders" EntitySet="Orders" />
          </AssociationSet>








          <AssociationSet Name="FK_Products_CategoryID_CategoryID" Association="northwindEFModel.Store.FK_Products_CategoryID_CategoryID">
            <End Role="Categories" EntitySet="Categories" />
            <End Role="Products" EntitySet="Products" />
          </AssociationSet>
          <AssociationSet Name="FK_Products_SupplierID_SupplierID" Association="northwindEFModel.Store.FK_Products_SupplierID_SupplierID">
            <End Role="Suppliers" EntitySet="Suppliers" />
            <End Role="Products" EntitySet="Products" />
          </AssociationSet>
          <AssociationSet Name="FK_Territories_RegionID_RegionID" Association="northwindEFModel.Store.FK_Territories_RegionID_RegionID">
            <End Role="Regions" EntitySet="Regions" />
            <End Role="Territories" EntitySet="Territories" />
          </AssociationSet>
        </EntityContainer>
        <EntityType Name="Categories">
          <Key>
            <PropertyRef Name="CategoryID" />
          </Key>
          <Property Name="CategoryID" Type="integer" Nullable="false" StoreGeneratedPattern="Identity" />
          <Property Name="CategoryName" Type="nvarchar" Nullable="false" MaxLength="15" />
          <Property Name="Description" Type="nvarchar" />
          <Property Name="Picture" Type="blob" />
        </EntityType>















        <EntityType Name="Customers">
          <Key>
            <PropertyRef Name="CustomerID" />
          </Key>
          <Property Name="CustomerID" Type="nvarchar" Nullable="false" MaxLength="5" />
          <Property Name="CompanyName" Type="nvarchar" Nullable="false" MaxLength="40" />
          <Property Name="ContactName" Type="nvarchar" MaxLength="30" />
          <Property Name="ContactTitle" Type="nvarchar" MaxLength="30" />
          <Property Name="Address" Type="nvarchar" MaxLength="60" />
          <Property Name="City" Type="nvarchar" MaxLength="15" />
          <Property Name="Region" Type="nvarchar" MaxLength="15" />
          <Property Name="PostalCode" Type="nvarchar" MaxLength="10" />






|
|
|
>
>
|
|
|
<
|
|
<
|
|
>
|
|
>
>
>
>
>
>
>
>
>
>
>
>
|

|

|

|

<
<
<
<
|

|

|

|

|



>
>
>
>
>
>
>
>
|



|



|
|












>
>
>
>
>
>
>
>
>
>
>
>
>
>
>




|







1
2
3
4
5
6
7
8
9
10
11
12
13
14

15
16

17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41




42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<?xml version="1.0" encoding="utf-8"?>
<edmx:Edmx Version="1.0" xmlns:edmx="http://schemas.microsoft.com/ado/2007/06/edmx">
  <!-- EF Runtime content -->
  <edmx:Runtime>
    <!-- SSDL content -->
    <edmx:StorageModels>
      <Schema Namespace="northwindModel.Store" Alias="Self" Provider="System.Data.SQLite" ProviderManifestToken="ISO8601" xmlns:store="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator" xmlns="http://schemas.microsoft.com/ado/2006/04/edm/ssdl">
        <EntityContainer Name="northwindModelStoreContainer">
          <EntitySet Name="Categories" EntityType="northwindModel.Store.Categories" store:Type="Tables" />
          <EntitySet Name="CustomerCustomerDemo" EntityType="northwindModel.Store.CustomerCustomerDemo" store:Type="Tables" />
          <EntitySet Name="CustomerDemographics" EntityType="northwindModel.Store.CustomerDemographics" store:Type="Tables" />
          <EntitySet Name="Customers" EntityType="northwindModel.Store.Customers" store:Type="Tables" />
          <EntitySet Name="Employees" EntityType="northwindModel.Store.Employees" store:Type="Tables" />
          <EntitySet Name="EmployeeTerritories" EntityType="northwindModel.Store.EmployeeTerritories" store:Type="Tables" />

          <EntitySet Name="Order Details" EntityType="northwindModel.Store.Order Details" store:Type="Tables" />
          <EntitySet Name="Orders" EntityType="northwindModel.Store.Orders" store:Type="Tables" />

          <EntitySet Name="Products" EntityType="northwindModel.Store.Products" store:Type="Tables" />
          <EntitySet Name="Region" EntityType="northwindModel.Store.Region" store:Type="Tables" />
          <EntitySet Name="Shippers" EntityType="northwindModel.Store.Shippers" store:Type="Tables" />
          <EntitySet Name="Suppliers" EntityType="northwindModel.Store.Suppliers" store:Type="Tables" />
          <EntitySet Name="Territories" EntityType="northwindModel.Store.Territories" store:Type="Tables" />
          <AssociationSet Name="FK_CustomerCustomerDemo_CustomerID_CustomerID" Association="northwindModel.Store.FK_CustomerCustomerDemo_CustomerID_CustomerID">
            <End Role="Customers" EntitySet="Customers" />
            <End Role="CustomerCustomerDemo" EntitySet="CustomerCustomerDemo" />
          </AssociationSet>
          <AssociationSet Name="FK_CustomerCustomerDemo_CustomerTypeID_CustomerTypeID" Association="northwindModel.Store.FK_CustomerCustomerDemo_CustomerTypeID_CustomerTypeID">
            <End Role="CustomerDemographics" EntitySet="CustomerDemographics" />
            <End Role="CustomerCustomerDemo" EntitySet="CustomerCustomerDemo" />
          </AssociationSet>
          <AssociationSet Name="FK_Employees_ReportsTo_EmployeeID" Association="northwindModel.Store.FK_Employees_ReportsTo_EmployeeID">
            <End Role="Employees" EntitySet="Employees" />
            <End Role="Employees1" EntitySet="Employees" />
          </AssociationSet>
          <AssociationSet Name="FK_EmployeeTerritories_EmployeeID_EmployeeID" Association="northwindModel.Store.FK_EmployeeTerritories_EmployeeID_EmployeeID">
            <End Role="Employees" EntitySet="Employees" />
            <End Role="EmployeeTerritories" EntitySet="EmployeeTerritories" />
          </AssociationSet>
          <AssociationSet Name="FK_EmployeeTerritories_TerritoryID_TerritoryID" Association="northwindModel.Store.FK_EmployeeTerritories_TerritoryID_TerritoryID">
            <End Role="Territories" EntitySet="Territories" />
            <End Role="EmployeeTerritories" EntitySet="EmployeeTerritories" />
          </AssociationSet>




          <AssociationSet Name="FK_Order Details_OrderID_OrderID" Association="northwindModel.Store.FK_Order Details_OrderID_OrderID">
            <End Role="Orders" EntitySet="Orders" />
            <End Role="Order Details" EntitySet="Order Details" />
          </AssociationSet>
          <AssociationSet Name="FK_Order Details_ProductID_ProductID" Association="northwindModel.Store.FK_Order Details_ProductID_ProductID">
            <End Role="Products" EntitySet="Products" />
            <End Role="Order Details" EntitySet="Order Details" />
          </AssociationSet>
          <AssociationSet Name="FK_Orders_CustomerID_CustomerID" Association="northwindModel.Store.FK_Orders_CustomerID_CustomerID">
            <End Role="Customers" EntitySet="Customers" />
            <End Role="Orders" EntitySet="Orders" />
          </AssociationSet>
          <AssociationSet Name="FK_Orders_EmployeeID_EmployeeID" Association="northwindModel.Store.FK_Orders_EmployeeID_EmployeeID">
            <End Role="Employees" EntitySet="Employees" />
            <End Role="Orders" EntitySet="Orders" />
          </AssociationSet>
          <AssociationSet Name="FK_Orders_ShipVia_ShipperID" Association="northwindModel.Store.FK_Orders_ShipVia_ShipperID">
            <End Role="Shippers" EntitySet="Shippers" />
            <End Role="Orders" EntitySet="Orders" />
          </AssociationSet>
          <AssociationSet Name="FK_Products_CategoryID_CategoryID" Association="northwindModel.Store.FK_Products_CategoryID_CategoryID">
            <End Role="Categories" EntitySet="Categories" />
            <End Role="Products" EntitySet="Products" />
          </AssociationSet>
          <AssociationSet Name="FK_Products_SupplierID_SupplierID" Association="northwindModel.Store.FK_Products_SupplierID_SupplierID">
            <End Role="Suppliers" EntitySet="Suppliers" />
            <End Role="Products" EntitySet="Products" />
          </AssociationSet>
          <AssociationSet Name="FK_Territories_RegionID_RegionID" Association="northwindModel.Store.FK_Territories_RegionID_RegionID">
            <End Role="Region" EntitySet="Region" />
            <End Role="Territories" EntitySet="Territories" />
          </AssociationSet>
        </EntityContainer>
        <EntityType Name="Categories">
          <Key>
            <PropertyRef Name="CategoryID" />
          </Key>
          <Property Name="CategoryID" Type="integer" Nullable="false" StoreGeneratedPattern="Identity" />
          <Property Name="CategoryName" Type="nvarchar" Nullable="false" MaxLength="15" />
          <Property Name="Description" Type="nvarchar" />
          <Property Name="Picture" Type="blob" />
        </EntityType>
        <EntityType Name="CustomerCustomerDemo">
          <Key>
            <PropertyRef Name="CustomerID" />
            <PropertyRef Name="CustomerTypeID" />
          </Key>
          <Property Name="CustomerID" Type="nvarchar" Nullable="false" MaxLength="5" StoreGeneratedPattern="Identity" />
          <Property Name="CustomerTypeID" Type="nvarchar" Nullable="false" MaxLength="10" StoreGeneratedPattern="Identity" />
        </EntityType>
        <EntityType Name="CustomerDemographics">
          <Key>
            <PropertyRef Name="CustomerTypeID" />
          </Key>
          <Property Name="CustomerTypeID" Type="nvarchar" Nullable="false" MaxLength="10" StoreGeneratedPattern="Identity" />
          <Property Name="CustomerDesc" Type="nvarchar" />
        </EntityType>
        <EntityType Name="Customers">
          <Key>
            <PropertyRef Name="CustomerID" />
          </Key>
          <Property Name="CustomerID" Type="nvarchar" Nullable="false" MaxLength="5" StoreGeneratedPattern="Identity" />
          <Property Name="CompanyName" Type="nvarchar" Nullable="false" MaxLength="40" />
          <Property Name="ContactName" Type="nvarchar" MaxLength="30" />
          <Property Name="ContactTitle" Type="nvarchar" MaxLength="30" />
          <Property Name="Address" Type="nvarchar" MaxLength="60" />
          <Property Name="City" Type="nvarchar" MaxLength="15" />
          <Property Name="Region" Type="nvarchar" MaxLength="15" />
          <Property Name="PostalCode" Type="nvarchar" MaxLength="10" />
96
97
98
99
100
101
102

103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141

142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194








195
196
197
198
199
200
201
          <Property Name="Region" Type="nvarchar" MaxLength="15" />
          <Property Name="PostalCode" Type="nvarchar" MaxLength="10" />
          <Property Name="Country" Type="nvarchar" MaxLength="15" />
          <Property Name="HomePhone" Type="nvarchar" MaxLength="24" />
          <Property Name="Extension" Type="nvarchar" MaxLength="4" />
          <Property Name="Photo" Type="blob" />
          <Property Name="Notes" Type="nvarchar" />

          <Property Name="PhotoPath" Type="nvarchar" MaxLength="255" />
        </EntityType>
        <EntityType Name="EmployeesTerritories">
          <Key>
            <PropertyRef Name="EmployeeID" />
            <PropertyRef Name="TerritoryID" />
          </Key>
          <Property Name="EmployeeID" Type="integer" Nullable="false" />
          <Property Name="TerritoryID" Type="integer" Nullable="false" />
        </EntityType>
        <EntityType Name="InternationalOrders">
          <Key>
            <PropertyRef Name="OrderID" />
          </Key>
          <Property Name="OrderID" Type="integer" Nullable="false" />
          <Property Name="CustomsDescription" Type="nvarchar" Nullable="false" MaxLength="100" />
          <Property Name="ExciseTax" Type="decimal" Nullable="false" Precision="53" />
        </EntityType>
        <EntityType Name="OrderDetails">
          <Key>
            <PropertyRef Name="OrderID" />
            <PropertyRef Name="ProductID" />
          </Key>
          <Property Name="OrderID" Type="integer" Nullable="false" />
          <Property Name="ProductID" Type="integer" Nullable="false" />
          <Property Name="UnitPrice" Type="decimal" Nullable="false" Precision="53" />
          <Property Name="Quantity" Type="smallint" Nullable="false" />
          <Property Name="Discount" Type="real" Nullable="false" />
        </EntityType>
        <EntityType Name="Orders">
          <Key>
            <PropertyRef Name="OrderID" />
          </Key>
          <Property Name="OrderID" Type="integer" Nullable="false" StoreGeneratedPattern="Identity" />
          <Property Name="CustomerID" Type="nvarchar" MaxLength="5" />
          <Property Name="EmployeeID" Type="integer" />
          <Property Name="OrderDate" Type="datetime" />
          <Property Name="RequiredDate" Type="datetime" />
          <Property Name="ShippedDate" Type="datetime" />

          <Property Name="Freight" Type="decimal" Precision="53" />
          <Property Name="ShipName" Type="nvarchar" MaxLength="40" />
          <Property Name="ShipAddress" Type="nvarchar" MaxLength="60" />
          <Property Name="ShipCity" Type="nvarchar" MaxLength="15" />
          <Property Name="ShipRegion" Type="nvarchar" MaxLength="15" />
          <Property Name="ShipPostalCode" Type="nvarchar" MaxLength="10" />
          <Property Name="ShipCountry" Type="nvarchar" MaxLength="15" />
        </EntityType>
        <EntityType Name="PreviousEmployees">
          <Key>
            <PropertyRef Name="EmployeeID" />
          </Key>
          <Property Name="EmployeeID" Type="integer" Nullable="false" />
          <Property Name="LastName" Type="nvarchar" Nullable="false" MaxLength="20" />
          <Property Name="FirstName" Type="nvarchar" Nullable="false" MaxLength="10" />
          <Property Name="Title" Type="nvarchar" MaxLength="30" />
          <Property Name="TitleOfCourtesy" Type="nvarchar" MaxLength="25" />
          <Property Name="BirthDate" Type="datetime" />
          <Property Name="HireDate" Type="datetime" />
          <Property Name="Address" Type="nvarchar" MaxLength="60" />
          <Property Name="City" Type="nvarchar" MaxLength="15" />
          <Property Name="Region" Type="nvarchar" MaxLength="15" />
          <Property Name="PostalCode" Type="nvarchar" MaxLength="10" />
          <Property Name="Country" Type="nvarchar" MaxLength="15" />
          <Property Name="HomePhone" Type="nvarchar" MaxLength="24" />
          <Property Name="Extension" Type="nvarchar" MaxLength="4" />
          <Property Name="Photo" Type="blob" />
          <Property Name="Notes" Type="nvarchar" />
          <Property Name="PhotoPath" Type="nvarchar" MaxLength="255" />
        </EntityType>
        <EntityType Name="Products">
          <Key>
            <PropertyRef Name="ProductID" />
          </Key>
          <Property Name="ProductID" Type="integer" Nullable="false" StoreGeneratedPattern="Identity" />
          <Property Name="ProductName" Type="nvarchar" Nullable="false" MaxLength="40" />
          <Property Name="SupplierID" Type="integer" />
          <Property Name="CategoryID" Type="integer" />
          <Property Name="QuantityPerUnit" Type="nvarchar" MaxLength="20" />
          <Property Name="UnitPrice" Type="decimal" Precision="53" />
          <Property Name="UnitsInStock" Type="smallint" />
          <Property Name="UnitsOnOrder" Type="smallint" />
          <Property Name="ReorderLevel" Type="smallint" />
          <Property Name="Discontinued" Type="bit" Nullable="false" />
          <Property Name="DiscontinuedDate" Type="datetime" />
        </EntityType>
        <EntityType Name="Regions">
          <Key>
            <PropertyRef Name="RegionID" />
          </Key>
          <Property Name="RegionID" Type="integer" Nullable="false" />
          <Property Name="RegionDescription" Type="nvarchar" Nullable="false" MaxLength="50" />
        </EntityType>








        <EntityType Name="Suppliers">
          <Key>
            <PropertyRef Name="SupplierID" />
          </Key>
          <Property Name="SupplierID" Type="integer" Nullable="false" StoreGeneratedPattern="Identity" />
          <Property Name="CompanyName" Type="nvarchar" Nullable="false" MaxLength="40" />
          <Property Name="ContactName" Type="nvarchar" MaxLength="30" />







>


|




|
|

<
<
<
<
<
<
<
<
|




|
|














>








<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<














<

|



|


>
>
>
>
>
>
>
>







128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145








146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175






















176
177
178
179
180
181
182
183
184
185
186
187
188
189

190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
          <Property Name="Region" Type="nvarchar" MaxLength="15" />
          <Property Name="PostalCode" Type="nvarchar" MaxLength="10" />
          <Property Name="Country" Type="nvarchar" MaxLength="15" />
          <Property Name="HomePhone" Type="nvarchar" MaxLength="24" />
          <Property Name="Extension" Type="nvarchar" MaxLength="4" />
          <Property Name="Photo" Type="blob" />
          <Property Name="Notes" Type="nvarchar" />
          <Property Name="ReportsTo" Type="integer" />
          <Property Name="PhotoPath" Type="nvarchar" MaxLength="255" />
        </EntityType>
        <EntityType Name="EmployeeTerritories">
          <Key>
            <PropertyRef Name="EmployeeID" />
            <PropertyRef Name="TerritoryID" />
          </Key>
          <Property Name="EmployeeID" Type="integer" Nullable="false" StoreGeneratedPattern="Identity" />
          <Property Name="TerritoryID" Type="nvarchar" Nullable="false" MaxLength="20" StoreGeneratedPattern="Identity" />
        </EntityType>








        <EntityType Name="Order Details">
          <Key>
            <PropertyRef Name="OrderID" />
            <PropertyRef Name="ProductID" />
          </Key>
          <Property Name="OrderID" Type="integer" Nullable="false" StoreGeneratedPattern="Identity" />
          <Property Name="ProductID" Type="integer" Nullable="false" StoreGeneratedPattern="Identity" />
          <Property Name="UnitPrice" Type="decimal" Nullable="false" Precision="53" />
          <Property Name="Quantity" Type="smallint" Nullable="false" />
          <Property Name="Discount" Type="real" Nullable="false" />
        </EntityType>
        <EntityType Name="Orders">
          <Key>
            <PropertyRef Name="OrderID" />
          </Key>
          <Property Name="OrderID" Type="integer" Nullable="false" StoreGeneratedPattern="Identity" />
          <Property Name="CustomerID" Type="nvarchar" MaxLength="5" />
          <Property Name="EmployeeID" Type="integer" />
          <Property Name="OrderDate" Type="datetime" />
          <Property Name="RequiredDate" Type="datetime" />
          <Property Name="ShippedDate" Type="datetime" />
          <Property Name="ShipVia" Type="integer" />
          <Property Name="Freight" Type="decimal" Precision="53" />
          <Property Name="ShipName" Type="nvarchar" MaxLength="40" />
          <Property Name="ShipAddress" Type="nvarchar" MaxLength="60" />
          <Property Name="ShipCity" Type="nvarchar" MaxLength="15" />
          <Property Name="ShipRegion" Type="nvarchar" MaxLength="15" />
          <Property Name="ShipPostalCode" Type="nvarchar" MaxLength="10" />
          <Property Name="ShipCountry" Type="nvarchar" MaxLength="15" />
        </EntityType>






















        <EntityType Name="Products">
          <Key>
            <PropertyRef Name="ProductID" />
          </Key>
          <Property Name="ProductID" Type="integer" Nullable="false" StoreGeneratedPattern="Identity" />
          <Property Name="ProductName" Type="nvarchar" Nullable="false" MaxLength="40" />
          <Property Name="SupplierID" Type="integer" />
          <Property Name="CategoryID" Type="integer" />
          <Property Name="QuantityPerUnit" Type="nvarchar" MaxLength="20" />
          <Property Name="UnitPrice" Type="decimal" Precision="53" />
          <Property Name="UnitsInStock" Type="smallint" />
          <Property Name="UnitsOnOrder" Type="smallint" />
          <Property Name="ReorderLevel" Type="smallint" />
          <Property Name="Discontinued" Type="bit" Nullable="false" />

        </EntityType>
        <EntityType Name="Region">
          <Key>
            <PropertyRef Name="RegionID" />
          </Key>
          <Property Name="RegionID" Type="integer" Nullable="false" StoreGeneratedPattern="Identity" />
          <Property Name="RegionDescription" Type="nvarchar" Nullable="false" MaxLength="50" />
        </EntityType>
        <EntityType Name="Shippers">
          <Key>
            <PropertyRef Name="ShipperID" />
          </Key>
          <Property Name="ShipperID" Type="integer" Nullable="false" StoreGeneratedPattern="Identity" />
          <Property Name="CompanyName" Type="nvarchar" Nullable="false" MaxLength="40" />
          <Property Name="Phone" Type="nvarchar" MaxLength="24" />
        </EntityType>
        <EntityType Name="Suppliers">
          <Key>
            <PropertyRef Name="SupplierID" />
          </Key>
          <Property Name="SupplierID" Type="integer" Nullable="false" StoreGeneratedPattern="Identity" />
          <Property Name="CompanyName" Type="nvarchar" Nullable="false" MaxLength="40" />
          <Property Name="ContactName" Type="nvarchar" MaxLength="30" />
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231












232
233
234
235
236
237
238
239
240
241
242
243
244

245










246

247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
























292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327

328
329
330
331
332
333

334
335
336
337
338
339
340
341

342
343
344
345
346
347
348
349
350
351
352





353
354
355
356
357
358
359
360
361
362
363




364
365
366
367
368
369
370
371




372
373
374
375
376
377
378
379
380
381
382
383
384
385








386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402

403
404
405
406
407
408
409
          <Property Name="Fax" Type="nvarchar" MaxLength="24" />
          <Property Name="HomePage" Type="nvarchar" />
        </EntityType>
        <EntityType Name="Territories">
          <Key>
            <PropertyRef Name="TerritoryID" />
          </Key>
          <Property Name="TerritoryID" Type="integer" Nullable="false" />
          <Property Name="TerritoryDescription" Type="nvarchar" Nullable="false" MaxLength="50" />
          <Property Name="RegionID" Type="integer" Nullable="false" />
        </EntityType>
        <Association Name="FK_EmployeesTerritories_EmployeeID_EmployeeID">
          <End Role="Employees" Type="northwindEFModel.Store.Employees" Multiplicity="1" />
          <End Role="EmployeesTerritories" Type="northwindEFModel.Store.EmployeesTerritories" Multiplicity="*" />
          <ReferentialConstraint>
            <Principal Role="Employees">
              <PropertyRef Name="EmployeeID" />
            </Principal>
            <Dependent Role="EmployeesTerritories">
              <PropertyRef Name="EmployeeID" />
            </Dependent>
          </ReferentialConstraint>
        </Association>












        <Association Name="FK_EmployeesTerritories_TerritoryID_TerritoryID">
          <End Role="Territories" Type="northwindEFModel.Store.Territories" Multiplicity="1" />
          <End Role="EmployeesTerritories" Type="northwindEFModel.Store.EmployeesTerritories" Multiplicity="*" />
          <ReferentialConstraint>
            <Principal Role="Territories">
              <PropertyRef Name="TerritoryID" />
            </Principal>
            <Dependent Role="EmployeesTerritories">
              <PropertyRef Name="TerritoryID" />
            </Dependent>
          </ReferentialConstraint>
        </Association>
        <Association Name="FK_InternationalOrders_OrderID_OrderID">

          <End Role="Orders" Type="northwindEFModel.Store.Orders" Multiplicity="1" />










          <End Role="InternationalOrders" Type="northwindEFModel.Store.InternationalOrders" Multiplicity="0..1" />

          <ReferentialConstraint>
            <Principal Role="Orders">
              <PropertyRef Name="OrderID" />
            </Principal>
            <Dependent Role="InternationalOrders">
              <PropertyRef Name="OrderID" />
            </Dependent>
          </ReferentialConstraint>
        </Association>
        <Association Name="FK_OrderDetails_OrderID_OrderID">
          <End Role="Orders" Type="northwindEFModel.Store.Orders" Multiplicity="1" />
          <End Role="OrderDetails" Type="northwindEFModel.Store.OrderDetails" Multiplicity="*" />
          <ReferentialConstraint>
            <Principal Role="Orders">
              <PropertyRef Name="OrderID" />
            </Principal>
            <Dependent Role="OrderDetails">
              <PropertyRef Name="OrderID" />
            </Dependent>
          </ReferentialConstraint>
        </Association>
        <Association Name="FK_OrderDetails_ProductID_ProductID">
          <End Role="Products" Type="northwindEFModel.Store.Products" Multiplicity="1" />
          <End Role="OrderDetails" Type="northwindEFModel.Store.OrderDetails" Multiplicity="*" />
          <ReferentialConstraint>
            <Principal Role="Products">
              <PropertyRef Name="ProductID" />
            </Principal>
            <Dependent Role="OrderDetails">
              <PropertyRef Name="ProductID" />
            </Dependent>
          </ReferentialConstraint>
        </Association>
        <Association Name="FK_Orders_CustomerID_CustomerID">
          <End Role="Customers" Type="northwindEFModel.Store.Customers" Multiplicity="0..1" />
          <End Role="Orders" Type="northwindEFModel.Store.Orders" Multiplicity="*" />
          <ReferentialConstraint>
            <Principal Role="Customers">
              <PropertyRef Name="CustomerID" />
            </Principal>
            <Dependent Role="Orders">
              <PropertyRef Name="CustomerID" />
            </Dependent>
          </ReferentialConstraint>
        </Association>
























        <Association Name="FK_Products_CategoryID_CategoryID">
          <End Role="Categories" Type="northwindEFModel.Store.Categories" Multiplicity="0..1" />
          <End Role="Products" Type="northwindEFModel.Store.Products" Multiplicity="*" />
          <ReferentialConstraint>
            <Principal Role="Categories">
              <PropertyRef Name="CategoryID" />
            </Principal>
            <Dependent Role="Products">
              <PropertyRef Name="CategoryID" />
            </Dependent>
          </ReferentialConstraint>
        </Association>
        <Association Name="FK_Products_SupplierID_SupplierID">
          <End Role="Suppliers" Type="northwindEFModel.Store.Suppliers" Multiplicity="0..1" />
          <End Role="Products" Type="northwindEFModel.Store.Products" Multiplicity="*" />
          <ReferentialConstraint>
            <Principal Role="Suppliers">
              <PropertyRef Name="SupplierID" />
            </Principal>
            <Dependent Role="Products">
              <PropertyRef Name="SupplierID" />
            </Dependent>
          </ReferentialConstraint>
        </Association>
        <Association Name="FK_Territories_RegionID_RegionID">
          <End Role="Regions" Type="northwindEFModel.Store.Regions" Multiplicity="1" />
          <End Role="Territories" Type="northwindEFModel.Store.Territories" Multiplicity="*" />
          <ReferentialConstraint>
            <Principal Role="Regions">
              <PropertyRef Name="RegionID" />
            </Principal>
            <Dependent Role="Territories">
              <PropertyRef Name="RegionID" />
            </Dependent>
          </ReferentialConstraint>
        </Association>

      </Schema></edmx:StorageModels>
    <!-- CSDL content -->
    <edmx:ConceptualModels>
      <Schema Namespace="northwindEFModel" Alias="Self" xmlns="http://schemas.microsoft.com/ado/2006/04/edm">
        <EntityContainer Name="northwindEFEntities">
          <EntitySet Name="Categories" EntityType="northwindEFModel.Categories" />

          <EntitySet Name="Customers" EntityType="northwindEFModel.Customers" />
          <EntitySet Name="Employees" EntityType="northwindEFModel.Employees" />
          <EntitySet Name="InternationalOrders" EntityType="northwindEFModel.InternationalOrders" />
          <EntitySet Name="OrderDetails" EntityType="northwindEFModel.OrderDetails" />
          <EntitySet Name="Orders" EntityType="northwindEFModel.Orders" />
          <EntitySet Name="PreviousEmployees" EntityType="northwindEFModel.PreviousEmployees" />
          <EntitySet Name="Products" EntityType="northwindEFModel.Products" />
          <EntitySet Name="Regions" EntityType="northwindEFModel.Regions" />

          <EntitySet Name="Suppliers" EntityType="northwindEFModel.Suppliers" />
          <EntitySet Name="Territories" EntityType="northwindEFModel.Territories" />
          <AssociationSet Name="FK_Products_CategoryID_CategoryID" Association="northwindEFModel.FK_Products_CategoryID_CategoryID">
            <End Role="Categories" EntitySet="Categories" />
            <End Role="Products" EntitySet="Products" />
          </AssociationSet>
          <AssociationSet Name="FK_Orders_CustomerID_CustomerID" Association="northwindEFModel.FK_Orders_CustomerID_CustomerID">
            <End Role="Customers" EntitySet="Customers" />
            <End Role="Orders" EntitySet="Orders" />
          </AssociationSet>
          <AssociationSet Name="FK_InternationalOrders_OrderID_OrderID" Association="northwindEFModel.FK_InternationalOrders_OrderID_OrderID">





            <End Role="Orders" EntitySet="Orders" />
            <End Role="InternationalOrders" EntitySet="InternationalOrders" />
          </AssociationSet>
          <AssociationSet Name="FK_OrderDetails_OrderID_OrderID" Association="northwindEFModel.FK_OrderDetails_OrderID_OrderID">
            <End Role="Orders" EntitySet="Orders" />
            <End Role="OrderDetails" EntitySet="OrderDetails" />
          </AssociationSet>
          <AssociationSet Name="FK_OrderDetails_ProductID_ProductID" Association="northwindEFModel.FK_OrderDetails_ProductID_ProductID">
            <End Role="Products" EntitySet="Products" />
            <End Role="OrderDetails" EntitySet="OrderDetails" />
          </AssociationSet>




          <AssociationSet Name="FK_Products_SupplierID_SupplierID" Association="northwindEFModel.FK_Products_SupplierID_SupplierID">
            <End Role="Suppliers" EntitySet="Suppliers" />
            <End Role="Products" EntitySet="Products" />
          </AssociationSet>
          <AssociationSet Name="FK_Territories_RegionID_RegionID" Association="northwindEFModel.FK_Territories_RegionID_RegionID">
            <End Role="Regions" EntitySet="Regions" />
            <End Role="Territories" EntitySet="Territories" />
          </AssociationSet>




          <AssociationSet Name="EmployeesTerritories" Association="northwindEFModel.EmployeesTerritories">
            <End Role="Employees" EntitySet="Employees" />
            <End Role="Territories" EntitySet="Territories" />
          </AssociationSet>
          </EntityContainer>
        <EntityType Name="Categories">
          <Key>
            <PropertyRef Name="CategoryID" />
          </Key>
          <Property Name="CategoryID" Type="Int64" Nullable="false" />
          <Property Name="CategoryName" Type="String" Nullable="false" MaxLength="15" Unicode="true" FixedLength="false" />
          <Property Name="Description" Type="String" MaxLength="2147483647" Unicode="true" FixedLength="false" />
          <Property Name="Picture" Type="Binary" MaxLength="2147483647" FixedLength="false" />
          <NavigationProperty Name="Products" Relationship="northwindEFModel.FK_Products_CategoryID_CategoryID" FromRole="Categories" ToRole="Products" />








        </EntityType>
        <EntityType Name="Customers">
          <Key>
            <PropertyRef Name="CustomerID" />
          </Key>
          <Property Name="CustomerID" Type="String" Nullable="false" MaxLength="5" Unicode="true" FixedLength="false" />
          <Property Name="CompanyName" Type="String" Nullable="false" MaxLength="40" Unicode="true" FixedLength="false" />
          <Property Name="ContactName" Type="String" MaxLength="30" Unicode="true" FixedLength="false" />
          <Property Name="ContactTitle" Type="String" MaxLength="30" Unicode="true" FixedLength="false" />
          <Property Name="Address" Type="String" MaxLength="60" Unicode="true" FixedLength="false" />
          <Property Name="City" Type="String" MaxLength="15" Unicode="true" FixedLength="false" />
          <Property Name="Region" Type="String" MaxLength="15" Unicode="true" FixedLength="false" />
          <Property Name="PostalCode" Type="String" MaxLength="10" Unicode="true" FixedLength="false" />
          <Property Name="Country" Type="String" MaxLength="15" Unicode="true" FixedLength="false" />
          <Property Name="Phone" Type="String" MaxLength="24" Unicode="true" FixedLength="false" />
          <Property Name="Fax" Type="String" MaxLength="24" Unicode="true" FixedLength="false" />
          <NavigationProperty Name="Orders" Relationship="northwindEFModel.FK_Orders_CustomerID_CustomerID" FromRole="Customers" ToRole="Orders" />

        </EntityType>
        <EntityType Name="Employees">
          <Key>
            <PropertyRef Name="EmployeeID" />
          </Key>
          <Property Name="EmployeeID" Type="Int64" Nullable="false" />
          <Property Name="LastName" Type="String" Nullable="false" MaxLength="20" Unicode="true" FixedLength="false" />







|



|
|
|

|
|

|
|



>
>
>
>
>
>
>
>
>
>
>
>
|
|
|

|
|

|
|



|
>
|
>
>
>
>
>
>
>
>
>
>
|
>

|
|

|
|



|
|
|




|




|
|
|




|





|
|









>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

|
|










|
|










|
|

|







>
|


|
|
|
>
|
|
<
|
|
<
|
|
>
|
|
|



|



|
>
>
>
>
>

<

|

|

|

|

>
>
>
>
|



|
|


>
>
>
>
|



|








|
>
>
>
>
>
>
>
>
















|
>







220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396

397
398

399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418

419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
          <Property Name="Fax" Type="nvarchar" MaxLength="24" />
          <Property Name="HomePage" Type="nvarchar" />
        </EntityType>
        <EntityType Name="Territories">
          <Key>
            <PropertyRef Name="TerritoryID" />
          </Key>
          <Property Name="TerritoryID" Type="nvarchar" Nullable="false" MaxLength="20" StoreGeneratedPattern="Identity" />
          <Property Name="TerritoryDescription" Type="nvarchar" Nullable="false" MaxLength="50" />
          <Property Name="RegionID" Type="integer" Nullable="false" />
        </EntityType>
        <Association Name="FK_CustomerCustomerDemo_CustomerID_CustomerID">
          <End Role="Customers" Type="northwindModel.Store.Customers" Multiplicity="1" />
          <End Role="CustomerCustomerDemo" Type="northwindModel.Store.CustomerCustomerDemo" Multiplicity="*" />
          <ReferentialConstraint>
            <Principal Role="Customers">
              <PropertyRef Name="CustomerID" />
            </Principal>
            <Dependent Role="CustomerCustomerDemo">
              <PropertyRef Name="CustomerID" />
            </Dependent>
          </ReferentialConstraint>
        </Association>
        <Association Name="FK_CustomerCustomerDemo_CustomerTypeID_CustomerTypeID">
          <End Role="CustomerDemographics" Type="northwindModel.Store.CustomerDemographics" Multiplicity="1" />
          <End Role="CustomerCustomerDemo" Type="northwindModel.Store.CustomerCustomerDemo" Multiplicity="*" />
          <ReferentialConstraint>
            <Principal Role="CustomerDemographics">
              <PropertyRef Name="CustomerTypeID" />
            </Principal>
            <Dependent Role="CustomerCustomerDemo">
              <PropertyRef Name="CustomerTypeID" />
            </Dependent>
          </ReferentialConstraint>
        </Association>
        <Association Name="FK_Employees_ReportsTo_EmployeeID">
          <End Role="Employees" Type="northwindModel.Store.Employees" Multiplicity="0..1" />
          <End Role="Employees1" Type="northwindModel.Store.Employees" Multiplicity="*" />
          <ReferentialConstraint>
            <Principal Role="Employees">
              <PropertyRef Name="EmployeeID" />
            </Principal>
            <Dependent Role="Employees1">
              <PropertyRef Name="ReportsTo" />
            </Dependent>
          </ReferentialConstraint>
        </Association>
        <Association Name="FK_EmployeeTerritories_EmployeeID_EmployeeID">
          <End Role="Employees" Type="northwindModel.Store.Employees" Multiplicity="1" />
          <End Role="EmployeeTerritories" Type="northwindModel.Store.EmployeeTerritories" Multiplicity="*" />
          <ReferentialConstraint>
            <Principal Role="Employees">
              <PropertyRef Name="EmployeeID" />
            </Principal>
            <Dependent Role="EmployeeTerritories">
              <PropertyRef Name="EmployeeID" />
            </Dependent>
          </ReferentialConstraint>
        </Association>
        <Association Name="FK_EmployeeTerritories_TerritoryID_TerritoryID">
          <End Role="Territories" Type="northwindModel.Store.Territories" Multiplicity="1" />
          <End Role="EmployeeTerritories" Type="northwindModel.Store.EmployeeTerritories" Multiplicity="*" />
          <ReferentialConstraint>
            <Principal Role="Territories">
              <PropertyRef Name="TerritoryID" />
            </Principal>
            <Dependent Role="EmployeeTerritories">
              <PropertyRef Name="TerritoryID" />
            </Dependent>
          </ReferentialConstraint>
        </Association>
        <Association Name="FK_Order Details_OrderID_OrderID">
          <End Role="Orders" Type="northwindModel.Store.Orders" Multiplicity="1" />
          <End Role="Order Details" Type="northwindModel.Store.Order Details" Multiplicity="*" />
          <ReferentialConstraint>
            <Principal Role="Orders">
              <PropertyRef Name="OrderID" />
            </Principal>
            <Dependent Role="Order Details">
              <PropertyRef Name="OrderID" />
            </Dependent>
          </ReferentialConstraint>
        </Association>
        <Association Name="FK_Order Details_ProductID_ProductID">
          <End Role="Products" Type="northwindModel.Store.Products" Multiplicity="1" />
          <End Role="Order Details" Type="northwindModel.Store.Order Details" Multiplicity="*" />
          <ReferentialConstraint>
            <Principal Role="Products">
              <PropertyRef Name="ProductID" />
            </Principal>
            <Dependent Role="Order Details">
              <PropertyRef Name="ProductID" />
            </Dependent>
          </ReferentialConstraint>
        </Association>
        <Association Name="FK_Orders_CustomerID_CustomerID">
          <End Role="Customers" Type="northwindModel.Store.Customers" Multiplicity="0..1" />
          <End Role="Orders" Type="northwindModel.Store.Orders" Multiplicity="*" />
          <ReferentialConstraint>
            <Principal Role="Customers">
              <PropertyRef Name="CustomerID" />
            </Principal>
            <Dependent Role="Orders">
              <PropertyRef Name="CustomerID" />
            </Dependent>
          </ReferentialConstraint>
        </Association>
        <Association Name="FK_Orders_EmployeeID_EmployeeID">
          <End Role="Employees" Type="northwindModel.Store.Employees" Multiplicity="0..1" />
          <End Role="Orders" Type="northwindModel.Store.Orders" Multiplicity="*" />
          <ReferentialConstraint>
            <Principal Role="Employees">
              <PropertyRef Name="EmployeeID" />
            </Principal>
            <Dependent Role="Orders">
              <PropertyRef Name="EmployeeID" />
            </Dependent>
          </ReferentialConstraint>
        </Association>
        <Association Name="FK_Orders_ShipVia_ShipperID">
          <End Role="Shippers" Type="northwindModel.Store.Shippers" Multiplicity="0..1" />
          <End Role="Orders" Type="northwindModel.Store.Orders" Multiplicity="*" />
          <ReferentialConstraint>
            <Principal Role="Shippers">
              <PropertyRef Name="ShipperID" />
            </Principal>
            <Dependent Role="Orders">
              <PropertyRef Name="ShipVia" />
            </Dependent>
          </ReferentialConstraint>
        </Association>
        <Association Name="FK_Products_CategoryID_CategoryID">
          <End Role="Categories" Type="northwindModel.Store.Categories" Multiplicity="0..1" />
          <End Role="Products" Type="northwindModel.Store.Products" Multiplicity="*" />
          <ReferentialConstraint>
            <Principal Role="Categories">
              <PropertyRef Name="CategoryID" />
            </Principal>
            <Dependent Role="Products">
              <PropertyRef Name="CategoryID" />
            </Dependent>
          </ReferentialConstraint>
        </Association>
        <Association Name="FK_Products_SupplierID_SupplierID">
          <End Role="Suppliers" Type="northwindModel.Store.Suppliers" Multiplicity="0..1" />
          <End Role="Products" Type="northwindModel.Store.Products" Multiplicity="*" />
          <ReferentialConstraint>
            <Principal Role="Suppliers">
              <PropertyRef Name="SupplierID" />
            </Principal>
            <Dependent Role="Products">
              <PropertyRef Name="SupplierID" />
            </Dependent>
          </ReferentialConstraint>
        </Association>
        <Association Name="FK_Territories_RegionID_RegionID">
          <End Role="Region" Type="northwindModel.Store.Region" Multiplicity="1" />
          <End Role="Territories" Type="northwindModel.Store.Territories" Multiplicity="*" />
          <ReferentialConstraint>
            <Principal Role="Region">
              <PropertyRef Name="RegionID" />
            </Principal>
            <Dependent Role="Territories">
              <PropertyRef Name="RegionID" />
            </Dependent>
          </ReferentialConstraint>
        </Association>
      </Schema>
    </edmx:StorageModels>
    <!-- CSDL content -->
    <edmx:ConceptualModels>
      <Schema Namespace="northwindModel" Alias="Self" xmlns="http://schemas.microsoft.com/ado/2006/04/edm">
        <EntityContainer Name="northwindEntities">
          <EntitySet Name="Categories" EntityType="northwindModel.Categories" />
          <EntitySet Name="CustomerDemographics" EntityType="northwindModel.CustomerDemographics" />
          <EntitySet Name="Customers" EntityType="northwindModel.Customers" />
          <EntitySet Name="Employees" EntityType="northwindModel.Employees" />

          <EntitySet Name="Order_Details" EntityType="northwindModel.Order_Details" />
          <EntitySet Name="Orders" EntityType="northwindModel.Orders" />

          <EntitySet Name="Products" EntityType="northwindModel.Products" />
          <EntitySet Name="Region" EntityType="northwindModel.Region" />
          <EntitySet Name="Shippers" EntityType="northwindModel.Shippers" />
          <EntitySet Name="Suppliers" EntityType="northwindModel.Suppliers" />
          <EntitySet Name="Territories" EntityType="northwindModel.Territories" />
          <AssociationSet Name="FK_Products_CategoryID_CategoryID" Association="northwindModel.FK_Products_CategoryID_CategoryID">
            <End Role="Categories" EntitySet="Categories" />
            <End Role="Products" EntitySet="Products" />
          </AssociationSet>
          <AssociationSet Name="FK_Orders_CustomerID_CustomerID" Association="northwindModel.FK_Orders_CustomerID_CustomerID">
            <End Role="Customers" EntitySet="Customers" />
            <End Role="Orders" EntitySet="Orders" />
          </AssociationSet>
          <AssociationSet Name="FK_Employees_ReportsTo_EmployeeID" Association="northwindModel.FK_Employees_ReportsTo_EmployeeID">
            <End Role="Employees" EntitySet="Employees" />
            <End Role="Employees1" EntitySet="Employees" />
          </AssociationSet>
          <AssociationSet Name="FK_Orders_EmployeeID_EmployeeID" Association="northwindModel.FK_Orders_EmployeeID_EmployeeID">
            <End Role="Employees" EntitySet="Employees" />
            <End Role="Orders" EntitySet="Orders" />

          </AssociationSet>
          <AssociationSet Name="FK_Order_Details_OrderID_OrderID" Association="northwindModel.FK_Order_Details_OrderID_OrderID">
            <End Role="Orders" EntitySet="Orders" />
            <End Role="Order_Details" EntitySet="Order_Details" />
          </AssociationSet>
          <AssociationSet Name="FK_Order_Details_ProductID_ProductID" Association="northwindModel.FK_Order_Details_ProductID_ProductID">
            <End Role="Products" EntitySet="Products" />
            <End Role="Order_Details" EntitySet="Order_Details" />
          </AssociationSet>
          <AssociationSet Name="FK_Orders_ShipVia_ShipperID" Association="northwindModel.FK_Orders_ShipVia_ShipperID">
            <End Role="Shippers" EntitySet="Shippers" />
            <End Role="Orders" EntitySet="Orders" />
          </AssociationSet>
          <AssociationSet Name="FK_Products_SupplierID_SupplierID" Association="northwindModel.FK_Products_SupplierID_SupplierID">
            <End Role="Suppliers" EntitySet="Suppliers" />
            <End Role="Products" EntitySet="Products" />
          </AssociationSet>
          <AssociationSet Name="FK_Territories_RegionID_RegionID" Association="northwindModel.FK_Territories_RegionID_RegionID">
            <End Role="Region" EntitySet="Region" />
            <End Role="Territories" EntitySet="Territories" />
          </AssociationSet>
          <AssociationSet Name="CustomerCustomerDemo" Association="northwindModel.CustomerCustomerDemo">
            <End Role="Customers" EntitySet="Customers" />
            <End Role="CustomerDemographics" EntitySet="CustomerDemographics" />
          </AssociationSet>
          <AssociationSet Name="EmployeeTerritories" Association="northwindModel.EmployeeTerritories">
            <End Role="Employees" EntitySet="Employees" />
            <End Role="Territories" EntitySet="Territories" />
          </AssociationSet>
        </EntityContainer>
        <EntityType Name="Categories">
          <Key>
            <PropertyRef Name="CategoryID" />
          </Key>
          <Property Name="CategoryID" Type="Int64" Nullable="false" />
          <Property Name="CategoryName" Type="String" Nullable="false" MaxLength="15" Unicode="true" FixedLength="false" />
          <Property Name="Description" Type="String" MaxLength="2147483647" Unicode="true" FixedLength="false" />
          <Property Name="Picture" Type="Binary" MaxLength="2147483647" FixedLength="false" />
          <NavigationProperty Name="Products" Relationship="northwindModel.FK_Products_CategoryID_CategoryID" FromRole="Categories" ToRole="Products" />
        </EntityType>
        <EntityType Name="CustomerDemographics">
          <Key>
            <PropertyRef Name="CustomerTypeID" />
          </Key>
          <Property Name="CustomerTypeID" Type="String" Nullable="false" MaxLength="10" Unicode="true" FixedLength="false" />
          <Property Name="CustomerDesc" Type="String" MaxLength="2147483647" Unicode="true" FixedLength="false" />
          <NavigationProperty Name="Customers" Relationship="northwindModel.CustomerCustomerDemo" FromRole="CustomerDemographics" ToRole="Customers" />
        </EntityType>
        <EntityType Name="Customers">
          <Key>
            <PropertyRef Name="CustomerID" />
          </Key>
          <Property Name="CustomerID" Type="String" Nullable="false" MaxLength="5" Unicode="true" FixedLength="false" />
          <Property Name="CompanyName" Type="String" Nullable="false" MaxLength="40" Unicode="true" FixedLength="false" />
          <Property Name="ContactName" Type="String" MaxLength="30" Unicode="true" FixedLength="false" />
          <Property Name="ContactTitle" Type="String" MaxLength="30" Unicode="true" FixedLength="false" />
          <Property Name="Address" Type="String" MaxLength="60" Unicode="true" FixedLength="false" />
          <Property Name="City" Type="String" MaxLength="15" Unicode="true" FixedLength="false" />
          <Property Name="Region" Type="String" MaxLength="15" Unicode="true" FixedLength="false" />
          <Property Name="PostalCode" Type="String" MaxLength="10" Unicode="true" FixedLength="false" />
          <Property Name="Country" Type="String" MaxLength="15" Unicode="true" FixedLength="false" />
          <Property Name="Phone" Type="String" MaxLength="24" Unicode="true" FixedLength="false" />
          <Property Name="Fax" Type="String" MaxLength="24" Unicode="true" FixedLength="false" />
          <NavigationProperty Name="Orders" Relationship="northwindModel.FK_Orders_CustomerID_CustomerID" FromRole="Customers" ToRole="Orders" />
          <NavigationProperty Name="CustomerDemographics" Relationship="northwindModel.CustomerCustomerDemo" FromRole="Customers" ToRole="CustomerDemographics" />
        </EntityType>
        <EntityType Name="Employees">
          <Key>
            <PropertyRef Name="EmployeeID" />
          </Key>
          <Property Name="EmployeeID" Type="Int64" Nullable="false" />
          <Property Name="LastName" Type="String" Nullable="false" MaxLength="20" Unicode="true" FixedLength="false" />
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434

435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514









515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551





552


553

554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594




595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614








615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
          <Property Name="PostalCode" Type="String" MaxLength="10" Unicode="true" FixedLength="false" />
          <Property Name="Country" Type="String" MaxLength="15" Unicode="true" FixedLength="false" />
          <Property Name="HomePhone" Type="String" MaxLength="24" Unicode="true" FixedLength="false" />
          <Property Name="Extension" Type="String" MaxLength="4" Unicode="true" FixedLength="false" />
          <Property Name="Photo" Type="Binary" MaxLength="2147483647" FixedLength="false" />
          <Property Name="Notes" Type="String" MaxLength="2147483647" Unicode="true" FixedLength="false" />
          <Property Name="PhotoPath" Type="String" MaxLength="255" Unicode="true" FixedLength="false" />
          <NavigationProperty Name="Territories" Relationship="northwindEFModel.EmployeesTerritories" FromRole="Employees" ToRole="Territories" />
        </EntityType>
        <EntityType Name="InternationalOrders">
          <Key>
            <PropertyRef Name="OrderID" />
          </Key>
          <Property Name="OrderID" Type="Int64" Nullable="false" />
          <Property Name="CustomsDescription" Type="String" Nullable="false" MaxLength="100" Unicode="true" FixedLength="false" />
          <Property Name="ExciseTax" Type="Decimal" Nullable="false" Precision="53" Scale="0" />
          <NavigationProperty Name="Orders" Relationship="northwindEFModel.FK_InternationalOrders_OrderID_OrderID" FromRole="InternationalOrders" ToRole="Orders" />

        </EntityType>
        <EntityType Name="OrderDetails">
          <Key>
            <PropertyRef Name="OrderID" />
            <PropertyRef Name="ProductID" />
          </Key>
          <Property Name="OrderID" Type="Int64" Nullable="false" />
          <Property Name="ProductID" Type="Int64" Nullable="false" />
          <Property Name="UnitPrice" Type="Decimal" Nullable="false" Precision="53" Scale="0" />
          <Property Name="Quantity" Type="Int16" Nullable="false" />
          <Property Name="Discount" Type="Single" Nullable="false" />
          <NavigationProperty Name="Orders" Relationship="northwindEFModel.FK_OrderDetails_OrderID_OrderID" FromRole="OrderDetails" ToRole="Orders" />
          <NavigationProperty Name="Products" Relationship="northwindEFModel.FK_OrderDetails_ProductID_ProductID" FromRole="OrderDetails" ToRole="Products" />
        </EntityType>
        <EntityType Name="Orders">
          <Key>
            <PropertyRef Name="OrderID" />
          </Key>
          <Property Name="OrderID" Type="Int64" Nullable="false" />
          <Property Name="EmployeeID" Type="Int64" />
          <Property Name="OrderDate" Type="DateTime" />
          <Property Name="RequiredDate" Type="DateTime" />
          <Property Name="ShippedDate" Type="DateTime" />
          <Property Name="Freight" Type="Decimal" Precision="53" Scale="0" />
          <Property Name="ShipName" Type="String" MaxLength="40" Unicode="true" FixedLength="false" />
          <Property Name="ShipAddress" Type="String" MaxLength="60" Unicode="true" FixedLength="false" />
          <Property Name="ShipCity" Type="String" MaxLength="15" Unicode="true" FixedLength="false" />
          <Property Name="ShipRegion" Type="String" MaxLength="15" Unicode="true" FixedLength="false" />
          <Property Name="ShipPostalCode" Type="String" MaxLength="10" Unicode="true" FixedLength="false" />
          <Property Name="ShipCountry" Type="String" MaxLength="15" Unicode="true" FixedLength="false" />
          <NavigationProperty Name="Customers" Relationship="northwindEFModel.FK_Orders_CustomerID_CustomerID" FromRole="Orders" ToRole="Customers" />
          <NavigationProperty Name="InternationalOrders" Relationship="northwindEFModel.FK_InternationalOrders_OrderID_OrderID" FromRole="Orders" ToRole="InternationalOrders" />
          <NavigationProperty Name="OrderDetails" Relationship="northwindEFModel.FK_OrderDetails_OrderID_OrderID" FromRole="Orders" ToRole="OrderDetails" />
        </EntityType>
        <EntityType Name="PreviousEmployees">
          <Key>
            <PropertyRef Name="EmployeeID" />
          </Key>
          <Property Name="EmployeeID" Type="Int64" Nullable="false" />
          <Property Name="LastName" Type="String" Nullable="false" MaxLength="20" Unicode="true" FixedLength="false" />
          <Property Name="FirstName" Type="String" Nullable="false" MaxLength="10" Unicode="true" FixedLength="false" />
          <Property Name="Title" Type="String" MaxLength="30" Unicode="true" FixedLength="false" />
          <Property Name="TitleOfCourtesy" Type="String" MaxLength="25" Unicode="true" FixedLength="false" />
          <Property Name="BirthDate" Type="DateTime" />
          <Property Name="HireDate" Type="DateTime" />
          <Property Name="Address" Type="String" MaxLength="60" Unicode="true" FixedLength="false" />
          <Property Name="City" Type="String" MaxLength="15" Unicode="true" FixedLength="false" />
          <Property Name="Region" Type="String" MaxLength="15" Unicode="true" FixedLength="false" />
          <Property Name="PostalCode" Type="String" MaxLength="10" Unicode="true" FixedLength="false" />
          <Property Name="Country" Type="String" MaxLength="15" Unicode="true" FixedLength="false" />
          <Property Name="HomePhone" Type="String" MaxLength="24" Unicode="true" FixedLength="false" />
          <Property Name="Extension" Type="String" MaxLength="4" Unicode="true" FixedLength="false" />
          <Property Name="Photo" Type="Binary" MaxLength="2147483647" FixedLength="false" />
          <Property Name="Notes" Type="String" MaxLength="2147483647" Unicode="true" FixedLength="false" />
          <Property Name="PhotoPath" Type="String" MaxLength="255" Unicode="true" FixedLength="false" />
        </EntityType>
        <EntityType Name="Products">
          <Key>
            <PropertyRef Name="ProductID" />
          </Key>
          <Property Name="ProductID" Type="Int64" Nullable="false" />
          <Property Name="ProductName" Type="String" Nullable="false" MaxLength="40" Unicode="true" FixedLength="false" />
          <Property Name="QuantityPerUnit" Type="String" MaxLength="20" Unicode="true" FixedLength="false" />
          <Property Name="UnitPrice" Type="Decimal" Precision="53" Scale="0" />
          <Property Name="UnitsInStock" Type="Int16" />
          <Property Name="UnitsOnOrder" Type="Int16" />
          <Property Name="ReorderLevel" Type="Int16" />
          <Property Name="Discontinued" Type="Boolean" Nullable="false" />
          <Property Name="DiscontinuedDate" Type="DateTime" />
          <NavigationProperty Name="Categories" Relationship="northwindEFModel.FK_Products_CategoryID_CategoryID" FromRole="Products" ToRole="Categories" />
          <NavigationProperty Name="OrderDetails" Relationship="northwindEFModel.FK_OrderDetails_ProductID_ProductID" FromRole="Products" ToRole="OrderDetails" />
          <NavigationProperty Name="Suppliers" Relationship="northwindEFModel.FK_Products_SupplierID_SupplierID" FromRole="Products" ToRole="Suppliers" />
        </EntityType>
        <EntityType Name="Regions">
          <Key>
            <PropertyRef Name="RegionID" />
          </Key>
          <Property Name="RegionID" Type="Int64" Nullable="false" />
          <Property Name="RegionDescription" Type="String" Nullable="false" MaxLength="50" Unicode="true" FixedLength="false" />
          <NavigationProperty Name="Territories" Relationship="northwindEFModel.FK_Territories_RegionID_RegionID" FromRole="Regions" ToRole="Territories" />









        </EntityType>
        <EntityType Name="Suppliers">
          <Key>
            <PropertyRef Name="SupplierID" />
          </Key>
          <Property Name="SupplierID" Type="Int64" Nullable="false" />
          <Property Name="CompanyName" Type="String" Nullable="false" MaxLength="40" Unicode="true" FixedLength="false" />
          <Property Name="ContactName" Type="String" MaxLength="30" Unicode="true" FixedLength="false" />
          <Property Name="ContactTitle" Type="String" MaxLength="30" Unicode="true" FixedLength="false" />
          <Property Name="Address" Type="String" MaxLength="60" Unicode="true" FixedLength="false" />
          <Property Name="City" Type="String" MaxLength="15" Unicode="true" FixedLength="false" />
          <Property Name="Region" Type="String" MaxLength="15" Unicode="true" FixedLength="false" />
          <Property Name="PostalCode" Type="String" MaxLength="10" Unicode="true" FixedLength="false" />
          <Property Name="Country" Type="String" MaxLength="15" Unicode="true" FixedLength="false" />
          <Property Name="Phone" Type="String" MaxLength="24" Unicode="true" FixedLength="false" />
          <Property Name="Fax" Type="String" MaxLength="24" Unicode="true" FixedLength="false" />
          <Property Name="HomePage" Type="String" MaxLength="2147483647" Unicode="true" FixedLength="false" />
          <NavigationProperty Name="Products" Relationship="northwindEFModel.FK_Products_SupplierID_SupplierID" FromRole="Suppliers" ToRole="Products" />
        </EntityType>
        <EntityType Name="Territories">
          <Key>
            <PropertyRef Name="TerritoryID" />
          </Key>
          <Property Name="TerritoryID" Type="Int64" Nullable="false" />
          <Property Name="TerritoryDescription" Type="String" Nullable="false" MaxLength="50" Unicode="true" FixedLength="false" />
          <NavigationProperty Name="Regions" Relationship="northwindEFModel.FK_Territories_RegionID_RegionID" FromRole="Territories" ToRole="Regions" />
          <NavigationProperty Name="Employees" Relationship="northwindEFModel.EmployeesTerritories" FromRole="Territories" ToRole="Employees" />
        </EntityType>
        <Association Name="FK_Products_CategoryID_CategoryID">
          <End Role="Categories" Type="northwindEFModel.Categories" Multiplicity="0..1" />
          <End Role="Products" Type="northwindEFModel.Products" Multiplicity="*" />
        </Association>
        <Association Name="FK_Orders_CustomerID_CustomerID">
          <End Role="Customers" Type="northwindEFModel.Customers" Multiplicity="0..1" />
          <End Role="Orders" Type="northwindEFModel.Orders" Multiplicity="*" />
        </Association>
        <Association Name="FK_InternationalOrders_OrderID_OrderID">





          <End Role="Orders" Type="northwindEFModel.Orders" Multiplicity="1" />


          <End Role="InternationalOrders" Type="northwindEFModel.InternationalOrders" Multiplicity="0..1" />

          <ReferentialConstraint>
            <Principal Role="Orders">
              <PropertyRef Name="OrderID" />
            </Principal>
            <Dependent Role="InternationalOrders">
              <PropertyRef Name="OrderID" />
            </Dependent>
          </ReferentialConstraint>
        </Association>
        <Association Name="FK_OrderDetails_OrderID_OrderID">
          <End Role="Orders" Type="northwindEFModel.Orders" Multiplicity="1" />
          <End Role="OrderDetails" Type="northwindEFModel.OrderDetails" Multiplicity="*" />
          <ReferentialConstraint>
            <Principal Role="Orders">
              <PropertyRef Name="OrderID" />
            </Principal>
            <Dependent Role="OrderDetails">
              <PropertyRef Name="OrderID" />
            </Dependent>
          </ReferentialConstraint>
        </Association>
        <Association Name="FK_OrderDetails_ProductID_ProductID">
          <End Role="Products" Type="northwindEFModel.Products" Multiplicity="1" />
          <End Role="OrderDetails" Type="northwindEFModel.OrderDetails" Multiplicity="*" />
          <ReferentialConstraint>
            <Principal Role="Products">
              <PropertyRef Name="ProductID" />
            </Principal>
            <Dependent Role="OrderDetails">
              <PropertyRef Name="ProductID" />
            </Dependent>
          </ReferentialConstraint>
        </Association>
        <Association Name="FK_Products_SupplierID_SupplierID">
          <End Role="Suppliers" Type="northwindEFModel.Suppliers" Multiplicity="0..1" />
          <End Role="Products" Type="northwindEFModel.Products" Multiplicity="*" />
        </Association>
        <Association Name="FK_Territories_RegionID_RegionID">
          <End Role="Regions" Type="northwindEFModel.Regions" Multiplicity="1" />
          <End Role="Territories" Type="northwindEFModel.Territories" Multiplicity="*" />
        </Association>




        <Association Name="EmployeesTerritories">
          <End Role="Employees" Type="northwindEFModel.Employees" Multiplicity="*" />
          <End Role="Territories" Type="northwindEFModel.Territories" Multiplicity="*" />
        </Association>
        </Schema>
    </edmx:ConceptualModels>
    <!-- C-S mapping content -->
    <edmx:Mappings>
      <Mapping Space="C-S" xmlns="urn:schemas-microsoft-com:windows:storage:mapping:CS">
        <EntityContainerMapping StorageEntityContainer="northwindEFModelStoreContainer" CdmEntityContainer="northwindEFEntities">
          <EntitySetMapping Name="Categories">
            <EntityTypeMapping TypeName="IsTypeOf(northwindEFModel.Categories)">
              <MappingFragment StoreEntitySet="Categories">
                <ScalarProperty Name="CategoryID" ColumnName="CategoryID" />
                <ScalarProperty Name="CategoryName" ColumnName="CategoryName" />
                <ScalarProperty Name="Description" ColumnName="Description" />
                <ScalarProperty Name="Picture" ColumnName="Picture" />
              </MappingFragment>
            </EntityTypeMapping>
          </EntitySetMapping>








          <EntitySetMapping Name="Customers">
            <EntityTypeMapping TypeName="IsTypeOf(northwindEFModel.Customers)">
              <MappingFragment StoreEntitySet="Customers">
                <ScalarProperty Name="CustomerID" ColumnName="CustomerID" />
                <ScalarProperty Name="CompanyName" ColumnName="CompanyName" />
                <ScalarProperty Name="ContactName" ColumnName="ContactName" />
                <ScalarProperty Name="ContactTitle" ColumnName="ContactTitle" />
                <ScalarProperty Name="Address" ColumnName="Address" />
                <ScalarProperty Name="City" ColumnName="City" />
                <ScalarProperty Name="Region" ColumnName="Region" />
                <ScalarProperty Name="PostalCode" ColumnName="PostalCode" />
                <ScalarProperty Name="Country" ColumnName="Country" />
                <ScalarProperty Name="Phone" ColumnName="Phone" />
                <ScalarProperty Name="Fax" ColumnName="Fax" />
              </MappingFragment>
            </EntityTypeMapping>
          </EntitySetMapping>
          <EntitySetMapping Name="Employees">
            <EntityTypeMapping TypeName="IsTypeOf(northwindEFModel.Employees)">
              <MappingFragment StoreEntitySet="Employees">
                <ScalarProperty Name="EmployeeID" ColumnName="EmployeeID" />
                <ScalarProperty Name="LastName" ColumnName="LastName" />
                <ScalarProperty Name="FirstName" ColumnName="FirstName" />
                <ScalarProperty Name="Title" ColumnName="Title" />
                <ScalarProperty Name="TitleOfCourtesy" ColumnName="TitleOfCourtesy" />
                <ScalarProperty Name="BirthDate" ColumnName="BirthDate" />







|
<
<
<
<
<
|
<
<
|
>

|









|
|






<










|
|
|
<
<
<
<
<
<
<
<
<
<
|
<
<
<
<
<
<
<
<
<
<
<













<
|
|
|

|





|
>
>
>
>
>
>
>
>
>

















|





|

|
|


|
|


|
|

|
>
>
>
>
>
|
>
>
|
>




|




|
|
|

|
|

|
|



|
|
|
<
<
<
<
<
<
<
<


|
|


|
|

>
>
>
>
|
|
|

|




|

|








>
>
>
>
>
>
>
>

|
















|







499
500
501
502
503
504
505
506





507


508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528

529
530
531
532
533
534
535
536
537
538
539
540
541










542











543
544
545
546
547
548
549
550
551
552
553
554
555

556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646








647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
          <Property Name="PostalCode" Type="String" MaxLength="10" Unicode="true" FixedLength="false" />
          <Property Name="Country" Type="String" MaxLength="15" Unicode="true" FixedLength="false" />
          <Property Name="HomePhone" Type="String" MaxLength="24" Unicode="true" FixedLength="false" />
          <Property Name="Extension" Type="String" MaxLength="4" Unicode="true" FixedLength="false" />
          <Property Name="Photo" Type="Binary" MaxLength="2147483647" FixedLength="false" />
          <Property Name="Notes" Type="String" MaxLength="2147483647" Unicode="true" FixedLength="false" />
          <Property Name="PhotoPath" Type="String" MaxLength="255" Unicode="true" FixedLength="false" />
          <NavigationProperty Name="Employees1" Relationship="northwindModel.FK_Employees_ReportsTo_EmployeeID" FromRole="Employees" ToRole="Employees1" />





          <NavigationProperty Name="Employees2" Relationship="northwindModel.FK_Employees_ReportsTo_EmployeeID" FromRole="Employees1" ToRole="Employees" />


          <NavigationProperty Name="Orders" Relationship="northwindModel.FK_Orders_EmployeeID_EmployeeID" FromRole="Employees" ToRole="Orders" />
          <NavigationProperty Name="Territories" Relationship="northwindModel.EmployeeTerritories" FromRole="Employees" ToRole="Territories" />
        </EntityType>
        <EntityType Name="Order_Details">
          <Key>
            <PropertyRef Name="OrderID" />
            <PropertyRef Name="ProductID" />
          </Key>
          <Property Name="OrderID" Type="Int64" Nullable="false" />
          <Property Name="ProductID" Type="Int64" Nullable="false" />
          <Property Name="UnitPrice" Type="Decimal" Nullable="false" Precision="53" Scale="0" />
          <Property Name="Quantity" Type="Int16" Nullable="false" />
          <Property Name="Discount" Type="Single" Nullable="false" />
          <NavigationProperty Name="Orders" Relationship="northwindModel.FK_Order_Details_OrderID_OrderID" FromRole="Order_Details" ToRole="Orders" />
          <NavigationProperty Name="Products" Relationship="northwindModel.FK_Order_Details_ProductID_ProductID" FromRole="Order_Details" ToRole="Products" />
        </EntityType>
        <EntityType Name="Orders">
          <Key>
            <PropertyRef Name="OrderID" />
          </Key>
          <Property Name="OrderID" Type="Int64" Nullable="false" />

          <Property Name="OrderDate" Type="DateTime" />
          <Property Name="RequiredDate" Type="DateTime" />
          <Property Name="ShippedDate" Type="DateTime" />
          <Property Name="Freight" Type="Decimal" Precision="53" Scale="0" />
          <Property Name="ShipName" Type="String" MaxLength="40" Unicode="true" FixedLength="false" />
          <Property Name="ShipAddress" Type="String" MaxLength="60" Unicode="true" FixedLength="false" />
          <Property Name="ShipCity" Type="String" MaxLength="15" Unicode="true" FixedLength="false" />
          <Property Name="ShipRegion" Type="String" MaxLength="15" Unicode="true" FixedLength="false" />
          <Property Name="ShipPostalCode" Type="String" MaxLength="10" Unicode="true" FixedLength="false" />
          <Property Name="ShipCountry" Type="String" MaxLength="15" Unicode="true" FixedLength="false" />
          <NavigationProperty Name="Customers" Relationship="northwindModel.FK_Orders_CustomerID_CustomerID" FromRole="Orders" ToRole="Customers" />
          <NavigationProperty Name="Employees" Relationship="northwindModel.FK_Orders_EmployeeID_EmployeeID" FromRole="Orders" ToRole="Employees" />
          <NavigationProperty Name="Order_Details" Relationship="northwindModel.FK_Order_Details_OrderID_OrderID" FromRole="Orders" ToRole="Order_Details" />










          <NavigationProperty Name="Shippers" Relationship="northwindModel.FK_Orders_ShipVia_ShipperID" FromRole="Orders" ToRole="Shippers" />











        </EntityType>
        <EntityType Name="Products">
          <Key>
            <PropertyRef Name="ProductID" />
          </Key>
          <Property Name="ProductID" Type="Int64" Nullable="false" />
          <Property Name="ProductName" Type="String" Nullable="false" MaxLength="40" Unicode="true" FixedLength="false" />
          <Property Name="QuantityPerUnit" Type="String" MaxLength="20" Unicode="true" FixedLength="false" />
          <Property Name="UnitPrice" Type="Decimal" Precision="53" Scale="0" />
          <Property Name="UnitsInStock" Type="Int16" />
          <Property Name="UnitsOnOrder" Type="Int16" />
          <Property Name="ReorderLevel" Type="Int16" />
          <Property Name="Discontinued" Type="Boolean" Nullable="false" />

          <NavigationProperty Name="Categories" Relationship="northwindModel.FK_Products_CategoryID_CategoryID" FromRole="Products" ToRole="Categories" />
          <NavigationProperty Name="Order_Details" Relationship="northwindModel.FK_Order_Details_ProductID_ProductID" FromRole="Products" ToRole="Order_Details" />
          <NavigationProperty Name="Suppliers" Relationship="northwindModel.FK_Products_SupplierID_SupplierID" FromRole="Products" ToRole="Suppliers" />
        </EntityType>
        <EntityType Name="Region">
          <Key>
            <PropertyRef Name="RegionID" />
          </Key>
          <Property Name="RegionID" Type="Int64" Nullable="false" />
          <Property Name="RegionDescription" Type="String" Nullable="false" MaxLength="50" Unicode="true" FixedLength="false" />
          <NavigationProperty Name="Territories" Relationship="northwindModel.FK_Territories_RegionID_RegionID" FromRole="Region" ToRole="Territories" />
        </EntityType>
        <EntityType Name="Shippers">
          <Key>
            <PropertyRef Name="ShipperID" />
          </Key>
          <Property Name="ShipperID" Type="Int64" Nullable="false" />
          <Property Name="CompanyName" Type="String" Nullable="false" MaxLength="40" Unicode="true" FixedLength="false" />
          <Property Name="Phone" Type="String" MaxLength="24" Unicode="true" FixedLength="false" />
          <NavigationProperty Name="Orders" Relationship="northwindModel.FK_Orders_ShipVia_ShipperID" FromRole="Shippers" ToRole="Orders" />
        </EntityType>
        <EntityType Name="Suppliers">
          <Key>
            <PropertyRef Name="SupplierID" />
          </Key>
          <Property Name="SupplierID" Type="Int64" Nullable="false" />
          <Property Name="CompanyName" Type="String" Nullable="false" MaxLength="40" Unicode="true" FixedLength="false" />
          <Property Name="ContactName" Type="String" MaxLength="30" Unicode="true" FixedLength="false" />
          <Property Name="ContactTitle" Type="String" MaxLength="30" Unicode="true" FixedLength="false" />
          <Property Name="Address" Type="String" MaxLength="60" Unicode="true" FixedLength="false" />
          <Property Name="City" Type="String" MaxLength="15" Unicode="true" FixedLength="false" />
          <Property Name="Region" Type="String" MaxLength="15" Unicode="true" FixedLength="false" />
          <Property Name="PostalCode" Type="String" MaxLength="10" Unicode="true" FixedLength="false" />
          <Property Name="Country" Type="String" MaxLength="15" Unicode="true" FixedLength="false" />
          <Property Name="Phone" Type="String" MaxLength="24" Unicode="true" FixedLength="false" />
          <Property Name="Fax" Type="String" MaxLength="24" Unicode="true" FixedLength="false" />
          <Property Name="HomePage" Type="String" MaxLength="2147483647" Unicode="true" FixedLength="false" />
          <NavigationProperty Name="Products" Relationship="northwindModel.FK_Products_SupplierID_SupplierID" FromRole="Suppliers" ToRole="Products" />
        </EntityType>
        <EntityType Name="Territories">
          <Key>
            <PropertyRef Name="TerritoryID" />
          </Key>
          <Property Name="TerritoryID" Type="String" Nullable="false" MaxLength="20" Unicode="true" FixedLength="false" />
          <Property Name="TerritoryDescription" Type="String" Nullable="false" MaxLength="50" Unicode="true" FixedLength="false" />
          <NavigationProperty Name="Region" Relationship="northwindModel.FK_Territories_RegionID_RegionID" FromRole="Territories" ToRole="Region" />
          <NavigationProperty Name="Employees" Relationship="northwindModel.EmployeeTerritories" FromRole="Territories" ToRole="Employees" />
        </EntityType>
        <Association Name="FK_Products_CategoryID_CategoryID">
          <End Role="Categories" Type="northwindModel.Categories" Multiplicity="0..1" />
          <End Role="Products" Type="northwindModel.Products" Multiplicity="*" />
        </Association>
        <Association Name="FK_Orders_CustomerID_CustomerID">
          <End Role="Customers" Type="northwindModel.Customers" Multiplicity="0..1" />
          <End Role="Orders" Type="northwindModel.Orders" Multiplicity="*" />
        </Association>
        <Association Name="FK_Employees_ReportsTo_EmployeeID">
          <End Role="Employees" Type="northwindModel.Employees" Multiplicity="0..1" />
          <End Role="Employees1" Type="northwindModel.Employees" Multiplicity="*" />
        </Association>
        <Association Name="FK_Orders_EmployeeID_EmployeeID">
          <End Role="Employees" Type="northwindModel.Employees" Multiplicity="0..1" />
          <End Role="Orders" Type="northwindModel.Orders" Multiplicity="*" />
        </Association>
        <Association Name="FK_Order_Details_OrderID_OrderID">
          <End Role="Orders" Type="northwindModel.Orders" Multiplicity="1" />
          <End Role="Order_Details" Type="northwindModel.Order_Details" Multiplicity="*" />
          <ReferentialConstraint>
            <Principal Role="Orders">
              <PropertyRef Name="OrderID" />
            </Principal>
            <Dependent Role="Order_Details">
              <PropertyRef Name="OrderID" />
            </Dependent>
          </ReferentialConstraint>
        </Association>
        <Association Name="FK_Order_Details_ProductID_ProductID">
          <End Role="Products" Type="northwindModel.Products" Multiplicity="1" />
          <End Role="Order_Details" Type="northwindModel.Order_Details" Multiplicity="*" />
          <ReferentialConstraint>
            <Principal Role="Products">
              <PropertyRef Name="ProductID" />
            </Principal>
            <Dependent Role="Order_Details">
              <PropertyRef Name="ProductID" />
            </Dependent>
          </ReferentialConstraint>
        </Association>
        <Association Name="FK_Orders_ShipVia_ShipperID">
          <End Role="Shippers" Type="northwindModel.Shippers" Multiplicity="0..1" />
          <End Role="Orders" Type="northwindModel.Orders" Multiplicity="*" />








        </Association>
        <Association Name="FK_Products_SupplierID_SupplierID">
          <End Role="Suppliers" Type="northwindModel.Suppliers" Multiplicity="0..1" />
          <End Role="Products" Type="northwindModel.Products" Multiplicity="*" />
        </Association>
        <Association Name="FK_Territories_RegionID_RegionID">
          <End Role="Region" Type="northwindModel.Region" Multiplicity="1" />
          <End Role="Territories" Type="northwindModel.Territories" Multiplicity="*" />
        </Association>
        <Association Name="CustomerCustomerDemo">
          <End Role="Customers" Type="northwindModel.Customers" Multiplicity="*" />
          <End Role="CustomerDemographics" Type="northwindModel.CustomerDemographics" Multiplicity="*" />
        </Association>
        <Association Name="EmployeeTerritories">
          <End Role="Employees" Type="northwindModel.Employees" Multiplicity="*" />
          <End Role="Territories" Type="northwindModel.Territories" Multiplicity="*" />
        </Association>
      </Schema>
    </edmx:ConceptualModels>
    <!-- C-S mapping content -->
    <edmx:Mappings>
      <Mapping Space="C-S" xmlns="urn:schemas-microsoft-com:windows:storage:mapping:CS">
        <EntityContainerMapping StorageEntityContainer="northwindModelStoreContainer" CdmEntityContainer="northwindEntities">
          <EntitySetMapping Name="Categories">
            <EntityTypeMapping TypeName="IsTypeOf(northwindModel.Categories)">
              <MappingFragment StoreEntitySet="Categories">
                <ScalarProperty Name="CategoryID" ColumnName="CategoryID" />
                <ScalarProperty Name="CategoryName" ColumnName="CategoryName" />
                <ScalarProperty Name="Description" ColumnName="Description" />
                <ScalarProperty Name="Picture" ColumnName="Picture" />
              </MappingFragment>
            </EntityTypeMapping>
          </EntitySetMapping>
          <EntitySetMapping Name="CustomerDemographics">
            <EntityTypeMapping TypeName="IsTypeOf(northwindModel.CustomerDemographics)">
              <MappingFragment StoreEntitySet="CustomerDemographics">
                <ScalarProperty Name="CustomerTypeID" ColumnName="CustomerTypeID" />
                <ScalarProperty Name="CustomerDesc" ColumnName="CustomerDesc" />
              </MappingFragment>
            </EntityTypeMapping>
          </EntitySetMapping>
          <EntitySetMapping Name="Customers">
            <EntityTypeMapping TypeName="IsTypeOf(northwindModel.Customers)">
              <MappingFragment StoreEntitySet="Customers">
                <ScalarProperty Name="CustomerID" ColumnName="CustomerID" />
                <ScalarProperty Name="CompanyName" ColumnName="CompanyName" />
                <ScalarProperty Name="ContactName" ColumnName="ContactName" />
                <ScalarProperty Name="ContactTitle" ColumnName="ContactTitle" />
                <ScalarProperty Name="Address" ColumnName="Address" />
                <ScalarProperty Name="City" ColumnName="City" />
                <ScalarProperty Name="Region" ColumnName="Region" />
                <ScalarProperty Name="PostalCode" ColumnName="PostalCode" />
                <ScalarProperty Name="Country" ColumnName="Country" />
                <ScalarProperty Name="Phone" ColumnName="Phone" />
                <ScalarProperty Name="Fax" ColumnName="Fax" />
              </MappingFragment>
            </EntityTypeMapping>
          </EntitySetMapping>
          <EntitySetMapping Name="Employees">
            <EntityTypeMapping TypeName="IsTypeOf(northwindModel.Employees)">
              <MappingFragment StoreEntitySet="Employees">
                <ScalarProperty Name="EmployeeID" ColumnName="EmployeeID" />
                <ScalarProperty Name="LastName" ColumnName="LastName" />
                <ScalarProperty Name="FirstName" ColumnName="FirstName" />
                <ScalarProperty Name="Title" ColumnName="Title" />
                <ScalarProperty Name="TitleOfCourtesy" ColumnName="TitleOfCourtesy" />
                <ScalarProperty Name="BirthDate" ColumnName="BirthDate" />
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738









739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782








783




784
785
786
787
788
789
790
791
792
793
794
795









796
797
798
799
800
801
802
803
804
805
806
807

808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825








826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873


874


875
876
877

878
879


880
881
882

883

884
885
886
887
888
889
890

891
892
893
894
895
896
897
898
899
                <ScalarProperty Name="Extension" ColumnName="Extension" />
                <ScalarProperty Name="Photo" ColumnName="Photo" />
                <ScalarProperty Name="Notes" ColumnName="Notes" />
                <ScalarProperty Name="PhotoPath" ColumnName="PhotoPath" />
              </MappingFragment>
            </EntityTypeMapping>
          </EntitySetMapping>
          <EntitySetMapping Name="InternationalOrders">
            <EntityTypeMapping TypeName="IsTypeOf(northwindEFModel.InternationalOrders)">
              <MappingFragment StoreEntitySet="InternationalOrders">
                <ScalarProperty Name="OrderID" ColumnName="OrderID" />
                <ScalarProperty Name="CustomsDescription" ColumnName="CustomsDescription" />
                <ScalarProperty Name="ExciseTax" ColumnName="ExciseTax" />
              </MappingFragment>
            </EntityTypeMapping>
          </EntitySetMapping>
          <EntitySetMapping Name="OrderDetails">
            <EntityTypeMapping TypeName="IsTypeOf(northwindEFModel.OrderDetails)">
              <MappingFragment StoreEntitySet="OrderDetails">
                <ScalarProperty Name="OrderID" ColumnName="OrderID" />
                <ScalarProperty Name="ProductID" ColumnName="ProductID" />
                <ScalarProperty Name="UnitPrice" ColumnName="UnitPrice" />
                <ScalarProperty Name="Quantity" ColumnName="Quantity" />
                <ScalarProperty Name="Discount" ColumnName="Discount" />
              </MappingFragment>
            </EntityTypeMapping>
          </EntitySetMapping>
          <EntitySetMapping Name="Orders">
            <EntityTypeMapping TypeName="IsTypeOf(northwindEFModel.Orders)">
              <MappingFragment StoreEntitySet="Orders">
                <ScalarProperty Name="OrderID" ColumnName="OrderID" />
                <ScalarProperty Name="EmployeeID" ColumnName="EmployeeID" />
                <ScalarProperty Name="OrderDate" ColumnName="OrderDate" />
                <ScalarProperty Name="RequiredDate" ColumnName="RequiredDate" />
                <ScalarProperty Name="ShippedDate" ColumnName="ShippedDate" />
                <ScalarProperty Name="Freight" ColumnName="Freight" />
                <ScalarProperty Name="ShipName" ColumnName="ShipName" />
                <ScalarProperty Name="ShipAddress" ColumnName="ShipAddress" />
                <ScalarProperty Name="ShipCity" ColumnName="ShipCity" />
                <ScalarProperty Name="ShipRegion" ColumnName="ShipRegion" />
                <ScalarProperty Name="ShipPostalCode" ColumnName="ShipPostalCode" />
                <ScalarProperty Name="ShipCountry" ColumnName="ShipCountry" />
              </MappingFragment>
            </EntityTypeMapping>
          </EntitySetMapping>
          <EntitySetMapping Name="PreviousEmployees">
            <EntityTypeMapping TypeName="IsTypeOf(northwindEFModel.PreviousEmployees)">
              <MappingFragment StoreEntitySet="PreviousEmployees">
                <ScalarProperty Name="EmployeeID" ColumnName="EmployeeID" />
                <ScalarProperty Name="LastName" ColumnName="LastName" />
                <ScalarProperty Name="FirstName" ColumnName="FirstName" />
                <ScalarProperty Name="Title" ColumnName="Title" />
                <ScalarProperty Name="TitleOfCourtesy" ColumnName="TitleOfCourtesy" />
                <ScalarProperty Name="BirthDate" ColumnName="BirthDate" />
                <ScalarProperty Name="HireDate" ColumnName="HireDate" />
                <ScalarProperty Name="Address" ColumnName="Address" />
                <ScalarProperty Name="City" ColumnName="City" />
                <ScalarProperty Name="Region" ColumnName="Region" />
                <ScalarProperty Name="PostalCode" ColumnName="PostalCode" />
                <ScalarProperty Name="Country" ColumnName="Country" />
                <ScalarProperty Name="HomePhone" ColumnName="HomePhone" />
                <ScalarProperty Name="Extension" ColumnName="Extension" />
                <ScalarProperty Name="Photo" ColumnName="Photo" />
                <ScalarProperty Name="Notes" ColumnName="Notes" />
                <ScalarProperty Name="PhotoPath" ColumnName="PhotoPath" />
              </MappingFragment>
            </EntityTypeMapping>
          </EntitySetMapping>
          <EntitySetMapping Name="Products">
            <EntityTypeMapping TypeName="IsTypeOf(northwindEFModel.Products)">
              <MappingFragment StoreEntitySet="Products">
                <ScalarProperty Name="ProductID" ColumnName="ProductID" />
                <ScalarProperty Name="ProductName" ColumnName="ProductName" />
                <ScalarProperty Name="QuantityPerUnit" ColumnName="QuantityPerUnit" />
                <ScalarProperty Name="UnitPrice" ColumnName="UnitPrice" />
                <ScalarProperty Name="UnitsInStock" ColumnName="UnitsInStock" />
                <ScalarProperty Name="UnitsOnOrder" ColumnName="UnitsOnOrder" />
                <ScalarProperty Name="ReorderLevel" ColumnName="ReorderLevel" />
                <ScalarProperty Name="Discontinued" ColumnName="Discontinued" />
                <ScalarProperty Name="DiscontinuedDate" ColumnName="DiscontinuedDate" />
              </MappingFragment>
            </EntityTypeMapping>
          </EntitySetMapping>
          <EntitySetMapping Name="Regions">
            <EntityTypeMapping TypeName="IsTypeOf(northwindEFModel.Regions)">
              <MappingFragment StoreEntitySet="Regions">
                <ScalarProperty Name="RegionID" ColumnName="RegionID" />
                <ScalarProperty Name="RegionDescription" ColumnName="RegionDescription" />
              </MappingFragment>
            </EntityTypeMapping>
          </EntitySetMapping>









          <EntitySetMapping Name="Suppliers">
            <EntityTypeMapping TypeName="IsTypeOf(northwindEFModel.Suppliers)">
              <MappingFragment StoreEntitySet="Suppliers">
                <ScalarProperty Name="SupplierID" ColumnName="SupplierID" />
                <ScalarProperty Name="CompanyName" ColumnName="CompanyName" />
                <ScalarProperty Name="ContactName" ColumnName="ContactName" />
                <ScalarProperty Name="ContactTitle" ColumnName="ContactTitle" />
                <ScalarProperty Name="Address" ColumnName="Address" />
                <ScalarProperty Name="City" ColumnName="City" />
                <ScalarProperty Name="Region" ColumnName="Region" />
                <ScalarProperty Name="PostalCode" ColumnName="PostalCode" />
                <ScalarProperty Name="Country" ColumnName="Country" />
                <ScalarProperty Name="Phone" ColumnName="Phone" />
                <ScalarProperty Name="Fax" ColumnName="Fax" />
                <ScalarProperty Name="HomePage" ColumnName="HomePage" />
              </MappingFragment>
            </EntityTypeMapping>
          </EntitySetMapping>
          <EntitySetMapping Name="Territories">
            <EntityTypeMapping TypeName="IsTypeOf(northwindEFModel.Territories)">
              <MappingFragment StoreEntitySet="Territories">
                <ScalarProperty Name="TerritoryID" ColumnName="TerritoryID" />
                <ScalarProperty Name="TerritoryDescription" ColumnName="TerritoryDescription" />
              </MappingFragment>
            </EntityTypeMapping>
          </EntitySetMapping>
          <AssociationSetMapping Name="FK_Products_CategoryID_CategoryID" TypeName="northwindEFModel.FK_Products_CategoryID_CategoryID" StoreEntitySet="Products">
            <EndProperty Name="Categories">
              <ScalarProperty Name="CategoryID" ColumnName="CategoryID" />
            </EndProperty>
            <EndProperty Name="Products">
              <ScalarProperty Name="ProductID" ColumnName="ProductID" />
            </EndProperty>
            <Condition ColumnName="CategoryID" IsNull="false" />
          </AssociationSetMapping>
          <AssociationSetMapping Name="FK_Orders_CustomerID_CustomerID" TypeName="northwindEFModel.FK_Orders_CustomerID_CustomerID" StoreEntitySet="Orders">
            <EndProperty Name="Customers">
              <ScalarProperty Name="CustomerID" ColumnName="CustomerID" />
            </EndProperty>
            <EndProperty Name="Orders">
              <ScalarProperty Name="OrderID" ColumnName="OrderID" />
            </EndProperty>
            <Condition ColumnName="CustomerID" IsNull="false" />
          </AssociationSetMapping>








          <AssociationSetMapping Name="FK_InternationalOrders_OrderID_OrderID" TypeName="northwindEFModel.FK_InternationalOrders_OrderID_OrderID" StoreEntitySet="InternationalOrders">




            <EndProperty Name="Orders">
              <ScalarProperty Name="OrderID" ColumnName="OrderID" />
            </EndProperty>
            <EndProperty Name="InternationalOrders">
              <ScalarProperty Name="OrderID" ColumnName="OrderID" />
            </EndProperty>
          </AssociationSetMapping>
          <AssociationSetMapping Name="FK_OrderDetails_OrderID_OrderID" TypeName="northwindEFModel.FK_OrderDetails_OrderID_OrderID" StoreEntitySet="OrderDetails">
            <EndProperty Name="Orders">
              <ScalarProperty Name="OrderID" ColumnName="OrderID" />
            </EndProperty>
            <EndProperty Name="OrderDetails">









              <ScalarProperty Name="OrderID" ColumnName="OrderID" />
              <ScalarProperty Name="ProductID" ColumnName="ProductID" />
            </EndProperty>
          </AssociationSetMapping>
          <AssociationSetMapping Name="FK_OrderDetails_ProductID_ProductID" TypeName="northwindEFModel.FK_OrderDetails_ProductID_ProductID" StoreEntitySet="OrderDetails">
            <EndProperty Name="Products">
              <ScalarProperty Name="ProductID" ColumnName="ProductID" />
            </EndProperty>
            <EndProperty Name="OrderDetails">
              <ScalarProperty Name="OrderID" ColumnName="OrderID" />
              <ScalarProperty Name="ProductID" ColumnName="ProductID" />
            </EndProperty>

          </AssociationSetMapping>
          <AssociationSetMapping Name="FK_Products_SupplierID_SupplierID" TypeName="northwindEFModel.FK_Products_SupplierID_SupplierID" StoreEntitySet="Products">
            <EndProperty Name="Suppliers">
              <ScalarProperty Name="SupplierID" ColumnName="SupplierID" />
            </EndProperty>
            <EndProperty Name="Products">
              <ScalarProperty Name="ProductID" ColumnName="ProductID" />
            </EndProperty>
            <Condition ColumnName="SupplierID" IsNull="false" />
          </AssociationSetMapping>
          <AssociationSetMapping Name="FK_Territories_RegionID_RegionID" TypeName="northwindEFModel.FK_Territories_RegionID_RegionID" StoreEntitySet="Territories">
            <EndProperty Name="Regions">
              <ScalarProperty Name="RegionID" ColumnName="RegionID" />
            </EndProperty>
            <EndProperty Name="Territories">
              <ScalarProperty Name="TerritoryID" ColumnName="TerritoryID" />
            </EndProperty>
          </AssociationSetMapping>








          <AssociationSetMapping Name="EmployeesTerritories" TypeName="northwindEFModel.EmployeesTerritories" StoreEntitySet="EmployeesTerritories">
            <EndProperty Name="Employees">
              <ScalarProperty Name="EmployeeID" ColumnName="EmployeeID" />
            </EndProperty>
            <EndProperty Name="Territories">
              <ScalarProperty Name="TerritoryID" ColumnName="TerritoryID" />
            </EndProperty>
          </AssociationSetMapping>
          </EntityContainerMapping>
      </Mapping>
    </edmx:Mappings>
  </edmx:Runtime>
  <!-- EF Designer content (DO NOT EDIT MANUALLY BELOW HERE) -->
  <edmx:Designer xmlns="http://schemas.microsoft.com/ado/2007/06/edmx">
    <edmx:Connection>
      <DesignerInfoPropertySet>
        <DesignerProperty Name="MetadataArtifactProcessing" Value="EmbedInOutputAssembly" />
      </DesignerInfoPropertySet>
    </edmx:Connection>
    <edmx:Options>
      <DesignerInfoPropertySet>
        <DesignerProperty Name="ValidateOnBuild" Value="true" />
      </DesignerInfoPropertySet>
    </edmx:Options>
    <!-- Diagram content (shape and connector positions) -->
    <edmx:Diagrams>
      <Diagram Name="NorthwindModel">
        <EntityTypeShape EntityType="northwindEFModel.Categories" Width="1.5" PointX="0.75" PointY="1.625" Height="1.9802864583333335" IsExpanded="true" />
        <EntityTypeShape EntityType="northwindEFModel.Customers" Width="1.5" PointX="0.75" PointY="9.625" Height="3.3263964843749996" IsExpanded="true" />
        <EntityTypeShape EntityType="northwindEFModel.Employees" Width="1.5" PointX="2.75" PointY="14.625" Height="4.4802050781250014" IsExpanded="true" />
        <EntityTypeShape EntityType="northwindEFModel.InternationalOrders" Width="1.5" PointX="5.25" PointY="10.375" Height="1.7879850260416674" IsExpanded="true" />
        <EntityTypeShape EntityType="northwindEFModel.OrderDetails" Width="1.5" PointX="5.25" PointY="1.5" Height="2.3648893229166656" IsExpanded="true" />
        <EntityTypeShape EntityType="northwindEFModel.Orders" Width="1.5" PointX="3" PointY="9.25" Height="3.9033007812499996" IsExpanded="true" />
        <EntityTypeShape EntityType="northwindEFModel.PreviousEmployees" Width="1.5" PointX="7.75" PointY="0.75" Height="4.2879036458333317" IsExpanded="true" />
        <EntityTypeShape EntityType="northwindEFModel.Products" Width="1.5" PointX="3" PointY="1" Height="3.3263964843749996" IsExpanded="true" />
        <EntityTypeShape EntityType="northwindEFModel.Regions" Width="1.5" PointX="2.75" PointY="6" Height="1.5956835937499996" IsExpanded="true" />
        <EntityTypeShape EntityType="northwindEFModel.Suppliers" Width="1.5" PointX="0.75" PointY="4.875" Height="3.5186979166666656" IsExpanded="true" />
        <EntityTypeShape EntityType="northwindEFModel.Territories" Width="1.5" PointX="5" PointY="5.875" Height="1.7879850260416674" IsExpanded="true" />
        <AssociationConnector Association="northwindEFModel.FK_Products_CategoryID_CategoryID" ManuallyRouted="false">
          <ConnectorPoint PointX="2.25" PointY="2.6151432291666667" />
          <ConnectorPoint PointX="3" PointY="2.6151432291666667" /></AssociationConnector>
        <AssociationConnector Association="northwindEFModel.FK_Orders_CustomerID_CustomerID" ManuallyRouted="false">
          <ConnectorPoint PointX="2.25" PointY="11.2881982421875" />
          <ConnectorPoint PointX="3" PointY="11.2881982421875" /></AssociationConnector>
        <AssociationConnector Association="northwindEFModel.FK_InternationalOrders_OrderID_OrderID" ManuallyRouted="false">
          <ConnectorPoint PointX="4.5" PointY="11.268992513020834" />
          <ConnectorPoint PointX="5.010416666666667" PointY="11.268992513020834" />
          <ConnectorPoint PointX="5.177083333333333" PointY="11.268992513020834" />


          <ConnectorPoint PointX="5.25" PointY="11.268992513020834" /></AssociationConnector>


        <AssociationConnector Association="northwindEFModel.FK_OrderDetails_OrderID_OrderID" ManuallyRouted="false">
          <ConnectorPoint PointX="3.75" PointY="9.25" />
          <ConnectorPoint PointX="3.75" PointY="7.84568359375" />

          <ConnectorPoint PointX="4.75" PointY="7.84568359375" />
          <ConnectorPoint PointX="4.75" PointY="2.6824446614583328" />


          <ConnectorPoint PointX="5.25" PointY="2.6824446614583328" /></AssociationConnector>
        <AssociationConnector Association="northwindEFModel.FK_OrderDetails_ProductID_ProductID" ManuallyRouted="false">
          <ConnectorPoint PointX="4.5" PointY="2.0287223307291664" />

          <ConnectorPoint PointX="5.25" PointY="2.0287223307291664" /></AssociationConnector>

        <AssociationConnector Association="northwindEFModel.FK_Products_SupplierID_SupplierID" ManuallyRouted="false">
          <ConnectorPoint PointX="2.25" PointY="5.40625" />
          <ConnectorPoint PointX="4.40625" PointY="5.40625" />
          <ConnectorPoint PointX="4.40625" PointY="4.326396484375" /></AssociationConnector>
        <AssociationConnector Association="northwindEFModel.FK_Territories_RegionID_RegionID" ManuallyRouted="false">
          <ConnectorPoint PointX="4.25" PointY="6.797841796875" />
          <ConnectorPoint PointX="4.666666666666667" PointY="6.7978417968749989" />

          <ConnectorPoint PointX="4.833333333333333" PointY="6.797841796875" />
          <ConnectorPoint PointX="5" PointY="6.797841796875" /></AssociationConnector>
        <AssociationConnector Association="northwindEFModel.EmployeesTerritories" ManuallyRouted="false">
          <ConnectorPoint PointX="4.25" PointY="16.8651025390625" />
          <ConnectorPoint PointX="5.09375" PointY="16.8651025390625" />
          <ConnectorPoint PointX="5.09375" PointY="7.6629850260416674" /></AssociationConnector>
        </Diagram></edmx:Diagrams>
  </edmx:Designer>
</edmx:Edmx>







<
<
<
<
<
<
<
<
<
|
|
|









|


<













<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<

|









<



|
|
|





>
>
>
>
>
>
>
>
>

|

















|






|








|








>
>
>
>
>
>
>
>
|
>
>
>
>



<
|
<

|



|
>
>
>
>
>
>
>
>
>




|
|
|

|

<

>

|








|
|






>
>
>
>
>
>
>
>
|







|


















|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
>
>
|
>
>
|
|
|
>
|
|
>
>
|
|
|
>
|
>
|
|
|
|
<
|
|
>
|
|
|
|
|
|
|


721
722
723
724
725
726
727









728
729
730
731
732
733
734
735
736
737
738
739
740
741
742

743
744
745
746
747
748
749
750
751
752
753
754
755























756
757
758
759
760
761
762
763
764
765
766

767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846

847

848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872

873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971

972
973
974
975
976
977
978
979
980
981
982
983
                <ScalarProperty Name="Extension" ColumnName="Extension" />
                <ScalarProperty Name="Photo" ColumnName="Photo" />
                <ScalarProperty Name="Notes" ColumnName="Notes" />
                <ScalarProperty Name="PhotoPath" ColumnName="PhotoPath" />
              </MappingFragment>
            </EntityTypeMapping>
          </EntitySetMapping>









          <EntitySetMapping Name="Order_Details">
            <EntityTypeMapping TypeName="IsTypeOf(northwindModel.Order_Details)">
              <MappingFragment StoreEntitySet="Order Details">
                <ScalarProperty Name="OrderID" ColumnName="OrderID" />
                <ScalarProperty Name="ProductID" ColumnName="ProductID" />
                <ScalarProperty Name="UnitPrice" ColumnName="UnitPrice" />
                <ScalarProperty Name="Quantity" ColumnName="Quantity" />
                <ScalarProperty Name="Discount" ColumnName="Discount" />
              </MappingFragment>
            </EntityTypeMapping>
          </EntitySetMapping>
          <EntitySetMapping Name="Orders">
            <EntityTypeMapping TypeName="IsTypeOf(northwindModel.Orders)">
              <MappingFragment StoreEntitySet="Orders">
                <ScalarProperty Name="OrderID" ColumnName="OrderID" />

                <ScalarProperty Name="OrderDate" ColumnName="OrderDate" />
                <ScalarProperty Name="RequiredDate" ColumnName="RequiredDate" />
                <ScalarProperty Name="ShippedDate" ColumnName="ShippedDate" />
                <ScalarProperty Name="Freight" ColumnName="Freight" />
                <ScalarProperty Name="ShipName" ColumnName="ShipName" />
                <ScalarProperty Name="ShipAddress" ColumnName="ShipAddress" />
                <ScalarProperty Name="ShipCity" ColumnName="ShipCity" />
                <ScalarProperty Name="ShipRegion" ColumnName="ShipRegion" />
                <ScalarProperty Name="ShipPostalCode" ColumnName="ShipPostalCode" />
                <ScalarProperty Name="ShipCountry" ColumnName="ShipCountry" />
              </MappingFragment>
            </EntityTypeMapping>
          </EntitySetMapping>























          <EntitySetMapping Name="Products">
            <EntityTypeMapping TypeName="IsTypeOf(northwindModel.Products)">
              <MappingFragment StoreEntitySet="Products">
                <ScalarProperty Name="ProductID" ColumnName="ProductID" />
                <ScalarProperty Name="ProductName" ColumnName="ProductName" />
                <ScalarProperty Name="QuantityPerUnit" ColumnName="QuantityPerUnit" />
                <ScalarProperty Name="UnitPrice" ColumnName="UnitPrice" />
                <ScalarProperty Name="UnitsInStock" ColumnName="UnitsInStock" />
                <ScalarProperty Name="UnitsOnOrder" ColumnName="UnitsOnOrder" />
                <ScalarProperty Name="ReorderLevel" ColumnName="ReorderLevel" />
                <ScalarProperty Name="Discontinued" ColumnName="Discontinued" />

              </MappingFragment>
            </EntityTypeMapping>
          </EntitySetMapping>
          <EntitySetMapping Name="Region">
            <EntityTypeMapping TypeName="IsTypeOf(northwindModel.Region)">
              <MappingFragment StoreEntitySet="Region">
                <ScalarProperty Name="RegionID" ColumnName="RegionID" />
                <ScalarProperty Name="RegionDescription" ColumnName="RegionDescription" />
              </MappingFragment>
            </EntityTypeMapping>
          </EntitySetMapping>
          <EntitySetMapping Name="Shippers">
            <EntityTypeMapping TypeName="IsTypeOf(northwindModel.Shippers)">
              <MappingFragment StoreEntitySet="Shippers">
                <ScalarProperty Name="ShipperID" ColumnName="ShipperID" />
                <ScalarProperty Name="CompanyName" ColumnName="CompanyName" />
                <ScalarProperty Name="Phone" ColumnName="Phone" />
              </MappingFragment>
            </EntityTypeMapping>
          </EntitySetMapping>
          <EntitySetMapping Name="Suppliers">
            <EntityTypeMapping TypeName="IsTypeOf(northwindModel.Suppliers)">
              <MappingFragment StoreEntitySet="Suppliers">
                <ScalarProperty Name="SupplierID" ColumnName="SupplierID" />
                <ScalarProperty Name="CompanyName" ColumnName="CompanyName" />
                <ScalarProperty Name="ContactName" ColumnName="ContactName" />
                <ScalarProperty Name="ContactTitle" ColumnName="ContactTitle" />
                <ScalarProperty Name="Address" ColumnName="Address" />
                <ScalarProperty Name="City" ColumnName="City" />
                <ScalarProperty Name="Region" ColumnName="Region" />
                <ScalarProperty Name="PostalCode" ColumnName="PostalCode" />
                <ScalarProperty Name="Country" ColumnName="Country" />
                <ScalarProperty Name="Phone" ColumnName="Phone" />
                <ScalarProperty Name="Fax" ColumnName="Fax" />
                <ScalarProperty Name="HomePage" ColumnName="HomePage" />
              </MappingFragment>
            </EntityTypeMapping>
          </EntitySetMapping>
          <EntitySetMapping Name="Territories">
            <EntityTypeMapping TypeName="IsTypeOf(northwindModel.Territories)">
              <MappingFragment StoreEntitySet="Territories">
                <ScalarProperty Name="TerritoryID" ColumnName="TerritoryID" />
                <ScalarProperty Name="TerritoryDescription" ColumnName="TerritoryDescription" />
              </MappingFragment>
            </EntityTypeMapping>
          </EntitySetMapping>
          <AssociationSetMapping Name="FK_Products_CategoryID_CategoryID" TypeName="northwindModel.FK_Products_CategoryID_CategoryID" StoreEntitySet="Products">
            <EndProperty Name="Categories">
              <ScalarProperty Name="CategoryID" ColumnName="CategoryID" />
            </EndProperty>
            <EndProperty Name="Products">
              <ScalarProperty Name="ProductID" ColumnName="ProductID" />
            </EndProperty>
            <Condition ColumnName="CategoryID" IsNull="false" />
          </AssociationSetMapping>
          <AssociationSetMapping Name="FK_Orders_CustomerID_CustomerID" TypeName="northwindModel.FK_Orders_CustomerID_CustomerID" StoreEntitySet="Orders">
            <EndProperty Name="Customers">
              <ScalarProperty Name="CustomerID" ColumnName="CustomerID" />
            </EndProperty>
            <EndProperty Name="Orders">
              <ScalarProperty Name="OrderID" ColumnName="OrderID" />
            </EndProperty>
            <Condition ColumnName="CustomerID" IsNull="false" />
          </AssociationSetMapping>
          <AssociationSetMapping Name="FK_Employees_ReportsTo_EmployeeID" TypeName="northwindModel.FK_Employees_ReportsTo_EmployeeID" StoreEntitySet="Employees">
            <EndProperty Name="Employees">
              <ScalarProperty Name="EmployeeID" ColumnName="ReportsTo" />
            </EndProperty>
            <EndProperty Name="Employees1">
              <ScalarProperty Name="EmployeeID" ColumnName="EmployeeID" />
            </EndProperty>
            <Condition ColumnName="ReportsTo" IsNull="false" />
          </AssociationSetMapping>
          <AssociationSetMapping Name="FK_Orders_EmployeeID_EmployeeID" TypeName="northwindModel.FK_Orders_EmployeeID_EmployeeID" StoreEntitySet="Orders">
            <EndProperty Name="Employees">
              <ScalarProperty Name="EmployeeID" ColumnName="EmployeeID" />
            </EndProperty>
            <EndProperty Name="Orders">
              <ScalarProperty Name="OrderID" ColumnName="OrderID" />
            </EndProperty>

            <Condition ColumnName="EmployeeID" IsNull="false" />

          </AssociationSetMapping>
          <AssociationSetMapping Name="FK_Order_Details_OrderID_OrderID" TypeName="northwindModel.FK_Order_Details_OrderID_OrderID" StoreEntitySet="Order Details">
            <EndProperty Name="Orders">
              <ScalarProperty Name="OrderID" ColumnName="OrderID" />
            </EndProperty>
            <EndProperty Name="Order_Details">
              <ScalarProperty Name="OrderID" ColumnName="OrderID" />
              <ScalarProperty Name="ProductID" ColumnName="ProductID" />
            </EndProperty>
          </AssociationSetMapping>
          <AssociationSetMapping Name="FK_Order_Details_ProductID_ProductID" TypeName="northwindModel.FK_Order_Details_ProductID_ProductID" StoreEntitySet="Order Details">
            <EndProperty Name="Products">
              <ScalarProperty Name="ProductID" ColumnName="ProductID" />
            </EndProperty>
            <EndProperty Name="Order_Details">
              <ScalarProperty Name="OrderID" ColumnName="OrderID" />
              <ScalarProperty Name="ProductID" ColumnName="ProductID" />
            </EndProperty>
          </AssociationSetMapping>
          <AssociationSetMapping Name="FK_Orders_ShipVia_ShipperID" TypeName="northwindModel.FK_Orders_ShipVia_ShipperID" StoreEntitySet="Orders">
            <EndProperty Name="Shippers">
              <ScalarProperty Name="ShipperID" ColumnName="ShipVia" />
            </EndProperty>
            <EndProperty Name="Orders">
              <ScalarProperty Name="OrderID" ColumnName="OrderID" />

            </EndProperty>
            <Condition ColumnName="ShipVia" IsNull="false" />
          </AssociationSetMapping>
          <AssociationSetMapping Name="FK_Products_SupplierID_SupplierID" TypeName="northwindModel.FK_Products_SupplierID_SupplierID" StoreEntitySet="Products">
            <EndProperty Name="Suppliers">
              <ScalarProperty Name="SupplierID" ColumnName="SupplierID" />
            </EndProperty>
            <EndProperty Name="Products">
              <ScalarProperty Name="ProductID" ColumnName="ProductID" />
            </EndProperty>
            <Condition ColumnName="SupplierID" IsNull="false" />
          </AssociationSetMapping>
          <AssociationSetMapping Name="FK_Territories_RegionID_RegionID" TypeName="northwindModel.FK_Territories_RegionID_RegionID" StoreEntitySet="Territories">
            <EndProperty Name="Region">
              <ScalarProperty Name="RegionID" ColumnName="RegionID" />
            </EndProperty>
            <EndProperty Name="Territories">
              <ScalarProperty Name="TerritoryID" ColumnName="TerritoryID" />
            </EndProperty>
          </AssociationSetMapping>
          <AssociationSetMapping Name="CustomerCustomerDemo" TypeName="northwindModel.CustomerCustomerDemo" StoreEntitySet="CustomerCustomerDemo">
            <EndProperty Name="Customers">
              <ScalarProperty Name="CustomerID" ColumnName="CustomerID" />
            </EndProperty>
            <EndProperty Name="CustomerDemographics">
              <ScalarProperty Name="CustomerTypeID" ColumnName="CustomerTypeID" />
            </EndProperty>
          </AssociationSetMapping>
          <AssociationSetMapping Name="EmployeeTerritories" TypeName="northwindModel.EmployeeTerritories" StoreEntitySet="EmployeeTerritories">
            <EndProperty Name="Employees">
              <ScalarProperty Name="EmployeeID" ColumnName="EmployeeID" />
            </EndProperty>
            <EndProperty Name="Territories">
              <ScalarProperty Name="TerritoryID" ColumnName="TerritoryID" />
            </EndProperty>
          </AssociationSetMapping>
        </EntityContainerMapping>
      </Mapping>
    </edmx:Mappings>
  </edmx:Runtime>
  <!-- EF Designer content (DO NOT EDIT MANUALLY BELOW HERE) -->
  <edmx:Designer xmlns="http://schemas.microsoft.com/ado/2007/06/edmx">
    <edmx:Connection>
      <DesignerInfoPropertySet>
        <DesignerProperty Name="MetadataArtifactProcessing" Value="EmbedInOutputAssembly" />
      </DesignerInfoPropertySet>
    </edmx:Connection>
    <edmx:Options>
      <DesignerInfoPropertySet>
        <DesignerProperty Name="ValidateOnBuild" Value="true" />
      </DesignerInfoPropertySet>
    </edmx:Options>
    <!-- Diagram content (shape and connector positions) -->
    <edmx:Diagrams>
      <Diagram Name="NorthwindModel">
        <EntityTypeShape EntityType="northwindModel.Categories" Width="1.5" PointX="3.75" PointY="16.125" Height="1.9802864583333317" IsExpanded="true" />
        <EntityTypeShape EntityType="northwindModel.CustomerDemographics" Width="1.5" PointX="3" PointY="3.5" Height="1.5956835937499996" IsExpanded="true" />
        <EntityTypeShape EntityType="northwindModel.Customers" Width="1.5" PointX="0.75" PointY="2.5" Height="3.5186979166666656" IsExpanded="true" />
        <EntityTypeShape EntityType="northwindModel.Employees" Width="1.5" PointX="3.75" PointY="9.375" Height="5.057109375" IsExpanded="true" />
        <EntityTypeShape EntityType="northwindModel.Order_Details" Width="1.5" PointX="8.25" PointY="3.125" Height="2.3648893229166656" IsExpanded="true" />
        <EntityTypeShape EntityType="northwindModel.Orders" Width="1.5" PointX="6" PointY="2.25" Height="3.9033007812499996" IsExpanded="true" />
        <EntityTypeShape EntityType="northwindModel.Products" Width="1.5" PointX="6" PointY="17.75" Height="3.1340950520833317" IsExpanded="true" />
        <EntityTypeShape EntityType="northwindModel.Region" Width="1.5" PointX="5.75" PointY="8" Height="1.5956835937499996" IsExpanded="true" />
        <EntityTypeShape EntityType="northwindModel.Shippers" Width="1.5" PointX="3.75" PointY="6.75" Height="1.7879850260416674" IsExpanded="true" />
        <EntityTypeShape EntityType="northwindModel.Suppliers" Width="1.5" PointX="3.75" PointY="18.875" Height="3.5186979166666674" IsExpanded="true" />
        <EntityTypeShape EntityType="northwindModel.Territories" Width="1.5" PointX="8" PointY="10.25" Height="1.7879850260416674" IsExpanded="true" />
        <AssociationConnector Association="northwindModel.FK_Products_CategoryID_CategoryID" ManuallyRouted="false">
          <ConnectorPoint PointX="5.25" PointY="17.927643229166666" />
          <ConnectorPoint PointX="6" PointY="17.927643229166666" /></AssociationConnector>
        <AssociationConnector Association="northwindModel.FK_Orders_CustomerID_CustomerID" ManuallyRouted="false">
          <ConnectorPoint PointX="2.25" PointY="2.96875" />
          <ConnectorPoint PointX="6" PointY="2.96875" /></AssociationConnector>
        <AssociationConnector Association="northwindModel.FK_Employees_ReportsTo_EmployeeID" ManuallyRouted="false">
          <ConnectorPoint PointX="4.2819230769230767" PointY="14.432109375" />
          <ConnectorPoint PointX="4.2819230769230767" PointY="14.682109375" />
          <ConnectorPoint PointX="4.7284615384615378" PointY="14.682109375" />
          <ConnectorPoint PointX="4.7284615384615378" PointY="14.432109375" /></AssociationConnector>
        <AssociationConnector Association="northwindModel.FK_Orders_EmployeeID_EmployeeID" ManuallyRouted="false">
          <ConnectorPoint PointX="5.25" PointY="12.045146484375" />
          <ConnectorPoint PointX="7.40625" PointY="12.045146484375" />
          <ConnectorPoint PointX="7.40625" PointY="6.15330078125" /></AssociationConnector>
        <AssociationConnector Association="northwindModel.FK_Order_Details_OrderID_OrderID" ManuallyRouted="false">
          <ConnectorPoint PointX="7.5" PointY="4.3074446614583328" />
          <ConnectorPoint PointX="8.25" PointY="4.3074446614583328" /></AssociationConnector>
        <AssociationConnector Association="northwindModel.FK_Order_Details_ProductID_ProductID" ManuallyRouted="false">
          <ConnectorPoint PointX="7.5" PointY="19.317047526041666" />
          <ConnectorPoint PointX="9.65625" PointY="19.317047526041666" />
          <ConnectorPoint PointX="9.65625" PointY="5.4898893229166656" /></AssociationConnector>
        <AssociationConnector Association="northwindModel.FK_Orders_ShipVia_ShipperID" ManuallyRouted="false">
          <ConnectorPoint PointX="5.25" PointY="7.34375" />
          <ConnectorPoint PointX="7.3749975" PointY="7.34375" />
          <ConnectorPoint PointX="7.3749975" PointY="6.15330078125" /></AssociationConnector>
        <AssociationConnector Association="northwindModel.FK_Products_SupplierID_SupplierID" ManuallyRouted="false">
          <ConnectorPoint PointX="5.25" PointY="19.879547526041666" />
          <ConnectorPoint PointX="6" PointY="19.879547526041666" /></AssociationConnector>
        <AssociationConnector Association="northwindModel.FK_Territories_RegionID_RegionID" ManuallyRouted="false">
          <ConnectorPoint PointX="7.25" PointY="8.797841796875" />
          <ConnectorPoint PointX="7.322916666666667" PointY="8.797841796875" />
          <ConnectorPoint PointX="7.489583333333333" PointY="8.797841796875" />

          <ConnectorPoint PointX="8.75" PointY="8.797841796875" />
          <ConnectorPoint PointX="8.75" PointY="10.25" /></AssociationConnector>
        <AssociationConnector Association="northwindModel.CustomerCustomerDemo" ManuallyRouted="false">
          <ConnectorPoint PointX="2.25" PointY="4.297841796875" />
          <ConnectorPoint PointX="3" PointY="4.297841796875" /></AssociationConnector>
        <AssociationConnector Association="northwindModel.EmployeeTerritories" ManuallyRouted="false">
          <ConnectorPoint PointX="5.25" PointY="11.143992513020834" />
          <ConnectorPoint PointX="7.322916666666667" PointY="11.143992513020834" />
          <ConnectorPoint PointX="7.489583333333333" PointY="11.143992513020834" />
          <ConnectorPoint PointX="8" PointY="11.143992513020834" /></AssociationConnector></Diagram></edmx:Diagrams>
  </edmx:Designer>
</edmx:Edmx>
Changes to testlinq/Program.cs.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Objects;

namespace testlinq
{
  class Program
  {
    static void Main(string[] args)
    {
      using (northwindEFEntities db = new northwindEFEntities())
      {
        {
          string entitySQL = "SELECT VALUE o FROM Orders AS o WHERE SQLite.DatePart('yyyy', o.OrderDate) = 1997;";
          ObjectQuery<Orders> query = db.CreateQuery<Orders>(entitySQL);

          foreach (Orders o in query)
          {
            Console.WriteLine(o.ShipPostalCode);
          }
        }

        {
          var query = from c in db.Customers
                      where c.City == "London"
                      orderby c.CompanyName
                      select c;

          int cc = query.Count();

          foreach (Customers c in query)
          {
            Console.WriteLine(c.CompanyName);
          }
        }

        {
          string scity = "London";
          Customers c = db.Customers.FirstOrDefault(cd => cd.City == scity);
          Console.WriteLine(c.CompanyName);
        }

        {
          DateTime dt = new DateTime(1997, 1, 1);
          var query = from order in db.Orders
                      where order.OrderDate < dt
                      select order;

          foreach (Orders o in query)












|

















<
<






<
<
<
<
<
<







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30


31
32
33
34
35
36






37
38
39
40
41
42
43
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Objects;

namespace testlinq
{
  class Program
  {
    static void Main(string[] args)
    {
      using (northwindEntities db = new northwindEntities())
      {
        {
          string entitySQL = "SELECT VALUE o FROM Orders AS o WHERE SQLite.DatePart('yyyy', o.OrderDate) = 1997;";
          ObjectQuery<Orders> query = db.CreateQuery<Orders>(entitySQL);

          foreach (Orders o in query)
          {
            Console.WriteLine(o.ShipPostalCode);
          }
        }

        {
          var query = from c in db.Customers
                      where c.City == "London"
                      orderby c.CompanyName
                      select c;



          foreach (Customers c in query)
          {
            Console.WriteLine(c.CompanyName);
          }
        }







        {
          DateTime dt = new DateTime(1997, 1, 1);
          var query = from order in db.Orders
                      where order.OrderDate < dt
                      select order;

          foreach (Orders o in query)
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
          c.Description = "My modified description";
          db.SaveChanges();

          db.DeleteObject(c);
          db.SaveChanges();
        }

        {
          Customers cust = new Customers();
          cust.CustomerID = "MTMTM";
          cust.ContactName = "My Name";
          cust.CompanyName = "SQLite Company";
          cust.Country = "Netherlands";
          cust.City = "Amsterdam";
          cust.Phone = "012345677";
          db.AddToCustomers(cust);
          db.SaveChanges();

          db.DeleteObject(cust);
          db.SaveChanges();
        }

        {
          var query = db.Customers.Where(cust => cust.Country == "Denmark")
                          .SelectMany(cust => cust.Orders.Where(o => o.Freight > 5));

          foreach (Orders c in query)
          {
            Console.WriteLine(c.Freight);







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







58
59
60
61
62
63
64















65
66
67
68
69
70
71
          c.Description = "My modified description";
          db.SaveChanges();

          db.DeleteObject(c);
          db.SaveChanges();
        }
















        {
          var query = db.Customers.Where(cust => cust.Country == "Denmark")
                          .SelectMany(cust => cust.Orders.Where(o => o.Freight > 5));

          foreach (Orders c in query)
          {
            Console.WriteLine(c.Freight);
122
123
124
125
126
127
128
129
130

131
132
133
134
135
136

137
138
139


140
141
142
143
144

          foreach (Orders o in query)
          {
            Console.WriteLine(o.ShipPostalCode);
          }
        }

        // This query requires SQLite 3.6.2 to function correctly
        {

          var query = from p in db.Products
                      where p.OrderDetails.Count(od => od.Orders.Customers.Country == p.Suppliers.Country) > 2
                      select p;

          foreach (Products p in query)
          {

            Console.WriteLine(p.ProductName);
          }
        }


      }
      Console.ReadKey();
    }
  }
}







|
<
>
|
|
|

|
<
>
|
<
<
>
>





99
100
101
102
103
104
105
106

107
108
109
110
111
112

113
114


115
116
117
118
119
120
121

          foreach (Orders o in query)
          {
            Console.WriteLine(o.ShipPostalCode);
          }
        }

         //This query fails due to a SQLite core issue.  Currently pending review by Dr. Hipp

        //{
        //  var query = from p in db.Products
        //              where p.Order_Details.Count(od => od.Orders.Customers.Country == p.Suppliers.Country) > 2
        //              select p;

        //  foreach (Products p in query)

        //  {
        //    Console.WriteLine(p.ProductName);


        //  }
        //}
      }
      Console.ReadKey();
    }
  }
}
Added testlinq/northwind.db.

cannot compute difference between binary files

Deleted testlinq/northwindEF.db.

cannot compute difference between binary files

Changes to testlinq/testlinq.csproj.
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
      <DependentUpon>NorthwindModel.edmx</DependentUpon>
    </Compile>
    <Compile Include="Program.cs" />
    <Compile Include="Properties\AssemblyInfo.cs" />
  </ItemGroup>
  <ItemGroup>
    <None Include="App.Config" />
    <None Include="northwindEF.db">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </None>
    <EntityDeploy Include="NorthwindModel.edmx">
      <Generator>EntityModelCodeGenerator</Generator>
      <LastGenOutput>NorthwindModel.Designer.cs</LastGenOutput>
    </EntityDeploy>
  </ItemGroup>







|







62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
      <DependentUpon>NorthwindModel.edmx</DependentUpon>
    </Compile>
    <Compile Include="Program.cs" />
    <Compile Include="Properties\AssemblyInfo.cs" />
  </ItemGroup>
  <ItemGroup>
    <None Include="App.Config" />
    <None Include="northwind.db">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </None>
    <EntityDeploy Include="NorthwindModel.edmx">
      <Generator>EntityModelCodeGenerator</Generator>
      <LastGenOutput>NorthwindModel.Designer.cs</LastGenOutput>
    </EntityDeploy>
  </ItemGroup>
Changes to tools/install/Resources/System.Data.SQLite.dll.

cannot compute difference between binary files

Changes to tools/setup/exe/setup/setup.rc.
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85

/////////////////////////////////////////////////////////////////////////////
//
// Version
//

VS_VERSION_INFO VERSIONINFO
 FILEVERSION 1,0,59,0
 PRODUCTVERSION 1,0,0,0
 FILEFLAGSMASK 0x17L
#ifdef _DEBUG
 FILEFLAGS 0x1L
#else
 FILEFLAGS 0x0L
#endif
 FILEOS 0x4L
 FILETYPE 0x1L
 FILESUBTYPE 0x0L
BEGIN
    BLOCK "StringFileInfo"
    BEGIN
        BLOCK "040904b0"
        BEGIN
            VALUE "Comments", "http://sqlite.phxsoftware.com"
            VALUE "FileDescription", "SQLite ADO.NET 2.0 Setup"
            VALUE "FileVersion", "1.0.59.0"
            VALUE "InternalName", "setup"
            VALUE "LegalCopyright", "Released to the public domain"
            VALUE "OriginalFilename", "setup.exe"
            VALUE "ProductName", "System.Data.SQLite"
            VALUE "ProductVersion", "1.0"
        END
    END







|

















|







53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85

/////////////////////////////////////////////////////////////////////////////
//
// Version
//

VS_VERSION_INFO VERSIONINFO
 FILEVERSION 1,0,56,0
 PRODUCTVERSION 1,0,0,0
 FILEFLAGSMASK 0x17L
#ifdef _DEBUG
 FILEFLAGS 0x1L
#else
 FILEFLAGS 0x0L
#endif
 FILEOS 0x4L
 FILETYPE 0x1L
 FILESUBTYPE 0x0L
BEGIN
    BLOCK "StringFileInfo"
    BEGIN
        BLOCK "040904b0"
        BEGIN
            VALUE "Comments", "http://sqlite.phxsoftware.com"
            VALUE "FileDescription", "SQLite ADO.NET 2.0 Setup"
            VALUE "FileVersion", "1.0.56.0"
            VALUE "InternalName", "setup"
            VALUE "LegalCopyright", "Released to the public domain"
            VALUE "OriginalFilename", "setup.exe"
            VALUE "ProductName", "System.Data.SQLite"
            VALUE "ProductVersion", "1.0"
        END
    END
Changes to tools/setup/sqlite_setup.suo.

cannot compute difference between binary files

Changes to tools/setup/sqlite_setup.vdproj.
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57






58
59
60
61
62
63
64
        {
        "MsmKey" = "8:_1A571C82DAEBE73A54E0D256CAAD80DF"
        "OwnerKey" = "8:_3578C7AADEF926410602B18EDBBEFFF9"
        "MsmSig" = "8:_UNDEFINED"
        }
        "Entry"
        {
        "MsmKey" = "8:_200C9E264509441F9AAB7EBE82A905DB"
        "OwnerKey" = "8:_UNDEFINED"
        "MsmSig" = "8:_UNDEFINED"
        }
        "Entry"
        {
        "MsmKey" = "8:_244D4945EA335F5E4E54085BFD020CC1"
        "OwnerKey" = "8:_A7448E608040319F6C5E12637881B1F6"
        "MsmSig" = "8:_UNDEFINED"
        }
        "Entry"
        {
        "MsmKey" = "8:_2560D913B1D74BAAB2B910FD325E9721"
        "OwnerKey" = "8:_UNDEFINED"
        "MsmSig" = "8:_UNDEFINED"
        }
        "Entry"
        {
        "MsmKey" = "8:_26E74AC417994018832F9B82462AA3AF"
        "OwnerKey" = "8:_UNDEFINED"
        "MsmSig" = "8:_UNDEFINED"
        }






        "Entry"
        {
        "MsmKey" = "8:_2C7EDFF06B61482393D94E3A63D90113"
        "OwnerKey" = "8:_UNDEFINED"
        "MsmSig" = "8:_UNDEFINED"
        }
        "Entry"







<
<
<
<
<
<






<
<
<
<
<
<




>
>
>
>
>
>







29
30
31
32
33
34
35






36
37
38
39
40
41






42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
        {
        "MsmKey" = "8:_1A571C82DAEBE73A54E0D256CAAD80DF"
        "OwnerKey" = "8:_3578C7AADEF926410602B18EDBBEFFF9"
        "MsmSig" = "8:_UNDEFINED"
        }
        "Entry"
        {






        "MsmKey" = "8:_244D4945EA335F5E4E54085BFD020CC1"
        "OwnerKey" = "8:_A7448E608040319F6C5E12637881B1F6"
        "MsmSig" = "8:_UNDEFINED"
        }
        "Entry"
        {






        "MsmKey" = "8:_26E74AC417994018832F9B82462AA3AF"
        "OwnerKey" = "8:_UNDEFINED"
        "MsmSig" = "8:_UNDEFINED"
        }
        "Entry"
        {
        "MsmKey" = "8:_29B62FDE3E56411381A6E8B358CBB0F5"
        "OwnerKey" = "8:_UNDEFINED"
        "MsmSig" = "8:_UNDEFINED"
        }
        "Entry"
        {
        "MsmKey" = "8:_2C7EDFF06B61482393D94E3A63D90113"
        "OwnerKey" = "8:_UNDEFINED"
        "MsmSig" = "8:_UNDEFINED"
        }
        "Entry"
142
143
144
145
146
147
148






149
150
151
152
153
154
155
        "Entry"
        {
        "MsmKey" = "8:_9352653B827F735B8C3BE81D11522ECC"
        "OwnerKey" = "8:_B00FB4712154B7A5894294702C96689D"
        "MsmSig" = "8:_UNDEFINED"
        }
        "Entry"






        {
        "MsmKey" = "8:_A18DBDB7776215EAD9A52C96F8CA1E91"
        "OwnerKey" = "8:_40F352185F3B41A485F42BFC64BF9162"
        "MsmSig" = "8:_UNDEFINED"
        }
        "Entry"
        {







>
>
>
>
>
>







136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
        "Entry"
        {
        "MsmKey" = "8:_9352653B827F735B8C3BE81D11522ECC"
        "OwnerKey" = "8:_B00FB4712154B7A5894294702C96689D"
        "MsmSig" = "8:_UNDEFINED"
        }
        "Entry"
        {
        "MsmKey" = "8:_A1873A8DC29649A4BAF00E155CDCB8BF"
        "OwnerKey" = "8:_UNDEFINED"
        "MsmSig" = "8:_UNDEFINED"
        }
        "Entry"
        {
        "MsmKey" = "8:_A18DBDB7776215EAD9A52C96F8CA1E91"
        "OwnerKey" = "8:_40F352185F3B41A485F42BFC64BF9162"
        "MsmSig" = "8:_UNDEFINED"
        }
        "Entry"
        {
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
        }
        "Entry"
        {
        "MsmKey" = "8:_CD3CE5CDAB13405EA6EAAADC95F88D2E"
        "OwnerKey" = "8:_UNDEFINED"
        "MsmSig" = "8:_UNDEFINED"
        }
        "Entry"
        {
        "MsmKey" = "8:_CE9E3EF0722342DB8DE0860C0DDCD39E"
        "OwnerKey" = "8:_UNDEFINED"
        "MsmSig" = "8:_UNDEFINED"
        }
        "Entry"
        {
        "MsmKey" = "8:_CEFA203C4DAE4417B0E17113DA2684CD"
        "OwnerKey" = "8:_UNDEFINED"
        "MsmSig" = "8:_UNDEFINED"
        }
        "Entry"







<
<
<
<
<
<







195
196
197
198
199
200
201






202
203
204
205
206
207
208
        }
        "Entry"
        {
        "MsmKey" = "8:_CD3CE5CDAB13405EA6EAAADC95F88D2E"
        "OwnerKey" = "8:_UNDEFINED"
        "MsmSig" = "8:_UNDEFINED"
        }






        "Entry"
        {
        "MsmKey" = "8:_CEFA203C4DAE4417B0E17113DA2684CD"
        "OwnerKey" = "8:_UNDEFINED"
        "MsmSig" = "8:_UNDEFINED"
        }
        "Entry"
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
        {
        "MsmKey" = "8:_F320FBAE871DA320178BEEA242900CC7"
        "OwnerKey" = "8:_2C7EDFF06B61482393D94E3A63D90113"
        "MsmSig" = "8:_UNDEFINED"
        }
        "Entry"
        {
        "MsmKey" = "8:_F320FBAE871DA320178BEEA242900CC7"
        "OwnerKey" = "8:_CE9E3EF0722342DB8DE0860C0DDCD39E"
        "MsmSig" = "8:_UNDEFINED"
        }
        "Entry"
        {
        "MsmKey" = "8:_UNDEFINED"
        "OwnerKey" = "8:_B29C75F5F4D24817846DCEF9951068E1"
        "MsmSig" = "8:_UNDEFINED"
        }
        "Entry"
        {
        "MsmKey" = "8:_UNDEFINED"
        "OwnerKey" = "8:_CE9E3EF0722342DB8DE0860C0DDCD39E"
        "MsmSig" = "8:_UNDEFINED"
        }
        "Entry"
        {
        "MsmKey" = "8:_UNDEFINED"
        "OwnerKey" = "8:_E6DB5A9B08AC4645A19C948BBFDD0348"
        "MsmSig" = "8:_UNDEFINED"
        }
        "Entry"







<
<
<
<
<
<




<
<
<
<
<
<







263
264
265
266
267
268
269






270
271
272
273






274
275
276
277
278
279
280
        {
        "MsmKey" = "8:_F320FBAE871DA320178BEEA242900CC7"
        "OwnerKey" = "8:_2C7EDFF06B61482393D94E3A63D90113"
        "MsmSig" = "8:_UNDEFINED"
        }
        "Entry"
        {






        "MsmKey" = "8:_UNDEFINED"
        "OwnerKey" = "8:_B29C75F5F4D24817846DCEF9951068E1"
        "MsmSig" = "8:_UNDEFINED"
        }






        "Entry"
        {
        "MsmKey" = "8:_UNDEFINED"
        "OwnerKey" = "8:_E6DB5A9B08AC4645A19C948BBFDD0348"
        "MsmSig" = "8:_UNDEFINED"
        }
        "Entry"
363
364
365
366
367
368
369






370
371
372
373
374
375
376
        }
        "Entry"
        {
        "MsmKey" = "8:_UNDEFINED"
        "OwnerKey" = "8:_F320FBAE871DA320178BEEA242900CC7"
        "MsmSig" = "8:_UNDEFINED"
        }






        "Entry"
        {
        "MsmKey" = "8:_UNDEFINED"
        "OwnerKey" = "8:_244D4945EA335F5E4E54085BFD020CC1"
        "MsmSig" = "8:_UNDEFINED"
        }
        "Entry"







>
>
>
>
>
>







345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
        }
        "Entry"
        {
        "MsmKey" = "8:_UNDEFINED"
        "OwnerKey" = "8:_F320FBAE871DA320178BEEA242900CC7"
        "MsmSig" = "8:_UNDEFINED"
        }
        "Entry"
        {
        "MsmKey" = "8:_UNDEFINED"
        "OwnerKey" = "8:_29B62FDE3E56411381A6E8B358CBB0F5"
        "MsmSig" = "8:_UNDEFINED"
        }
        "Entry"
        {
        "MsmKey" = "8:_UNDEFINED"
        "OwnerKey" = "8:_244D4945EA335F5E4E54085BFD020CC1"
        "MsmSig" = "8:_UNDEFINED"
        }
        "Entry"
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
            "SharedLegacy" = "11:FALSE"
            "PackageAs" = "3:1"
            "Register" = "3:1"
            "Exclude" = "11:TRUE"
            "IsDependency" = "11:TRUE"
            "IsolateTo" = "8:"
            }
            "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_200C9E264509441F9AAB7EBE82A905DB"
            {
            "SourcePath" = "8:..\\..\\bin\\CompactFramework\\SQLite.Interop.059.lib"
            "TargetName" = "8:SQLite.Interop.059.lib"
            "Tag" = "8:"
            "Folder" = "8:_10C8E86E2EEF451BB40F774C35C5466F"
            "Condition" = "8:"
            "Transitive" = "11:FALSE"
            "Vital" = "11:TRUE"
            "ReadOnly" = "11:FALSE"
            "Hidden" = "11:FALSE"
            "System" = "11:FALSE"
            "Permanent" = "11:FALSE"
            "SharedLegacy" = "11:FALSE"
            "PackageAs" = "3:1"
            "Register" = "3:1"
            "Exclude" = "11:FALSE"
            "IsDependency" = "11:FALSE"
            "IsolateTo" = "8:"
            }
            "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_244D4945EA335F5E4E54085BFD020CC1"
            {
            "AssemblyRegister" = "3:1"
            "AssemblyIsInGAC" = "11:TRUE"
            "AssemblyAsmDisplayName" = "8:Microsoft.VisualStudio.Shell.Interop.8.0, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
                "ScatterAssemblies"
                {







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







575
576
577
578
579
580
581




















582
583
584
585
586
587
588
            "SharedLegacy" = "11:FALSE"
            "PackageAs" = "3:1"
            "Register" = "3:1"
            "Exclude" = "11:TRUE"
            "IsDependency" = "11:TRUE"
            "IsolateTo" = "8:"
            }




















            "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_244D4945EA335F5E4E54085BFD020CC1"
            {
            "AssemblyRegister" = "3:1"
            "AssemblyIsInGAC" = "11:TRUE"
            "AssemblyAsmDisplayName" = "8:Microsoft.VisualStudio.Shell.Interop.8.0, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
                "ScatterAssemblies"
                {
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683































684
685
686
687
688
689
690
691
692
693
694
695
696
            "SharedLegacy" = "11:FALSE"
            "PackageAs" = "3:1"
            "Register" = "3:1"
            "Exclude" = "11:TRUE"
            "IsDependency" = "11:TRUE"
            "IsolateTo" = "8:"
            }
            "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_2560D913B1D74BAAB2B910FD325E9721"
            {
            "SourcePath" = "8:..\\..\\bin\\CompactFramework\\SQLite.Interop.059.DLL"
            "TargetName" = "8:SQLite.Interop.059.DLL"
            "Tag" = "8:"
            "Folder" = "8:_10C8E86E2EEF451BB40F774C35C5466F"
            "Condition" = "8:"
            "Transitive" = "11:FALSE"
            "Vital" = "11:TRUE"
            "ReadOnly" = "11:FALSE"
            "Hidden" = "11:FALSE"
            "System" = "11:FALSE"
            "Permanent" = "11:FALSE"
            "SharedLegacy" = "11:FALSE"
            "PackageAs" = "3:1"
            "Register" = "3:1"
            "Exclude" = "11:FALSE"
            "IsDependency" = "11:FALSE"
            "IsolateTo" = "8:"
            }
            "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_26E74AC417994018832F9B82462AA3AF"
            {
            "SourcePath" = "8:..\\..\\bin\\x64\\System.Data.SQLite.lib"
            "TargetName" = "8:System.Data.SQLite.lib"
            "Tag" = "8:"
            "Folder" = "8:_66DBD0998AA8499691D4F5E42417697D"
            "Condition" = "8:"
            "Transitive" = "11:FALSE"
            "Vital" = "11:TRUE"
            "ReadOnly" = "11:FALSE"
            "Hidden" = "11:FALSE"
            "System" = "11:FALSE"
            "Permanent" = "11:FALSE"
            "SharedLegacy" = "11:FALSE"
            "PackageAs" = "3:1"
            "Register" = "3:1"
            "Exclude" = "11:FALSE"
            "IsDependency" = "11:FALSE"
            "IsolateTo" = "8:"































            }
            "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_2C7EDFF06B61482393D94E3A63D90113"
            {
            "AssemblyRegister" = "3:1"
            "AssemblyIsInGAC" = "11:FALSE"
            "AssemblyAsmDisplayName" = "8:test, Version=1.0.0.13492, Culture=neutral, processorArchitecture=x86"
                "ScatterAssemblies"
                {
                    "_2C7EDFF06B61482393D94E3A63D90113"
                    {
                    "Name" = "8:test.exe"
                    "Attributes" = "3:512"
                    }







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<



















>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>





|







606
607
608
609
610
611
612




















613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
            "SharedLegacy" = "11:FALSE"
            "PackageAs" = "3:1"
            "Register" = "3:1"
            "Exclude" = "11:TRUE"
            "IsDependency" = "11:TRUE"
            "IsolateTo" = "8:"
            }




















            "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_26E74AC417994018832F9B82462AA3AF"
            {
            "SourcePath" = "8:..\\..\\bin\\x64\\System.Data.SQLite.lib"
            "TargetName" = "8:System.Data.SQLite.lib"
            "Tag" = "8:"
            "Folder" = "8:_66DBD0998AA8499691D4F5E42417697D"
            "Condition" = "8:"
            "Transitive" = "11:FALSE"
            "Vital" = "11:TRUE"
            "ReadOnly" = "11:FALSE"
            "Hidden" = "11:FALSE"
            "System" = "11:FALSE"
            "Permanent" = "11:FALSE"
            "SharedLegacy" = "11:FALSE"
            "PackageAs" = "3:1"
            "Register" = "3:1"
            "Exclude" = "11:FALSE"
            "IsDependency" = "11:FALSE"
            "IsolateTo" = "8:"
            }
            "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_29B62FDE3E56411381A6E8B358CBB0F5"
            {
            "AssemblyRegister" = "3:1"
            "AssemblyIsInGAC" = "11:FALSE"
            "AssemblyAsmDisplayName" = "8:System.Data.SQLite.Linq, Version=2.0.36.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL"
                "ScatterAssemblies"
                {
                    "_29B62FDE3E56411381A6E8B358CBB0F5"
                    {
                    "Name" = "8:System.Data.SQLite.Linq.dll"
                    "Attributes" = "3:512"
                    }
                }
            "SourcePath" = "8:..\\..\\bin\\Designer\\System.Data.SQLite.Linq.dll"
            "TargetName" = "8:"
            "Tag" = "8:"
            "Folder" = "8:_F11D54EE0EEA4BF59B52E621630B6A2E"
            "Condition" = "8:"
            "Transitive" = "11:FALSE"
            "Vital" = "11:TRUE"
            "ReadOnly" = "11:FALSE"
            "Hidden" = "11:FALSE"
            "System" = "11:FALSE"
            "Permanent" = "11:FALSE"
            "SharedLegacy" = "11:FALSE"
            "PackageAs" = "3:1"
            "Register" = "3:1"
            "Exclude" = "11:FALSE"
            "IsDependency" = "11:FALSE"
            "IsolateTo" = "8:"
            }
            "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_2C7EDFF06B61482393D94E3A63D90113"
            {
            "AssemblyRegister" = "3:1"
            "AssemblyIsInGAC" = "11:FALSE"
            "AssemblyAsmDisplayName" = "8:test, Version=1.0.0.21862, Culture=neutral, processorArchitecture=x86"
                "ScatterAssemblies"
                {
                    "_2C7EDFF06B61482393D94E3A63D90113"
                    {
                    "Name" = "8:test.exe"
                    "Attributes" = "3:512"
                    }
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
            "IsDependency" = "11:TRUE"
            "IsolateTo" = "8:"
            }
            "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_40DFF08BA903482D807E715A041CA8B1"
            {
            "AssemblyRegister" = "3:1"
            "AssemblyIsInGAC" = "11:FALSE"
            "AssemblyAsmDisplayName" = "8:install, Version=1.0.0.13866, Culture=neutral, processorArchitecture=x86"
                "ScatterAssemblies"
                {
                    "_40DFF08BA903482D807E715A041CA8B1"
                    {
                    "Name" = "8:install.exe"
                    "Attributes" = "3:512"
                    }







|







774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
            "IsDependency" = "11:TRUE"
            "IsolateTo" = "8:"
            }
            "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_40DFF08BA903482D807E715A041CA8B1"
            {
            "AssemblyRegister" = "3:1"
            "AssemblyIsInGAC" = "11:FALSE"
            "AssemblyAsmDisplayName" = "8:install, Version=1.0.0.21008, Culture=neutral, processorArchitecture=x86"
                "ScatterAssemblies"
                {
                    "_40DFF08BA903482D807E715A041CA8B1"
                    {
                    "Name" = "8:install.exe"
                    "Attributes" = "3:512"
                    }
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
            "IsDependency" = "11:FALSE"
            "IsolateTo" = "8:"
            }
            "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_40F352185F3B41A485F42BFC64BF9162"
            {
            "AssemblyRegister" = "3:1"
            "AssemblyIsInGAC" = "11:FALSE"
            "AssemblyAsmDisplayName" = "8:testce, Version=1.0.0.13580, Culture=neutral, processorArchitecture=MSIL"
                "ScatterAssemblies"
                {
                    "_40F352185F3B41A485F42BFC64BF9162"
                    {
                    "Name" = "8:testce.exe"
                    "Attributes" = "3:512"
                    }







|







805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
            "IsDependency" = "11:FALSE"
            "IsolateTo" = "8:"
            }
            "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_40F352185F3B41A485F42BFC64BF9162"
            {
            "AssemblyRegister" = "3:1"
            "AssemblyIsInGAC" = "11:FALSE"
            "AssemblyAsmDisplayName" = "8:testce, Version=1.0.0.21647, Culture=neutral, processorArchitecture=MSIL"
                "ScatterAssemblies"
                {
                    "_40F352185F3B41A485F42BFC64BF9162"
                    {
                    "Name" = "8:testce.exe"
                    "Attributes" = "3:512"
                    }
954
955
956
957
958
959
960




















961
962
963
964
965
966
967
968
969
970
971
972
973
            "Permanent" = "11:FALSE"
            "SharedLegacy" = "11:FALSE"
            "PackageAs" = "3:1"
            "Register" = "3:1"
            "Exclude" = "11:TRUE"
            "IsDependency" = "11:TRUE"
            "IsolateTo" = "8:"




















            }
            "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_A18DBDB7776215EAD9A52C96F8CA1E91"
            {
            "AssemblyRegister" = "3:1"
            "AssemblyIsInGAC" = "11:FALSE"
            "AssemblyAsmDisplayName" = "8:System.Data.SQLite, Version=1.0.59.0, Culture=neutral, PublicKeyToken=1fdb50b1b62b4c84, processorArchitecture=MSIL"
                "ScatterAssemblies"
                {
                    "_A18DBDB7776215EAD9A52C96F8CA1E91"
                    {
                    "Name" = "8:System.Data.SQLite.DLL"
                    "Attributes" = "3:512"
                    }







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>





|







933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
            "Permanent" = "11:FALSE"
            "SharedLegacy" = "11:FALSE"
            "PackageAs" = "3:1"
            "Register" = "3:1"
            "Exclude" = "11:TRUE"
            "IsDependency" = "11:TRUE"
            "IsolateTo" = "8:"
            }
            "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_A1873A8DC29649A4BAF00E155CDCB8BF"
            {
            "SourcePath" = "8:..\\..\\bin\\CompactFramework\\System.Data.SQLite.lib"
            "TargetName" = "8:System.Data.SQLite.lib"
            "Tag" = "8:"
            "Folder" = "8:_10C8E86E2EEF451BB40F774C35C5466F"
            "Condition" = "8:"
            "Transitive" = "11:FALSE"
            "Vital" = "11:TRUE"
            "ReadOnly" = "11:FALSE"
            "Hidden" = "11:FALSE"
            "System" = "11:FALSE"
            "Permanent" = "11:FALSE"
            "SharedLegacy" = "11:FALSE"
            "PackageAs" = "3:1"
            "Register" = "3:1"
            "Exclude" = "11:FALSE"
            "IsDependency" = "11:FALSE"
            "IsolateTo" = "8:"
            }
            "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_A18DBDB7776215EAD9A52C96F8CA1E91"
            {
            "AssemblyRegister" = "3:1"
            "AssemblyIsInGAC" = "11:FALSE"
            "AssemblyAsmDisplayName" = "8:System.Data.SQLite, Version=1.0.56.0, Culture=neutral, PublicKeyToken=1fdb50b1b62b4c84, processorArchitecture=x86"
                "ScatterAssemblies"
                {
                    "_A18DBDB7776215EAD9A52C96F8CA1E91"
                    {
                    "Name" = "8:System.Data.SQLite.DLL"
                    "Attributes" = "3:512"
                    }
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
            "IsDependency" = "11:FALSE"
            "IsolateTo" = "8:"
            }
            "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_CD3CE5CDAB13405EA6EAAADC95F88D2E"
            {
            "AssemblyRegister" = "3:1"
            "AssemblyIsInGAC" = "11:FALSE"
            "AssemblyAsmDisplayName" = "8:SQLite.Designer, Version=1.0.36.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=x86"
                "ScatterAssemblies"
                {
                    "_CD3CE5CDAB13405EA6EAAADC95F88D2E"
                    {
                    "Name" = "8:SQLite.Designer.dll"
                    "Attributes" = "3:512"
                    }
                }
            "SourcePath" = "8:..\\..\\bin\\Designer\\SQLite.Designer.dll"
            "TargetName" = "8:"
            "Tag" = "8:"
            "Folder" = "8:_F11D54EE0EEA4BF59B52E621630B6A2E"
            "Condition" = "8:"
            "Transitive" = "11:FALSE"
            "Vital" = "11:TRUE"
            "ReadOnly" = "11:FALSE"
            "Hidden" = "11:FALSE"
            "System" = "11:FALSE"
            "Permanent" = "11:FALSE"
            "SharedLegacy" = "11:FALSE"
            "PackageAs" = "3:1"
            "Register" = "3:1"
            "Exclude" = "11:FALSE"
            "IsDependency" = "11:FALSE"
            "IsolateTo" = "8:"
            }
            "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_CE9E3EF0722342DB8DE0860C0DDCD39E"
            {
            "AssemblyRegister" = "3:1"
            "AssemblyIsInGAC" = "11:FALSE"
            "AssemblyAsmDisplayName" = "8:System.Data.SQLite.Linq, Version=2.0.38.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL"
                "ScatterAssemblies"
                {
                    "_CE9E3EF0722342DB8DE0860C0DDCD39E"
                    {
                    "Name" = "8:System.Data.SQLite.Linq.dll"
                    "Attributes" = "3:512"
                    }
                }
            "SourcePath" = "8:..\\..\\bin\\System.Data.SQLite.Linq.dll"
            "TargetName" = "8:"
            "Tag" = "8:"
            "Folder" = "8:_30C77BF2E6E84D01ADE5FB8BA2F81504"
            "Condition" = "8:"
            "Transitive" = "11:FALSE"
            "Vital" = "11:TRUE"
            "ReadOnly" = "11:FALSE"
            "Hidden" = "11:FALSE"
            "System" = "11:FALSE"
            "Permanent" = "11:FALSE"
            "SharedLegacy" = "11:FALSE"







|













<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162































1163
1164
1165
1166
1167
1168
1169
            "IsDependency" = "11:FALSE"
            "IsolateTo" = "8:"
            }
            "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_CD3CE5CDAB13405EA6EAAADC95F88D2E"
            {
            "AssemblyRegister" = "3:1"
            "AssemblyIsInGAC" = "11:FALSE"
            "AssemblyAsmDisplayName" = "8:SQLite.Designer, Version=1.0.35.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=x86"
                "ScatterAssemblies"
                {
                    "_CD3CE5CDAB13405EA6EAAADC95F88D2E"
                    {
                    "Name" = "8:SQLite.Designer.dll"
                    "Attributes" = "3:512"
                    }
                }
            "SourcePath" = "8:..\\..\\bin\\Designer\\SQLite.Designer.dll"
            "TargetName" = "8:"
            "Tag" = "8:"
            "Folder" = "8:_F11D54EE0EEA4BF59B52E621630B6A2E"
            "Condition" = "8:"































            "Transitive" = "11:FALSE"
            "Vital" = "11:TRUE"
            "ReadOnly" = "11:FALSE"
            "Hidden" = "11:FALSE"
            "System" = "11:FALSE"
            "Permanent" = "11:FALSE"
            "SharedLegacy" = "11:FALSE"
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
            "IsDependency" = "11:TRUE"
            "IsolateTo" = "8:"
            }
            "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_F320FBAE871DA320178BEEA242900CC7"
            {
            "AssemblyRegister" = "3:1"
            "AssemblyIsInGAC" = "11:FALSE"
            "AssemblyAsmDisplayName" = "8:System.Data.SQLite, Version=1.0.59.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=x86"
                "ScatterAssemblies"
                {
                    "_F320FBAE871DA320178BEEA242900CC7"
                    {
                    "Name" = "8:System.Data.SQLite.DLL"
                    "Attributes" = "3:512"
                    }







|







1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
            "IsDependency" = "11:TRUE"
            "IsolateTo" = "8:"
            }
            "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_F320FBAE871DA320178BEEA242900CC7"
            {
            "AssemblyRegister" = "3:1"
            "AssemblyIsInGAC" = "11:FALSE"
            "AssemblyAsmDisplayName" = "8:System.Data.SQLite, Version=1.0.56.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=x86"
                "ScatterAssemblies"
                {
                    "_F320FBAE871DA320178BEEA242900CC7"
                    {
                    "Name" = "8:System.Data.SQLite.DLL"
                    "Attributes" = "3:512"
                    }
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
        "LangId" = "3:1033"
        "RequiresElevation" = "11:FALSE"
        }
        "Product"
        {
        "Name" = "8:Microsoft Visual Studio"
        "ProductName" = "8:SQLite ADO.NET 2.0 Provider"
        "ProductCode" = "8:{718F7D6C-4CA0-4A7E-8F31-4EFE34F7ACE6}"
        "PackageCode" = "8:{E7E5C8DD-10BB-4BA9-B896-B45FDE9F0250}"
        "UpgradeCode" = "8:{78329A82-AFB1-453B-AF00-D46AC911DA89}"
        "RestartWWWService" = "11:FALSE"
        "RemovePreviousVersions" = "11:TRUE"
        "DetectNewerInstalledVersion" = "11:TRUE"
        "InstallAllUsers" = "11:TRUE"
        "ProductVersion" = "8:1.059.0"
        "Manufacturer" = "8:Phoenix Software Solutions, LLC"
        "ARPHELPTELEPHONE" = "8:"
        "ARPHELPLINK" = "8:http://sqlite.phxsoftware.com"
        "Title" = "8:SQLite ADO.NET 2.0 Provider"
        "Subject" = "8:"
        "ARPCONTACT" = "8:Phoenix Software Solutions, LLC"
        "Keywords" = "8:"







|
|





|







1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
        "LangId" = "3:1033"
        "RequiresElevation" = "11:FALSE"
        }
        "Product"
        {
        "Name" = "8:Microsoft Visual Studio"
        "ProductName" = "8:SQLite ADO.NET 2.0 Provider"
        "ProductCode" = "8:{414A1727-0EEC-4F19-BA00-79CCD8EB2E8A}"
        "PackageCode" = "8:{D61282A9-3BE9-4C9A-A44D-DF9A6F4B89AB}"
        "UpgradeCode" = "8:{78329A82-AFB1-453B-AF00-D46AC911DA89}"
        "RestartWWWService" = "11:FALSE"
        "RemovePreviousVersions" = "11:TRUE"
        "DetectNewerInstalledVersion" = "11:TRUE"
        "InstallAllUsers" = "11:TRUE"
        "ProductVersion" = "8:1.056.0"
        "Manufacturer" = "8:Phoenix Software Solutions, LLC"
        "ARPHELPTELEPHONE" = "8:"
        "ARPHELPLINK" = "8:http://sqlite.phxsoftware.com"
        "Title" = "8:SQLite ADO.NET 2.0 Provider"
        "Subject" = "8:"
        "ARPCONTACT" = "8:Phoenix Software Solutions, LLC"
        "Keywords" = "8:"
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
            "ShowCmd" = "3:1"
            "IconIndex" = "3:32512"
            "Transitive" = "11:FALSE"
            "Target" = "8:_40DFF08BA903482D807E715A041CA8B1"
            "Folder" = "8:_1B562A9F876E47058AB813C418E24FBF"
            "WorkingFolder" = "8:_F11D54EE0EEA4BF59B52E621630B6A2E"
            "Icon" = "8:_40DFF08BA903482D807E715A041CA8B1"
            "Feature" = "8:"
            }
            "{970C0BB2-C7D0-45D7-ABFA-7EC378858BC0}:_920202B002F9475288A945B0C8361A44"
            {
            "Name" = "8:SQLite Test Application"
            "Arguments" = "8:"
            "Description" = "8:"
            "ShowCmd" = "3:1"
            "IconIndex" = "3:0"
            "Transitive" = "11:FALSE"
            "Target" = "8:_2C7EDFF06B61482393D94E3A63D90113"
            "Folder" = "8:_1B562A9F876E47058AB813C418E24FBF"
            "WorkingFolder" = "8:_30C77BF2E6E84D01ADE5FB8BA2F81504"
            "Icon" = "8:"
            "Feature" = "8:"
            }
            "{970C0BB2-C7D0-45D7-ABFA-7EC378858BC0}:_CC64AEB6D8A643F7BC8EB95EBC803EB5"
            {
            "Name" = "8:Help"
            "Arguments" = "8:"
            "Description" = "8:"







<
<
<
<
<
<
<
<
<
<
<
<
<
<







1511
1512
1513
1514
1515
1516
1517














1518
1519
1520
1521
1522
1523
1524
            "ShowCmd" = "3:1"
            "IconIndex" = "3:32512"
            "Transitive" = "11:FALSE"
            "Target" = "8:_40DFF08BA903482D807E715A041CA8B1"
            "Folder" = "8:_1B562A9F876E47058AB813C418E24FBF"
            "WorkingFolder" = "8:_F11D54EE0EEA4BF59B52E621630B6A2E"
            "Icon" = "8:_40DFF08BA903482D807E715A041CA8B1"














            "Feature" = "8:"
            }
            "{970C0BB2-C7D0-45D7-ABFA-7EC378858BC0}:_CC64AEB6D8A643F7BC8EB95EBC803EB5"
            {
            "Name" = "8:Help"
            "Arguments" = "8:"
            "Description" = "8:"