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 OnDtoCreating(ContosoUniversity.DAL.SalesModel.Store source, StoreDto target);
 static partial void OnEntityCreating(StoreDto source, ContosoUniversity.DAL.SalesModel.Store target);
 public ItemStoreDto(long id, int minLimit, int maxLimit, int quantity, long itemId, int storeId, ItemDto item, StoreDto store)
 {
     this.Id       = id;
     this.MinLimit = minLimit;
     this.MaxLimit = maxLimit;
     this.Quantity = quantity;
     this.ItemId   = itemId;
     this.StoreId  = storeId;
     this.Item     = item;
     this.Store    = store;
 }