Exemple #1
0
        public DSS1_RetailerDriverStockOptimisation.BO.RequestLog Hit_To_RequestLog(DSS1_RetailerDriverStockOptimisation.ExternalStructs.Elasticsearch.Hit interfacesElasticsearchHitInput)
        {
            //Leave, if there is nothing to transform
            if (interfacesElasticsearchHitInput == null)
            {
                return(default(DSS1_RetailerDriverStockOptimisation.BO.RequestLog));
            }
            // If the same Transformation has already ran, get the stored Output and return
            if (Hit_To_RequestLog_Transformations.ContainsKey(interfacesElasticsearchHitInput))
            {
                return(Hit_To_RequestLog_Transformations[interfacesElasticsearchHitInput]);
            }
            // Instantiate target root
            var domainRequestLogOutput = new DSS1_RetailerDriverStockOptimisation.BO.RequestLog();

            Hit_To_RequestLog_Transformations.Add(interfacesElasticsearchHitInput, domainRequestLogOutput);
            // Hit.RequestUri to RequestLog.RequestUri
            domainRequestLogOutput.RequestUri = interfacesElasticsearchHitInput?.RequestUri;
            // Hit.Username to RequestLog.Username
            domainRequestLogOutput.Username = interfacesElasticsearchHitInput?.Username;
            // Hit.Operation to RequestLog.Operation
            domainRequestLogOutput.Operation = interfacesElasticsearchHitInput?.Operation;
            // Hit.Message to RequestLog.Message
            domainRequestLogOutput.Message = interfacesElasticsearchHitInput?.Message;
            // Hit.RequestId to RequestLog.RequestId
            domainRequestLogOutput.RequestId = interfacesElasticsearchHitInput?.RequestId;
            // Hit.RequestMethod to RequestLog.RequestMethod
            domainRequestLogOutput.RequestMethod = interfacesElasticsearchHitInput?.RequestMethod;
            // Hit.ElapsedMsecs to RequestLog.ElapsedMsecs
            domainRequestLogOutput.ElapsedMsecs = interfacesElasticsearchHitInput?.ElapsedMsecs == null ? null : zAppDev.DotNet.Framework.Utilities.Common.ConvertToNullableDouble(interfacesElasticsearchHitInput?.ElapsedMsecs.ToString());
            // Hit.IP to RequestLog.IP
            domainRequestLogOutput.IP = interfacesElasticsearchHitInput?.IP;
            // Hit.Service to RequestLog.Service
            domainRequestLogOutput.Service = interfacesElasticsearchHitInput?.Service;
            // Hit.RequestPath to RequestLog.RequestPath
            domainRequestLogOutput.RequestPath = interfacesElasticsearchHitInput?.RequestPath;
            // Hit.StatusCode to RequestLog.StatusCode
            domainRequestLogOutput.StatusCode = interfacesElasticsearchHitInput?.StatusCode.ToString();
            // Hit.Timestamp to RequestLog.Timestamp
            domainRequestLogOutput.Timestamp = interfacesElasticsearchHitInput?.Timestamp.ToString();
            // Hit.ClientId to RequestLog.ClientId
            domainRequestLogOutput.ClientId = interfacesElasticsearchHitInput?.ClientId;
            // Hit.ClientName to RequestLog.ClientName
            domainRequestLogOutput.ClientName = interfacesElasticsearchHitInput?.ClientName;
            // Hit.Product to RequestLog.ProductName
            domainRequestLogOutput.ProductName = interfacesElasticsearchHitInput?.Product;
            return(domainRequestLogOutput);
        }
Exemple #2
0
        public DSS1_RetailerDriverStockOptimisation.ExternalStructs.Elasticsearch.Hit Hit_To_RequestLogReversed(DSS1_RetailerDriverStockOptimisation.BO.RequestLog domainRequestLogInput, DSS1_RetailerDriverStockOptimisation.ExternalStructs.Elasticsearch.Hit interfacesElasticsearchHitInstance)
        {
            //Leave, if there is nothing to transform
            if (domainRequestLogInput == null)
            {
                return(default(DSS1_RetailerDriverStockOptimisation.ExternalStructs.Elasticsearch.Hit));
            }
            if (interfacesElasticsearchHitInstance == null)
            {
                return(Hit_To_RequestLogReversed(domainRequestLogInput));
            }
            // If the same Transformation has already ran, get the stored Output and return
            if (Hit_To_RequestLogReversed_MappingTransformations.ContainsKey(domainRequestLogInput))
            {
                return(Hit_To_RequestLogReversed_MappingTransformations[domainRequestLogInput]);
            }
            // Instantiate target root
            var interfacesElasticsearchHitOutput = interfacesElasticsearchHitInstance;

            Hit_To_RequestLogReversed_MappingTransformations.Add(domainRequestLogInput, interfacesElasticsearchHitOutput);
            // RequestLog.RequestUri to Hit.RequestUri
            interfacesElasticsearchHitOutput.RequestUri = domainRequestLogInput?.RequestUri;
            // RequestLog.Username to Hit.Username
            interfacesElasticsearchHitOutput.Username = domainRequestLogInput?.Username;
            // RequestLog.Operation to Hit.Operation
            interfacesElasticsearchHitOutput.Operation = domainRequestLogInput?.Operation;
            // RequestLog.Message to Hit.Message
            interfacesElasticsearchHitOutput.Message = domainRequestLogInput?.Message;
            // RequestLog.RequestId to Hit.RequestId
            interfacesElasticsearchHitOutput.RequestId = domainRequestLogInput?.RequestId;
            // RequestLog.RequestMethod to Hit.RequestMethod
            interfacesElasticsearchHitOutput.RequestMethod = domainRequestLogInput?.RequestMethod;
            // RequestLog.ElapsedMsecs to Hit.ElapsedMsecs
            interfacesElasticsearchHitOutput.ElapsedMsecs = domainRequestLogInput?.ElapsedMsecs == null ? null : zAppDev.DotNet.Framework.Utilities.Common.ConvertToNullableFloat(domainRequestLogInput?.ElapsedMsecs.ToString());
            // RequestLog.IP to Hit.IP
            interfacesElasticsearchHitOutput.IP = domainRequestLogInput?.IP;
            // RequestLog.Service to Hit.Service
            interfacesElasticsearchHitOutput.Service = domainRequestLogInput?.Service;
            // RequestLog.RequestPath to Hit.RequestPath
            interfacesElasticsearchHitOutput.RequestPath = domainRequestLogInput?.RequestPath;
            // RequestLog.StatusCode to Hit.StatusCode
            interfacesElasticsearchHitOutput.StatusCode = zAppDev.DotNet.Framework.Utilities.Common.ConvertToNullableInt(domainRequestLogInput?.StatusCode.ToString());
            // RequestLog.Timestamp to Hit.Timestamp
            interfacesElasticsearchHitOutput.Timestamp = zAppDev.DotNet.Framework.Utilities.Common.ConvertToNullableDateTime(domainRequestLogInput?.Timestamp.ToString());
            // RequestLog.ClientId to Hit.ClientId
            interfacesElasticsearchHitOutput.ClientId = domainRequestLogInput?.ClientId;
            // RequestLog.ClientName to Hit.ClientName
            interfacesElasticsearchHitOutput.ClientName = domainRequestLogInput?.ClientName;
            // RequestLog.ProductName to Hit.Product
            interfacesElasticsearchHitOutput.Product = domainRequestLogInput?.ProductName;
            return(interfacesElasticsearchHitOutput);
        }