public IActionResult Update(string id, [FromBody] OaTenant oaTenant) { if (oaTenant == null) { return(BadRequest()); } Tenant.Update(_setting, Request, oaTenant); return(Ok()); }
public IActionResult Create([FromBody] OaTenant oaTenant) { if (oaTenant == null) { return(BadRequest()); } // Call Models var tenantId = Tenant.Create(_setting, Request, oaTenant); return(CreatedAtRoute( "Root", null, new { tenantId } )); }
public static Tenant GetObject(Setting setting, HttpRequest request, OaTenant oaTenant) { var oaApplication = Oa.GetResource <OaApplication>(setting, request, oaTenant.AppLink.ApsLink.Id); var oaAccount = Oa.GetResource <OaAccount>(setting, request, oaTenant.AccountLink.ApsLink.Id); return(new Tenant { Id = oaTenant.Aps.Id, CompanyName = oaAccount.CompanyName, App = Application.GetObject(oaApplication), // resources UsersLimit = oaTenant.UsersLimit.Limit, DiskspaceLimit = oaTenant.DiskspaceLimit.Limit, DevicesLimit = oaTenant.DevicesLimit.Limit }); }
public static void Update(Setting setting, HttpRequest request, OaTenant oaTenant) { var tenant = GetObject(setting, request, oaTenant); FbClient.Update(setting, tenant); }
public static string Create(Setting setting, HttpRequest request, OaTenant oaTenant) { var tenant = GetObject(setting, request, oaTenant); return(FbClient.Create(setting, tenant)); }