Exemplo n.º 1
0
        public static TxHistory ToDomain(this TxHistoryEntity entity)
        {
            var domain = new TxHistory
            {
                FromAddress = entity.FromAddress,
                ToAddress   = entity.ToAddress,
                AssetId     = entity.AssetId,
                Amount      = entity.Amount,
                Hash        = entity.Hash,
                CreatedAt   = entity.CreatedAt,
                PaymentType = entity.PaymentType,
                Memo        = entity.Memo
            };

            return(domain);
        }
Exemplo n.º 2
0
        public static TxHistoryEntity ToEntity(this TxHistory domain)
        {
            var entity = new TxHistoryEntity
            {
                PartitionKey = TxHistory.GetKey(domain.PagingToken, domain.OperationIndex),
                RowKey       = domain.Memo ?? string.Empty,
                FromAddress  = domain.FromAddress,
                ToAddress    = domain.ToAddress,
                AssetId      = domain.AssetId,
                Amount       = domain.Amount,
                Hash         = domain.Hash,
                CreatedAt    = domain.CreatedAt,
                PaymentType  = domain.PaymentType
            };

            return(entity);
        }
Exemplo n.º 3
0
        public static TxHistory ToDomain(this TxHistoryEntity entity)
        {
            var domain = new TxHistory
            {
                OperationId  = entity.OperationId,
                FromAddress  = entity.FromAddress,
                ToAddress    = entity.ToAddress,
                AssetId      = entity.AssetId,
                Amount       = entity.Amount,
                Hash         = entity.Hash,
                PaymentId    = entity.PaymentId,
                CreatedAt    = entity.CreatedAt,
                PaymentType  = entity.PaymentType,
                Memo         = entity.Memo,
                LastModified = entity.Timestamp
            };

            return(domain);
        }
Exemplo n.º 4
0
        public static TxHistoryEntity ToEntity(this TxHistory domain, string partitionKey)
        {
            var entity = new TxHistoryEntity
            {
                PartitionKey = partitionKey,
                RowKey       = UInt64.Parse(domain.PaymentId).ToString("D20"),
                OperationId  = domain.OperationId,
                FromAddress  = domain.FromAddress,
                ToAddress    = domain.ToAddress,
                AssetId      = domain.AssetId,
                Amount       = domain.Amount,
                Hash         = domain.Hash,
                PaymentId    = domain.PaymentId,
                CreatedAt    = domain.CreatedAt,
                PaymentType  = domain.PaymentType,
                Memo         = domain.Memo
            };

            return(entity);
        }