public async Task <ActionResult> PostToGroup(string message) { var user = await CharacterFacade.GetCharacterById(Guid.Parse(User.Identity.Name)); if (user != null && user.GroupId.HasValue) { await GroupFacade.CreatePost(new GroupPostDto { GroupId = user.GroupId.Value, CharacterId = user.Id, Text = message, Timestamp = DateTime.Now }); return(RedirectToAction("Index")); } return(RedirectToAction("NotAuthorized", "Error")); }