Ejemplo n.º 1
0
        public async Task <IActionResult> PostMapCustomerEnquiryUpload([FromBody] MapCustomerEnquiryUpload mapCustomerEnquiryUpload)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            _context.MapCustomerEnquiryUpload.Add(mapCustomerEnquiryUpload);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetMapCustomerEnquiryUpload", new { id = mapCustomerEnquiryUpload.CeUploadId }, mapCustomerEnquiryUpload));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> PutMapCustomerEnquiryUpload([FromRoute] int id, [FromBody] MapCustomerEnquiryUpload mapCustomerEnquiryUpload)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != mapCustomerEnquiryUpload.CeUploadId)
            {
                return(BadRequest());
            }

            _context.Entry(mapCustomerEnquiryUpload).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!MapCustomerEnquiryUploadExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }