예제 #1
0
        public List<Offence> GetOffenceCondition(OffenceSearchCondition condition)
        {
            var where = PredicateExtensionses.True<Offence>();

            if (condition.TypeId != 0)
            {
                where = where.And(u => u.Type.Id == condition.TypeId);
            }
            var offenceList = Db.Offences.Where(where);
            return offenceList.ToList();
        }
예제 #2
0
 public ActionResult Search(OffenceSearchCondition condition)
 {
     var business = new OffenceBusiness(Db);
     return Content(JsonConvert.SerializeObject(business.GetOffenceCondition(condition), DateTimeConverter));
 }