public async Task <IActionResult> Update(string id, Campaigns updatedCampaign) { var queriedCampaign = await _campaignService.GetByIdAsync(id); if (queriedCampaign == null) { return(NotFound()); } await _campaignService.UpdateAsync(id, updatedCampaign); return(NoContent()); }
public async Task UpdateAsync(string id, Campaigns campaigns) { await _campaigns.ReplaceOneAsync(s => s.Id == id, campaigns); }
public async Task <IActionResult> Create(Campaigns campaign) { await _campaignService.CreateAsync(campaign); return(Ok(campaign)); }
public async Task <Campaigns> CreateAsync(Campaigns campaigns) { await _campaigns.InsertOneAsync(campaigns); return(campaigns); }