Hello dear all.
I have a problem with AddCallBack function. The thing is that I need to execute the stored procedure and return a value from it. But it should be when the UnitOfWork commit everything.
So, I have a procedure:
public static int SysCheckCountryRegionCity(System.String inZip, System.String inCity, System.String inRegion, System.String inCountry, ref System.Int64 outCtyId, IDataAccessCore dataAccessProvider)
{
using(StoredProcedureCall call = CreateSysCheckCountryRegionCityCall(dataAccessProvider, inZip, inCity, inRegion, inCountry, outCtyId))
{
int toReturn = call.Call();
outCtyId = call.GetParameterValue<System.Int64>(4);
return toReturn;
}
}
So, InternalSaveBirthCity didn't call back.
What did I do wrong? How to solve it?
Thank you.
This procedure returns some ID. How to obtain it from UnitOfWork.AddCallBack?
I tried to make a fake procedure and put it as callback delegate but it's doesn't work.
private void SaveBirthCity(PPW.Common.UnitOfWork aUnitOfWork)
{
if ((m_BirthCity != null) || (m_BirthZip != null) || (m_BirthRegion != null) || (m_BirthCountry != null))
{
aUnitOfWork.AddCallBack(new ActionProcedures.SysCheckCountryRegionCityCallBack(InternalSaveBirthCity),
UnitOfWorkCallBackScheduleSlot.PreEntityUpdate, m_BirthZip, m_BirthCity, m_BirthRegion, m_BirthCountry);
}
}
private int InternalSaveBirthCity(string aZip, string aCity, string aRegion, string aCountry, ref long aOutCtyId, IDataAccessCore aDataAccessProvider)
{
var temp = ActionProcedures.SysCheckCountryRegionCity(aZip, aCity, aRegion, aCountry, ref aOutCtyId, aDataAccessProvider);
BirthCityId = aOutCtyId;
ResetBirthZipCity();
return temp;
}