Ejemplo n.º 1
0
        public object Post(VehicleEntity vehicle)
        {
            try
            {
                var stringBuilder = new StringBuilder();
                if (vehicle.photoIds != null)
                {
                    vehicle.photoIds.ToList().ForEach(p => stringBuilder.Append(p + ","));
                }

                var message = string.Format("Post a new Vehicle {0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, {10}, {11}, {12}.", vehicle.Vin, vehicle.MakeId, vehicle.Make, vehicle.ModelId, vehicle.Model, vehicle.OEMCode, (vehicle.Options == null) ? "0" : vehicle.Options.Count().ToString(), vehicle.StockNumber, vehicle.Style, vehicle.StyleId, vehicle.Trim, vehicle.Year, stringBuilder.ToString());
                _log.Log(message, System.Diagnostics.EventLogEntryType.Information);
            }
            catch
            {
                // Logging - so don't want this code to crash original worflow
            }


            return(_vehicleFacade.CreateVehicle(vehicle));
        }