private List <string> Add_List(List <Abstract_Iter_able> abstract_List) { List <string> return_List = new List <string>(); Facade_Table_Facade facade_Facade = new Facade_Table_Facade(); foreach (Abstract_Iter_able jB_Abstract in abstract_List) { Facade_Table facade = new Facade_Table(); facade.Facade_Description = "Test"; facade.Facade_Name = jB_Abstract.GetType().ToString(); facade.Facade_ID = Guid.NewGuid(); MemoryStream memStream = new MemoryStream(); StreamWriter sw = new StreamWriter(memStream); sw.Write(jB_Abstract); facade.Facade_Obj = memStream.GetBuffer(); return_List.Add(facade.Facade_ID.ToString()); facade_Facade.Add(facade); } return(return_List); }
private List <string> Update_List(List <Abstract_Iter_able> abstract_List) { List <string> return_List = new List <string>(); Facade_Table_Facade facade_Facade = new Facade_Table_Facade(); foreach (Abstract_Iter_able jB_Abstract in abstract_List) { List <Abstract_Iter_able> existing_List = facade_Facade.GetByIdWhere(jB_Abstract.GetType().ToString(), "Facade_Name"); if (existing_List.Count() > 0) { Facade_Table facade = (Facade_Table)existing_List[0]; facade.Facade_Description = ((Facade_Table)jB_Abstract).Facade_Description; facade.Facade_Name = jB_Abstract.GetType().ToString(); MemoryStream memStream = new MemoryStream(); StreamWriter sw = new StreamWriter(memStream); sw.Write(jB_Abstract); facade.Facade_Obj = memStream.GetBuffer(); return_List.Add(facade.Facade_ID.ToString()); facade_Facade.Add(facade); } } return(return_List); }