public async Task <ReliabilityThreatGetRp> CreateThreat(ReliabilityThreatPostRp model) { var modifiedBy = this._identityGateway.GetIdentity(); var modifiedOn = this._datetimeGateway.GetCurrentDateTime(); var item = ReliabilityThreatEntity.Factory.Create(modifiedOn, modifiedBy, model.Name); this._dbContext.Add(item); await this._dbContext.SaveChangesAsync(); return(this._mapper.Map <ReliabilityThreatGetRp>(item)); }
public async Task <IActionResult> PostThreat([FromBody] ReliabilityThreatPostRp model) { var response = await this._ReliabilityRiskComponent.CreateThreat(model); return(this.Ok(response)); }