public void Key_Insert(KeysList key) { using (IDbConnection connection = new SqlConnection(GlobalConfig.CnnString(databaseName))) { var p = new DynamicParameters(); p.Add("@Id", (int)key); p.Add("@Code", key.ToString()); p.Add("@Name", key.GetDescription()); connection.Execute("dbo.spKeys_Insert", p, commandType: CommandType.StoredProcedure); } }