public override bool UpdateConfig(LyciumConfig config) { var repository = _freeSql.GetRepository <LyciumConfig>(); var item = repository.Where(item => item.Id == config.Id).First(); return(repository.Update(item) == 1); }
/// <summary> /// 更新配置 /// </summary> /// <param name="config"></param> /// <returns></returns> public abstract bool UpdateConfig(LyciumConfig config);
/// <summary> /// 增加一个配置 /// </summary> /// <param name="config"></param> /// <returns></returns> public abstract bool AddConfig(LyciumConfig config);
public HttpStatusCode Modify(LyciumConfig config) { return(_configService.UpdateConfig(config) ? HttpStatusCode.OK : HttpStatusCode.BadRequest); }
public HttpStatusCode Create(LyciumConfig config) { return(_configService.AddConfig(config) ? HttpStatusCode.OK : HttpStatusCode.BadRequest); }
public override bool AddConfig(LyciumConfig config) { return(_freeSql.Insert(config).ExecuteAffrows() == 1); }