Thanks a lot for your help
, but it doesn't work as I expect...
I'm encapsulating the fetching behavior passing the entity with the Id loaded, then after that I'm using it outside. After the fetch, I validate the boolean fetch result. If it's false, I set the entity as null, as follows:
// TEntity is of type IEntity2
public void FillEntity(TEntity pEntity)
{
bool vIsEntityFetched = false;
// Adapter instance
using (DataAccessAdapterBase vAdapter = GetAdapter())
{
// Gets the entity
vIsEntityFetched = vAdapter.FetchEntity(pEntity);
if (!vIsEntityFetched)
pEntity= null;
}
}
I'm trying to follow the FetchEntity method behavior. I mean that I wouldn't like to return the entity, instead, I'd like to manipulate the one I have passed to my FillEntity method. BUT, after I set the entity to null, this one is still fetched with exceptions on the properties outside the method.
Isn't it supposed to remain as I modified it to null? but it's acting like a value type.
Am I right?
regards