 | AgentFactoryFindById Method |
Find an agent using his identifier.
Namespace:
AskiaFieldCom
Assembly:
AskiaFieldCom (in AskiaFieldCom.dll) Version: 1.0.0.0 (1.0.0.0)
Syntaxpublic static IResult<IAgent> FindById(
IContext context,
int id
)
public:
static IResult<IAgent^>^ FindById(
IContext^ context,
int id
)
Parameters
- context
- Type: AskiaFieldComIContext
Context of execution. - id
- Type: SystemInt32
Identifier of the agent to find.
Return Value
Type:
IResultIAgent
Returns the instance of agent or a fail result.
Remarks
ExamplesFind an agent using his identifier.
var result = AgentFactory.FindById(context, 25);
if (!result.Success) throw result.Exception;
var agent = result.Value;
Console.WriteLine($"Agent {agent.FirstName} {agent.LastName} is found.");
See Also