Your model is a list of MedicalGroupModel objects
List<MedicalGroupModel> medicalgroupmodel = new List<MedicalGroupModel>();
but when you add to it you are adding a class of type MedicalGroup
var newgroup = new MedicalGroup();
{
Medicalgroupname = newgroup.MedicalGroupName;
AddressId = newgroup.AddressId;
ContactId = newgroup.ContactId;
}
Maybe the AddressId and ContactId etc properties are on the MedicalGroupModel class instead? ie did you mean this
var newgroup = new MedicalGroupModel();
{
Medicalgroupname = newgroup.MedicalGroupName;
AddressId = newgroup.AddressId;
ContactId = newgroup.ContactId;
}
As for the IDisposable error, if you want to use something in a "using" block it must implement IDisposible, so if your RxMedicaDBEntities doesn't then amend it so it does.
public class RxMedicaDBEntities : IDisposable