public virtual CommonResponse Activate(int id) { CommonResponse response = new CommonResponse(); try { using (var transaction = context.Database.BeginTransaction()) { try { repository.byUserId = loggedUser.UserID; repository.Activate(id); transaction.Commit(); } catch (Exception e) { transaction.Rollback(); return(response.Error("ERROR: " + e.ToString())); } } } catch (Exception e) { return(response.Error("ERROR: " + e.ToString())); } return(response.Success(id)); }
public HttpResponseMessage ActivateContact(int id) { try { var result = _contactRepository.Activate(id); HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK, result); return response; } catch (Exception ex) { HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.BadRequest, ex.Message); return response; } }
public void Activate(T model) { repo.Activate(model); }