public Staging_Alert MapXmlToStagingAlert(string xmlString) { XmlSerializer serializer = new XmlSerializer(typeof(Staging_Alert), new XmlRootAttribute("AGVAlert")); StringReader stringReader = new StringReader(xmlString); Staging_Alert alert = (Staging_Alert)serializer.Deserialize(stringReader); return(alert); }
public void AddAlert(Staging_Alert alert) { using (var ctx = new AGVStagingContext()) { ctx.Staging_Alert.Add(alert); ctx.SaveChanges(); } }