public Guid Insert(IGeneralInfoEntity entity) { var guid = Guid.NewGuid(); Update(guid, entity); return(guid); }
public void Update(Guid guid, IGeneralInfoEntity entity) { XDocument doc = persister.Load <IGeneralInfoEntity>(); var ele = GetXElement(doc, guid); ele.ReplaceWith(ConvertToXml(guid, entity)); persister.Persist <IGeneralInfoEntity>(doc); }
private XElement ConvertToXml(Guid guid, IGeneralInfoEntity entity) { return (new XElement("GeneralInfo", new XAttribute("Guid", entity.ID), new XElement("FullName", entity.FullName), new XElement("AddLine1", entity.Add1), new XElement("AddLine2", entity.Add2), new XElement("Email", entity.Email), new XElement("Phone", entity.Phone))); }
public void Update(Guid g, IGeneralInfoEntity t) { try { xs.Update(g, t); } catch (Exception) { throw; } }
public Guid Add(IGeneralInfoEntity entity) { try { return(xs.Insert(entity)); } catch (Exception) { throw; } }