public async Task <IActionResult> Edit(long id, string returnUrl) { var branch = await _branchesDao.GetByIdAsync(id); return(View( new EditViewModel { Id = branch.Id, EditorMode = EditorMode.Update, Name = branch.Name, Address = branch.Address, ReturnUrl = returnUrl })); }
private async Task <bool> CacheBranchAsync(long branchId = default(long)) { if (branchId == default(long)) { var session = _httpContextAccessor.HttpContext.Session; branchId = session.GetJson <long>(BranchIdJsonKey); if (branchId == default(long)) { return(false); } } _cachedBranch = await _branchesDao.GetByIdAsync(branchId); return(_cachedBranch != null); }