Example #1
0
        internal override void Write(SplitGoal goal)
        {
            try
            {
                using (var conn = new SqlConnection(ConnectionString))
                {
                    conn.Open();

                    var cmd = new SqlCommand(CommandText, conn);

                    foreach (var parameter in Parameters)
                    {
                        if (CommandText.Contains(parameter.Key))
                        {
                            cmd.Parameters.AddWithValue(parameter.Key, ParameterRetriever.RetireveValue(goal, parameter.Value));
                        }
                    }

                    cmd.ExecuteNonQuery();

                    conn.Close();
                }
            }
            catch (Exception ex)
            {
                if (TargetService.Config.Targets.ThrowExceptions)
                {
                    throw new Exception("Exception occurred in AbTestMaster when writing to database. Error Message: " + ex.Message);
                }
            }
        }
Example #2
0
        internal override void Write(SplitGoal goal)
        {
            try
            {
                var logservice = new LogService();

                var values = Parameters.ToDictionary(parameter => parameter.Key, parameter => ParameterRetriever.RetireveValue(goal, parameter.Value).ToString());

                logservice.WriteToFile(values, Path);
            }
            catch (Exception ex)
            {
                if (TargetService.Config.Targets.ThrowExceptions)
                {
                    throw new Exception("Exception occurred in AbTestMaster when writing to file. Error Message: " + ex.Message);
                }
            }
        }