public ActionResult AddSubscription(SubscriptionDetails obj) { string Token = HttpContext.Request.Headers["Authorization"].Single().Split(" ")[1]; SubscriptionRepository sub = new SubscriptionRepository(); string status = sub.AddSubscription(obj, Token); if (status == null) { return(BadRequest()); } return(Ok(status)); }
public IActionResult Post(Subscription subscription) { _subscriptionRepository.AddSubscription(subscription); return(CreatedAtAction("Get", new { id = subscription.Id }, subscription)); }