示例#1
0
 public HttpResponseMessage Get()
 {
     try
     {
         List <WebEntityModel> entitys = SourceData.GetAll().ToList();
         if (entitys != null && entitys.Count > 0)
         {
             return(Request.CreateResponse(HttpStatusCode.OK, entitys));
         }
         else
         {
             return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, "Something Happend"));
         }
     }
     catch (Exception ex)
     {
         Logger.Fatal("getAllEntitys function in EntityController" + ex.InnerException);
         return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, "Something Happend" + ex.InnerException.ToString()));
     }
 }