Ejemplo n.º 1
0
 public HttpResponseMessage Get(string userName)
 {
     var profile = new Facade().GetProfileRepository().Get(userName);
     ProfileDTO profileDTO = null;
         profileDTO = new ProfileConverter().Convert(profile);
         return Request.CreateResponse<ProfileDTO>(HttpStatusCode.OK, profileDTO);
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Will get a specific Profile found by the Id
 /// </summary>
 /// <param name="id"></param>
 /// <returns></returns>
 public HttpResponseMessage Get(int id)
 {
     var profile = new Facade().GetProfileRepository().Get(id);
     ProfileDTO profileDTO = null;
     if (profile != null)
     {
         profileDTO = new ProfileConverter().Convert(profile);
         return Request.CreateResponse<ProfileDTO>(HttpStatusCode.OK, profileDTO);
     }
     var response = new HttpResponseMessage(HttpStatusCode.NotFound)
     {
         Content = new StringContent("Profile not found.")
     };
     throw new HttpResponseException(response);
 }