Exemple #1
0
 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);
     }
 }
Exemple #2
0
 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());
     }
 }