public async Task <ActionResult <Rights> > Post([FromBody] Rights right) { try { right.RightID = Guid.NewGuid(); await rightRepo.CreateAsync(right); return(CreatedAtRoute("GetRightByID", new { id = right.RightID }, right)); } catch (Exception) { return(BadRequest()); } }