예제 #1
0
 public void AddAdmin(int userRequesterId, int forumId, int adminId)
 {
     if (_real != null)
     {
         _real.AddAdmin(userRequesterId, forumId, adminId);
     }
     throw new NullReferenceException("_real in null");
 }
예제 #2
0
        public HttpResponseMessage Post_addAdmin(int forumId, int userId, int adminId)
        {
            try{
                driver.AddAdmin(userId, forumId, adminId);
                HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK);

                return(response);
            }
            catch (Exception e)
            {
                var data = new
                {
                    message = e.Message
                };
                HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.NotFound, data);
                return(response);
            }
        }