/// <inheritdoc/>
        protected override void ExecuteSelf(OperationExecutionContext context)
        {
            var session  = context.Session;
            var key      = context.TryRemapKey(Key);
            var valueKey = context.TryRemapKey(ValueKey);
            var entity   = session.Query.Single(key);
            var value    = ValueKey != null?session.Query.Single(valueKey) : Value;

            entity.SetFieldValue(Field, value);
        }
Example #2
0
 /// <inheritdoc/>
 protected override void PrepareSelf(OperationExecutionContext context)
 {
     foreach (var key in Keys)
     {
         context.RegisterKey(context.TryRemapKey(key), false);
     }
 }
Example #3
0
        /// <inheritdoc/>
        protected override void ExecuteSelf(OperationExecutionContext context)
        {
            var session = context.Session;
            var item    = session.Query.Single(context.TryRemapKey(ItemKey));

            GetEntitySet(context).Remove(item);
        }
        /// <summary>
        /// Gets the entity set involved into this operation.
        /// </summary>
        /// <param name="context">The operation context.</param>
        /// <returns>Entity set involved into this operation.</returns>
        public EntitySetBase GetEntitySet(OperationExecutionContext context)
        {
            var session = context.Session;
            var key     = context.TryRemapKey(Key);
            var target  = session.Query.Single(key);

            return((EntitySetBase)target.GetFieldValue(Field));
        }
        /// <inheritdoc/>
        protected override void ExecuteSelf(OperationExecutionContext context)
        {
            var session = context.Session;
            var domain  = session.Domain;
            var key     = context.TryRemapKey(Key);
            var type    = domain.Model.Types[TypeName];

            key = Key.Create(domain, session.StorageNodeId, type, TypeReferenceAccuracy.ExactType, key.Value);
            session.CreateOrInitializeExistingEntity(type.UnderlyingType, key);
        }
        /// <inheritdoc/>
        protected override void ExecuteSelf(OperationExecutionContext context)
        {
            var session  = context.Session;
            var entities =
                from key in Keys
                let remappedKey = context.TryRemapKey(key)
                                  let entity = session.Query.Single(remappedKey)
                                               select entity;

            session.Remove(entities);
        }
 /// <inheritdoc/>
 protected override void PrepareSelf(OperationExecutionContext context)
 {
     // There should be no base method call here!
     context.RegisterKey(context.TryRemapKey(Key), true);
 }
 /// <inheritdoc/>
 protected override void PrepareSelf(OperationExecutionContext context)
 {
     base.PrepareSelf(context);
     // Next line works properly when ValueKey==null
     context.RegisterKey(context.TryRemapKey(ValueKey), false);
 }
 /// <inheritdoc/>
 protected override void PrepareSelf(OperationExecutionContext context)
 {
     context.RegisterKey(context.TryRemapKey(Key), false);
 }