public COFDTO GetByID(int ID) { COFFlammable COF = (from p in _unitOfWork.COFFlammable.FindAll().Where(p => p.ID == ID) select p).FirstOrDefault(); COFDTO inspectionStrategDTO = _mapper.Map <COFDTO>(COF); return(inspectionStrategDTO); }
public void Create(COFDTO COFDTO) { COFFlammable COF = _mapper.Map <COFFlammable>(COFDTO); COF.CreatedDate = DateTime.Now; _unitOfWork.COFFlammable.Create(COF); _unitOfWork.SaveChanges(); }
public void Update(COFDTO COFDTO) { var response = _unitOfWork.COFFlammable.FindById(COFDTO.ID); if (response != null) { response.ModifiedDate = DateTime.Now; } _unitOfWork.COFFlammable.Update(response); _unitOfWork.SaveChanges(); }