public async Task <IActionResult> Delete(ParamConfigInfo param)
 {
     return(await ActionWrapAsync(async() =>
     {
         ResultData <bool> result = new ResultData <bool>();
         result.Data = await _configService.Delete(param);
         return result;
     }));
 }
Exemplo n.º 2
0
        public async Task <bool> Delete(ParamConfigInfo param)
        {
            if (param.Id <= 0)
            {
                return(false);
            }
            var entity = Context.Configs.Attach(new Config()
            {
                Id = param.Id, Status = 1
            });

            entity.Property(x => x.Status).IsModified = true;
            return((await Context.SaveChangesAsync()) > 0);
        }
Exemplo n.º 3
0
        public async Task <bool> AddOrUpdate(ParamConfigInfo param)
        {
            var entity = param.Id > 0 ? Context.Configs.Single(x => x.Id == param.Id) : Context.Configs.Attach(new Config()).Entity;

            entity.ConfigValue  = param.ConfigValue;
            entity.ConfigDesc   = param.ConfigDesc;
            entity.LastUpdate   = DateTime.Now;
            entity.LastTimespan = BeeUtils.ConvertToTimeStamp(DateTime.Now);

            if (param.Id <= 0)
            {
                entity.ConfigId   = param.ConfigId;
                entity.AppId      = param.AppId;
                entity.EnvId      = param.EnvId;
                entity.CreateDate = DateTime.Now;
                Context.Configs.Add(entity);
            }
            else
            {
                Context.Configs.Update(entity);
            }

            return((await Context.SaveChangesAsync()) > 0);
        }
Exemplo n.º 4
0
 public async Task <bool> Delete(ParamConfigInfo param)
 {
     return(await _configRepository.Delete(param));
 }
Exemplo n.º 5
0
 public async Task <bool> AddOrUpdate(ParamConfigInfo param)
 {
     return(await _configRepository.AddOrUpdate(param));
 }