//create public static void Create(INSURANCE_DTO insurence) { using (HMO_PROGECTEntities ctx = new HMO_PROGECTEntities()) { ctx.INSURANCE_TBL.Add(new INSURANCE_TBL()); ctx.SaveChanges(); } }
public static INSURANCE_TBL CastToTBL(INSURANCE_DTO a) { return(new INSURANCE_TBL { insuranceId = a.insuranceId, insuranceName = a.insuranceName, hmoId = a.hmoId, InsurancePrice = a.InsurancePrice, description = a.description, HMO_TBL = db.HMO_TBL.Where(s => s.hmoId == a.hmoId).FirstOrDefault() }); }
//delete public static void Delete(HMO_PROGECTEntities ctx, INSURANCE_DTO insurance) { ctx.INSURANCE_TBL.Remove(ctx.INSURANCE_TBL.Find(insurance)); ctx.SaveChanges(); }