⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 formula1.designer.cs

📁 C#高级编程第6版随书源代码 值得下载
💻 CS
📖 第 1 页 / 共 2 页
字号:
#pragma warning disable 1591
//------------------------------------------------------------------------------
// <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 Wrox.ProCSharp.Syndication
{
	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.ComponentModel;
	using System;
	
	
	[System.Data.Linq.Mapping.DatabaseAttribute(Name="Formula1V1")]
	public partial class Formula1DataContext : System.Data.Linq.DataContext
	{
		
		private static System.Data.Linq.Mapping.MappingSource mappingSource = new AttributeMappingSource();
		
    #region Extensibility Method Definitions
    partial void OnCreated();
    partial void InsertRaceResult(RaceResult instance);
    partial void UpdateRaceResult(RaceResult instance);
    partial void DeleteRaceResult(RaceResult instance);
    partial void InsertRace(Race instance);
    partial void UpdateRace(Race instance);
    partial void DeleteRace(Race instance);
    partial void InsertRacer(Racer instance);
    partial void UpdateRacer(Racer instance);
    partial void DeleteRacer(Racer instance);
    partial void InsertCircuit(Circuit instance);
    partial void UpdateCircuit(Circuit instance);
    partial void DeleteCircuit(Circuit instance);
    #endregion
		
		public Formula1DataContext() : 
				base(global::Wrox.ProCSharp.Syndication.Properties.Settings.Default.Formula1V1ConnectionString, mappingSource)
		{
			OnCreated();
		}
		
		public Formula1DataContext(string connection) : 
				base(connection, mappingSource)
		{
			OnCreated();
		}
		
		public Formula1DataContext(System.Data.IDbConnection connection) : 
				base(connection, mappingSource)
		{
			OnCreated();
		}
		
		public Formula1DataContext(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) : 
				base(connection, mappingSource)
		{
			OnCreated();
		}
		
		public Formula1DataContext(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) : 
				base(connection, mappingSource)
		{
			OnCreated();
		}
		
		public System.Data.Linq.Table<RaceResult> RaceResults
		{
			get
			{
				return this.GetTable<RaceResult>();
			}
		}
		
		public System.Data.Linq.Table<Race> Races
		{
			get
			{
				return this.GetTable<Race>();
			}
		}
		
		public System.Data.Linq.Table<Racer> Racers
		{
			get
			{
				return this.GetTable<Racer>();
			}
		}
		
		public System.Data.Linq.Table<Circuit> Circuits
		{
			get
			{
				return this.GetTable<Circuit>();
			}
		}
	}
	
	[Table(Name="dbo.RaceResults")]
	public partial class RaceResult : INotifyPropertyChanging, INotifyPropertyChanged
	{
		
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
		
		private int _Id;
		
		private int _RaceId;
		
		private int _Position;
		
		private System.Nullable<int> _Grid;
		
		private System.Nullable<decimal> _Points;
		
		private int _RacerId;
		
		private int _TeamId;
		
		private EntityRef<Race> _Race;
		
		private EntityRef<Racer> _Racer;
		
    #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 OnRaceIdChanging(int value);
    partial void OnRaceIdChanged();
    partial void OnPositionChanging(int value);
    partial void OnPositionChanged();
    partial void OnGridChanging(System.Nullable<int> value);
    partial void OnGridChanged();
    partial void OnPointsChanging(System.Nullable<decimal> value);
    partial void OnPointsChanged();
    partial void OnRacerIdChanging(int value);
    partial void OnRacerIdChanged();
    partial void OnTeamIdChanging(int value);
    partial void OnTeamIdChanged();
    #endregion
		
		public RaceResult()
		{
			this._Race = default(EntityRef<Race>);
			this._Racer = default(EntityRef<Racer>);
			OnCreated();
		}
		
		[Column(Storage="_Id", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
		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="_RaceId", DbType="Int NOT NULL")]
		public int RaceId
		{
			get
			{
				return this._RaceId;
			}
			set
			{
				if ((this._RaceId != value))
				{
					if (this._Race.HasLoadedOrAssignedValue)
					{
						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
					}
					this.OnRaceIdChanging(value);
					this.SendPropertyChanging();
					this._RaceId = value;
					this.SendPropertyChanged("RaceId");
					this.OnRaceIdChanged();
				}
			}
		}
		
		[Column(Storage="_Position", DbType="Int NOT NULL")]
		public int Position
		{
			get
			{
				return this._Position;
			}
			set
			{
				if ((this._Position != value))
				{
					this.OnPositionChanging(value);
					this.SendPropertyChanging();
					this._Position = value;
					this.SendPropertyChanged("Position");
					this.OnPositionChanged();
				}
			}
		}
		
		[Column(Storage="_Grid", DbType="Int")]
		public System.Nullable<int> Grid
		{
			get
			{
				return this._Grid;
			}
			set
			{
				if ((this._Grid != value))
				{
					this.OnGridChanging(value);
					this.SendPropertyChanging();
					this._Grid = value;
					this.SendPropertyChanged("Grid");
					this.OnGridChanged();
				}
			}
		}
		
		[Column(Storage="_Points", DbType="Decimal(8,2)")]
		public System.Nullable<decimal> Points
		{
			get
			{
				return this._Points;
			}
			set
			{
				if ((this._Points != value))
				{
					this.OnPointsChanging(value);
					this.SendPropertyChanging();
					this._Points = value;
					this.SendPropertyChanged("Points");
					this.OnPointsChanged();
				}
			}
		}
		
		[Column(Storage="_RacerId", DbType="Int NOT NULL")]
		public int RacerId
		{
			get
			{
				return this._RacerId;
			}
			set
			{
				if ((this._RacerId != value))
				{
					if (this._Racer.HasLoadedOrAssignedValue)
					{
						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
					}
					this.OnRacerIdChanging(value);
					this.SendPropertyChanging();
					this._RacerId = value;
					this.SendPropertyChanged("RacerId");
					this.OnRacerIdChanged();
				}
			}
		}
		
		[Column(Storage="_TeamId", DbType="Int NOT NULL")]
		public int TeamId
		{
			get
			{
				return this._TeamId;
			}
			set
			{
				if ((this._TeamId != value))
				{
					this.OnTeamIdChanging(value);
					this.SendPropertyChanging();
					this._TeamId = value;
					this.SendPropertyChanged("TeamId");
					this.OnTeamIdChanged();
				}
			}
		}
		
		[Association(Name="Race_RaceResult", Storage="_Race", ThisKey="RaceId", IsForeignKey=true)]
		public Race Race
		{
			get
			{
				return this._Race.Entity;
			}
			set
			{
				Race previousValue = this._Race.Entity;
				if (((previousValue != value) 
							|| (this._Race.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._Race.Entity = null;
						previousValue.RaceResults.Remove(this);
					}
					this._Race.Entity = value;
					if ((value != null))
					{
						value.RaceResults.Add(this);
						this._RaceId = value.Id;
					}
					else
					{
						this._RaceId = default(int);
					}
					this.SendPropertyChanged("Race");
				}
			}
		}
		
		[Association(Name="Racer_RaceResult", Storage="_Racer", ThisKey="RacerId", IsForeignKey=true)]
		public Racer Racer
		{
			get
			{
				return this._Racer.Entity;
			}
			set
			{
				Racer previousValue = this._Racer.Entity;
				if (((previousValue != value) 
							|| (this._Racer.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._Racer.Entity = null;
						previousValue.RaceResults.Remove(this);
					}
					this._Racer.Entity = value;
					if ((value != null))
					{
						value.RaceResults.Add(this);
						this._RacerId = value.Id;
					}
					else
					{
						this._RacerId = default(int);
					}
					this.SendPropertyChanged("Racer");
				}
			}
		}
		
		public event PropertyChangingEventHandler PropertyChanging;
		
		public event PropertyChangedEventHandler PropertyChanged;
		
		protected virtual void SendPropertyChanging()
		{
			if ((this.PropertyChanging != null))
			{
				this.PropertyChanging(this, emptyChangingEventArgs);
			}
		}
		
		protected virtual void SendPropertyChanged(String propertyName)
		{
			if ((this.PropertyChanged != null))
			{
				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
			}
		}
	}
	
	[Table(Name="dbo.Race")]
	public partial class Race : INotifyPropertyChanging, INotifyPropertyChanged
	{
		
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
		
		private int _Id;
		
		private int _CircuitId;
		
		private System.DateTime _Date;
		
		private EntitySet<RaceResult> _RaceResults;
		
		private EntityRef<Circuit> _Circuit;
		
    #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 OnCircuitIdChanging(int value);
    partial void OnCircuitIdChanged();
    partial void OnDateChanging(System.DateTime value);
    partial void OnDateChanged();
    #endregion
		
		public Race()
		{
			this._RaceResults = new EntitySet<RaceResult>(new Action<RaceResult>(this.attach_RaceResults), new Action<RaceResult>(this.detach_RaceResults));
			this._Circuit = default(EntityRef<Circuit>);
			OnCreated();
		}
		
		[Column(Storage="_Id", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
		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="_CircuitId", DbType="Int NOT NULL")]
		public int CircuitId
		{
			get
			{
				return this._CircuitId;
			}
			set
			{
				if ((this._CircuitId != value))
				{

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -