public FriendService() { dc= new SPKTDataContext(); _accountRepository = new SPKTCore.Core.DataAccess.Impl.AccountRepository(); _webContext = new SPKTCore.Core.Impl.WebContext(); _friendInvitationRepository = new SPKTCore.Core.DataAccess.Impl.FriendInvitationRepository(); _friendRepository = new SPKTCore.Core.DataAccess.Impl.FriendRepository(); _userSession = new SPKTCore.Core.Impl.UserSession(); }
public List<Account> SearchFriend(Account account) { SPKTDataContext dc=new SPKTDataContext(); List<Account> list = new List<Account>(); foreach (Account a in dc.Accounts) { if (IsFriend(a, account) == true || IsFriend(account, a) == true) list.Add(a); } return list; }
public SPKTDataContext GetContext() { SPKTDataContext spktDC = new SPKTDataContext(ConnectionString); spktDC.DeferredLoadingEnabled = false; return spktDC; }