コード例 #1
0
        public async Task <ApiResult> PostAffrowsAsync(DemandView dto)
        {
            ApiResult res    = new ApiResult();
            var       source = await this.QueryByIDAsync(dto.Id);

            //  this.freeSql.Update()

            //  dto.AssignValuesToEntity(source);
            var exp = source.UpdateExpression(dto);

            var updater = this.freeSql.Update <Demand>(source.ID).Set(exp).Set(a => a.ModifyDate, DateTime.Now);

            int i = await updater.ExecuteAffrowsAsync();

            return(res);
        }
コード例 #2
0
        public async Task <IActionResult> Post([FromBody] DemandView value)
        {
            string id     = "";
            var    demand = this.mapper.Map <Demand>(value);
            var    tm     = this.mapper.ConfigurationProvider.FindTypeMapFor <DemandView, Demand>();

            int r = await demandService.AddAsync(demand);

            ApiResult apiResult = new ApiResult();

            if (r > 0)
            {
                apiResult.msg = "添加成功!";
            }
            else
            {
                apiResult.msg = "添加失败!";
            }

            var res = await billOperation.PostAsync(value);

            return(Ok(apiResult));
        }
コード例 #3
0
 public Task <ApiResult> PostAffrowsAsync(DemandView model)
 {
     throw new NotImplementedException();
 }