コード例 #1
0
ファイル: Document.cs プロジェクト: micheldavid/aws-sdk-net
        internal static DynamoDBEntry AttributeValueToDynamoDBEntry(AttributeValue attributeValue)
        {
            Primitive primitive = null;

            if (attributeValue.S != null)
            {
                primitive = new Primitive(attributeValue.S);
            }
            else if (attributeValue.N != null)
            {
                primitive = new Primitive(attributeValue.N, true);
            }
            else if (attributeValue.B != null)
            {
                primitive = new Primitive(attributeValue.B);
            }
            if (primitive != null)
            {
                return(primitive);
            }

            PrimitiveList primitiveList = null;

            if (attributeValue.SS != null && attributeValue.SS.Count != 0)
            {
                primitiveList = new PrimitiveList(DynamoDBEntryType.String);
                foreach (string item in attributeValue.SS)
                {
                    primitive = new Primitive(item);
                    primitiveList.Add(primitive);
                }
            }
            else if (attributeValue.NS != null && attributeValue.NS.Count != 0)
            {
                primitiveList = new PrimitiveList(DynamoDBEntryType.Numeric);
                foreach (string item in attributeValue.NS)
                {
                    primitive = new Primitive(item, true);
                    primitiveList.Add(primitive);
                }
            }
            else if (attributeValue.BS != null && attributeValue.BS.Count != 0)
            {
                primitiveList = new PrimitiveList(DynamoDBEntryType.Binary);
                foreach (MemoryStream item in attributeValue.BS)
                {
                    primitive = new Primitive(item);
                    primitiveList.Add(primitive);
                }
            }

            if (primitiveList != null)
            {
                return(primitiveList);
            }

            return(null);
        }
コード例 #2
0
        public override object Clone()
        {
            PrimitiveList list = new PrimitiveList(this.Type);

            foreach (Primitive entry in this.Entries)
            {
                list.Add(entry.Clone() as Primitive);
            }

            return(list);
        }
コード例 #3
0
        internal static DynamoDBEntry AttributeValueToDynamoDBEntry(AttributeValue attributeValue)
        {
            Primitive primitive = null;
            if (attributeValue.S != null)
            {
                primitive = new Primitive(attributeValue.S);
            }
            else if (attributeValue.N != null)
            {
                primitive = new Primitive(attributeValue.N, true);
            }
            else if (attributeValue.B != null)
            {
                primitive = new Primitive(attributeValue.B);
            }
            if (primitive != null)
                return primitive;

            PrimitiveList primitiveList = null;
            if (attributeValue.SS != null && attributeValue.SS.Count != 0)
            {
                primitiveList = new PrimitiveList(DynamoDBEntryType.String);
                foreach (string item in attributeValue.SS)
                {
                    primitive = new Primitive(item);
                    primitiveList.Add(primitive);
                }
            }
            else if (attributeValue.NS != null && attributeValue.NS.Count != 0)
            {
                primitiveList = new PrimitiveList(DynamoDBEntryType.Numeric);
                foreach (string item in attributeValue.NS)
                {
                    primitive = new Primitive(item, true);
                    primitiveList.Add(primitive);
                }
            }
            else if (attributeValue.BS != null && attributeValue.BS.Count != 0)
            {
                primitiveList = new PrimitiveList(DynamoDBEntryType.Binary);
                foreach (MemoryStream item in attributeValue.BS)
                {
                    primitive = new Primitive(item);
                    primitiveList.Add(primitive);
                }
            }

            if (primitiveList != null)
                return primitiveList;

            return null;
        }
コード例 #4
0
        public override object Clone()
        {
            PrimitiveList list = new PrimitiveList(this.Type);
            foreach (Primitive entry in this.Entries)
            {
                list.Add(entry.Clone() as Primitive);
            }

            return list;
        }