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); } }
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)); }
public IEnumerable <Photo> GetMyPhoto(string name) { var account = accountService.GetMyAccount(name, null, "Name"); return(db.Photos.Where(x => x.AccountId == account.Id)); }