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

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

            return(campaigns);
        }