public async Task <TipRead> Create(NewTip tip) { var newTip = tip.ToTip(); newTip.Validate(); var createdTip = await _repository.Create(newTip); return(new TipRead(createdTip)); }
public async Task <TipRead> AddTipToPlatform(NewTip newTip) { await FindPlatform(newTip.PlatformId); return(await _tipService.Create(newTip)); }
public async Task <ActionResult <TipRead> > AddTipToPlatform(Guid platformId, NewTip newTip) { newTip.PlatformId = platformId; var createdTip = await _platformService.AddTipToPlatform(newTip); return(Created("/", createdTip)); }