/// <summary> /// Gets the contact records /// </summary> public static List<CTContact> GetContacts(int AccountId) { BrightPlatformEntities _efDbModel = new BrightPlatformEntities(UserSession.EntityConnection); return _efDbModel.FIGetContacts(AccountId).ToList(); //var objContacts = // from objContact in m_objBrightPlatformEntity.contacts // join objAccountContact in m_objBrightPlatformEntity.account_contacts on objContact.id equals objAccountContact.contact_id // join objAccount in m_objBrightPlatformEntity.accounts on objAccountContact.account_id equals objAccount.id // //where objContact.account_id == AccountId // where objAccountContact.account_id == AccountId // orderby objContact.first_name, objContact.last_name // select new ContactInstance // { // id = objContact.id, // first_name = objContact.first_name, // middle_name = objContact.middle_name, // last_name = objContact.last_name, // direct_phone = objContact.direct_phone, // mobile = objContact.mobile, // email = objContact.email, // title = objContact.title, // company_name = objAccount.company_name, // address_1 = objContact.address_1, // address_2 = objContact.address_2, // city = objContact.city, // zip_code = objContact.zipcode, // country = objContact.country, // active = objContact.active, // date_created = objContact.created_date == null? DateTime.Now :(DateTime)objContact.created_date, // date_modified = objContact.modified_date == null? DateTime.Now : (DateTime)objContact.modified_date // }; //return (ObjectQuery) objContacts; }