root/branches/Abonament/Wierszowki/Wierszowki.Model/Linq/Wierszowki.designer.cs @ 854

Wersja 752, 48.1 KB (wprowadzona przez marek, 17 years temu)

wiersz

Line 
1#pragma warning disable 1591
2//------------------------------------------------------------------------------
3// <auto-generated>
4//     This code was generated by a tool.
5//     Runtime Version:2.0.50727.3082
6//
7//     Changes to this file may cause incorrect behavior and will be lost if
8//     the code is regenerated.
9// </auto-generated>
10//------------------------------------------------------------------------------
11
12namespace Wierszowki.Core.Linq
13{
14        using System.Data.Linq;
15        using System.Data.Linq.Mapping;
16        using System.Data;
17        using System.Collections.Generic;
18        using System.Reflection;
19        using System.Linq;
20        using System.Linq.Expressions;
21        using System.Runtime.Serialization;
22        using System.ComponentModel;
23        using System;
24       
25       
26        [System.Data.Linq.Mapping.DatabaseAttribute(Name="Wierszowki")]
27        public partial class WierszowkiDataContext : System.Data.Linq.DataContext
28        {
29               
30                private static System.Data.Linq.Mapping.MappingSource mappingSource = new AttributeMappingSource();
31               
32    #region Extensibility Method Definitions
33    partial void OnCreated();
34    partial void InsertUser(User instance);
35    partial void UpdateUser(User instance);
36    partial void DeleteUser(User instance);
37    partial void InsertAuthor(Author instance);
38    partial void UpdateAuthor(Author instance);
39    partial void DeleteAuthor(Author instance);
40    partial void InsertItemType(ItemType instance);
41    partial void UpdateItemType(ItemType instance);
42    partial void DeleteItemType(ItemType instance);
43    partial void InsertMagazine(Magazine instance);
44    partial void UpdateMagazine(Magazine instance);
45    partial void DeleteMagazine(Magazine instance);
46    partial void InsertIssue(Issue instance);
47    partial void UpdateIssue(Issue instance);
48    partial void DeleteIssue(Issue instance);
49    partial void InsertMagazineItem(MagazineItem instance);
50    partial void UpdateMagazineItem(MagazineItem instance);
51    partial void DeleteMagazineItem(MagazineItem instance);
52    partial void InsertEmploymentType(EmploymentType instance);
53    partial void UpdateEmploymentType(EmploymentType instance);
54    partial void DeleteEmploymentType(EmploymentType instance);
55    #endregion
56               
57                public WierszowkiDataContext() :
58                                base(global::Wierszowki.Core.Properties.Settings.Default.WierszowkiConnectionString, mappingSource)
59                {
60                        OnCreated();
61                }
62               
63                public WierszowkiDataContext(string connection) :
64                                base(connection, mappingSource)
65                {
66                        OnCreated();
67                }
68               
69                public WierszowkiDataContext(System.Data.IDbConnection connection) :
70                                base(connection, mappingSource)
71                {
72                        OnCreated();
73                }
74               
75                public WierszowkiDataContext(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
76                                base(connection, mappingSource)
77                {
78                        OnCreated();
79                }
80               
81                public WierszowkiDataContext(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
82                                base(connection, mappingSource)
83                {
84                        OnCreated();
85                }
86               
87                public System.Data.Linq.Table<User> Users
88                {
89                        get
90                        {
91                                return this.GetTable<User>();
92                        }
93                }
94               
95                public System.Data.Linq.Table<Author> Authors
96                {
97                        get
98                        {
99                                return this.GetTable<Author>();
100                        }
101                }
102               
103                public System.Data.Linq.Table<ItemType> ItemTypes
104                {
105                        get
106                        {
107                                return this.GetTable<ItemType>();
108                        }
109                }
110               
111                public System.Data.Linq.Table<Magazine> Magazines
112                {
113                        get
114                        {
115                                return this.GetTable<Magazine>();
116                        }
117                }
118               
119                public System.Data.Linq.Table<Issue> Issues
120                {
121                        get
122                        {
123                                return this.GetTable<Issue>();
124                        }
125                }
126               
127                public System.Data.Linq.Table<MagazineItem> MagazineItems
128                {
129                        get
130                        {
131                                return this.GetTable<MagazineItem>();
132                        }
133                }
134               
135                public System.Data.Linq.Table<EmploymentType> EmploymentTypes
136                {
137                        get
138                        {
139                                return this.GetTable<EmploymentType>();
140                        }
141                }
142               
143                [Function(Name="dbo.GetAuthors")]
144                public ISingleResult<GetAuthorsResult> GetAuthors([Parameter(DbType="Int")] System.Nullable<int> year, [Parameter(DbType="Int")] System.Nullable<int> month)
145                {
146                        IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), year, month);
147                        return ((ISingleResult<GetAuthorsResult>)(result.ReturnValue));
148                }
149               
150                [Function(Name="dbo.GetAuthorsByMagzines")]
151                public ISingleResult<GetAuthorsByMagzinesResult> GetAuthorsByMagzines([Parameter(DbType="Int")] System.Nullable<int> year, [Parameter(DbType="Int")] System.Nullable<int> month)
152                {
153                        IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), year, month);
154                        return ((ISingleResult<GetAuthorsByMagzinesResult>)(result.ReturnValue));
155                }
156        }
157       
158        [Table(Name="dbo.[User]")]
159        [DataContract()]
160        public partial class User : INotifyPropertyChanging, INotifyPropertyChanged
161        {
162               
163                private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
164               
165                private int _Id;
166               
167                private string _Login;
168               
169                private string _Password;
170               
171                private string _FirstName;
172               
173                private string _LastName;
174               
175    #region Extensibility Method Definitions
176    partial void OnLoaded();
177    partial void OnValidate(System.Data.Linq.ChangeAction action);
178    partial void OnCreated();
179    partial void OnIdChanging(int value);
180    partial void OnIdChanged();
181    partial void OnLoginChanging(string value);
182    partial void OnLoginChanged();
183    partial void OnPasswordChanging(string value);
184    partial void OnPasswordChanged();
185    partial void OnFirstNameChanging(string value);
186    partial void OnFirstNameChanged();
187    partial void OnLastNameChanging(string value);
188    partial void OnLastNameChanged();
189    #endregion
190               
191                public User()
192                {
193                        this.Initialize();
194                }
195               
196                [Column(Storage="_Id", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
197                [DataMember(Order=1)]
198                public int Id
199                {
200                        get
201                        {
202                                return this._Id;
203                        }
204                        set
205                        {
206                                if ((this._Id != value))
207                                {
208                                        this.OnIdChanging(value);
209                                        this.SendPropertyChanging();
210                                        this._Id = value;
211                                        this.SendPropertyChanged("Id");
212                                        this.OnIdChanged();
213                                }
214                        }
215                }
216               
217                [Column(Storage="_Login", DbType="VarChar(50) NOT NULL", CanBeNull=false)]
218                [DataMember(Order=2)]
219                public string Login
220                {
221                        get
222                        {
223                                return this._Login;
224                        }
225                        set
226                        {
227                                if ((this._Login != value))
228                                {
229                                        this.OnLoginChanging(value);
230                                        this.SendPropertyChanging();
231                                        this._Login = value;
232                                        this.SendPropertyChanged("Login");
233                                        this.OnLoginChanged();
234                                }
235                        }
236                }
237               
238                [Column(Storage="_Password", DbType="VarChar(50) NOT NULL", CanBeNull=false)]
239                [DataMember(Order=3)]
240                public string Password
241                {
242                        get
243                        {
244                                return this._Password;
245                        }
246                        set
247                        {
248                                if ((this._Password != value))
249                                {
250                                        this.OnPasswordChanging(value);
251                                        this.SendPropertyChanging();
252                                        this._Password = value;
253                                        this.SendPropertyChanged("Password");
254                                        this.OnPasswordChanged();
255                                }
256                        }
257                }
258               
259                [Column(Storage="_FirstName", DbType="NVarChar(50)")]
260                [DataMember(Order=4)]
261                public string FirstName
262                {
263                        get
264                        {
265                                return this._FirstName;
266                        }
267                        set
268                        {
269                                if ((this._FirstName != value))
270                                {
271                                        this.OnFirstNameChanging(value);
272                                        this.SendPropertyChanging();
273                                        this._FirstName = value;
274                                        this.SendPropertyChanged("FirstName");
275                                        this.OnFirstNameChanged();
276                                }
277                        }
278                }
279               
280                [Column(Storage="_LastName", DbType="NVarChar(50)")]
281                [DataMember(Order=5)]
282                public string LastName
283                {
284                        get
285                        {
286                                return this._LastName;
287                        }
288                        set
289                        {
290                                if ((this._LastName != value))
291                                {
292                                        this.OnLastNameChanging(value);
293                                        this.SendPropertyChanging();
294                                        this._LastName = value;
295                                        this.SendPropertyChanged("LastName");
296                                        this.OnLastNameChanged();
297                                }
298                        }
299                }
300               
301                public event PropertyChangingEventHandler PropertyChanging;
302               
303                public event PropertyChangedEventHandler PropertyChanged;
304               
305                protected virtual void SendPropertyChanging()
306                {
307                        if ((this.PropertyChanging != null))
308                        {
309                                this.PropertyChanging(this, emptyChangingEventArgs);
310                        }
311                }
312               
313                protected virtual void SendPropertyChanged(String propertyName)
314                {
315                        if ((this.PropertyChanged != null))
316                        {
317                                this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
318                        }
319                }
320               
321                private void Initialize()
322                {
323                        OnCreated();
324                }
325               
326                [OnDeserializing()]
327                [System.ComponentModel.EditorBrowsableAttribute(EditorBrowsableState.Never)]
328                public void OnDeserializing(StreamingContext context)
329                {
330                        this.Initialize();
331                }
332        }
333       
334        [Table(Name="dbo.Author")]
335        [DataContract()]
336        public partial class Author : INotifyPropertyChanging, INotifyPropertyChanged
337        {
338               
339                private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
340               
341                private int _Id;
342               
343                private int _EmploymentTypeId;
344               
345                private string _FirstName;
346               
347                private string _LastName;
348               
349                private EntitySet<MagazineItem> _MagazineItems;
350               
351                private EntityRef<EmploymentType> _EmploymentType;
352               
353                private bool serializing;
354               
355    #region Extensibility Method Definitions
356    partial void OnLoaded();
357    partial void OnValidate(System.Data.Linq.ChangeAction action);
358    partial void OnCreated();
359    partial void OnIdChanging(int value);
360    partial void OnIdChanged();
361    partial void OnEmploymentTypeIdChanging(int value);
362    partial void OnEmploymentTypeIdChanged();
363    partial void OnFirstNameChanging(string value);
364    partial void OnFirstNameChanged();
365    partial void OnLastNameChanging(string value);
366    partial void OnLastNameChanged();
367    #endregion
368               
369                public Author()
370                {
371                        this.Initialize();
372                }
373               
374                [Column(Storage="_Id", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
375                [DataMember(Order=1)]
376                public int Id
377                {
378                        get
379                        {
380                                return this._Id;
381                        }
382                        set
383                        {
384                                if ((this._Id != value))
385                                {
386                                        this.OnIdChanging(value);
387                                        this.SendPropertyChanging();
388                                        this._Id = value;
389                                        this.SendPropertyChanged("Id");
390                                        this.OnIdChanged();
391                                }
392                        }
393                }
394               
395                [Column(Storage="_EmploymentTypeId", DbType="Int NOT NULL")]
396                [DataMember(Order=2)]
397                public int EmploymentTypeId
398                {
399                        get
400                        {
401                                return this._EmploymentTypeId;
402                        }
403                        set
404                        {
405                                if ((this._EmploymentTypeId != value))
406                                {
407                                        if (this._EmploymentType.HasLoadedOrAssignedValue)
408                                        {
409                                                throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
410                                        }
411                                        this.OnEmploymentTypeIdChanging(value);
412                                        this.SendPropertyChanging();
413                                        this._EmploymentTypeId = value;
414                                        this.SendPropertyChanged("EmploymentTypeId");
415                                        this.OnEmploymentTypeIdChanged();
416                                }
417                        }
418                }
419               
420                [Column(Storage="_FirstName", DbType="NVarChar(100) NOT NULL", CanBeNull=false)]
421                [DataMember(Order=3)]
422                public string FirstName
423                {
424                        get
425                        {
426                                return this._FirstName;
427                        }
428                        set
429                        {
430                                if ((this._FirstName != value))
431                                {
432                                        this.OnFirstNameChanging(value);
433                                        this.SendPropertyChanging();
434                                        this._FirstName = value;
435                                        this.SendPropertyChanged("FirstName");
436                                        this.OnFirstNameChanged();
437                                }
438                        }
439                }
440               
441                [Column(Storage="_LastName", DbType="NVarChar(100) NOT NULL", CanBeNull=false)]
442                [DataMember(Order=4)]
443                public string LastName
444                {
445                        get
446                        {
447                                return this._LastName;
448                        }
449                        set
450                        {
451                                if ((this._LastName != value))
452                                {
453                                        this.OnLastNameChanging(value);
454                                        this.SendPropertyChanging();
455                                        this._LastName = value;
456                                        this.SendPropertyChanged("LastName");
457                                        this.OnLastNameChanged();
458                                }
459                        }
460                }
461               
462                [Association(Name="Author_MagazineItem", Storage="_MagazineItems", ThisKey="Id", OtherKey="AuthorId")]
463                [DataMember(Order=5, EmitDefaultValue=false)]
464                public EntitySet<MagazineItem> MagazineItems
465                {
466                        get
467                        {
468                                if ((this.serializing
469                                                        && (this._MagazineItems.HasLoadedOrAssignedValues == false)))
470                                {
471                                        return null;
472                                }
473                                return this._MagazineItems;
474                        }
475                        set
476                        {
477                                this._MagazineItems.Assign(value);
478                        }
479                }
480               
481                [Association(Name="EmploymentType_Author", Storage="_EmploymentType", ThisKey="EmploymentTypeId", OtherKey="Id", IsForeignKey=true)]
482                public EmploymentType EmploymentType
483                {
484                        get
485                        {
486                                return this._EmploymentType.Entity;
487                        }
488                        set
489                        {
490                                EmploymentType previousValue = this._EmploymentType.Entity;
491                                if (((previousValue != value)
492                                                        || (this._EmploymentType.HasLoadedOrAssignedValue == false)))
493                                {
494                                        this.SendPropertyChanging();
495                                        if ((previousValue != null))
496                                        {
497                                                this._EmploymentType.Entity = null;
498                                                previousValue.Authors.Remove(this);
499                                        }
500                                        this._EmploymentType.Entity = value;
501                                        if ((value != null))
502                                        {
503                                                value.Authors.Add(this);
504                                                this._EmploymentTypeId = value.Id;
505                                        }
506                                        else
507                                        {
508                                                this._EmploymentTypeId = default(int);
509                                        }
510                                        this.SendPropertyChanged("EmploymentType");
511                                }
512                        }
513                }
514               
515                public event PropertyChangingEventHandler PropertyChanging;
516               
517                public event PropertyChangedEventHandler PropertyChanged;
518               
519                protected virtual void SendPropertyChanging()
520                {
521                        if ((this.PropertyChanging != null))
522                        {
523                                this.PropertyChanging(this, emptyChangingEventArgs);
524                        }
525                }
526               
527                protected virtual void SendPropertyChanged(String propertyName)
528                {
529                        if ((this.PropertyChanged != null))
530                        {
531                                this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
532                        }
533                }
534               
535                private void attach_MagazineItems(MagazineItem entity)
536                {
537                        this.SendPropertyChanging();
538                        entity.Author = this;
539                }
540               
541                private void detach_MagazineItems(MagazineItem entity)
542                {
543                        this.SendPropertyChanging();
544                        entity.Author = null;
545                }
546               
547                private void Initialize()
548                {
549                        this._MagazineItems = new EntitySet<MagazineItem>(new Action<MagazineItem>(this.attach_MagazineItems), new Action<MagazineItem>(this.detach_MagazineItems));
550                        this._EmploymentType = default(EntityRef<EmploymentType>);
551                        OnCreated();
552                }
553               
554                [OnDeserializing()]
555                [System.ComponentModel.EditorBrowsableAttribute(EditorBrowsableState.Never)]
556                public void OnDeserializing(StreamingContext context)
557                {
558                        this.Initialize();
559                }
560               
561                [OnSerializing()]
562                [System.ComponentModel.EditorBrowsableAttribute(EditorBrowsableState.Never)]
563                public void OnSerializing(StreamingContext context)
564                {
565                        this.serializing = true;
566                }
567               
568                [OnSerialized()]
569                [System.ComponentModel.EditorBrowsableAttribute(EditorBrowsableState.Never)]
570                public void OnSerialized(StreamingContext context)
571                {
572                        this.serializing = false;
573                }
574        }
575       
576        [Table(Name="dbo.ItemType")]
577        [DataContract()]
578        public partial class ItemType : INotifyPropertyChanging, INotifyPropertyChanged
579        {
580               
581                private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
582               
583                private int _Id;
584               
585                private string _Name;
586               
587                private EntitySet<MagazineItem> _MagazineItems;
588               
589                private bool serializing;
590               
591    #region Extensibility Method Definitions
592    partial void OnLoaded();
593    partial void OnValidate(System.Data.Linq.ChangeAction action);
594    partial void OnCreated();
595    partial void OnIdChanging(int value);
596    partial void OnIdChanged();
597    partial void OnNameChanging(string value);
598    partial void OnNameChanged();
599    #endregion
600               
601                public ItemType()
602                {
603                        this.Initialize();
604                }
605               
606                [Column(Storage="_Id", DbType="Int NOT NULL", IsPrimaryKey=true)]
607                [DataMember(Order=1)]
608                public int Id
609                {
610                        get
611                        {
612                                return this._Id;
613                        }
614                        set
615                        {
616                                if ((this._Id != value))
617                                {
618                                        this.OnIdChanging(value);
619                                        this.SendPropertyChanging();
620                                        this._Id = value;
621                                        this.SendPropertyChanged("Id");
622                                        this.OnIdChanged();
623                                }
624                        }
625                }
626               
627                [Column(Storage="_Name", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]
628                [DataMember(Order=2)]
629                public string Name
630                {
631                        get
632                        {
633                                return this._Name;
634                        }
635                        set
636                        {
637                                if ((this._Name != value))
638                                {
639                                        this.OnNameChanging(value);
640                                        this.SendPropertyChanging();
641                                        this._Name = value;
642                                        this.SendPropertyChanged("Name");
643                                        this.OnNameChanged();
644                                }
645                        }
646                }
647               
648                [Association(Name="ItemType_MagazineItem", Storage="_MagazineItems", ThisKey="Id", OtherKey="ItemTypeId")]
649                [DataMember(Order=3, EmitDefaultValue=false)]
650                public EntitySet<MagazineItem> MagazineItems
651                {
652                        get
653                        {
654                                if ((this.serializing
655                                                        && (this._MagazineItems.HasLoadedOrAssignedValues == false)))
656                                {
657                                        return null;
658                                }
659                                return this._MagazineItems;
660                        }
661                        set
662                        {
663                                this._MagazineItems.Assign(value);
664                        }
665                }
666               
667                public event PropertyChangingEventHandler PropertyChanging;
668               
669                public event PropertyChangedEventHandler PropertyChanged;
670               
671                protected virtual void SendPropertyChanging()
672                {
673                        if ((this.PropertyChanging != null))
674                        {
675                                this.PropertyChanging(this, emptyChangingEventArgs);
676                        }
677                }
678               
679                protected virtual void SendPropertyChanged(String propertyName)
680                {
681                        if ((this.PropertyChanged != null))
682                        {
683                                this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
684                        }
685                }
686               
687                private void attach_MagazineItems(MagazineItem entity)
688                {
689                        this.SendPropertyChanging();
690                        entity.ItemType = this;
691                }
692               
693                private void detach_MagazineItems(MagazineItem entity)
694                {
695                        this.SendPropertyChanging();
696                        entity.ItemType = null;
697                }
698               
699                private void Initialize()
700                {
701                        this._MagazineItems = new EntitySet<MagazineItem>(new Action<MagazineItem>(this.attach_MagazineItems), new Action<MagazineItem>(this.detach_MagazineItems));
702                        OnCreated();
703                }
704               
705                [OnDeserializing()]
706                [System.ComponentModel.EditorBrowsableAttribute(EditorBrowsableState.Never)]
707                public void OnDeserializing(StreamingContext context)
708                {
709                        this.Initialize();
710                }
711               
712                [OnSerializing()]
713                [System.ComponentModel.EditorBrowsableAttribute(EditorBrowsableState.Never)]
714                public void OnSerializing(StreamingContext context)
715                {
716                        this.serializing = true;
717                }
718               
719                [OnSerialized()]
720                [System.ComponentModel.EditorBrowsableAttribute(EditorBrowsableState.Never)]
721                public void OnSerialized(StreamingContext context)
722                {
723                        this.serializing = false;
724                }
725        }
726       
727        [Table(Name="dbo.Magazine")]
728        [DataContract()]
729        public partial class Magazine : INotifyPropertyChanging, INotifyPropertyChanged
730        {
731               
732                private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
733               
734                private int _Id;
735               
736                private string _Name;
737               
738                private string _NickName;
739               
740                private EntitySet<Issue> _Issues;
741               
742                private bool serializing;
743               
744    #region Extensibility Method Definitions
745    partial void OnLoaded();
746    partial void OnValidate(System.Data.Linq.ChangeAction action);
747    partial void OnCreated();
748    partial void OnIdChanging(int value);
749    partial void OnIdChanged();
750    partial void OnNameChanging(string value);
751    partial void OnNameChanged();
752    partial void OnNickNameChanging(string value);
753    partial void OnNickNameChanged();
754    #endregion
755               
756                public Magazine()
757                {
758                        this.Initialize();
759                }
760               
761                [Column(Storage="_Id", DbType="Int NOT NULL", IsPrimaryKey=true)]
762                [DataMember(Order=1)]
763                public int Id
764                {
765                        get
766                        {
767                                return this._Id;
768                        }
769                        set
770                        {
771                                if ((this._Id != value))
772                                {
773                                        this.OnIdChanging(value);
774                                        this.SendPropertyChanging();
775                                        this._Id = value;
776                                        this.SendPropertyChanged("Id");
777                                        this.OnIdChanged();
778                                }
779                        }
780                }
781               
782                [Column(Storage="_Name", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]
783                [DataMember(Order=2)]
784                public string Name
785                {
786                        get
787                        {
788                                return this._Name;
789                        }
790                        set
791                        {
792                                if ((this._Name != value))
793                                {
794                                        this.OnNameChanging(value);
795                                        this.SendPropertyChanging();
796                                        this._Name = value;
797                                        this.SendPropertyChanged("Name");
798                                        this.OnNameChanged();
799                                }
800                        }
801                }
802               
803                [Column(Storage="_NickName", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]
804                [DataMember(Order=3)]
805                public string NickName
806                {
807                        get
808                        {
809                                return this._NickName;
810                        }
811                        set
812                        {
813                                if ((this._NickName != value))
814                                {
815                                        this.OnNickNameChanging(value);
816                                        this.SendPropertyChanging();
817                                        this._NickName = value;
818                                        this.SendPropertyChanged("NickName");
819                                        this.OnNickNameChanged();
820                                }
821                        }
822                }
823               
824                [Association(Name="Magazine_Issue", Storage="_Issues", ThisKey="Id", OtherKey="MagazineId")]
825                [DataMember(Order=4, EmitDefaultValue=false)]
826                public EntitySet<Issue> Issues
827                {
828                        get
829                        {
830                                if ((this.serializing
831                                                        && (this._Issues.HasLoadedOrAssignedValues == false)))
832                                {
833                                        return null;
834                                }
835                                return this._Issues;
836                        }
837                        set
838                        {
839                                this._Issues.Assign(value);
840                        }
841                }
842               
843                public event PropertyChangingEventHandler PropertyChanging;
844               
845                public event PropertyChangedEventHandler PropertyChanged;
846               
847                protected virtual void SendPropertyChanging()
848                {
849                        if ((this.PropertyChanging != null))
850                        {
851                                this.PropertyChanging(this, emptyChangingEventArgs);
852                        }
853                }
854               
855                protected virtual void SendPropertyChanged(String propertyName)
856                {
857                        if ((this.PropertyChanged != null))
858                        {
859                                this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
860                        }
861                }
862               
863                private void attach_Issues(Issue entity)
864                {
865                        this.SendPropertyChanging();
866                        entity.Magazine = this;
867                }
868               
869                private void detach_Issues(Issue entity)
870                {
871                        this.SendPropertyChanging();
872                        entity.Magazine = null;
873                }
874               
875                private void Initialize()
876                {
877                        this._Issues = new EntitySet<Issue>(new Action<Issue>(this.attach_Issues), new Action<Issue>(this.detach_Issues));
878                        OnCreated();
879                }
880               
881                [OnDeserializing()]
882                [System.ComponentModel.EditorBrowsableAttribute(EditorBrowsableState.Never)]
883                public void OnDeserializing(StreamingContext context)
884                {
885                        this.Initialize();
886                }
887               
888                [OnSerializing()]
889                [System.ComponentModel.EditorBrowsableAttribute(EditorBrowsableState.Never)]
890                public void OnSerializing(StreamingContext context)
891                {
892                        this.serializing = true;
893                }
894               
895                [OnSerialized()]
896                [System.ComponentModel.EditorBrowsableAttribute(EditorBrowsableState.Never)]
897                public void OnSerialized(StreamingContext context)
898                {
899                        this.serializing = false;
900                }
901        }
902       
903        [Table(Name="dbo.Issue")]
904        [DataContract()]
905        public partial class Issue : INotifyPropertyChanging, INotifyPropertyChanged
906        {
907               
908                private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
909               
910                private int _Id;
911               
912                private int _MagazineId;
913               
914                private int _Number;
915               
916                private System.DateTime _Date;
917               
918                private EntitySet<MagazineItem> _MagazineItems;
919               
920                private EntityRef<Magazine> _Magazine;
921               
922                private bool serializing;
923               
924    #region Extensibility Method Definitions
925    partial void OnLoaded();
926    partial void OnValidate(System.Data.Linq.ChangeAction action);
927    partial void OnCreated();
928    partial void OnIdChanging(int value);
929    partial void OnIdChanged();
930    partial void OnMagazineIdChanging(int value);
931    partial void OnMagazineIdChanged();
932    partial void OnNumberChanging(int value);
933    partial void OnNumberChanged();
934    partial void OnDateChanging(System.DateTime value);
935    partial void OnDateChanged();
936    #endregion
937               
938                public Issue()
939                {
940                        this.Initialize();
941                }
942               
943                [Column(Storage="_Id", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
944                [DataMember(Order=1)]
945                public int Id
946                {
947                        get
948                        {
949                                return this._Id;
950                        }
951                        set
952                        {
953                                if ((this._Id != value))
954                                {
955                                        this.OnIdChanging(value);
956                                        this.SendPropertyChanging();
957                                        this._Id = value;
958                                        this.SendPropertyChanged("Id");
959                                        this.OnIdChanged();
960                                }
961                        }
962                }
963               
964                [Column(Storage="_MagazineId", DbType="Int NOT NULL")]
965                [DataMember(Order=2)]
966                public int MagazineId
967                {
968                        get
969                        {
970                                return this._MagazineId;
971                        }
972                        set
973                        {
974                                if ((this._MagazineId != value))
975                                {
976                                        if (this._Magazine.HasLoadedOrAssignedValue)
977                                        {
978                                                throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
979                                        }
980                                        this.OnMagazineIdChanging(value);
981                                        this.SendPropertyChanging();
982                                        this._MagazineId = value;
983                                        this.SendPropertyChanged("MagazineId");
984                                        this.OnMagazineIdChanged();
985                                }
986                        }
987                }
988               
989                [Column(Storage="_Number", DbType="Int NOT NULL")]
990                [DataMember(Order=3)]
991                public int Number
992                {
993                        get
994                        {
995                                return this._Number;
996                        }
997                        set
998                        {
999                                if ((this._Number != value))
1000                                {
1001                                        this.OnNumberChanging(value);
1002                                        this.SendPropertyChanging();
1003                                        this._Number = value;
1004                                        this.SendPropertyChanged("Number");
1005                                        this.OnNumberChanged();
1006                                }
1007                        }
1008                }
1009               
1010                [Column(Storage="_Date", DbType="DateTime NOT NULL")]
1011                [DataMember(Order=4)]
1012                public System.DateTime Date
1013                {
1014                        get
1015                        {
1016                                return this._Date;
1017                        }
1018                        set
1019                        {
1020                                if ((this._Date != value))
1021                                {
1022                                        this.OnDateChanging(value);
1023                                        this.SendPropertyChanging();
1024                                        this._Date = value;
1025                                        this.SendPropertyChanged("Date");
1026                                        this.OnDateChanged();
1027                                }
1028                        }
1029                }
1030               
1031                [Association(Name="Issue_MagazineItem", Storage="_MagazineItems", ThisKey="Id", OtherKey="IssueId")]
1032                [DataMember(Order=5, EmitDefaultValue=false)]
1033                public EntitySet<MagazineItem> MagazineItems
1034                {
1035                        get
1036                        {
1037                                if ((this.serializing
1038                                                        && (this._MagazineItems.HasLoadedOrAssignedValues == false)))
1039                                {
1040                                        return null;
1041                                }
1042                                return this._MagazineItems;
1043                        }
1044                        set
1045                        {
1046                                this._MagazineItems.Assign(value);
1047                        }
1048                }
1049               
1050                [Association(Name="Magazine_Issue", Storage="_Magazine", ThisKey="MagazineId", OtherKey="Id", IsForeignKey=true)]
1051                public Magazine Magazine
1052                {
1053                        get
1054                        {
1055                                return this._Magazine.Entity;
1056                        }
1057                        set
1058                        {
1059                                Magazine previousValue = this._Magazine.Entity;
1060                                if (((previousValue != value)
1061                                                        || (this._Magazine.HasLoadedOrAssignedValue == false)))
1062                                {
1063                                        this.SendPropertyChanging();
1064                                        if ((previousValue != null))
1065                                        {
1066                                                this._Magazine.Entity = null;
1067                                                previousValue.Issues.Remove(this);
1068                                        }
1069                                        this._Magazine.Entity = value;
1070                                        if ((value != null))
1071                                        {
1072                                                value.Issues.Add(this);
1073                                                this._MagazineId = value.Id;
1074                                        }
1075                                        else
1076                                        {
1077                                                this._MagazineId = default(int);
1078                                        }
1079                                        this.SendPropertyChanged("Magazine");
1080                                }
1081                        }
1082                }
1083               
1084                public event PropertyChangingEventHandler PropertyChanging;
1085               
1086                public event PropertyChangedEventHandler PropertyChanged;
1087               
1088                protected virtual void SendPropertyChanging()
1089                {
1090                        if ((this.PropertyChanging != null))
1091                        {
1092                                this.PropertyChanging(this, emptyChangingEventArgs);
1093                        }
1094                }
1095               
1096                protected virtual void SendPropertyChanged(String propertyName)
1097                {
1098                        if ((this.PropertyChanged != null))
1099                        {
1100                                this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
1101                        }
1102                }
1103               
1104                private void attach_MagazineItems(MagazineItem entity)
1105                {
1106                        this.SendPropertyChanging();
1107                        entity.Issue = this;
1108                }
1109               
1110                private void detach_MagazineItems(MagazineItem entity)
1111                {
1112                        this.SendPropertyChanging();
1113                        entity.Issue = null;
1114                }
1115               
1116                private void Initialize()
1117                {
1118                        this._MagazineItems = new EntitySet<MagazineItem>(new Action<MagazineItem>(this.attach_MagazineItems), new Action<MagazineItem>(this.detach_MagazineItems));
1119                        this._Magazine = default(EntityRef<Magazine>);
1120                        OnCreated();
1121                }
1122               
1123                [OnDeserializing()]
1124                [System.ComponentModel.EditorBrowsableAttribute(EditorBrowsableState.Never)]
1125                public void OnDeserializing(StreamingContext context)
1126                {
1127                        this.Initialize();
1128                }
1129               
1130                [OnSerializing()]
1131                [System.ComponentModel.EditorBrowsableAttribute(EditorBrowsableState.Never)]
1132                public void OnSerializing(StreamingContext context)
1133                {
1134                        this.serializing = true;
1135                }
1136               
1137                [OnSerialized()]
1138                [System.ComponentModel.EditorBrowsableAttribute(EditorBrowsableState.Never)]
1139                public void OnSerialized(StreamingContext context)
1140                {
1141                        this.serializing = false;
1142                }
1143        }
1144       
1145        [Table(Name="dbo.MagazineItem")]
1146        [DataContract()]
1147        public partial class MagazineItem : INotifyPropertyChanging, INotifyPropertyChanged
1148        {
1149               
1150                private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
1151               
1152                private int _Id;
1153               
1154                private int _AuthorId;
1155               
1156                private int _IssueId;
1157               
1158                private int _ItemTypeId;
1159               
1160                private string _Caption;
1161               
1162                private string _Description;
1163               
1164                private decimal _Price;
1165               
1166                private decimal _Bonus;
1167               
1168                private int _CreatedBy;
1169               
1170                private System.DateTime _CreatedOn;
1171               
1172                private int _UpdatedBy;
1173               
1174                private System.DateTime _UpdatedOn;
1175               
1176                private System.DateTime _Date;
1177               
1178                private EntityRef<Author> _Author;
1179               
1180                private EntityRef<User> _User;
1181               
1182                private EntityRef<Issue> _Issue;
1183               
1184                private EntityRef<ItemType> _ItemType;
1185               
1186                private EntityRef<User> _User1;
1187               
1188                private bool serializing;
1189               
1190    #region Extensibility Method Definitions
1191    partial void OnLoaded();
1192    partial void OnValidate(System.Data.Linq.ChangeAction action);
1193    partial void OnCreated();
1194    partial void OnIdChanging(int value);
1195    partial void OnIdChanged();
1196    partial void OnAuthorIdChanging(int value);
1197    partial void OnAuthorIdChanged();
1198    partial void OnIssueIdChanging(int value);
1199    partial void OnIssueIdChanged();
1200    partial void OnItemTypeIdChanging(int value);
1201    partial void OnItemTypeIdChanged();
1202    partial void OnCaptionChanging(string value);
1203    partial void OnCaptionChanged();
1204    partial void OnDescriptionChanging(string value);
1205    partial void OnDescriptionChanged();
1206    partial void OnPriceChanging(decimal value);
1207    partial void OnPriceChanged();
1208    partial void OnBonusChanging(decimal value);
1209    partial void OnBonusChanged();
1210    partial void OnCreatedByChanging(int value);
1211    partial void OnCreatedByChanged();
1212    partial void OnCreatedOnChanging(System.DateTime value);
1213    partial void OnCreatedOnChanged();
1214    partial void OnUpdatedByChanging(int value);
1215    partial void OnUpdatedByChanged();
1216    partial void OnUpdatedOnChanging(System.DateTime value);
1217    partial void OnUpdatedOnChanged();
1218    partial void OnDateChanging(System.DateTime value);
1219    partial void OnDateChanged();
1220    #endregion
1221               
1222                public MagazineItem()
1223                {
1224                        this.Initialize();
1225                }
1226               
1227                [Column(Storage="_Id", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
1228                [DataMember(Order=1)]
1229                public int Id
1230                {
1231                        get
1232                        {
1233                                return this._Id;
1234                        }
1235                        set
1236                        {
1237                                if ((this._Id != value))
1238                                {
1239                                        this.OnIdChanging(value);
1240                                        this.SendPropertyChanging();
1241                                        this._Id = value;
1242                                        this.SendPropertyChanged("Id");
1243                                        this.OnIdChanged();
1244                                }
1245                        }
1246                }
1247               
1248                [Column(Storage="_AuthorId", DbType="Int NOT NULL")]
1249                [DataMember(Order=2)]
1250                public int AuthorId
1251                {
1252                        get
1253                        {
1254                                return this._AuthorId;
1255                        }
1256                        set
1257                        {
1258                                if ((this._AuthorId != value))
1259                                {
1260                                        if (this._Author.HasLoadedOrAssignedValue)
1261                                        {
1262                                                throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
1263                                        }
1264                                        this.OnAuthorIdChanging(value);
1265                                        this.SendPropertyChanging();
1266                                        this._AuthorId = value;
1267                                        this.SendPropertyChanged("AuthorId");
1268                                        this.OnAuthorIdChanged();
1269                                }
1270                        }
1271                }
1272               
1273                [Column(Storage="_IssueId", DbType="Int NOT NULL")]
1274                [DataMember(Order=3)]
1275                public int IssueId
1276                {
1277                        get
1278                        {
1279                                return this._IssueId;
1280                        }
1281                        set
1282                        {
1283                                if ((this._IssueId != value))
1284                                {
1285                                        if (this._Issue.HasLoadedOrAssignedValue)
1286                                        {
1287                                                throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
1288                                        }
1289                                        this.OnIssueIdChanging(value);
1290                                        this.SendPropertyChanging();
1291                                        this._IssueId = value;
1292                                        this.SendPropertyChanged("IssueId");
1293                                        this.OnIssueIdChanged();
1294                                }
1295                        }
1296                }
1297               
1298                [Column(Storage="_ItemTypeId", DbType="Int NOT NULL")]
1299                [DataMember(Order=4)]
1300                public int ItemTypeId
1301                {
1302                        get
1303                        {
1304                                return this._ItemTypeId;
1305                        }
1306                        set
1307                        {
1308                                if ((this._ItemTypeId != value))
1309                                {
1310                                        if (this._ItemType.HasLoadedOrAssignedValue)
1311                                        {
1312                                                throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
1313                                        }
1314                                        this.OnItemTypeIdChanging(value);
1315                                        this.SendPropertyChanging();
1316                                        this._ItemTypeId = value;
1317                                        this.SendPropertyChanged("ItemTypeId");
1318                                        this.OnItemTypeIdChanged();
1319                                }
1320                        }
1321                }
1322               
1323                [Column(Storage="_Caption", DbType="NVarChar(255) NOT NULL", CanBeNull=false)]
1324                [DataMember(Order=5)]
1325                public string Caption
1326                {
1327                        get
1328                        {
1329                                return this._Caption;
1330                        }
1331                        set
1332                        {
1333                                if ((this._Caption != value))
1334                                {
1335                                        this.OnCaptionChanging(value);
1336                                        this.SendPropertyChanging();
1337                                        this._Caption = value;
1338                                        this.SendPropertyChanged("Caption");
1339                                        this.OnCaptionChanged();
1340                                }
1341                        }
1342                }
1343               
1344                [Column(Storage="_Description", DbType="NVarChar(255)")]
1345                [DataMember(Order=6)]
1346                public string Description
1347                {
1348                        get
1349                        {
1350                                return this._Description;
1351                        }
1352                        set
1353                        {
1354                                if ((this._Description != value))
1355                                {
1356                                        this.OnDescriptionChanging(value);
1357                                        this.SendPropertyChanging();
1358                                        this._Description = value;
1359                                        this.SendPropertyChanged("Description");
1360                                        this.OnDescriptionChanged();
1361                                }
1362                        }
1363                }
1364               
1365                [Column(Storage="_Price", DbType="Decimal(9,2) NOT NULL")]
1366                [DataMember(Order=7)]
1367                public decimal Price
1368                {
1369                        get
1370                        {
1371                                return this._Price;
1372                        }
1373                        set
1374                        {
1375                                if ((this._Price != value))
1376                                {
1377                                        this.OnPriceChanging(value);
1378                                        this.SendPropertyChanging();
1379                                        this._Price = value;
1380                                        this.SendPropertyChanged("Price");
1381                                        this.OnPriceChanged();
1382                                }
1383                        }
1384                }
1385               
1386                [Column(Storage="_Bonus", DbType="Decimal(9,2) NOT NULL")]
1387                [DataMember(Order=8)]
1388                public decimal Bonus
1389                {
1390                        get
1391                        {
1392                                return this._Bonus;
1393                        }
1394                        set
1395                        {
1396                                if ((this._Bonus != value))
1397                                {
1398                                        this.OnBonusChanging(value);
1399                                        this.SendPropertyChanging();
1400                                        this._Bonus = value;
1401                                        this.SendPropertyChanged("Bonus");
1402                                        this.OnBonusChanged();
1403                                }
1404                        }
1405                }
1406               
1407                [Column(Storage="_CreatedBy", DbType="Int NOT NULL")]
1408                [DataMember(Order=9)]
1409                public int CreatedBy
1410                {
1411                        get
1412                        {
1413                                return this._CreatedBy;
1414                        }
1415                        set
1416                        {
1417                                if ((this._CreatedBy != value))
1418                                {
1419                                        if (this._User.HasLoadedOrAssignedValue)
1420                                        {
1421                                                throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
1422                                        }
1423                                        this.OnCreatedByChanging(value);
1424                                        this.SendPropertyChanging();
1425                                        this._CreatedBy = value;
1426                                        this.SendPropertyChanged("CreatedBy");
1427                                        this.OnCreatedByChanged();
1428                                }
1429                        }
1430                }
1431               
1432                [Column(Storage="_CreatedOn", DbType="DateTime NOT NULL")]
1433                [DataMember(Order=10)]
1434                public System.DateTime CreatedOn
1435                {
1436                        get
1437                        {
1438                                return this._CreatedOn;
1439                        }
1440                        set
1441                        {
1442                                if ((this._CreatedOn != value))
1443                                {
1444                                        this.OnCreatedOnChanging(value);
1445                                        this.SendPropertyChanging();
1446                                        this._CreatedOn = value;
1447                                        this.SendPropertyChanged("CreatedOn");
1448                                        this.OnCreatedOnChanged();
1449                                }
1450                        }
1451                }
1452               
1453                [Column(Storage="_UpdatedBy", DbType="Int NOT NULL")]
1454                [DataMember(Order=11)]
1455                public int UpdatedBy
1456                {
1457                        get
1458                        {
1459                                return this._UpdatedBy;
1460                        }
1461                        set
1462                        {
1463                                if ((this._UpdatedBy != value))
1464                                {
1465                                        if (this._User1.HasLoadedOrAssignedValue)
1466                                        {
1467                                                throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
1468                                        }
1469                                        this.OnUpdatedByChanging(value);
1470                                        this.SendPropertyChanging();
1471                                        this._UpdatedBy = value;
1472                                        this.SendPropertyChanged("UpdatedBy");
1473                                        this.OnUpdatedByChanged();
1474                                }
1475                        }
1476                }
1477               
1478                [Column(Storage="_UpdatedOn", DbType="DateTime NOT NULL")]
1479                [DataMember(Order=12)]
1480                public System.DateTime UpdatedOn
1481                {
1482                        get
1483                        {
1484                                return this._UpdatedOn;
1485                        }
1486                        set
1487                        {
1488                                if ((this._UpdatedOn != value))
1489                                {
1490                                        this.OnUpdatedOnChanging(value);
1491                                        this.SendPropertyChanging();
1492                                        this._UpdatedOn = value;
1493                                        this.SendPropertyChanged("UpdatedOn");
1494                                        this.OnUpdatedOnChanged();
1495                                }
1496                        }
1497                }
1498               
1499                [Column(Storage="_Date", DbType="DateTime NOT NULL")]
1500                [DataMember(Order=13)]
1501                public System.DateTime Date
1502                {
1503                        get
1504                        {
1505                                return this._Date;
1506                        }
1507                        set
1508                        {
1509                                if ((this._Date != value))
1510                                {
1511                                        this.OnDateChanging(value);
1512                                        this.SendPropertyChanging();
1513                                        this._Date = value;
1514                                        this.SendPropertyChanged("Date");
1515                                        this.OnDateChanged();
1516                                }
1517                        }
1518                }
1519               
1520                [Association(Name="Author_MagazineItem", Storage="_Author", ThisKey="AuthorId", OtherKey="Id", IsForeignKey=true)]
1521                public Author Author
1522                {
1523                        get
1524                        {
1525                                return this._Author.Entity;
1526                        }
1527                        set
1528                        {
1529                                Author previousValue = this._Author.Entity;
1530                                if (((previousValue != value)
1531                                                        || (this._Author.HasLoadedOrAssignedValue == false)))
1532                                {
1533                                        this.SendPropertyChanging();
1534                                        if ((previousValue != null))
1535                                        {
1536                                                this._Author.Entity = null;
1537                                                previousValue.MagazineItems.Remove(this);
1538                                        }
1539                                        this._Author.Entity = value;
1540                                        if ((value != null))
1541                                        {
1542                                                value.MagazineItems.Add(this);
1543                                                this._AuthorId = value.Id;
1544                                        }
1545                                        else
1546                                        {
1547                                                this._AuthorId = default(int);
1548                                        }
1549                                        this.SendPropertyChanged("Author");
1550                                }
1551                        }
1552                }
1553               
1554                [Association(Name="User_MagazineItem", Storage="_User", ThisKey="CreatedBy", OtherKey="Id", IsForeignKey=true)]
1555                [DataMember(Order=14, EmitDefaultValue=false)]
1556                public User CreatedByUser
1557                {
1558                        get
1559                        {
1560                                if ((this.serializing
1561                                                        && (this._User.HasLoadedOrAssignedValue == false)))
1562                                {
1563                                        return null;
1564                                }
1565                                return this._User.Entity;
1566                        }
1567                        set
1568                        {
1569                                if ((this._User.Entity != value))
1570                                {
1571                                        this.SendPropertyChanging();
1572                                        this._User.Entity = value;
1573                                        this.SendPropertyChanged("CreatedByUser");
1574                                }
1575                        }
1576                }
1577               
1578                [Association(Name="Issue_MagazineItem", Storage="_Issue", ThisKey="IssueId", OtherKey="Id", IsForeignKey=true)]
1579                public Issue Issue
1580                {
1581                        get
1582                        {
1583                                return this._Issue.Entity;
1584                        }
1585                        set
1586                        {
1587                                Issue previousValue = this._Issue.Entity;
1588                                if (((previousValue != value)
1589                                                        || (this._Issue.HasLoadedOrAssignedValue == false)))
1590                                {
1591                                        this.SendPropertyChanging();
1592                                        if ((previousValue != null))
1593                                        {
1594                                                this._Issue.Entity = null;
1595                                                previousValue.MagazineItems.Remove(this);
1596                                        }
1597                                        this._Issue.Entity = value;
1598                                        if ((value != null))
1599                                        {
1600                                                value.MagazineItems.Add(this);
1601                                                this._IssueId = value.Id;
1602                                        }
1603                                        else
1604                                        {
1605                                                this._IssueId = default(int);
1606                                        }
1607                                        this.SendPropertyChanged("Issue");
1608                                }
1609                        }
1610                }
1611               
1612                [Association(Name="ItemType_MagazineItem", Storage="_ItemType", ThisKey="ItemTypeId", OtherKey="Id", IsForeignKey=true)]
1613                public ItemType ItemType
1614                {
1615                        get
1616                        {
1617                                return this._ItemType.Entity;
1618                        }
1619                        set
1620                        {
1621                                ItemType previousValue = this._ItemType.Entity;
1622                                if (((previousValue != value)
1623                                                        || (this._ItemType.HasLoadedOrAssignedValue == false)))
1624                                {
1625                                        this.SendPropertyChanging();
1626                                        if ((previousValue != null))
1627                                        {
1628                                                this._ItemType.Entity = null;
1629                                                previousValue.MagazineItems.Remove(this);
1630                                        }
1631                                        this._ItemType.Entity = value;
1632                                        if ((value != null))
1633                                        {
1634                                                value.MagazineItems.Add(this);
1635                                                this._ItemTypeId = value.Id;
1636                                        }
1637                                        else
1638                                        {
1639                                                this._ItemTypeId = default(int);
1640                                        }
1641                                        this.SendPropertyChanged("ItemType");
1642                                }
1643                        }
1644                }
1645               
1646                [Association(Name="User_MagazineItem1", Storage="_User1", ThisKey="UpdatedBy", OtherKey="Id", IsForeignKey=true)]
1647                [DataMember(Order=15, EmitDefaultValue=false)]
1648                public User UpdatedByUser
1649                {
1650                        get
1651                        {
1652                                if ((this.serializing
1653                                                        && (this._User1.HasLoadedOrAssignedValue == false)))
1654                                {
1655                                        return null;
1656                                }
1657                                return this._User1.Entity;
1658                        }
1659                        set
1660                        {
1661                                if ((this._User1.Entity != value))
1662                                {
1663                                        this.SendPropertyChanging();
1664                                        this._User1.Entity = value;
1665                                        this.SendPropertyChanged("UpdatedByUser");
1666                                }
1667                        }
1668                }
1669               
1670                public event PropertyChangingEventHandler PropertyChanging;
1671               
1672                public event PropertyChangedEventHandler PropertyChanged;
1673               
1674                protected virtual void SendPropertyChanging()
1675                {
1676                        if ((this.PropertyChanging != null))
1677                        {
1678                                this.PropertyChanging(this, emptyChangingEventArgs);
1679                        }
1680                }
1681               
1682                protected virtual void SendPropertyChanged(String propertyName)
1683                {
1684                        if ((this.PropertyChanged != null))
1685                        {
1686                                this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
1687                        }
1688                }
1689               
1690                private void Initialize()
1691                {
1692                        this._Author = default(EntityRef<Author>);
1693                        this._User = default(EntityRef<User>);
1694                        this._Issue = default(EntityRef<Issue>);
1695                        this._ItemType = default(EntityRef<ItemType>);
1696                        this._User1 = default(EntityRef<User>);
1697                        OnCreated();
1698                }
1699               
1700                [OnDeserializing()]
1701                [System.ComponentModel.EditorBrowsableAttribute(EditorBrowsableState.Never)]
1702                public void OnDeserializing(StreamingContext context)
1703                {
1704                        this.Initialize();
1705                }
1706               
1707                [OnSerializing()]
1708                [System.ComponentModel.EditorBrowsableAttribute(EditorBrowsableState.Never)]
1709                public void OnSerializing(StreamingContext context)
1710                {
1711                        this.serializing = true;
1712                }
1713               
1714                [OnSerialized()]
1715                [System.ComponentModel.EditorBrowsableAttribute(EditorBrowsableState.Never)]
1716                public void OnSerialized(StreamingContext context)
1717                {
1718                        this.serializing = false;
1719                }
1720        }
1721       
1722        [Table(Name="dbo.EmploymentType")]
1723        [DataContract()]
1724        public partial class EmploymentType : INotifyPropertyChanging, INotifyPropertyChanged
1725        {
1726               
1727                private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
1728               
1729                private int _Id;
1730               
1731                private string _Name;
1732               
1733                private EntitySet<Author> _Authors;
1734               
1735                private bool serializing;
1736               
1737    #region Extensibility Method Definitions
1738    partial void OnLoaded();
1739    partial void OnValidate(System.Data.Linq.ChangeAction action);
1740    partial void OnCreated();
1741    partial void OnIdChanging(int value);
1742    partial void OnIdChanged();
1743    partial void OnNameChanging(string value);
1744    partial void OnNameChanged();
1745    #endregion
1746               
1747                public EmploymentType()
1748                {
1749                        this.Initialize();
1750                }
1751               
1752                [Column(Storage="_Id", DbType="Int NOT NULL", IsPrimaryKey=true)]
1753                [DataMember(Order=1)]
1754                public int Id
1755                {
1756                        get
1757                        {
1758                                return this._Id;
1759                        }
1760                        set
1761                        {
1762                                if ((this._Id != value))
1763                                {
1764                                        this.OnIdChanging(value);
1765                                        this.SendPropertyChanging();
1766                                        this._Id = value;
1767                                        this.SendPropertyChanged("Id");
1768                                        this.OnIdChanged();
1769                                }
1770                        }
1771                }
1772               
1773                [Column(Storage="_Name", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]
1774                [DataMember(Order=2)]
1775                public string Name
1776                {
1777                        get
1778                        {
1779                                return this._Name;
1780                        }
1781                        set
1782                        {
1783                                if ((this._Name != value))
1784                                {
1785                                        this.OnNameChanging(value);
1786                                        this.SendPropertyChanging();
1787                                        this._Name = value;
1788                                        this.SendPropertyChanged("Name");
1789                                        this.OnNameChanged();
1790                                }
1791                        }
1792                }
1793               
1794                [Association(Name="EmploymentType_Author", Storage="_Authors", ThisKey="Id", OtherKey="EmploymentTypeId")]
1795                [DataMember(Order=3, EmitDefaultValue=false)]
1796                public EntitySet<Author> Authors
1797                {
1798                        get
1799                        {
1800                                if ((this.serializing
1801                                                        && (this._Authors.HasLoadedOrAssignedValues == false)))
1802                                {
1803                                        return null;
1804                                }
1805                                return this._Authors;
1806                        }
1807                        set
1808                        {
1809                                this._Authors.Assign(value);
1810                        }
1811                }
1812               
1813                public event PropertyChangingEventHandler PropertyChanging;
1814               
1815                public event PropertyChangedEventHandler PropertyChanged;
1816               
1817                protected virtual void SendPropertyChanging()
1818                {
1819                        if ((this.PropertyChanging != null))
1820                        {
1821                                this.PropertyChanging(this, emptyChangingEventArgs);
1822                        }
1823                }
1824               
1825                protected virtual void SendPropertyChanged(String propertyName)
1826                {
1827                        if ((this.PropertyChanged != null))
1828                        {
1829                                this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
1830                        }
1831                }
1832               
1833                private void attach_Authors(Author entity)
1834                {
1835                        this.SendPropertyChanging();
1836                        entity.EmploymentType = this;
1837                }
1838               
1839                private void detach_Authors(Author entity)
1840                {
1841                        this.SendPropertyChanging();
1842                        entity.EmploymentType = null;
1843                }
1844               
1845                private void Initialize()
1846                {
1847                        this._Authors = new EntitySet<Author>(new Action<Author>(this.attach_Authors), new Action<Author>(this.detach_Authors));
1848                        OnCreated();
1849                }
1850               
1851                [OnDeserializing()]
1852                [System.ComponentModel.EditorBrowsableAttribute(EditorBrowsableState.Never)]
1853                public void OnDeserializing(StreamingContext context)
1854                {
1855                        this.Initialize();
1856                }
1857               
1858                [OnSerializing()]
1859                [System.ComponentModel.EditorBrowsableAttribute(EditorBrowsableState.Never)]
1860                public void OnSerializing(StreamingContext context)
1861                {
1862                        this.serializing = true;
1863                }
1864               
1865                [OnSerialized()]
1866                [System.ComponentModel.EditorBrowsableAttribute(EditorBrowsableState.Never)]
1867                public void OnSerialized(StreamingContext context)
1868                {
1869                        this.serializing = false;
1870                }
1871        }
1872       
1873        [DataContract()]
1874        public partial class GetAuthorsResult
1875        {
1876               
1877                private string _FirstName;
1878               
1879                private string _LastName;
1880               
1881                private System.Nullable<decimal> _Price;
1882               
1883                private System.Nullable<decimal> _Bonus;
1884               
1885                public GetAuthorsResult()
1886                {
1887                }
1888               
1889                [Column(Storage="_FirstName", DbType="NVarChar(100) NOT NULL", CanBeNull=false)]
1890                [DataMember(Order=1)]
1891                public string FirstName
1892                {
1893                        get
1894                        {
1895                                return this._FirstName;
1896                        }
1897                        set
1898                        {
1899                                if ((this._FirstName != value))
1900                                {
1901                                        this._FirstName = value;
1902                                }
1903                        }
1904                }
1905               
1906                [Column(Storage="_LastName", DbType="NVarChar(100) NOT NULL", CanBeNull=false)]
1907                [DataMember(Order=2)]
1908                public string LastName
1909                {
1910                        get
1911                        {
1912                                return this._LastName;
1913                        }
1914                        set
1915                        {
1916                                if ((this._LastName != value))
1917                                {
1918                                        this._LastName = value;
1919                                }
1920                        }
1921                }
1922               
1923                [Column(Storage="_Price", DbType="Decimal(0,0)")]
1924                [DataMember(Order=3)]
1925                public System.Nullable<decimal> Price
1926                {
1927                        get
1928                        {
1929                                return this._Price;
1930                        }
1931                        set
1932                        {
1933                                if ((this._Price != value))
1934                                {
1935                                        this._Price = value;
1936                                }
1937                        }
1938                }
1939               
1940                [Column(Storage="_Bonus", DbType="Decimal(0,0)")]
1941                [DataMember(Order=4)]
1942                public System.Nullable<decimal> Bonus
1943                {
1944                        get
1945                        {
1946                                return this._Bonus;
1947                        }
1948                        set
1949                        {
1950                                if ((this._Bonus != value))
1951                                {
1952                                        this._Bonus = value;
1953                                }
1954                        }
1955                }
1956        }
1957       
1958        [DataContract()]
1959        public partial class GetAuthorsByMagzinesResult
1960        {
1961               
1962                private int _Id;
1963               
1964                private string _FirstName;
1965               
1966                private string _LastName;
1967               
1968                private string _NickName;
1969               
1970                private System.Nullable<decimal> _Price;
1971               
1972                private System.Nullable<decimal> _Bonus;
1973               
1974                public GetAuthorsByMagzinesResult()
1975                {
1976                }
1977               
1978                [Column(Storage="_Id", DbType="Int NOT NULL")]
1979                [DataMember(Order=1)]
1980                public int Id
1981                {
1982                        get
1983                        {
1984                                return this._Id;
1985                        }
1986                        set
1987                        {
1988                                if ((this._Id != value))
1989                                {
1990                                        this._Id = value;
1991                                }
1992                        }
1993                }
1994               
1995                [Column(Storage="_FirstName", DbType="NVarChar(100) NOT NULL", CanBeNull=false)]
1996                [DataMember(Order=2)]
1997                public string FirstName
1998                {
1999                        get
2000                        {
2001                                return this._FirstName;
2002                        }
2003                        set
2004                        {
2005                                if ((this._FirstName != value))
2006                                {
2007                                        this._FirstName = value;
2008                                }
2009                        }
2010                }
2011               
2012                [Column(Storage="_LastName", DbType="NVarChar(100) NOT NULL", CanBeNull=false)]
2013                [DataMember(Order=3)]
2014                public string LastName
2015                {
2016                        get
2017                        {
2018                                return this._LastName;
2019                        }
2020                        set
2021                        {
2022                                if ((this._LastName != value))
2023                                {
2024                                        this._LastName = value;
2025                                }
2026                        }
2027                }
2028               
2029                [Column(Storage="_NickName", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]
2030                [DataMember(Order=4)]
2031                public string NickName
2032                {
2033                        get
2034                        {
2035                                return this._NickName;
2036                        }
2037                        set
2038                        {
2039                                if ((this._NickName != value))
2040                                {
2041                                        this._NickName = value;
2042                                }
2043                        }
2044                }
2045               
2046                [Column(Storage="_Price", DbType="Decimal(0,0)")]
2047                [DataMember(Order=5)]
2048                public System.Nullable<decimal> Price
2049                {
2050                        get
2051                        {
2052                                return this._Price;
2053                        }
2054                        set
2055                        {
2056                                if ((this._Price != value))
2057                                {
2058                                        this._Price = value;
2059                                }
2060                        }
2061                }
2062               
2063                [Column(Storage="_Bonus", DbType="Decimal(0,0)")]
2064                [DataMember(Order=6)]
2065                public System.Nullable<decimal> Bonus
2066                {
2067                        get
2068                        {
2069                                return this._Bonus;
2070                        }
2071                        set
2072                        {
2073                                if ((this._Bonus != value))
2074                                {
2075                                        this._Bonus = value;
2076                                }
2077                        }
2078                }
2079        }
2080}
2081#pragma warning restore 1591
Notatka: Zobacz TracBrowser aby uzyskać więcej informacji.