Exemple #1
0
        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());
        }
Exemple #2
0
 public async Task UpdateAsync(string id, Campaigns campaigns)
 {
     await _campaigns.ReplaceOneAsync(s => s.Id == id, campaigns);
 }
Exemple #3
0
        public async Task <IActionResult> Create(Campaigns campaign)
        {
            await _campaignService.CreateAsync(campaign);

            return(Ok(campaign));
        }
Exemple #4
0
        public async Task <Campaigns> CreateAsync(Campaigns campaigns)
        {
            await _campaigns.InsertOneAsync(campaigns);

            return(campaigns);
        }