public async Task <LeadTag> AddTag(LeadTagAddRequest model) { var tag = model.Tag.Id > 0? model.Tag: IU(model.Tag); foreach (var item in model.LeadIds) { await(_dbContext as Model.PunnelContext).msp_Lead_AddTag(item, tag.Id); } return(tag); }
public async Task <IHttpActionResult> Post(LeadTagAddRequest model) { try { model.Tag.UserId = this.CurrentUserId; var res = await _uow.LeadTag.AddTag(model); return(Ok(res)); } catch (BusinessException ex) { return(BadRequest(ex.Message)); } catch (Exception ex) { _log.Error(ex); return(BadRequest(this.General_Err)); } }