Exemple #1
0
        public async Task <VaccineDeliveryReport> AddDeliveryReport(VaccineDeliveryReport report)
        {
            _reportContext.Delivery.Add(report);
            await _reportContext.SaveChangesAsync();

            return(report);
        }
Exemple #2
0
        public async Task <ActionResult <VaccineDeliveryReport> > AddDeliveryReport([FromBody] VaccineDeliveryReport report)
        {
            if (!ModelState.IsValid)
            {
                Console.WriteLine("Invalid state...");
                return(BadRequest(ModelState));
            }
            var newReport = await _IInleveransRepository.AddDeliveryReport(report);

            return(CreatedAtAction(nameof(GetAllDeliveryReport), new { id = newReport.Id }, newReport));
        }
Exemple #3
0
 public async Task UpdateDeliveryReport(VaccineDeliveryReport report)
 {
     _reportContext.Entry(report).State = EntityState.Modified;
     await _reportContext.SaveChangesAsync();
 }