How to add a C# class object to an Enitity table using LINQ : How to add a class object to an Enitity table using LINQ???The prescriber object is built from FullMasters Entity but I need to take that object and save it to EPCS_Prescriber table. Im using linq.



       public void SavePrescriber(string id)
        {
            var data = context.FullMasters.Where(x => x.NPI ==  id).FirstOrDefault();

            Prescriber p = new Prescriber
            {
                First = data.FirstName,
                Last = data.LastName,
                DEA = data.DEA,
                License = data.LIC,
                Life = data.Life_Hosp,
                NPI = data.NPI
            };



            epcs.EPCS_Prescriber.AddObject(p);
            epcs.SaveChanges();
          
        }