#pragma warning disable 1591
//------------------------------------------------------------------------------
//
// This code was generated by a tool.
// Runtime Version:2.0.50727.3082
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
//
//------------------------------------------------------------------------------
namespace Wierszowki.Core.Linq
{
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;
[System.Data.Linq.Mapping.DatabaseAttribute(Name="Wierszowki")]
public partial class WierszowkiDataContext : System.Data.Linq.DataContext
{
private static System.Data.Linq.Mapping.MappingSource mappingSource = new AttributeMappingSource();
#region Extensibility Method Definitions
partial void OnCreated();
partial void InsertUser(User instance);
partial void UpdateUser(User instance);
partial void DeleteUser(User instance);
partial void InsertAuthor(Author instance);
partial void UpdateAuthor(Author instance);
partial void DeleteAuthor(Author instance);
partial void InsertItemType(ItemType instance);
partial void UpdateItemType(ItemType instance);
partial void DeleteItemType(ItemType instance);
partial void InsertMagazine(Magazine instance);
partial void UpdateMagazine(Magazine instance);
partial void DeleteMagazine(Magazine instance);
partial void InsertIssue(Issue instance);
partial void UpdateIssue(Issue instance);
partial void DeleteIssue(Issue instance);
partial void InsertMagazineItem(MagazineItem instance);
partial void UpdateMagazineItem(MagazineItem instance);
partial void DeleteMagazineItem(MagazineItem instance);
partial void InsertEmploymentType(EmploymentType instance);
partial void UpdateEmploymentType(EmploymentType instance);
partial void DeleteEmploymentType(EmploymentType instance);
#endregion
public WierszowkiDataContext() :
base(global::Wierszowki.Core.Properties.Settings.Default.WierszowkiConnectionString, mappingSource)
{
OnCreated();
}
public WierszowkiDataContext(string connection) :
base(connection, mappingSource)
{
OnCreated();
}
public WierszowkiDataContext(System.Data.IDbConnection connection) :
base(connection, mappingSource)
{
OnCreated();
}
public WierszowkiDataContext(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
base(connection, mappingSource)
{
OnCreated();
}
public WierszowkiDataContext(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
base(connection, mappingSource)
{
OnCreated();
}
public System.Data.Linq.Table Users
{
get
{
return this.GetTable();
}
}
public System.Data.Linq.Table Authors
{
get
{
return this.GetTable();
}
}
public System.Data.Linq.Table ItemTypes
{
get
{
return this.GetTable();
}
}
public System.Data.Linq.Table Magazines
{
get
{
return this.GetTable();
}
}
public System.Data.Linq.Table Issues
{
get
{
return this.GetTable();
}
}
public System.Data.Linq.Table MagazineItems
{
get
{
return this.GetTable();
}
}
public System.Data.Linq.Table EmploymentTypes
{
get
{
return this.GetTable();
}
}
[Function(Name="dbo.GetAuthors")]
public ISingleResult GetAuthors([Parameter(DbType="Int")] System.Nullable year, [Parameter(DbType="Int")] System.Nullable month)
{
IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), year, month);
return ((ISingleResult)(result.ReturnValue));
}
[Function(Name="dbo.GetAuthorsByMagzines")]
public ISingleResult GetAuthorsByMagzines([Parameter(DbType="Int")] System.Nullable year, [Parameter(DbType="Int")] System.Nullable month)
{
IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), year, month);
return ((ISingleResult)(result.ReturnValue));
}
}
[Table(Name="dbo.[User]")]
[DataContract()]
public partial class User : INotifyPropertyChanging, INotifyPropertyChanged
{
private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
private int _Id;
private string _Login;
private string _Password;
private string _FirstName;
private string _LastName;
#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 OnLoginChanging(string value);
partial void OnLoginChanged();
partial void OnPasswordChanging(string value);
partial void OnPasswordChanged();
partial void OnFirstNameChanging(string value);
partial void OnFirstNameChanged();
partial void OnLastNameChanging(string value);
partial void OnLastNameChanged();
#endregion
public User()
{
this.Initialize();
}
[Column(Storage="_Id", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
[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="_Login", DbType="VarChar(50) NOT NULL", CanBeNull=false)]
[DataMember(Order=2)]
public string Login
{
get
{
return this._Login;
}
set
{
if ((this._Login != value))
{
this.OnLoginChanging(value);
this.SendPropertyChanging();
this._Login = value;
this.SendPropertyChanged("Login");
this.OnLoginChanged();
}
}
}
[Column(Storage="_Password", DbType="VarChar(50) NOT NULL", CanBeNull=false)]
[DataMember(Order=3)]
public string Password
{
get
{
return this._Password;
}
set
{
if ((this._Password != value))
{
this.OnPasswordChanging(value);
this.SendPropertyChanging();
this._Password = value;
this.SendPropertyChanged("Password");
this.OnPasswordChanged();
}
}
}
[Column(Storage="_FirstName", DbType="NVarChar(50)")]
[DataMember(Order=4)]
public string FirstName
{
get
{
return this._FirstName;
}
set
{
if ((this._FirstName != value))
{
this.OnFirstNameChanging(value);
this.SendPropertyChanging();
this._FirstName = value;
this.SendPropertyChanged("FirstName");
this.OnFirstNameChanged();
}
}
}
[Column(Storage="_LastName", DbType="NVarChar(50)")]
[DataMember(Order=5)]
public string LastName
{
get
{
return this._LastName;
}
set
{
if ((this._LastName != value))
{
this.OnLastNameChanging(value);
this.SendPropertyChanging();
this._LastName = value;
this.SendPropertyChanged("LastName");
this.OnLastNameChanged();
}
}
}
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()
{
OnCreated();
}
[OnDeserializing()]
[System.ComponentModel.EditorBrowsableAttribute(EditorBrowsableState.Never)]
public void OnDeserializing(StreamingContext context)
{
this.Initialize();
}
}
[Table(Name="dbo.Author")]
[DataContract()]
public partial class Author : INotifyPropertyChanging, INotifyPropertyChanged
{
private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
private int _Id;
private int _EmploymentTypeId;
private string _FirstName;
private string _LastName;
private EntitySet _MagazineItems;
private EntityRef _EmploymentType;
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 OnEmploymentTypeIdChanging(int value);
partial void OnEmploymentTypeIdChanged();
partial void OnFirstNameChanging(string value);
partial void OnFirstNameChanged();
partial void OnLastNameChanging(string value);
partial void OnLastNameChanged();
#endregion
public Author()
{
this.Initialize();
}
[Column(Storage="_Id", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
[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="_EmploymentTypeId", DbType="Int NOT NULL")]
[DataMember(Order=2)]
public int EmploymentTypeId
{
get
{
return this._EmploymentTypeId;
}
set
{
if ((this._EmploymentTypeId != value))
{
if (this._EmploymentType.HasLoadedOrAssignedValue)
{
throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
}
this.OnEmploymentTypeIdChanging(value);
this.SendPropertyChanging();
this._EmploymentTypeId = value;
this.SendPropertyChanged("EmploymentTypeId");
this.OnEmploymentTypeIdChanged();
}
}
}
[Column(Storage="_FirstName", DbType="NVarChar(100) NOT NULL", CanBeNull=false)]
[DataMember(Order=3)]
public string FirstName
{
get
{
return this._FirstName;
}
set
{
if ((this._FirstName != value))
{
this.OnFirstNameChanging(value);
this.SendPropertyChanging();
this._FirstName = value;
this.SendPropertyChanged("FirstName");
this.OnFirstNameChanged();
}
}
}
[Column(Storage="_LastName", DbType="NVarChar(100) NOT NULL", CanBeNull=false)]
[DataMember(Order=4)]
public string LastName
{
get
{
return this._LastName;
}
set
{
if ((this._LastName != value))
{
this.OnLastNameChanging(value);
this.SendPropertyChanging();
this._LastName = value;
this.SendPropertyChanged("LastName");
this.OnLastNameChanged();
}
}
}
[Association(Name="Author_MagazineItem", Storage="_MagazineItems", ThisKey="Id", OtherKey="AuthorId")]
[DataMember(Order=5, EmitDefaultValue=false)]
public EntitySet MagazineItems
{
get
{
if ((this.serializing
&& (this._MagazineItems.HasLoadedOrAssignedValues == false)))
{
return null;
}
return this._MagazineItems;
}
set
{
this._MagazineItems.Assign(value);
}
}
[Association(Name="EmploymentType_Author", Storage="_EmploymentType", ThisKey="EmploymentTypeId", OtherKey="Id", IsForeignKey=true)]
public EmploymentType EmploymentType
{
get
{
return this._EmploymentType.Entity;
}
set
{
EmploymentType previousValue = this._EmploymentType.Entity;
if (((previousValue != value)
|| (this._EmploymentType.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
if ((previousValue != null))
{
this._EmploymentType.Entity = null;
previousValue.Authors.Remove(this);
}
this._EmploymentType.Entity = value;
if ((value != null))
{
value.Authors.Add(this);
this._EmploymentTypeId = value.Id;
}
else
{
this._EmploymentTypeId = default(int);
}
this.SendPropertyChanged("EmploymentType");
}
}
}
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_MagazineItems(MagazineItem entity)
{
this.SendPropertyChanging();
entity.Author = this;
}
private void detach_MagazineItems(MagazineItem entity)
{
this.SendPropertyChanging();
entity.Author = null;
}
private void Initialize()
{
this._MagazineItems = new EntitySet(new Action(this.attach_MagazineItems), new Action(this.detach_MagazineItems));
this._EmploymentType = default(EntityRef);
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="dbo.ItemType")]
[DataContract()]
public partial class ItemType : INotifyPropertyChanging, INotifyPropertyChanged
{
private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
private int _Id;
private string _Name;
private EntitySet _MagazineItems;
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 OnNameChanging(string value);
partial void OnNameChanged();
#endregion
public ItemType()
{
this.Initialize();
}
[Column(Storage="_Id", DbType="Int NOT NULL", IsPrimaryKey=true)]
[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="_Name", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]
[DataMember(Order=2)]
public string Name
{
get
{
return this._Name;
}
set
{
if ((this._Name != value))
{
this.OnNameChanging(value);
this.SendPropertyChanging();
this._Name = value;
this.SendPropertyChanged("Name");
this.OnNameChanged();
}
}
}
[Association(Name="ItemType_MagazineItem", Storage="_MagazineItems", ThisKey="Id", OtherKey="ItemTypeId")]
[DataMember(Order=3, EmitDefaultValue=false)]
public EntitySet MagazineItems
{
get
{
if ((this.serializing
&& (this._MagazineItems.HasLoadedOrAssignedValues == false)))
{
return null;
}
return this._MagazineItems;
}
set
{
this._MagazineItems.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_MagazineItems(MagazineItem entity)
{
this.SendPropertyChanging();
entity.ItemType = this;
}
private void detach_MagazineItems(MagazineItem entity)
{
this.SendPropertyChanging();
entity.ItemType = null;
}
private void Initialize()
{
this._MagazineItems = new EntitySet(new Action(this.attach_MagazineItems), new Action(this.detach_MagazineItems));
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="dbo.Magazine")]
[DataContract()]
public partial class Magazine : INotifyPropertyChanging, INotifyPropertyChanged
{
private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
private int _Id;
private string _Name;
private string _NickName;
private EntitySet _Issues;
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 OnNameChanging(string value);
partial void OnNameChanged();
partial void OnNickNameChanging(string value);
partial void OnNickNameChanged();
#endregion
public Magazine()
{
this.Initialize();
}
[Column(Storage="_Id", DbType="Int NOT NULL", IsPrimaryKey=true)]
[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="_Name", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]
[DataMember(Order=2)]
public string Name
{
get
{
return this._Name;
}
set
{
if ((this._Name != value))
{
this.OnNameChanging(value);
this.SendPropertyChanging();
this._Name = value;
this.SendPropertyChanged("Name");
this.OnNameChanged();
}
}
}
[Column(Storage="_NickName", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]
[DataMember(Order=3)]
public string NickName
{
get
{
return this._NickName;
}
set
{
if ((this._NickName != value))
{
this.OnNickNameChanging(value);
this.SendPropertyChanging();
this._NickName = value;
this.SendPropertyChanged("NickName");
this.OnNickNameChanged();
}
}
}
[Association(Name="Magazine_Issue", Storage="_Issues", ThisKey="Id", OtherKey="MagazineId")]
[DataMember(Order=4, EmitDefaultValue=false)]
public EntitySet Issues
{
get
{
if ((this.serializing
&& (this._Issues.HasLoadedOrAssignedValues == false)))
{
return null;
}
return this._Issues;
}
set
{
this._Issues.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_Issues(Issue entity)
{
this.SendPropertyChanging();
entity.Magazine = this;
}
private void detach_Issues(Issue entity)
{
this.SendPropertyChanging();
entity.Magazine = null;
}
private void Initialize()
{
this._Issues = new EntitySet(new Action(this.attach_Issues), new Action(this.detach_Issues));
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="dbo.Issue")]
[DataContract()]
public partial class Issue : INotifyPropertyChanging, INotifyPropertyChanged
{
private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
private int _Id;
private int _MagazineId;
private int _Number;
private System.DateTime _Date;
private EntitySet _MagazineItems;
private EntityRef _Magazine;
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 OnMagazineIdChanging(int value);
partial void OnMagazineIdChanged();
partial void OnNumberChanging(int value);
partial void OnNumberChanged();
partial void OnDateChanging(System.DateTime value);
partial void OnDateChanged();
#endregion
public Issue()
{
this.Initialize();
}
[Column(Storage="_Id", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
[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="_MagazineId", DbType="Int NOT NULL")]
[DataMember(Order=2)]
public int MagazineId
{
get
{
return this._MagazineId;
}
set
{
if ((this._MagazineId != value))
{
if (this._Magazine.HasLoadedOrAssignedValue)
{
throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
}
this.OnMagazineIdChanging(value);
this.SendPropertyChanging();
this._MagazineId = value;
this.SendPropertyChanged("MagazineId");
this.OnMagazineIdChanged();
}
}
}
[Column(Storage="_Number", DbType="Int NOT NULL")]
[DataMember(Order=3)]
public int Number
{
get
{
return this._Number;
}
set
{
if ((this._Number != value))
{
this.OnNumberChanging(value);
this.SendPropertyChanging();
this._Number = value;
this.SendPropertyChanged("Number");
this.OnNumberChanged();
}
}
}
[Column(Storage="_Date", DbType="DateTime NOT NULL")]
[DataMember(Order=4)]
public System.DateTime Date
{
get
{
return this._Date;
}
set
{
if ((this._Date != value))
{
this.OnDateChanging(value);
this.SendPropertyChanging();
this._Date = value;
this.SendPropertyChanged("Date");
this.OnDateChanged();
}
}
}
[Association(Name="Issue_MagazineItem", Storage="_MagazineItems", ThisKey="Id", OtherKey="IssueId")]
[DataMember(Order=5, EmitDefaultValue=false)]
public EntitySet MagazineItems
{
get
{
if ((this.serializing
&& (this._MagazineItems.HasLoadedOrAssignedValues == false)))
{
return null;
}
return this._MagazineItems;
}
set
{
this._MagazineItems.Assign(value);
}
}
[Association(Name="Magazine_Issue", Storage="_Magazine", ThisKey="MagazineId", OtherKey="Id", IsForeignKey=true)]
public Magazine Magazine
{
get
{
return this._Magazine.Entity;
}
set
{
Magazine previousValue = this._Magazine.Entity;
if (((previousValue != value)
|| (this._Magazine.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
if ((previousValue != null))
{
this._Magazine.Entity = null;
previousValue.Issues.Remove(this);
}
this._Magazine.Entity = value;
if ((value != null))
{
value.Issues.Add(this);
this._MagazineId = value.Id;
}
else
{
this._MagazineId = default(int);
}
this.SendPropertyChanged("Magazine");
}
}
}
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_MagazineItems(MagazineItem entity)
{
this.SendPropertyChanging();
entity.Issue = this;
}
private void detach_MagazineItems(MagazineItem entity)
{
this.SendPropertyChanging();
entity.Issue = null;
}
private void Initialize()
{
this._MagazineItems = new EntitySet(new Action(this.attach_MagazineItems), new Action(this.detach_MagazineItems));
this._Magazine = default(EntityRef);
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="dbo.MagazineItem")]
[DataContract()]
public partial class MagazineItem : INotifyPropertyChanging, INotifyPropertyChanged
{
private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
private int _Id;
private int _AuthorId;
private int _IssueId;
private int _ItemTypeId;
private string _Caption;
private string _Description;
private decimal _Price;
private decimal _Bonus;
private int _CreatedBy;
private System.DateTime _CreatedOn;
private int _UpdatedBy;
private System.DateTime _UpdatedOn;
private System.DateTime _Date;
private EntityRef _Author;
private EntityRef _User;
private EntityRef _Issue;
private EntityRef _ItemType;
private EntityRef _User1;
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 OnAuthorIdChanging(int value);
partial void OnAuthorIdChanged();
partial void OnIssueIdChanging(int value);
partial void OnIssueIdChanged();
partial void OnItemTypeIdChanging(int value);
partial void OnItemTypeIdChanged();
partial void OnCaptionChanging(string value);
partial void OnCaptionChanged();
partial void OnDescriptionChanging(string value);
partial void OnDescriptionChanged();
partial void OnPriceChanging(decimal value);
partial void OnPriceChanged();
partial void OnBonusChanging(decimal value);
partial void OnBonusChanged();
partial void OnCreatedByChanging(int value);
partial void OnCreatedByChanged();
partial void OnCreatedOnChanging(System.DateTime value);
partial void OnCreatedOnChanged();
partial void OnUpdatedByChanging(int value);
partial void OnUpdatedByChanged();
partial void OnUpdatedOnChanging(System.DateTime value);
partial void OnUpdatedOnChanged();
partial void OnDateChanging(System.DateTime value);
partial void OnDateChanged();
#endregion
public MagazineItem()
{
this.Initialize();
}
[Column(Storage="_Id", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
[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="_AuthorId", DbType="Int NOT NULL")]
[DataMember(Order=2)]
public int AuthorId
{
get
{
return this._AuthorId;
}
set
{
if ((this._AuthorId != value))
{
if (this._Author.HasLoadedOrAssignedValue)
{
throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
}
this.OnAuthorIdChanging(value);
this.SendPropertyChanging();
this._AuthorId = value;
this.SendPropertyChanged("AuthorId");
this.OnAuthorIdChanged();
}
}
}
[Column(Storage="_IssueId", DbType="Int NOT NULL")]
[DataMember(Order=3)]
public int IssueId
{
get
{
return this._IssueId;
}
set
{
if ((this._IssueId != value))
{
if (this._Issue.HasLoadedOrAssignedValue)
{
throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
}
this.OnIssueIdChanging(value);
this.SendPropertyChanging();
this._IssueId = value;
this.SendPropertyChanged("IssueId");
this.OnIssueIdChanged();
}
}
}
[Column(Storage="_ItemTypeId", DbType="Int NOT NULL")]
[DataMember(Order=4)]
public int ItemTypeId
{
get
{
return this._ItemTypeId;
}
set
{
if ((this._ItemTypeId != value))
{
if (this._ItemType.HasLoadedOrAssignedValue)
{
throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
}
this.OnItemTypeIdChanging(value);
this.SendPropertyChanging();
this._ItemTypeId = value;
this.SendPropertyChanged("ItemTypeId");
this.OnItemTypeIdChanged();
}
}
}
[Column(Storage="_Caption", DbType="NVarChar(255) NOT NULL", CanBeNull=false)]
[DataMember(Order=5)]
public string Caption
{
get
{
return this._Caption;
}
set
{
if ((this._Caption != value))
{
this.OnCaptionChanging(value);
this.SendPropertyChanging();
this._Caption = value;
this.SendPropertyChanged("Caption");
this.OnCaptionChanged();
}
}
}
[Column(Storage="_Description", DbType="NVarChar(255)")]
[DataMember(Order=6)]
public string Description
{
get
{
return this._Description;
}
set
{
if ((this._Description != value))
{
this.OnDescriptionChanging(value);
this.SendPropertyChanging();
this._Description = value;
this.SendPropertyChanged("Description");
this.OnDescriptionChanged();
}
}
}
[Column(Storage="_Price", DbType="Decimal(9,2) NOT NULL")]
[DataMember(Order=7)]
public decimal Price
{
get
{
return this._Price;
}
set
{
if ((this._Price != value))
{
this.OnPriceChanging(value);
this.SendPropertyChanging();
this._Price = value;
this.SendPropertyChanged("Price");
this.OnPriceChanged();
}
}
}
[Column(Storage="_Bonus", DbType="Decimal(9,2) NOT NULL")]
[DataMember(Order=8)]
public decimal Bonus
{
get
{
return this._Bonus;
}
set
{
if ((this._Bonus != value))
{
this.OnBonusChanging(value);
this.SendPropertyChanging();
this._Bonus = value;
this.SendPropertyChanged("Bonus");
this.OnBonusChanged();
}
}
}
[Column(Storage="_CreatedBy", DbType="Int NOT NULL")]
[DataMember(Order=9)]
public int CreatedBy
{
get
{
return this._CreatedBy;
}
set
{
if ((this._CreatedBy != value))
{
if (this._User.HasLoadedOrAssignedValue)
{
throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
}
this.OnCreatedByChanging(value);
this.SendPropertyChanging();
this._CreatedBy = value;
this.SendPropertyChanged("CreatedBy");
this.OnCreatedByChanged();
}
}
}
[Column(Storage="_CreatedOn", DbType="DateTime NOT NULL")]
[DataMember(Order=10)]
public System.DateTime CreatedOn
{
get
{
return this._CreatedOn;
}
set
{
if ((this._CreatedOn != value))
{
this.OnCreatedOnChanging(value);
this.SendPropertyChanging();
this._CreatedOn = value;
this.SendPropertyChanged("CreatedOn");
this.OnCreatedOnChanged();
}
}
}
[Column(Storage="_UpdatedBy", DbType="Int NOT NULL")]
[DataMember(Order=11)]
public int UpdatedBy
{
get
{
return this._UpdatedBy;
}
set
{
if ((this._UpdatedBy != value))
{
if (this._User1.HasLoadedOrAssignedValue)
{
throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
}
this.OnUpdatedByChanging(value);
this.SendPropertyChanging();
this._UpdatedBy = value;
this.SendPropertyChanged("UpdatedBy");
this.OnUpdatedByChanged();
}
}
}
[Column(Storage="_UpdatedOn", DbType="DateTime NOT NULL")]
[DataMember(Order=12)]
public System.DateTime UpdatedOn
{
get
{
return this._UpdatedOn;
}
set
{
if ((this._UpdatedOn != value))
{
this.OnUpdatedOnChanging(value);
this.SendPropertyChanging();
this._UpdatedOn = value;
this.SendPropertyChanged("UpdatedOn");
this.OnUpdatedOnChanged();
}
}
}
[Column(Storage="_Date", DbType="DateTime NOT NULL")]
[DataMember(Order=13)]
public System.DateTime Date
{
get
{
return this._Date;
}
set
{
if ((this._Date != value))
{
this.OnDateChanging(value);
this.SendPropertyChanging();
this._Date = value;
this.SendPropertyChanged("Date");
this.OnDateChanged();
}
}
}
[Association(Name="Author_MagazineItem", Storage="_Author", ThisKey="AuthorId", OtherKey="Id", IsForeignKey=true)]
public Author Author
{
get
{
return this._Author.Entity;
}
set
{
Author previousValue = this._Author.Entity;
if (((previousValue != value)
|| (this._Author.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
if ((previousValue != null))
{
this._Author.Entity = null;
previousValue.MagazineItems.Remove(this);
}
this._Author.Entity = value;
if ((value != null))
{
value.MagazineItems.Add(this);
this._AuthorId = value.Id;
}
else
{
this._AuthorId = default(int);
}
this.SendPropertyChanged("Author");
}
}
}
[Association(Name="User_MagazineItem", Storage="_User", ThisKey="CreatedBy", OtherKey="Id", IsForeignKey=true)]
[DataMember(Order=14, EmitDefaultValue=false)]
public User CreatedByUser
{
get
{
if ((this.serializing
&& (this._User.HasLoadedOrAssignedValue == false)))
{
return null;
}
return this._User.Entity;
}
set
{
if ((this._User.Entity != value))
{
this.SendPropertyChanging();
this._User.Entity = value;
this.SendPropertyChanged("CreatedByUser");
}
}
}
[Association(Name="Issue_MagazineItem", Storage="_Issue", ThisKey="IssueId", OtherKey="Id", IsForeignKey=true)]
public Issue Issue
{
get
{
return this._Issue.Entity;
}
set
{
Issue previousValue = this._Issue.Entity;
if (((previousValue != value)
|| (this._Issue.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
if ((previousValue != null))
{
this._Issue.Entity = null;
previousValue.MagazineItems.Remove(this);
}
this._Issue.Entity = value;
if ((value != null))
{
value.MagazineItems.Add(this);
this._IssueId = value.Id;
}
else
{
this._IssueId = default(int);
}
this.SendPropertyChanged("Issue");
}
}
}
[Association(Name="ItemType_MagazineItem", Storage="_ItemType", ThisKey="ItemTypeId", OtherKey="Id", IsForeignKey=true)]
public ItemType ItemType
{
get
{
return this._ItemType.Entity;
}
set
{
ItemType previousValue = this._ItemType.Entity;
if (((previousValue != value)
|| (this._ItemType.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
if ((previousValue != null))
{
this._ItemType.Entity = null;
previousValue.MagazineItems.Remove(this);
}
this._ItemType.Entity = value;
if ((value != null))
{
value.MagazineItems.Add(this);
this._ItemTypeId = value.Id;
}
else
{
this._ItemTypeId = default(int);
}
this.SendPropertyChanged("ItemType");
}
}
}
[Association(Name="User_MagazineItem1", Storage="_User1", ThisKey="UpdatedBy", OtherKey="Id", IsForeignKey=true)]
[DataMember(Order=15, EmitDefaultValue=false)]
public User UpdatedByUser
{
get
{
if ((this.serializing
&& (this._User1.HasLoadedOrAssignedValue == false)))
{
return null;
}
return this._User1.Entity;
}
set
{
if ((this._User1.Entity != value))
{
this.SendPropertyChanging();
this._User1.Entity = value;
this.SendPropertyChanged("UpdatedByUser");
}
}
}
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._Author = default(EntityRef);
this._User = default(EntityRef);
this._Issue = default(EntityRef);
this._ItemType = default(EntityRef);
this._User1 = default(EntityRef);
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="dbo.EmploymentType")]
[DataContract()]
public partial class EmploymentType : INotifyPropertyChanging, INotifyPropertyChanged
{
private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
private int _Id;
private string _Name;
private EntitySet _Authors;
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 OnNameChanging(string value);
partial void OnNameChanged();
#endregion
public EmploymentType()
{
this.Initialize();
}
[Column(Storage="_Id", DbType="Int NOT NULL", IsPrimaryKey=true)]
[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="_Name", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]
[DataMember(Order=2)]
public string Name
{
get
{
return this._Name;
}
set
{
if ((this._Name != value))
{
this.OnNameChanging(value);
this.SendPropertyChanging();
this._Name = value;
this.SendPropertyChanged("Name");
this.OnNameChanged();
}
}
}
[Association(Name="EmploymentType_Author", Storage="_Authors", ThisKey="Id", OtherKey="EmploymentTypeId")]
[DataMember(Order=3, EmitDefaultValue=false)]
public EntitySet Authors
{
get
{
if ((this.serializing
&& (this._Authors.HasLoadedOrAssignedValues == false)))
{
return null;
}
return this._Authors;
}
set
{
this._Authors.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_Authors(Author entity)
{
this.SendPropertyChanging();
entity.EmploymentType = this;
}
private void detach_Authors(Author entity)
{
this.SendPropertyChanging();
entity.EmploymentType = null;
}
private void Initialize()
{
this._Authors = new EntitySet(new Action(this.attach_Authors), new Action(this.detach_Authors));
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;
}
}
[DataContract()]
public partial class GetAuthorsResult
{
private string _FirstName;
private string _LastName;
private System.Nullable _Price;
private System.Nullable _Bonus;
public GetAuthorsResult()
{
}
[Column(Storage="_FirstName", DbType="NVarChar(100) NOT NULL", CanBeNull=false)]
[DataMember(Order=1)]
public string FirstName
{
get
{
return this._FirstName;
}
set
{
if ((this._FirstName != value))
{
this._FirstName = value;
}
}
}
[Column(Storage="_LastName", DbType="NVarChar(100) NOT NULL", CanBeNull=false)]
[DataMember(Order=2)]
public string LastName
{
get
{
return this._LastName;
}
set
{
if ((this._LastName != value))
{
this._LastName = value;
}
}
}
[Column(Storage="_Price", DbType="Decimal(0,0)")]
[DataMember(Order=3)]
public System.Nullable Price
{
get
{
return this._Price;
}
set
{
if ((this._Price != value))
{
this._Price = value;
}
}
}
[Column(Storage="_Bonus", DbType="Decimal(0,0)")]
[DataMember(Order=4)]
public System.Nullable Bonus
{
get
{
return this._Bonus;
}
set
{
if ((this._Bonus != value))
{
this._Bonus = value;
}
}
}
}
[DataContract()]
public partial class GetAuthorsByMagzinesResult
{
private int _Id;
private string _FirstName;
private string _LastName;
private string _NickName;
private System.Nullable _Price;
private System.Nullable _Bonus;
public GetAuthorsByMagzinesResult()
{
}
[Column(Storage="_Id", DbType="Int NOT NULL")]
[DataMember(Order=1)]
public int Id
{
get
{
return this._Id;
}
set
{
if ((this._Id != value))
{
this._Id = value;
}
}
}
[Column(Storage="_FirstName", DbType="NVarChar(100) NOT NULL", CanBeNull=false)]
[DataMember(Order=2)]
public string FirstName
{
get
{
return this._FirstName;
}
set
{
if ((this._FirstName != value))
{
this._FirstName = value;
}
}
}
[Column(Storage="_LastName", DbType="NVarChar(100) NOT NULL", CanBeNull=false)]
[DataMember(Order=3)]
public string LastName
{
get
{
return this._LastName;
}
set
{
if ((this._LastName != value))
{
this._LastName = value;
}
}
}
[Column(Storage="_NickName", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]
[DataMember(Order=4)]
public string NickName
{
get
{
return this._NickName;
}
set
{
if ((this._NickName != value))
{
this._NickName = value;
}
}
}
[Column(Storage="_Price", DbType="Decimal(0,0)")]
[DataMember(Order=5)]
public System.Nullable Price
{
get
{
return this._Price;
}
set
{
if ((this._Price != value))
{
this._Price = value;
}
}
}
[Column(Storage="_Bonus", DbType="Decimal(0,0)")]
[DataMember(Order=6)]
public System.Nullable Bonus
{
get
{
return this._Bonus;
}
set
{
if ((this._Bonus != value))
{
this._Bonus = value;
}
}
}
}
}
#pragma warning restore 1591