public async Task <IActionResult> Collection(int id) { var collection = await collectionsCrudService.GetAsync(id); if (collection is null) { return(RedirectToAction(nameof(Home.Index), nameof(Home))); } sessionHelper.RememberUserId(collection.OwnerId); var collectionVM = mapper.Map <CollectionVM>(collection); return(View(collectionVM)); }
public async Task <IActionResult> Info(int?id) { if (id is null) { id = sessionHelper.GetCurrentUserId(); } var user = await userCrudService.GetAsync(id.Value); if (user is null) { return(RedirectToAction(nameof(Home.Index), nameof(Home))); } sessionHelper.RememberUserId(id.Value); var model = mapper.Map <UserVM>(user); return(View(model)); }