1
Reply

I want to create dictionary for one to many relation ship

abhishek bisht

abhishek bisht

Jul 7 2016 5:35 AM
255
hi,
 
i want to create a method using dictionary .so that i can map one id with other id in same table and it should be one to many relationship . so that on click i can update all level id in one shot .
 
public bool UpdateVisioData(VisioShapeDataDALDTO visioObjToUpdate)
{
bool isUpdate = false;
if (visioObjToUpdate.ModifiedDate == DateTime.MinValue)
visioObjToUpdate.ModifiedDate = DateTime.Now;
VisioShapeData entity = DBContext.VisioShapeDatas.Where(a => a.ID == visioObjToUpdate.ID).FirstOrDefault();
entity.Level4Id = visioObjToUpdate.Level4Id;
if (DBContext.SaveChanges() > 0)
{
isUpdate = true;
}
return isUpdate;
}
 
 how i will implement dictionary in this method plz let me know asap.. 

Answers (1)