Пример #1
0
        public void GetInvites(FriendRequestViewDTO FriendRequestViewDTO, List <Request> RecievedInvites,
                               List <Request> SentInvites, IFriendsListStore _FriendListStore,
                               IUserStore _userStore, IRequestStore _RequestStore)
        {
            foreach (var Request in RecievedInvites)
            {
                var RequestUser = _RequestStore.GetRequestUserById(Request.RequestUserId);
                FriendRequestViewDTO.RecievedInvites.Add(new FriendRequestDTO()
                {
                    Id            = Request.Id,
                    RequestUserId = Request.RequestUserId,
                    FriendListId  = Request.FriendListId,
                    Pending       = Request.Pending,
                    Username      = RequestUser.Username,
                    message       = $"{RequestUser.Username} would like to be your friend."
                });
            }

            foreach (var Request in SentInvites)
            {
                var InviteeFriendsList = _FriendListStore.GetFriendListById(Request.FriendListId);
                var Invitee            = _userStore.GetByIdentityUserId(InviteeFriendsList.UserId);
                FriendRequestViewDTO.SentInvites.Add(new FriendRequestDTO()
                {
                    Id            = Request.Id,
                    RequestUserId = Request.RequestUserId,
                    FriendListId  = Request.FriendListId,
                    Pending       = Request.Pending,
                    Username      = Invitee.Username
                });
            }
        }
Пример #2
0
 public GetAllInvitesQuery(IRequestStore RequestStore, IUserStore UserStore,
                           IdentityUser CurrentUser, UserAccount CurrentAccount, IFriendsListStore FriendListStore)
 {
     this.RequestStore    = RequestStore;
     this.UserStore       = UserStore;
     this.CurrentUser     = CurrentUser;
     this.CurrentAccount  = CurrentAccount;
     this.FriendListStore = FriendListStore;
 }
Пример #3
0
 public GetAllPostsQuery(IdentityUser CurrentUser, UserAccount ExistingAccount, IFriendsListStore _FriendListStore,
                         INotificationBox _NotificationBox, IUserStore _UserStore, IPostStore _PostStore)
 {
     this.CurrentUser      = CurrentUser;
     this.ExistingAccount  = ExistingAccount;
     this._FriendListStore = _FriendListStore;
     this._NotificationBox = _NotificationBox;
     this._UserStore       = _UserStore;
     this._PostStore       = _PostStore;
 }
Пример #4
0
 public GetSearchResultQuery(IUserStore _UserStore, IFriendsListStore _FriendListStore,
                             IRequestStore _RequestStore, IdentityUser CurrentUser, UserAccount ResultUser, SearchUserDTO SearchUserDTO)
 {
     this._RequestStore    = _RequestStore;
     this._FriendListStore = _FriendListStore;
     this.CurrentUser      = CurrentUser;
     this._UserStore       = _UserStore;
     this.ResultUser       = ResultUser;
     this.SearchUserDTO    = SearchUserDTO;
 }
Пример #5
0
 public GetAllUsersQuery(IUserStore _UserStore, IFriendsListStore _FriendListStore,
                         IRequestStore _RequestStore, IdentityUser CurrentUser, UserAccount existingAccount,
                         SignInManager <User> signInManager)
 {
     this._RequestStore    = _RequestStore;
     this._FriendListStore = _FriendListStore;
     this.CurrentUser      = CurrentUser;
     this._UserStore       = _UserStore;
     this.existingAccount  = existingAccount;
     this.signInManager    = signInManager;
 }
Пример #6
0
 public PostsController(UserManager <User> userManager, SignInManager <User> signInManager, ApplicationDbContext _context,
                        IUserStore _userStore, IPostStore _postStore, ICommentStore _commentStore, CurrentPostDTO _currentpost,
                        IFriendsListStore _FriendListStore, INotificationBox _notificationBox, ILogger <PostsController> _logger)
 {
     this.userManager      = userManager;
     this.signInManager    = signInManager;
     this._context         = _context;
     this._userStore       = _userStore;
     this._postStore       = _postStore;
     this._commentStore    = _commentStore;
     this._currentpost     = _currentpost;
     this._FriendListStore = _FriendListStore;
     this._notificationBox = _notificationBox;
     this._logger          = _logger;
 }
Пример #7
0
 public GetUserProfileQuery(Guid Id, UserManager <User> UserManager,
                            IUserStore UserStore, IFriendsListStore FriendListStore, IRequestStore RequestStore,
                            IGroupStore GroupStore, ILogger <AccountsController> Logger,
                            UserAccount existingAccount, IdentityUser Currentuser)
 {
     this.AccountId   = Id;
     _UserManager     = UserManager;
     _UserStore       = UserStore;
     _FriendListStore = FriendListStore;
     _RequestStore    = RequestStore;
     _GroupStore      = GroupStore;
     _Logger          = Logger;
     _CurrentUser     = Currentuser;
     _ExistingAccount = existingAccount;
     _mapper          = new MapperConfiguration(cfg => cfg.AddProfile <EntityMapper>()).CreateMapper();
 }
Пример #8
0
 public AccountsController(UserManager <User> userManager, SignInManager <User> signInManager, ApplicationDbContext _context,
                           IUserStore _userStore, IFriendsListStore _FriendListStore, IRequestStore _RequestStore, INotificationBox _notificationBox,
                           IGroupStore GroupStore, ILogger <AccountsController> _logger, IAdminRequestStore _AdminRequestStore)
 {
     this.userManager        = userManager;
     this.signInManager      = signInManager;
     this._context           = _context;
     this._userStore         = _userStore;
     this._FriendListStore   = _FriendListStore;
     this._RequestStore      = _RequestStore;
     this._notificationBox   = _notificationBox;
     this.GroupStore         = GroupStore;
     this._logger            = _logger;
     this._AdminRequestStore = _AdminRequestStore;
     _mapper = new MapperConfiguration(cfg => cfg.AddProfile <EntityMapper>()).CreateMapper();
 }