//更新 public int Update(string id, bas_tenant tenant) { var result = _db.Update("bas_tenant", tenant) .AutoMap(x => x.tenant_id) .Where("tenant_id", id) .Execute(); return(result); }
//添加 public string Insert(bas_tenant tenant) { tenant.tenant_id = "T" + (new Random().Next(100) + 500).ToString(); var result = _db.Insert("bas_tenant", tenant) .AutoMap() .Execute(); return(tenant.tenant_id); }
/// <summary> /// 更新租户信息 /// </summary> /// <param name="id"></param> public void Put(string id, [FromBody] bas_tenant tenant) { _tenantService.Update(id, tenant); }
/// <summary> /// 创建新的租户信息 /// </summary> public string Post([FromBody] bas_tenant tenant) { return(_tenantService.Insert(tenant)); }