Beispiel #1
0
        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));
        }
Beispiel #2
0
        public async Task <IActionResult> PostThreat([FromBody] ReliabilityThreatPostRp model)
        {
            var response = await this._ReliabilityRiskComponent.CreateThreat(model);

            return(this.Ok(response));
        }