public async Task <IActionResult> Post([FromBody] OrganizacionaCelina organizacionaCelina) { if (!ModelState.IsValid) { return(Fail(ModelState)); } _unitOfWork.OrganizacioneCeline.Add(organizacionaCelina); await _unitOfWork.Complete(); return(Success(organizacionaCelina)); }
public async Task <IActionResult> Put([FromRoute] int id, [FromBody] OrganizacionaCelina organinizaCelinaEdit) { if (!ModelState.IsValid) { return(Fail(ModelState)); } var organizacionaCelina = await _unitOfWork.OrganizacioneCeline.Get(id); if (organizacionaCelina == null) { return(Fail("Not Found")); } organizacionaCelina.Naziv = organinizaCelinaEdit.Naziv; await _unitOfWork.Complete(); return(Success(organizacionaCelina)); }