Ejemplo n.º 1
0
        /// <summary>
        /// Serializes the <see cref="Entity"/> without the access attribute.
        /// </summary>
        /// <returns>The without access.</returns>
        /// <param name="id">Identifier.</param>
        /// <param name="encoder">Encoder.</param>
        /// <typeparam name="T">The 1st type parameter.</typeparam>
        public byte[] SerializeWithoutAccess <T> (EntityId id, CoflnetEncoder encoder) where T : Entity
        {
            T data = GetEntity <T> (id);

            byte[] result;
            // NOTE: this could still cause trouble if Access would be accessed in a different Thread
            lock (data) {
                Access access = data.Access;
                data.Access = null;
                result      = encoder.Serialize <T> (data);
                data.Access = access;
            }
            return(result);
        }
Ejemplo n.º 2
0
 static CoflnetEncoder()
 {
     Instance = new CoflnetEncoder();
 }