public ActionResult <TankDto> CreateTank(Guid terminalId, Guid dispenserId, Guid fuelTypeId, TankForCreationDto tank) { var tankEntity = _mapper.Map <Entities.Tank>(tank); tankEntity.TerminalId = terminalId; tankEntity.DispenserId = dispenserId; tankEntity.FuelTypeId = fuelTypeId; _tankRepository.AddTank(tankEntity); _tankRepository.Save(); var siteToReturn = _mapper.Map <TankDto>(tankEntity); var links = CreateLinksForTank(terminalId.ToString(), dispenserId.ToString(), fuelTypeId.ToString(), null, null); var linkedResourceToReturn = siteToReturn.ShapeData(null) as IDictionary <string, object>; linkedResourceToReturn.Add("links", links); return(CreatedAtRoute("GetTank", new { terminalId, dispenserId, fuelTypeId = linkedResourceToReturn["Id"] }, linkedResourceToReturn)); }