Beispiel #1
0
 protected override void Dispose(bool disposing)
 {
     if (disposing)
     {
         db = null;
     }
     base.Dispose(disposing);
 }
Beispiel #2
0
 public void delete(UpdateSpecieRequest request)
 {
     try
     {
         var response = new UpdateSpecieResponse();
         var bc       = new SpecieComponent();
         bc.Update(request.Specie);
     }
     catch (Exception ex)
     {
         var httpError = new HttpResponseMessage()
         {
             StatusCode   = (HttpStatusCode)422,
             ReasonPhrase = ex.Message
         };
         throw new HttpResponseException(httpError);
     }
 }
Beispiel #3
0
 public GetSpecieResponse getById(GetSpecieRequest request)
 {
     try
     {
         var response = new GetSpecieResponse();
         var bc       = new SpecieComponent();
         response.Result = bc.Find(request.Specie.Id);
         return(response);
     }
     catch (Exception ex)
     {
         var httpError = new HttpResponseMessage()
         {
             StatusCode   = (HttpStatusCode)422,
             ReasonPhrase = ex.Message
         };
         throw new HttpResponseException(httpError);
     }
 }
Beispiel #4
0
        public AllSpeciesResponse getAll()
        {
            try
            {
                var response = new AllSpeciesResponse();
                var bc       = new SpecieComponent();
                response.Result = bc.ToList();

                return(response);
            }
            catch (Exception ex)
            {
                var httpError = new HttpResponseMessage()
                {
                    StatusCode   = (HttpStatusCode)422,
                    ReasonPhrase = ex.Message
                };
                throw new HttpResponseException(httpError);
            }
        }