示例#1
0
        public void CommandMethod()
        {
            DataCore <Income> db = new DataCore <Income>(new SqlConnection(@"Server=Localhost\SQL2019;Database=FinanceManager;User Id=sa;Password=pass123;"));

            db.ExecuteCommand("UPDATE Incomes SET Description = @Desc WHERE Id = @Id", new { Desc = "Test", Id = 1 });

            Income obj = db.ExecuteQuery("SELECT * FROM Incomes WHERE Id = @Id", new { Id = 1 }).FirstOrDefault();

            Assert.IsTrue(obj.Description == "Test");
        }