コード例 #1
0
        public async Task <ActionResult <ComponentTestMinimal> > PostComponentTest(
            ComponentTestCreate componentTest)
        {
            var bllEntity = _mapper.MapToBLL(componentTest);

            _bll.ComponentTests.AddNoReturn(bllEntity);
            await _bll.SaveChangesAsync();

            return(CreatedAtAction("GetComponentTest", new { id = bllEntity.Id },
                                   componentTest));
        }
コード例 #2
0
ファイル: ComponentTest.cs プロジェクト: datoxicon/pcbuilder
 public ComponentTestMinimal MapToBLL(ComponentTestCreate bllComponentTest)
 {
     return(new ComponentTestMinimal
     {
         Id = 0,
         ComponentId = bllComponentTest.ComponentId,
         TestId = bllComponentTest.TestId,
         TestDate = bllComponentTest.TestDate,
         Value = bllComponentTest.Value
     });
 }