Exemplo n.º 1
0
        /// <summary>
        /// Starts an update-and-get command with projection support for the given entity type
        /// </summary>
        /// <typeparam name="T">The type of entity</typeparam>
        /// <typeparam name="TProjection">The type of the end result</typeparam>
        public UpdateAndGet <T, TProjection> UpdateAndGet <T, TProjection>() where T : IEntity
        {
            var cmd = new UpdateAndGet <T, TProjection>(Session, globalFilters, OnBeforeUpdate <T>());

            if (Cache <T> .ModifiedByProp != null)
            {
                ThrowIfModifiedByIsEmpty <T>();
                cmd.Modify(b => b.Set(Cache <T> .ModifiedByProp.Name, ModifiedBy));
            }
            return(cmd);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Starts an update-and-get command with projection support for the given entity type
        /// </summary>
        /// <typeparam name="T">The type of entity</typeparam>
        /// <typeparam name="TProjection">The type of the end result</typeparam>
        public virtual UpdateAndGet <T, TProjection> UpdateAndGet <T, TProjection>() where T : IEntity
        {
            var upGet = new UpdateAndGet <T, TProjection>(session);

            if (Cache <T> .ModifiedByProp != null)
            {
                ThrowIfModifiedByIsEmpty <T>();
                upGet.Modify(b => b.Set(Cache <T> .ModifiedByProp.Name, ModifiedBy));
            }
            return(upGet);
        }