public Boolean InsertInto(Character character) { try { using (IDbConnection connection = new System.Data.SqlClient.SqlConnection(ConnectionStrings.GetConnectionString("MonsterManualDb"))) { connection.Open(); connection.Insert(character); connection.Close(); return(true); } } catch (Exception e) { return(false); } }
public List <Character> GetMonsters(String monsterName) { using (IDbConnection connection = new System.Data.SqlClient.SqlConnection(ConnectionStrings.GetConnectionString("MonsterManualDb"))) { return(connection.Query <Character>($"select * from Character where Name like '%{monsterName}%';").ToList()); } }