My boyfriend has been told he has cancer, now l am pregancy with him will l and my baby also have cance?

Age & family history. Age, type of cancer and family history of cancer from both your bf's and your side- are important factors here in calculating the risk for your baby. The suspicion of certain hereditary cancer syndrome would be higher if a person is diagnosed with cancer at younger age <40 yo; strong family history of cancer that developed at young age and 2-3 or more family members with cancers.
Cancer inhereted? It is highly unlikely that your baby will have any cancer. It has been documented in a "rare case" that a mother's with leukemia transmitted it to her infant. Bottom line: have an oncologist discussed any possible genetic concerns about your boyfriend's cancer. This will enable you to most likely relax and enjoy your pregnancy.
No, but. Cancer is not contagious in this way. Cancer cannot spread by contact--ie contagiousness, but rarely susceptibility some forms of cancer are inheritable. The chances of this are not worth worrying about.