예제 #1
0
        // INSERT
        public bool InsertData(KoffieBattle koffieBattle)
        {
            string sql = @"INSERT KoffieBattle([Groot],[Medium],[NameRestaurant],[NameManager]) values (@Groot, @Medium, @NameRestaurant, @NameManager)";

            using (IDbConnection connection = new SqlConnection(_con))
            {
                int rowsAffected = connection.Execute
                                   (
                    sql,
                    new
                {
                    Groot          = koffieBattle.Groot,
                    Medium         = koffieBattle.Medium,
                    NameRestaurant = koffieBattle.NameRestaurant,
                    NameManager    = koffieBattle.NameManager
                });

                if (rowsAffected > 0)
                {
                    return(true);
                }
                return(false);
            }
        }
예제 #2
0
 public bool Post([FromBody] KoffieBattle koffieBattle)
 {
     return(_con.InsertData(koffieBattle));
 }