public static PerCallContext Begin(IPerCallDataProvider provider, string operation, string input)
        {
            var ret = new PerCallContext();

            //We find the cost for this call
            decimal cost = provider.GetOperationCost(operation);


            //We put a row into the DataProviderCall table
            ret.Call = new DataProviderCall
            {
                DataProviderCallId = Guid.NewGuid(),
                ActivityId         = BrokerContext.Current.ActivityId,
                CallTime           = DateTime.Now,
                Cost             = cost,
                Input            = input,
                DataProviderType = provider.GetType().ToString(),
                Operation        = operation,
                Success          = null,
            };

            ret.DataContext = new ApplicationDataContext();
            ret.DataContext.DataProviderCalls.InsertOnSubmit(ret.Call);
            ret.DataContext.SubmitChanges();

            return(ret);
        }
 public static PerCallContext BeginCall(this IPerCallDataProvider provider, string operation, string input)
 {
     return(PerCallContext.Begin(provider, operation, input));
 }