コード例 #1
0
        protected override async Task <Response> Implementation(Request request)
        {
            var contactCode = await _randomGenerator.GetEventCode();

            var dto = new TestContactDto
            {
                Name       = request.Name,
                EmailToken = request.Email.Token,
                EmailMask  = request.Email.MaskedValue,
                Code       = contactCode
            };

            await _testContactRepository.PersistContact(dto);

            return(new Response
            {
                Code = contactCode
            });
        }
コード例 #2
0
        public async Task <PersistResponse> PersistContact(TestContactDto testContact)
        {
            var data = new TestContactTable
            {
                PartitionKey = "Contact",
                RowKey       = testContact.Code,
                Name         = testContact.Name,
                EmailHash    = testContact.EmailMask,
                EmailToken   = testContact.EmailToken
            };

            data.UpdateAuditable(testContact);

            var table = await GetTable("TestContacts");

            var insertOperation = TableOperation.Insert(data);
            await table.ExecuteAsync(insertOperation);

            return(PersistResponse.Created());
        }