Ejemplo n.º 1
0
        public async Task <IActionResult> issueWeapons(IssueWeaponWeaponDto issueWeaponWeaponDto)
        {
            var issueWeaponToCreate = new IssueWeapon
            {
                Id         = issueWeaponWeaponDto.Id,
                DateIssue  = issueWeaponWeaponDto.DateIssue,
                DateReturn = issueWeaponWeaponDto.DateReturn,
                WeaponId   = issueWeaponWeaponDto.WeaponId
            };

            await _repo.IssueWeapon(issueWeaponToCreate);

            return(StatusCode(201));
        }
 //PUT
 public async Task UpdateIssueWeapon(IssueWeapon issueWeapon)
 {
     _context.IssueWeapons.Update(issueWeapon);
     await _context.SaveChangesAsync();
 }
        //POST
        public async Task IssueWeapon(IssueWeapon issueWeapon)
        {
            await _context.IssueWeapons.AddAsync(issueWeapon);

            await _context.SaveChangesAsync();
        }