Exemplo n.º 1
0
        public UpdateMethodResponse Update(UpdateMethodRequest request)
        {
            var response = new UpdateMethodResponse();

            try
            {
                var method = request.MapTo <Method>();
                DataContext.Methods.Attach(method);
                DataContext.Entry(method).State = EntityState.Modified;
                DataContext.SaveChanges();
                response.IsSuccess = true;
                response.Message   = "Method item has been updated successfully";
            }
            catch (DbUpdateException dbUpdateException)
            {
                response.Message = dbUpdateException.Message;
            }

            return(response);
        }
Exemplo n.º 2
0
        public void UpdateMethod(Method method)
        {
            var request = new UpdateMethodRequest(method);

            myClient.EnqueueRequest(request, _ => { });
        }