public static Business.CreateOrUpdateContainerParameters TranslateFromServiceToBusiness(DataContracts.CreateOrUpdateContainerParameters serviceItem)
        {
            if (serviceItem == null)
            {
                return(null);
            }

            Business.CreateOrUpdateContainerParameters businessItem = new Business.CreateOrUpdateContainerParameters();
            businessItem.Container = ContainerTranslator.TranslateFromServiceToBusiness(serviceItem.Container);

            return(businessItem);
        }
        public static DataContracts.CreateOrUpdateContainerParameters TranslateFromBusinessToService(Business.CreateOrUpdateContainerParameters businessItem)
        {
            if (businessItem == null)
            {
                return(null);
            }


            DataContracts.CreateOrUpdateContainerParameters serviceItem = new DataContracts.CreateOrUpdateContainerParameters();
            serviceItem.Container = ContainerTranslator.TranslateFromBusinessToService(businessItem.Container);

            return(serviceItem);
        }
Exemple #3
0
        public static IList <Business.Container> TranslateFromServiceToBusiness(DataContracts.FindContainerResult serviceItems)
        {
            if (serviceItems == null)
            {
                return(null);
            }

            IList <Business.Container> businessItems = new List <Business.Container>();

            foreach (DataContracts.Container serviceItem in serviceItems)
            {
                businessItems.Add(ContainerTranslator.TranslateFromServiceToBusiness(serviceItem));
            }

            return(businessItems);
        }
Exemple #4
0
        public static DataContracts.FindContainerResult TranslateFromBusinessToService(IList <Business.Container> businessItems)
        {
            if (businessItems == null)
            {
                return(null);
            }

            DataContracts.FindContainerResult serviceItems = new DataContracts.FindContainerResult();

            try
            {
                foreach (Business.Container businessItem in businessItems)
                {
                    serviceItems.Add(ContainerTranslator.TranslateFromBusinessToService(businessItem));
                }
            }
            catch (Exception) // Ignory lazy load errors
            {
            }

            return(serviceItems);
        }