I am trying to return an integer parameter based on the incoming object type (entity in this case), but is uncertain of the format. Any help please?
entity.ID = db.Create(
entity.Name,
entity.Description,
entity.InitialStep != null ? (int?)entity.InitialStep.ID : null,
entity.IsPrivate,
entity.AllowOnBehalfSubmission,
new Func<int>{something needs to happen here and return an integer});
The lambda function you’re trying to call needs to be executed in the same context as the definition. By my understanding your object (entity) can be of several types and you want to set a parameter value based the object type? If so, modify your code along the following lines: