D
DabblerNL
I have the following Methods:
public SecondResult DoSomething()
{
FirstResult firstResult=GetFirstResult();
SecondResult secondResult=GetSecondResult(firstResult);
return secondResult;
}
private FirstResult GetFirstResult()
{...}
private SecondResult(FirstResult fr)
{...}
The Method GetSecondResult should only and only then be called after
GetFirstResult has been called. To achieve that I want that the only way to
obtain a SecondResult object is through calling the FirstResult method.
This compares to the IOrderedEnumerable<T> type that is returned from the
OrderBy and OrderByDescending(IEnumerable<T>) methods, so that it is ensured
that the ThenBy and ThenByDescending(IOrderedEnumerable<T>) methods can only
be used after application of a OrderBy method.
How do I achieve this?
public SecondResult DoSomething()
{
FirstResult firstResult=GetFirstResult();
SecondResult secondResult=GetSecondResult(firstResult);
return secondResult;
}
private FirstResult GetFirstResult()
{...}
private SecondResult(FirstResult fr)
{...}
The Method GetSecondResult should only and only then be called after
GetFirstResult has been called. To achieve that I want that the only way to
obtain a SecondResult object is through calling the FirstResult method.
This compares to the IOrderedEnumerable<T> type that is returned from the
OrderBy and OrderByDescending(IEnumerable<T>) methods, so that it is ensured
that the ThenBy and ThenByDescending(IOrderedEnumerable<T>) methods can only
be used after application of a OrderBy method.
How do I achieve this?