Пример #1
0
 public void EstablishContext()
 {
     this.resource = new CreateSerialisedProductResource {
         ProductName = "Test"
     };
     this.result = this.Sut.Create(this.resource);
 }
 public void EstablishContext()
 {
     this.resource = new CreateSerialisedProductResource {
         productName = "Speakers", productType = "speakers"
     };
     this.result = this.Sut.Create(this.resource);
 }
 public static SerialisedProductResource ToResource(this SerialisedProduct domain)
 {
     return(domain.SerialNumber.Any()
         ? new SerialisedProductResource
     {
         ProductName = domain.ProductName,
         SerialNumber = domain.SerialNumber
     }
         : null);
 }
Пример #4
0
        public async Task Write(SerialisedProduct value, CancellationToken ct)
        {
            var request = new PutItemRequest()
            {
                TableName = this.tableName,
                Item      = new Dictionary <string, AttributeValue>
                {
                    { "Id", new AttributeValue {
                          S = Guid.NewGuid().ToString()
                      } },
                    { "ProductName", new AttributeValue {
                          S = value.ProductName
                      } },
                    { "SerialNumber", new AttributeValue {
                          NS = value.SerialNumber.Select(x => x.ToString()).ToList()
                      } }
                }
            };

            await this.client.PutItemAsync(request, ct);
        }