public async Task <IViewComponentResult> InvokeAsync(string clientId) { var model = new SiteCollectionViewModel(); model.ClientId = clientId; return(View(model)); }
public async Task <JsonResult> Edit(SiteCollectionViewModel vm) { var siteCollection = new SiteCollection(); siteCollection.Id = vm.Id; siteCollection.Name = vm.Name; siteCollection.ClientId = vm.ClientId; var isUpdated = await _siteCollectionManager.UpdateSiteCollectionDetailsAsync(siteCollection); return(Json(siteCollection)); }
public async Task <JsonResult> Create(SiteCollectionViewModel vm) { var siteCollection = new SiteCollection(); var newId = ""; siteCollection.Name = vm.Name; siteCollection.ClientId = vm.ClientId; newId = await _siteCollectionManager.CreateSiteCollectionAsync(siteCollection); siteCollection.Id = newId; return(Json(siteCollection)); }
public async Task <IViewComponentResult> InvokeAsync(string clientId, string collectionId = null) { SiteCollectionViewModel model = null; if (collectionId != null) { var site = await _siteCollectionsManager.GetSiteCollectionByIdAsync(collectionId); model = site.ProjectTo <SiteCollectionViewModel>(); return(View(model)); } else { model = new SiteCollectionViewModel(); model.ClientId = clientId; model.Name = ""; return(View(model)); } }