Пример #1
0
        public HttpResponseMessage GetInstitution(HttpRequestMessage request, string name, int userId)
        {
            var institution = _studentApi.GetExistingInstitution(name, userId);
            HttpResponseMessage response = null;

            if (institution != null)
            {
                response = request.CreateResponse(HttpStatusCode.OK, new { exists = true, institution.ID });
            }
            else
            {
                response = request.CreateResponse(HttpStatusCode.OK, new { exists = false });
            }

            return(response);
        }