public static StoreDto ToDtoWithRelated(this ContosoUniversity.DAL.SalesModel.Store source, int level)
        {
            if (source == null)
            {
                return(null);
            }

            var target = new StoreDto();

            // Properties
            target.Name   = source.Name;
            target.Id     = source.Id;
            target.Active = source.Active;

            // Navigation Properties
            if (level > 0)
            {
                target.ItemStores = source.ItemStores.ToDtosWithRelated(level - 1);
            }

            // User-defined partial method
            OnDtoCreating(source, target);

            return(target);
        }
        public static ContosoUniversity.DAL.SalesModel.Store ToEntity(this StoreDto source)
        {
            if (source == null)
            {
                return(null);
            }

            var target = new ContosoUniversity.DAL.SalesModel.Store();

            // Properties
            target.Name   = source.Name;
            target.Id     = source.Id;
            target.Active = source.Active;

            // User-defined partial method
            OnEntityCreating(source, target);

            return(target);
        }
 static partial void OnEntityCreating(StoreDto source, ContosoUniversity.DAL.SalesModel.Store target);
 public static StoreDto ToDto(this ContosoUniversity.DAL.SalesModel.Store source)
 {
     return(source.ToDtoWithRelated(0));
 }
 static partial void OnDtoCreating(ContosoUniversity.DAL.SalesModel.Store source, StoreDto target);