Ejemplo n.º 1
0
        public void Update_Ok_Test()
        {
            var rndString = Guid.NewGuid().ToString();
            var activity  = _context.Activities.First();

            activity.Name = rndString;

            var result = _activityOperations.UpdateAsync(activity).Result;

            Assert.AreEqual(rndString, result.Name);
        }
Ejemplo n.º 2
0
        public async Task <IHttpActionResult> Put(int id, ActivityViewModelPut putViewModel)
        {
            try
            {
                var activity = Mapper.Map <Activity>(putViewModel);
                activity.Id = id;
                await _activityOperations.UpdateAsync(activity);

                await _pictureOperations.SaveByFormIdAsync(putViewModel.FormId, id, LinkedObjectType.Activity);

                return(await Get(id));
            }
            catch (Exception ex)
            {
                ErrorLogger.Log("CANNOT PUT ACTIVITY", ex);
                throw;
            }
        }