private static PracticeEntity FetchPractice(string practiceAbbr) { var path = new PrefetchPath2((int)EntityType.PracticeEntity); path.Add(PracticeEntity.PrefetchPathClinics); var practiceEntity = new PracticeEntity(); practiceEntity.PracticeAbbr = practiceAbbr; using (IDataAccessAdapter adapter = AdapterFactory.CreateAdapter(MyNameSpace)) { bool fetchResult = adapter.FetchEntityUsingUniqueConstraint(practiceEntity, practiceEntity.ConstructFilterForUCPracticeAbbr(), path); if (!fetchResult) { // Not found. Place handle code here. return(null); } } return(practiceEntity); }
protected void ExpectFetchEntityUsingUniqueConstraint(bool entityExists) { ExpectGetDataAccessAdapterAndDispose(); Expect.Call(_dataAccessAdapter.FetchEntityUsingUniqueConstraint(null, null)).IgnoreArguments() .Return(entityExists); }