Usefull page for that
But it did not realy have what i wanted from it.
So the final solution was the following
to get a format like this:
2008-11-13 17:29:00
SET generated = cast( getdate() - 8 as smalldatetime)
SET generated = cast( getdate() - 8 as smalldatetime)
http://www.codeproject.com/KB/aspnet/IOCDI.aspx
Conlusion
Inversion of control is a principle with the goal to help you create better, more reusable code
Dependency injection is a specific method of achieving inversion of control.(Unity is a method for dependency injection)
This interface defines the service that is used to resolve URL paths. The IUrlResolutionService interface is used for resolving relative paths and paths that contain the ~ operator. Server controls that reference resources can define the paths to the resources through the ~ operator, which represents the root of the current application. A path containing the ~ operator will not work if passed to the browser. The server control must convert the path to an absolute or relative path before passing it to the browser.
Control implements this interface. A control that derives from Control could override this implementation to provide customized resolution of URLs.
void Process(){
Func<bool>[] steps = {
Step1,
Step2,
Step3,
Step4,
Step5
};
}
void ExecuteStepsUntilFirstFailure(IEnumerable<Func<bool>> steps)
{
steps.All(step => step() == true);
}
The All operator is documented as stopping as soon as a result can be determined, so the above code is equivalent to the following:
void ExecuteStepsUntilFirstFailure(IEnumerable<Func<bool>> steps)
{
foreach (var step in steps)
{
if (step() == false)
{
break;
}
}
}