private async Task DoInsert() { insertedObject = new ComplexObject { Name = "Brian Chavez", ProfileUri = new Uri("http://www.bitarmory.com"), CompanyUri = null, Balance = 1000001.2m, Clicks = 2000, Views = null, SecurityStamp = Guid.Parse("32753EDC-E5EF-46E0-ABCD-CE5413B30797"), TrackingId = null, LastLogin = new DateTime(2013, 1, 14, 4, 44, 25), LoginWindow = new TimeSpan(1, 2, 3, 4, 5), Signature = new byte[] {0xde, 0xad, 0xbe, 0xef}, Hours = new[] {1, 2, 3, 4}, ExtraInfo = new Dictionary<string, string>() { {"key1", "value1"}, {"key2", "value2"}, {"key3", "value3"}, }, Enabled = true, Notify = null, BinaryBools = new[] {true, false, true}, NullBinaryBools = new bool?[] {true, null, true}, SomeNumber = 1234 }; var resp = await connection.RunAsync(testTable.Insert(insertedObject)); insertedObject.Id = resp.GeneratedKeys[0]; }
public static ComplexObject NewObjectWithDefaults() { var obj = new ComplexObject { Id = Guid.Parse("{32753EDC-E5EF-46E0-ABCD-CE5413B30797}").ToString(), Name = "Brian Chavez", ProfileUri = new Uri("http://www.bitarmory.com"), CompanyUri = null, Balance = 1000001.2m, Clicks = 2000, Views = null, SecurityStamp = Guid.Parse("32753EDC-E5EF-46E0-ABCD-CE5413B30797"), TrackingId = null, LastLogin = new DateTime(2013, 1, 14, 4, 44, 25), LoginWindow = new TimeSpan(1, 2, 3, 4, 5), Signature = new byte[] {0xde, 0xad, 0xbe, 0xef}, Hours = new[] {1, 2, 3, 4}, ExtraInfo = new Dictionary<string, string>() { {"key1", "value1"}, {"key2", "value2"}, {"key3", "value3"}, }, Enabled = true, Notify = null, BinaryBools = new[] {true, false, true}, NullBinaryBools = new bool?[] {true, null, true}, SomeNumber = 1234 }; return obj; }