This question is locked. New answers and comments are not allowed.
I am uploading few files and i want to return their ids to client.
What i am do for that:
List<int> _listOfIds
public override Dictionary<string, object> GetAssociatedData()
{
if (IsFinalUploadRequest())
{
dict.Add("MyIds", _listOfIds);
}
}
public override void ProcessStream()
{
base.ProcessStream();
if (IsFinalUploadRequest())
{
//CODE to save item to database.
int savedId=SomeId();
_listOfIds.Add(savedId );
}
}
Problem here that GetAssociatedData is called earlier than i will recieve item ID!! What i suppose to do?
Can i send GetAssociatedData() after my manipulations to store data in DB?
What i am do for that:
List<int> _listOfIds
public override Dictionary<string, object> GetAssociatedData()
{
if (IsFinalUploadRequest())
{
dict.Add("MyIds", _listOfIds);
}
}
public override void ProcessStream()
{
base.ProcessStream();
if (IsFinalUploadRequest())
{
//CODE to save item to database.
int savedId=SomeId();
_listOfIds.Add(savedId );
}
}
Problem here that GetAssociatedData is called earlier than i will recieve item ID!! What i suppose to do?
Can i send GetAssociatedData() after my manipulations to store data in DB?