public void WithEntities() { System.Collections.IEnumerable persons = session.CreateCriteria(typeof(Person)).List <Person>(); Assert.AreEqual(2, session.CreateCriteria(typeof(Mail)) .Add(XmlIn.Create("To", persons, 1)) .List <Mail>() .Count); }
public void WithValues() { int[] persons = new int[] { 0, 1, 2 }; Assert.AreEqual(1, session.CreateCriteria(typeof(Mail)) .Add(XmlIn.Create("From.Id", persons, 1)) .List <Mail>() .Count); }
public void TwoXmlIn() { System.Collections.IEnumerable persons = session.CreateCriteria(typeof(Person)).List <Person>(); Assert.AreEqual(2, session.CreateCriteria(typeof(Mail)) .Add(Restrictions.And(XmlIn.Create("From", persons, 1), XmlIn.Create("To", persons, 1))) .List <Mail>().Count); }
public void WithEntitiesAndNoResults() { IList <Person> justBob = new List <Person>(); justBob.Add(bob); Assert.AreEqual(0, session.CreateCriteria(typeof(Mail)) .Add(XmlIn.Create("To", justBob)) .List <Mail>() .Count); }
public HttpResponseMessage Put(string content, HttpRequestMessage request) { if (String.IsNullOrWhiteSpace(content)) { return(Request.CreateResponse(HttpStatusCode.BadRequest)); } string objextContent = request.Content.ReadAsStringAsync().Result; XmlIn xmlIn = new XmlIn() { Content = content, Body = objextContent, EntryDate = DateTime.Now }; db.XmlIn.Add(xmlIn); db.SaveChanges(); return(Request.CreateResponse(HttpStatusCode.OK)); }