Exemplo n.º 1
0
        public async Task PostRecordsAsync(IEnumerable <Record> records)
        {
            foreach (var record in records)
            {
                if (record.TypeRecord == TypeData.Account)
                {
                    using (MemoryStream stream = new MemoryStream(record.Value.ToByteArray()))
                    {
                        BinaryFormatter form    = new BinaryFormatter();
                        Account         account = (Account)form.Deserialize(stream);
                        accountSubscriber.AddUser(account);
                    }
                }
            }

            try
            {
                await recordSubscriber.AddRecordsAsync(records);
            }
            catch (Exception ex)
            {
                throw new InvalidTransactionException(ex.Message);
            }
        }
Exemplo n.º 2
0
 public async Task <bool> AddRecordsAsync(Records records)
 {
     return(await _recordsRepository.AddRecordsAsync(records));
 }