Exemplo n.º 1
0
 // If your activity returns a value, derive from CodeActivity<TResult>
 // and return the value from the Execute method.
 protected override void Execute(CodeActivityContext context)
 {
     // Obtain the runtime value of the Text input argument
     int carId = context.GetValue(this.CarId);
     Car car = db.Cars.Find(carId);
     CarRequest carRequest = new CarRequest();
     carRequest.Id = car.Id;
     carRequest.Name = car.Name;
     carRequest.Type = car.Type;
     carRequest.Year = (int) car.Year;
     CarReq.Set(context, carRequest);
 }
Exemplo n.º 2
0
 // If your activity returns a value, derive from CodeActivity<TResult>
 // and return the value from the Execute method.
 protected override void Execute(CodeActivityContext context)
 {
     var cars = from c in db.Cars select c;
     List<CarRequest> carsReq = new List<CarRequest>();
     foreach (Car c in cars)
     {
         CarRequest carReq = new CarRequest();
         carReq.Id = c.Id;
         carReq.Name = c.Name;
         carReq.Type = c.Type;
         carReq.Year = (int) c.Year;
         carsReq.Add(carReq);
     }
     CarsReq.Set(context, carsReq.ToList());
 }