public void Savepeople(List <KillPeoPle> data) { string connStr = "data source=werewolfkill.database.windows.net;initial catalog=Werewolfkill;persist security info=True;user id=Werewolfkill;password=Wolfpeoplekill_2020;MultipleActiveResultSets=True;"; using (SqlConnection conn = new SqlConnection(connStr)) { conn.Open(); var paramater = new DBModels.GameRoom { RoomId = data[0].RoomId, Players = data[0].Player }; var sql = "update GameRoom set isAlive = 'True' where Players = @Players and RoomId = @RoomId"; conn.Query <DBModels.Room>(sql, paramater); } }
public List <Models.Occupation> Observer(KillPeoPle data) { var result = new DBModels.GameRoom(); string connStr = "data source=werewolfkill.database.windows.net;initial catalog=Werewolfkill;persist security info=True;user id=Werewolfkill;password=Wolfpeoplekill_2020;MultipleActiveResultSets=True;"; List <Models.Occupation> r = null; using (SqlConnection conn = new SqlConnection(connStr)) { conn.Open(); var paramater = new DBModels.GameRoom { RoomId = data.RoomId, Players = data.Player }; var sql = "select * from GameRoom where RoomId = 1 and Players = '*****@*****.**'"; conn.Query <Models.Occupation>(sql, paramater); //r = conn.Query<KillPeoPle>(sql, paramater).FirstOrDefault(); } return(r); }