Exemplo n.º 1
0
        /// <summary>
        /// Creates a new connected service.
        /// </summary>
        /// <param name="scope"></param>
        /// <param name="connector"></param>
        /// <param name="log"></param>
        /// <typeparam name="T"></typeparam>
        /// <returns>Returns the log of the operation.</returns>
        public static T CreateConnected <T>(
            this IBdoScope scope,
            IBdoConnector connector,
            IBdoLog log = null)
            where T : IBdoConnectedService, new()
        {
            var service = scope.CreateService <T>();

            var subLog = new BdoLog();

            service.WithConnector(connector);
            subLog.AddEventsTo(log);


            if (subLog.HasErrorsOrExceptions())
            {
                return(default);