I have a standard BusinessListBase class that needs to carry some private data given to it by the client app in the factory method. I then need this data during the DataPortal_Fetch() and DataPortal_Update() methods. Something like below...
When using LocalPortal it all works (no big surprise). But when using the WcfPortal the 2 Guids are always Guid.Empty (Default value for a Guid) in the DataPortal methods being executed remotley. I'm sure this is something stupid that the book explains perfectly well, but I can't find it.
THANKS FOR YOUR HELP IN ADVANCE
[Serializable] public class SystemList : BusinessListBase<SystemList, System>
{
private static Guid _UserUH;
private static Guid _CompanyUH;
public static SystemList GetSystemList(Guid UserUH, Guid CompanyUH, Guid UH)
{
_UserUH = UserUH;
_CompanyUH = CompanyUH;
return DataPortal.Fetch<SystemList>(new SingleCriteria<SystemList, Guid>(UH));
}
private void DataPortal_Fetch(SingleCriteria<SystemList, Guid> Criteria)
{
Access to _UserUH & _CompanyUH
}
protected override void DataPortal_Update()
{
Access to _UserUH & _CompanyUH
}
}
Thanks for your answer. I can see where that would work for the Fetch. But I also need the data available on the other side in DataPortal_Update() which takes no paramaters at all.
Again, why are these two fields declared as static?
If they were non-static member variables, they should be serialized across with your update (at least until you get into scenarios that require managed properties or your own serialization-assistance code like Silverlight).
I'd think the problem in this particular case is that the member variables in question are declared "static". I don't think static data ever gets serialized with an object instance.
Copyright (c) Marimer LLC