|
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated from a template.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
namespace EF_Translate.Data
{
public partial class Language : IEntity
{
#region Primitive Properties
public virtual int Id
{
get;
set;
}
public virtual string Code
{
get;
set;
}
public virtual string Name
{
get;
set;
}
#endregion
#region Navigation Properties
public virtual ICollection<LocalizableEntityTranslation> LocalizableEntityTranslation
{
get
{
if (_localizableEntityTranslation == null)
{
var newCollection = new FixupCollection<LocalizableEntityTranslation>();
newCollection.CollectionChanged += FixupLocalizableEntityTranslation;
_localizableEntityTranslation = newCollection;
}
return _localizableEntityTranslation;
}
set
{
if (!ReferenceEquals(_localizableEntityTranslation, value))
{
var previousValue = _localizableEntityTranslation as FixupCollection<LocalizableEntityTranslation>;
if (previousValue != null)
{
previousValue.CollectionChanged -= FixupLocalizableEntityTranslation;
}
_localizableEntityTranslation = value;
var newValue = value as FixupCollection<LocalizableEntityTranslation>;
if (newValue != null)
{
newValue.CollectionChanged += FixupLocalizableEntityTranslation;
}
}
}
}
private ICollection<LocalizableEntityTranslation> _localizableEntityTranslation;
#endregion
#region Association Fixup
private void FixupLocalizableEntityTranslation(object sender, NotifyCollectionChangedEventArgs e)
{
if (e.NewItems != null)
{
foreach (LocalizableEntityTranslation item in e.NewItems)
{
item.Language = this;
}
}
if (e.OldItems != null)
{
foreach (LocalizableEntityTranslation item in e.OldItems)
{
if (ReferenceEquals(item.Language, this))
{
item.Language = null;
}
}
}
}
#endregion
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.