/// <summary>
        ///
        /// </summary>
        /// <param name="id">id of DumpTruck to fetch</param>
        /// <param name="item"></param>
        /// <response code="200">OK</response>
        /// <response code="404">DumpTruck not found</response>
        public virtual IActionResult RentalrequestattachmentsIdPutAsync(int id, RentalRequestAttachment item)
        {
            var exists = _context.LookupLists.Any(a => a.Id == id);

            if (exists && id == item.Id)
            {
                _context.RentalRequestAttachments.Update(item);
                // Save the changes
                _context.SaveChanges();
                return(new ObjectResult(item));
            }
            else
            {
                // record not found
                return(new StatusCodeResult(404));
            }
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="item"></param>
        /// <response code="201">DumpTruck created</response>
        public virtual IActionResult RentalrequestattachmentsPostAsync(RentalRequestAttachment item)
        {
            var exists = _context.RentalRequestAttachments.Any(a => a.Id == item.Id);

            if (exists)
            {
                _context.RentalRequestAttachments.Update(item);
            }
            else
            {
                // record not found
                _context.RentalRequestAttachments.Add(item);
            }
            // Save the changes
            _context.SaveChanges();
            return(new ObjectResult(item));
        }
        /// <summary>
        /// Update rental request attachment
        /// </summary>
        /// <param name="id">id of Rental Request Attachment to fetch</param>
        /// <param name="item"></param>
        /// <response code="200">OK</response>
        /// <response code="404">Rental Request Attachment not found</response>
        public virtual IActionResult RentalrequestattachmentsIdPutAsync(int id, RentalRequestAttachment item)
        {
            bool exists = _context.LookupLists.Any(a => a.Id == id);

            if (exists && id == item.Id)
            {
                _context.RentalRequestAttachments.Update(item);

                // save the changes
                _context.SaveChanges();

                return(new ObjectResult(new HetsResponse(item)));
            }

            // record not found
            return(new ObjectResult(new HetsResponse("HETS-01", ErrorViewModel.GetDescription("HETS-01", _configuration))));
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="id">id of RentalRequestAttachment to fetch</param>
        /// <param name="item"></param>
        /// <response code="200">OK</response>
        /// <response code="404">RentalRequestAttachment not found</response>
        public virtual IActionResult RentalrequestattachmentsIdPutAsync(int id, RentalRequestAttachment item)
        {
            var result = "";

            return(new ObjectResult(result));
        }
Example #5
0
 public virtual IActionResult RentalrequestattachmentsPost([FromBody] RentalRequestAttachment item)
 {
     return(this._service.RentalrequestattachmentsPostAsync(item));
 }
Example #6
0
 public virtual IActionResult RentalrequestattachmentsIdPut([FromRoute] int id, [FromBody] RentalRequestAttachment item)
 {
     return(this._service.RentalrequestattachmentsIdPutAsync(id, item));
 }
 /// <summary>
 /// Setup the test.
 /// </summary>
 public RentalRequestAttachmentModelTests()
 {
     instance = new RentalRequestAttachment();
 }