Exemplo n.º 1
0
        public void InsertTheNullable()
        {
            var newTheNullable = new TheNullable
            {
                TheBigInt         = null,
                TheBinary         = null,
                TheBit            = null,
                TheChar           = null,
                TheDate           = null,
                TheDateTime       = null,
                TheDateTime2      = null,
                TheDateTimeOffset = null,
                TheDecimal        = null,
                TheFloat          = null,
                TheGuid           = null,
                TheMoney          = null,
                TheNChar          = null,
                TheNumeric        = null,
                TheNVarChar       = null,
                TheReal           = null,
                TheSmallDateTime  = null,
                TheSmallInt       = null,
                TheSmallMoney     = null,
                TheTime           = null,
                TheTinyInt        = null,
                TheVarBinary      = null,
                TheVarChar        = null,
                TheXml            = null
            };

            this.TestDbContext.TheNullable.Add(newTheNullable);
            this.TestDbContext.SaveChanges();
        }
        public async Task InsertNulls()
        {
            var newTheNullable = new TheNullable
            {
                TheBigInt         = null,
                TheBinary         = null,
                TheBit            = null,
                TheChar           = null,
                TheDate           = null,
                TheDateTime       = null,
                TheDateTime2      = null,
                TheDateTimeOffset = null,
                TheDecimal        = null,
                TheFloat          = null,
                TheGuid           = null,
                TheInt            = null,
                TheMoney          = null,
                TheNChar          = null,
                TheNumeric        = null,
                TheNVarChar       = null,
                TheReal           = null,
                TheSmallDateTime  = null,
                TheSmallInt       = null,
                TheSmallMoney     = null,
                TheTime           = null,
                TheTinyInt        = null,
                TheVarBinary      = null,
                TheVarChar        = null,
                TheXml            = null
            };

            DB.TheNullable.Add(newTheNullable);
            await DB.SaveChangesAsync();
        }