#pragma warning disable 1591
//------------------------------------------------------------------------------
//
// 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.
//
//------------------------------------------------------------------------------
namespace Website.DataAccess
{
using System.Data.Linq;
using System.Data.Linq.Mapping;
using System.Data;
using System.Collections.Generic;
using System.Reflection;
using System.Linq;
using System.Linq.Expressions;
using System.Runtime.Serialization;
using System.ComponentModel;
using System;
public partial class WebsiteDataContext : System.Data.Linq.DataContext
{
private static System.Data.Linq.Mapping.MappingSource mappingSource = new AttributeMappingSource();
#region Extensibility Method Definitions
partial void OnCreated();
partial void InsertContent(Content instance);
partial void UpdateContent(Content instance);
partial void DeleteContent(Content instance);
partial void InsertMetaDatum(MetaDatum instance);
partial void UpdateMetaDatum(MetaDatum instance);
partial void DeleteMetaDatum(MetaDatum instance);
#endregion
public WebsiteDataContext() :
base(global::Website.DataAccess.Properties.Settings.Default.WebsiteConnectionString, mappingSource)
{
OnCreated();
}
public WebsiteDataContext(string connection) :
base(connection, mappingSource)
{
OnCreated();
}
public WebsiteDataContext(System.Data.IDbConnection connection) :
base(connection, mappingSource)
{
OnCreated();
}
public WebsiteDataContext(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
base(connection, mappingSource)
{
OnCreated();
}
public WebsiteDataContext(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
base(connection, mappingSource)
{
OnCreated();
}
public System.Data.Linq.Table Contents
{
get
{
return this.GetTable();
}
}
public System.Data.Linq.Table MetaDatums
{
get
{
return this.GetTable();
}
}
}
[Table(Name="")]
[DataContract()]
public partial class Content : INotifyPropertyChanging, INotifyPropertyChanged
{
private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
private int _ID = default(int);
private string _Keywords;
private string _Text;
private string _Title;
private int _ParentID;
private string _Alias;
private EntitySet _MetaDatums;
private bool serializing;
#region Extensibility Method Definitions
partial void OnLoaded();
partial void OnValidate(System.Data.Linq.ChangeAction action);
partial void OnCreated();
partial void OnIDChanging(int value);
partial void OnIDChanged();
partial void OnKeywordsChanging(string value);
partial void OnKeywordsChanged();
partial void OnHtmlChanging(string value);
partial void OnHtmlChanged();
partial void OnTitleChanging(string value);
partial void OnTitleChanged();
partial void OnParentIDChanging(int value);
partial void OnParentIDChanged();
partial void OnAliasChanging(string value);
partial void OnAliasChanged();
#endregion
public Content()
{
this.Initialize();
}
[Column(Storage="_ID", IsPrimaryKey=true, IsDbGenerated=true, UpdateCheck=UpdateCheck.Never)]
[DataMember(Order=1)]
public int ID
{
get
{
return this._ID;
}
set
{
if ((this._ID != value))
{
this.OnIDChanging(value);
this.SendPropertyChanging();
this._ID = value;
this.SendPropertyChanged("ID");
this.OnIDChanged();
}
}
}
[Column(Storage="_Keywords")]
[DataMember(Order=2)]
public string Keywords
{
get
{
return this._Keywords;
}
set
{
if ((this._Keywords != value))
{
this.OnKeywordsChanging(value);
this.SendPropertyChanging();
this._Keywords = value;
this.SendPropertyChanged("Keywords");
this.OnKeywordsChanged();
}
}
}
[Column(Name="Text", Storage="_Text", DbType="ntext", UpdateCheck=UpdateCheck.Never)]
[DataMember(Order=3)]
public string Html
{
get
{
return this._Text;
}
set
{
if ((this._Text != value))
{
this.OnHtmlChanging(value);
this.SendPropertyChanging();
this._Text = value;
this.SendPropertyChanged("Html");
this.OnHtmlChanged();
}
}
}
[Column(Storage="_Title", CanBeNull=false)]
[DataMember(Order=4)]
public string Title
{
get
{
return this._Title;
}
set
{
if ((this._Title != value))
{
this.OnTitleChanging(value);
this.SendPropertyChanging();
this._Title = value;
this.SendPropertyChanged("Title");
this.OnTitleChanged();
}
}
}
[Column(Storage="_ParentID")]
[DataMember(Order=5)]
public int ParentID
{
get
{
return this._ParentID;
}
set
{
if ((this._ParentID != value))
{
this.OnParentIDChanging(value);
this.SendPropertyChanging();
this._ParentID = value;
this.SendPropertyChanged("ParentID");
this.OnParentIDChanged();
}
}
}
[Column(Storage="_Alias", CanBeNull=false)]
[DataMember(Order=6)]
public string Alias
{
get
{
return this._Alias;
}
set
{
if ((this._Alias != value))
{
this.OnAliasChanging(value);
this.SendPropertyChanging();
this._Alias = value;
this.SendPropertyChanged("Alias");
this.OnAliasChanged();
}
}
}
[Association(Name="Content_MetaDatum", Storage="_MetaDatums", OtherKey="ContentID")]
[DataMember(Order=7, EmitDefaultValue=false)]
public EntitySet MetaDatums
{
get
{
if ((this.serializing
&& (this._MetaDatums.HasLoadedOrAssignedValues == false)))
{
return null;
}
return this._MetaDatums;
}
set
{
this._MetaDatums.Assign(value);
}
}
public event PropertyChangingEventHandler PropertyChanging;
public event PropertyChangedEventHandler PropertyChanged;
protected virtual void SendPropertyChanging()
{
if ((this.PropertyChanging != null))
{
this.PropertyChanging(this, emptyChangingEventArgs);
}
}
protected virtual void SendPropertyChanged(String propertyName)
{
if ((this.PropertyChanged != null))
{
this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
}
private void attach_MetaDatums(MetaDatum entity)
{
this.SendPropertyChanging();
entity.Content = this;
}
private void detach_MetaDatums(MetaDatum entity)
{
this.SendPropertyChanging();
entity.Content = null;
}
private void Initialize()
{
this._MetaDatums = new EntitySet(new Action(this.attach_MetaDatums), new Action(this.detach_MetaDatums));
OnCreated();
}
[OnDeserializing()]
[System.ComponentModel.EditorBrowsableAttribute(EditorBrowsableState.Never)]
public void OnDeserializing(StreamingContext context)
{
this.Initialize();
}
[OnSerializing()]
[System.ComponentModel.EditorBrowsableAttribute(EditorBrowsableState.Never)]
public void OnSerializing(StreamingContext context)
{
this.serializing = true;
}
[OnSerialized()]
[System.ComponentModel.EditorBrowsableAttribute(EditorBrowsableState.Never)]
public void OnSerialized(StreamingContext context)
{
this.serializing = false;
}
}
[Table(Name="")]
[DataContract()]
public partial class MetaDatum : INotifyPropertyChanging, INotifyPropertyChanged
{
private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
private int _ContentID;
private string _Key;
private string _Value;
private EntityRef _Content;
#region Extensibility Method Definitions
partial void OnLoaded();
partial void OnValidate(System.Data.Linq.ChangeAction action);
partial void OnCreated();
partial void OnContentIDChanging(int value);
partial void OnContentIDChanged();
partial void OnKeyChanging(string value);
partial void OnKeyChanged();
partial void OnValueChanging(string value);
partial void OnValueChanged();
#endregion
public MetaDatum()
{
this.Initialize();
}
[Column(Storage="_ContentID", IsPrimaryKey=true)]
[DataMember(Order=1)]
public int ContentID
{
get
{
return this._ContentID;
}
set
{
if ((this._ContentID != value))
{
if (this._Content.HasLoadedOrAssignedValue)
{
throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
}
this.OnContentIDChanging(value);
this.SendPropertyChanging();
this._ContentID = value;
this.SendPropertyChanged("ContentID");
this.OnContentIDChanged();
}
}
}
[Column(Storage="_Key", CanBeNull=false, IsPrimaryKey=true)]
[DataMember(Order=2)]
public string Key
{
get
{
return this._Key;
}
set
{
if ((this._Key != value))
{
this.OnKeyChanging(value);
this.SendPropertyChanging();
this._Key = value;
this.SendPropertyChanged("Key");
this.OnKeyChanged();
}
}
}
[Column(Storage="_Value", CanBeNull=false)]
[DataMember(Order=3)]
public string Value
{
get
{
return this._Value;
}
set
{
if ((this._Value != value))
{
this.OnValueChanging(value);
this.SendPropertyChanging();
this._Value = value;
this.SendPropertyChanged("Value");
this.OnValueChanged();
}
}
}
[Association(Name="Content_MetaDatum", Storage="_Content", ThisKey="ContentID", IsForeignKey=true)]
public Content Content
{
get
{
return this._Content.Entity;
}
set
{
Content previousValue = this._Content.Entity;
if (((previousValue != value)
|| (this._Content.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
if ((previousValue != null))
{
this._Content.Entity = null;
previousValue.MetaDatums.Remove(this);
}
this._Content.Entity = value;
if ((value != null))
{
value.MetaDatums.Add(this);
this._ContentID = value.ID;
}
else
{
this._ContentID = default(int);
}
this.SendPropertyChanged("Content");
}
}
}
public event PropertyChangingEventHandler PropertyChanging;
public event PropertyChangedEventHandler PropertyChanged;
protected virtual void SendPropertyChanging()
{
if ((this.PropertyChanging != null))
{
this.PropertyChanging(this, emptyChangingEventArgs);
}
}
protected virtual void SendPropertyChanged(String propertyName)
{
if ((this.PropertyChanged != null))
{
this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
}
private void Initialize()
{
this._Content = default(EntityRef);
OnCreated();
}
[OnDeserializing()]
[System.ComponentModel.EditorBrowsableAttribute(EditorBrowsableState.Never)]
public void OnDeserializing(StreamingContext context)
{
this.Initialize();
}
}
}
#pragma warning restore 1591