Ejemplo n.º 1
0
        public void Delete(int id)
        {
            if (id == 0)
            {
                throw new Exception("id could not be 0");
            }

            var model = _dbset.AsQueryable().Where(LambdaHelper.CreateEqual <TEntity>("ID", id)).FirstOrDefault();

            Delete(model);
        }
        public async Task <List <GeneInfoDto> > GetGeneInfosFilter(List <FilterInputDto> input)
        {
            //帅选
            var where = LambdaHelper.True <TB_GeneInfo>();
            if (input != null && input.Count > 0)
            {
                foreach (var item in input)
                {
                    if (item.ColumName == "GeneName")
                    {
                        item.ColumValue = item.ColumValue.ToUpper();
                    }
                    where = where.And(LambdaHelper.CreateEqual <TB_GeneInfo>(item.ColumName, item.ColumValue));
                }
            }
            var geneInfos = await repository.GetAllListAsync(where);

            return(ObjectMapper.Map <List <GeneInfoDto> >(geneInfos));
        }