Example #1
0
        public static BlockResponse CreateBlockResponse(this IBlock block, Exception ex)
        {
            BlockResponse result = block.CreateBlockResponse();

            result.Error   = true;
            result.Message = ex.Message;
            return(result);
        }
Example #2
0
        public static BlockResponse CreateBlockResponse(this IBlock block)
        {
            BlockResponse result = new BlockResponse
            {
                Error      = false,
                Message    = string.Empty,
                BlockState = null,
                StartTime  = DateTime.Now,
                BlockID    = 0
            };

            if (block != null)
            {
                result.BlockID    = block.BlockID;
                result.BlockState = block.CreateBlockState();
            }

            return(result);
        }