Ambiguous Exception w/ overloaded DataPortal_Fetch Methods in 3.5 Beta 2Ambiguous Exception w/ overloaded DataPortal_Fetch Methods in 3.5 Beta 2
Old forum URL: forums.lhotka.net/forums/t/4425.aspx
colema18 posted on Wednesday, February 27, 2008
Is it possible to have 2 different DataPortal_Fetch methods with different signiture types (but the same number of parameters)? The following gives me:
Test method ProjectX.Library.Test.UserTest.InsertTest threw exception:
Csla.DataPortalException: DataPortal.Fetch failed (Ambiguous match
found.)
Code:
private void DataPortal_Fetch(SingleCriteria<DealerGroup, Guid> criteria)
{
using (var ctx = ContextManager<FinanceSource.DalLinq.UserDataContext>.GetManager(Database.FinanceSourceConnection))
{
// get DealerGroup data
var data = (from d in ctx.DataContext.DealerGroups
where d.Id == criteria.Value
select d).Single();
LoadProperties(data);
}
}
private void DataPortal_Fetch(SingleCriteria<DealerGroup, string> criteria)
{
using (var ctx = ContextManager<FinanceSource.DalLinq.UserDataContext>.GetManager(Database.FinanceSourceConnection))
{
// get DealerGroup data
var data = (from d in ctx.DataContext.DealerGroups
where d.Name == criteria.Value
select d).Single();
LoadProperties(data);
}
}
Copyright (c) Marimer LLC