/// <summary>
		/// Converting to foundation type
		/// </summary>
		/// <param name="catalog"></param>
		/// <returns></returns>
		public static dataModel.CatalogLanguage ToDataModel(this coreModel.CatalogLanguage language)
		{
			var retVal = new dataModel.CatalogLanguage
			{
				Language = language.LanguageCode,
			};

			return retVal;
		}
Пример #2
0
        /// <summary>
        /// Converting to foundation type
        /// </summary>
        /// <param name="catalog"></param>
        /// <returns></returns>
        public static dataModel.CatalogLanguage ToDataModel(this coreModel.CatalogLanguage language)
        {
            var retVal = new dataModel.CatalogLanguage
            {
                Language = language.LanguageCode,
            };

            return(retVal);
        }
Пример #3
0
        /// <summary>
        /// Patch CatalogLanguage type
        /// </summary>
        /// <param name="source"></param>
        /// <param name="target"></param>
        public static void Patch(this dataModel.CatalogLanguage source, dataModel.CatalogLanguage target)
        {
            if (target == null)
            {
                throw new ArgumentNullException("target");
            }

            var patchInjectionPolicy = new PatchInjection <dataModel.CatalogLanguage>(x => x.Language);

            target.InjectFrom(patchInjectionPolicy, source);
        }
Пример #4
0
        /// <summary>
        /// Converting to model type
        /// </summary>
        /// <param name="catalogBase"></param>
        /// <returns></returns>
        public static coreModel.CatalogLanguage ToCoreModel(this dataModel.CatalogLanguage dbLanguage, coreModel.Catalog catalog)
        {
            var retVal = new coreModel.CatalogLanguage();

            retVal.Id = dbLanguage.Id;

            retVal.CatalogId    = catalog.Id;
            retVal.LanguageCode = dbLanguage.Language;

            return(retVal);
        }
        public virtual CatalogLanguage ToModel(CatalogLanguage lang)
        {
            if (lang == null)
            {
                throw new ArgumentNullException(nameof(lang));
            }

            lang.Id           = this.Id;
            lang.CatalogId    = this.Id;
            lang.LanguageCode = this.Language;

            return(lang);
        }
        public virtual CatalogLanguageEntity FromModel(CatalogLanguage lang, PrimaryKeyResolvingMap pkMap)
        {
            if (lang == null)
            {
                throw new ArgumentNullException(nameof(lang));
            }

            pkMap.AddPair(lang, this);

            Id        = lang.Id;
            CatalogId = lang.Id;
            Language  = lang.LanguageCode;

            return(this);
        }
Пример #7
0
		public void Tst1()
		{
			var repository = GetRepository();
			var catalog = new dataModel.Catalog
			{
				Id = "sss",
				 Name = "test",
				 DefaultLanguage = "en-us"
			};
			var language = new dataModel.CatalogLanguage
			{
				 Language = "sss"
			};
			catalog.CatalogLanguages.Add(language);
			repository.Add(catalog);
			repository.UnitOfWork.Commit();
		}
Пример #8
0
        public void Tst1()
        {
            var repository = GetRepository();
            var catalog    = new dataModel.Catalog
            {
                Id              = "sss",
                Name            = "test",
                DefaultLanguage = "en-us"
            };
            var language = new dataModel.CatalogLanguage
            {
                Language = "sss"
            };

            catalog.CatalogLanguages.Add(language);
            repository.Add(catalog);
            repository.UnitOfWork.Commit();
        }