public void UpdateNotNullTest2() { var data = new UpdateDemo2 { Name = "cat", Ext1 = "ext1" }; var con = new { id = 1 }; var sql = DapperExt.UpdateNotNull(data, con, "myt"); var exp = "UPDATE myt SET myName = @Name, Ext1 = @Ext1 WHERE id = @w_id"; Assert.Equal(exp, sql); }
public void UpdateNotNullModelWithIdTest2() { var data = new UpdateDemo4 { Id = 1, Name = "cat" }; var con = new { id = 1 }; var sql = DapperExt.UpdateNotNull(data, con, "myt"); var exp = "UPDATE myt SET a_id = @Id, last_name = @Name WHERE id = @w_id"; Assert.Equal(exp, sql); }