public EProtection Add(EProtection eprotection) { try { _EProtectionRepository.Add(eprotection); return(eprotection); } catch (Exception ex) { throw ex; } }
public ActionResult <EProtection> Post([FromBody] EProtection eprotection) { var res = _eprotectionService.Add(eprotection); if (res is null) { return(BadRequest()); } else { return(eprotection); } }
public EProtection Add(EProtection eprotection) { try { _context.EProtections.Add(eprotection); _context.SaveChanges(); return(eprotection); } catch (Exception ex) { throw ex; } }