コード例 #1
0
 public IEnumerable <PhotoAlbum> GetSortList(string name)
 {
     try
     {
         var account = AccountService.GetMyAccount(name, null, "Name");
         return(db.PhotoAlbums.Where(x => x.AccountId == account.Id));
     }
     catch
     {
         Console.WriteLine("Error");
         return(null);
     }
 }
コード例 #2
0
        public List <UserOrFriendModel> GetStatusFriends(string login)
        {
            List <UserOrFriendModel> sortUser = new List <UserOrFriendModel>();
            Account account     = accountService.GetMyAccount(login, null, "Name");
            var     sortFriends = db.Friends.ToList();
            var     allUsers    = accountService.GetList();

            if (account != null)
            {
                foreach (var item in allUsers)
                {
                    if (item.Id != account.Id)
                    {
                        sortUser.Add(new UserOrFriendModel {
                            Id = item.Id, Username = item.AccountName
                        });
                    }
                }
            }
            return(GetUserStatusByMyAccount(account.Id, sortUser, sortFriends));
        }
コード例 #3
0
        public IEnumerable <Photo> GetMyPhoto(string name)
        {
            var account = accountService.GetMyAccount(name, null, "Name");

            return(db.Photos.Where(x => x.AccountId == account.Id));
        }