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
- UshortList2.cs
- ForceCopyBuildProvider.cs
- ListViewTableRow.cs
- Adorner.cs
- NameSpaceEvent.cs
- CallbackValidatorAttribute.cs
- dbenumerator.cs
- ReadWriteObjectLock.cs
- ExternalFile.cs
- Vector3DCollectionConverter.cs
- XmlNamespaceManager.cs
- AlphaSortedEnumConverter.cs
- TreeNode.cs
- ServerIdentity.cs
- PropertyStore.cs
- KnownColorTable.cs
- SerializationException.cs
- PropagationProtocolsTracing.cs
- Base64Stream.cs
- ImageSource.cs
- TextFormatterContext.cs
- querybuilder.cs
- QuerySubExprEliminator.cs
- BufferedReadStream.cs
- RequiredFieldValidator.cs
- DependencyProperty.cs
- DummyDataSource.cs
- SqlMultiplexer.cs
- IOThreadTimer.cs
- HiddenFieldPageStatePersister.cs
- DoubleAnimation.cs
- StoreContentChangedEventArgs.cs
- SourceFileInfo.cs
- WindowsGraphicsCacheManager.cs
- EventSetter.cs
- ScriptModule.cs
- XmlSchemaType.cs
- SchemaElementLookUpTable.cs
- HtmlWindow.cs
- ToolStripDropDownItemDesigner.cs
- DynamicMethod.cs
- IPGlobalProperties.cs
- TransactionManager.cs
- MenuItemStyle.cs
- ImageField.cs
- DLinqAssociationProvider.cs
- Variable.cs
- DtrList.cs
- ConfigurationHelpers.cs
- InlinedAggregationOperatorEnumerator.cs
- OleDbDataReader.cs
- EntityDataSourceSelectedEventArgs.cs
- SelectionItemPatternIdentifiers.cs
- Ipv6Element.cs
- XmlWhitespace.cs
- ChildDocumentBlock.cs
- ControlParameter.cs
- InputProcessorProfiles.cs
- Track.cs
- TypeUsageBuilder.cs
- DateTime.cs
- BoundColumn.cs
- HttpHandlerActionCollection.cs
- TextStore.cs
- SpellerError.cs
- ProcessHost.cs
- XmlObjectSerializerWriteContext.cs
- EmptyStringExpandableObjectConverter.cs
- ObjectReaderCompiler.cs
- Assign.cs
- MetabaseServerConfig.cs
- SingleSelectRootGridEntry.cs
- CollectionMarkupSerializer.cs
- ItemsControl.cs
- InternalBufferOverflowException.cs
- ToolboxItemAttribute.cs
- ProtectedConfigurationSection.cs
- DBNull.cs
- PrintPreviewDialog.cs
- LineBreak.cs
- FilterEventArgs.cs
- WebServiceData.cs
- PanelStyle.cs
- WebPartDescription.cs
- ProtocolInformationReader.cs
- OleDbConnectionPoolGroupProviderInfo.cs
- SystemKeyConverter.cs
- MobileFormsAuthentication.cs
- TextBoxBase.cs
- CheckBox.cs
- hwndwrapper.cs
- MatrixTransform3D.cs
- DataTableMappingCollection.cs
- _SecureChannel.cs
- Proxy.cs
- DesignBindingPropertyDescriptor.cs
- Evidence.cs
- SystemColors.cs
- CachedPathData.cs
- SmtpSpecifiedPickupDirectoryElement.cs