public async Task <HttpResponseMessage> AddSubscriberAsync([FromBody] SubscriberBl subscriber) { try { subscriber.BillingCycle = await Task.Run(() => _subscriberService.ChooseLeastCountedBillingCycle()); var subscriberId = await _subscriberService.AddSubscriberAsync(subscriber); return(Request.CreateResponse(HttpStatusCode.OK, subscriberId)); } catch (Exception e) { var message = $"failed adding new subscriber. {e.Message}"; return(Request.CreateResponse(HttpStatusCode.NotFound, message)); } }
public async Task AddSubscriberAsync(SubscriberBl subscriberBl) { await _subscriberService.AddSubscriberAsync(subscriberBl); }