Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataEntity / System / Data / Objects / Internal / PocoEntityKeyStrategy.cs / 1305376 / PocoEntityKeyStrategy.cs
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.Objects.DataClasses;
using System.Diagnostics;
namespace System.Data.Objects.Internal
{
///
/// Implementor of IEntityKeyStrategy for getting and setting a key on an entity that does not
/// implement IEntityWithKey. The key is stored in the strategy object.
///
internal sealed class PocoEntityKeyStrategy : IEntityKeyStrategy
{
private EntityKey _key;
///
/// Creates a new strategy object; no reference to the actual entity is required.
///
public PocoEntityKeyStrategy()
{
}
// See IEntityKeyStrategy
public EntityKey GetEntityKey()
{
return _key;
}
// See IEntityKeyStrategy
public void SetEntityKey(EntityKey key)
{
_key = key;
}
// See IEntityKeyStrategy
public EntityKey GetEntityKeyFromEntity()
{
return null;
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.Objects.DataClasses;
using System.Diagnostics;
namespace System.Data.Objects.Internal
{
///
/// Implementor of IEntityKeyStrategy for getting and setting a key on an entity that does not
/// implement IEntityWithKey. The key is stored in the strategy object.
///
internal sealed class PocoEntityKeyStrategy : IEntityKeyStrategy
{
private EntityKey _key;
///
/// Creates a new strategy object; no reference to the actual entity is required.
///
public PocoEntityKeyStrategy()
{
}
// See IEntityKeyStrategy
public EntityKey GetEntityKey()
{
return _key;
}
// See IEntityKeyStrategy
public void SetEntityKey(EntityKey key)
{
_key = key;
}
// See IEntityKeyStrategy
public EntityKey GetEntityKeyFromEntity()
{
return null;
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- Parser.cs
- RowParagraph.cs
- AssemblyName.cs
- StorageEntitySetMapping.cs
- VectorAnimationUsingKeyFrames.cs
- SessionStateSection.cs
- MediaContext.cs
- ValidationErrorEventArgs.cs
- SafeFileMapViewHandle.cs
- SqlConnectionPoolProviderInfo.cs
- RSACryptoServiceProvider.cs
- SoapAttributes.cs
- Utils.cs
- PageCatalogPart.cs
- VersionedStreamOwner.cs
- KoreanLunisolarCalendar.cs
- Matrix.cs
- SqlDataReaderSmi.cs
- SimpleHandlerFactory.cs
- Component.cs
- CounterSample.cs
- Int64Animation.cs
- assertwrapper.cs
- TextEffectResolver.cs
- ValueUnavailableException.cs
- DynamicActivityXamlReader.cs
- Calendar.cs
- DataList.cs
- WindowsTab.cs
- Timer.cs
- RelatedImageListAttribute.cs
- WebPartCancelEventArgs.cs
- Shape.cs
- DictionaryEntry.cs
- WebBrowserUriTypeConverter.cs
- ChildDocumentBlock.cs
- BitmapFrame.cs
- CodeArrayCreateExpression.cs
- ClientFormsIdentity.cs
- RangeContentEnumerator.cs
- PackWebResponse.cs
- EndpointDiscoveryBehavior.cs
- ConstructorBuilder.cs
- _SslStream.cs
- ConfigurationSection.cs
- ExclusiveNamedPipeTransportManager.cs
- AnnotationObservableCollection.cs
- Util.cs
- InvalidPropValue.cs
- TreeNodeBinding.cs
- URLIdentityPermission.cs
- AuthorizationRule.cs
- EndpointIdentityExtension.cs
- XmlCharCheckingWriter.cs
- SafeTokenHandle.cs
- QuotedPrintableStream.cs
- NameValuePermission.cs
- LoadedOrUnloadedOperation.cs
- Filter.cs
- CachedPathData.cs
- DbConnectionPoolGroup.cs
- _emptywebproxy.cs
- StylusButtonEventArgs.cs
- StringUtil.cs
- UserControlBuildProvider.cs
- ControlCollection.cs
- CompilerTypeWithParams.cs
- X509Utils.cs
- ToolStripGrip.cs
- DataGridViewCellErrorTextNeededEventArgs.cs
- OrderedDictionaryStateHelper.cs
- EventListenerClientSide.cs
- ThreadPool.cs
- TokenBasedSet.cs
- TableLayoutSettingsTypeConverter.cs
- RandomDelayQueuedSendsAsyncResult.cs
- FindCriteriaApril2005.cs
- InsufficientMemoryException.cs
- ObjRef.cs
- VisualTarget.cs
- Trustee.cs
- nulltextcontainer.cs
- CommandDesigner.cs
- GridViewPageEventArgs.cs
- ContractHandle.cs
- SmiMetaDataProperty.cs
- Point3DConverter.cs
- Stroke2.cs
- DataGridPageChangedEventArgs.cs
- LinqDataSourceDisposeEventArgs.cs
- BeginStoryboard.cs
- BufferedGraphicsContext.cs
- Converter.cs
- TraceContextRecord.cs
- OleDbException.cs
- wgx_sdk_version.cs
- XmlJsonWriter.cs
- ComEventsMethod.cs
- XmlSchemaValidationException.cs
- WhiteSpaceTrimStringConverter.cs