Пример #1
0
		/// <summary>
		/// Converting to foundation type
		/// </summary>
		public static dataModel.Asset ToDataModel(this coreModel.Asset asset, PrimaryKeyResolvingMap pkMap)
		{
			if (asset == null)
				throw new ArgumentNullException("asset");

			var retVal = new dataModel.Asset();
            pkMap.AddPair(asset, retVal);
            retVal.InjectFrom(asset);
			return retVal;
		}
Пример #2
0
        /// <summary>
        /// Patch changes
        /// </summary>
        /// <param name="source"></param>
        /// <param name="target"></param>
        public static void Patch(this dataModel.Asset source, dataModel.Asset target)
        {
            if (target == null)
            {
                throw new ArgumentNullException("target");
            }

            var patchInjectionPolicy = new PatchInjection <dataModel.Asset>(x => x.LanguageCode, x => x.Name);

            target.InjectFrom(patchInjectionPolicy, source);
        }
Пример #3
0
        /// <summary>
        /// Converting to foundation type
        /// </summary>
        public static dataModel.Asset ToDataModel(this coreModel.Asset asset, PrimaryKeyResolvingMap pkMap)
        {
            if (asset == null)
            {
                throw new ArgumentNullException("asset");
            }

            var retVal = new dataModel.Asset();

            pkMap.AddPair(asset, retVal);
            retVal.InjectFrom(asset);
            return(retVal);
        }
Пример #4
0
        /// <summary>
        /// Converting to model type
        /// </summary>
        /// <param name="catalogBase"></param>
        /// <returns></returns>
        public static coreModel.Asset ToCoreModel(this dataModel.Asset dbAsset)
        {
            if (dbAsset == null)
            {
                throw new ArgumentNullException("dbAsset");
            }

            var retVal = new coreModel.Asset();

            retVal.InjectFrom(dbAsset);

            return(retVal);
        }
Пример #5
0
		/// <summary>
		/// Converting to foundation type
		/// </summary>
		public static dataModel.Asset ToDataModel(this coreModel.Asset asset)
		{
			if (asset == null)
				throw new ArgumentNullException("asset");

			var retVal = new dataModel.Asset();
			var id = retVal.Id;
			retVal.InjectFrom(asset);
			if (asset.Id == null)
			{
				retVal.Id = id;
			}
			return retVal;
		}
Пример #6
0
        /// <summary>
        /// Converting to foundation type
        /// </summary>
        public static dataModel.Asset ToDataModel(this coreModel.Asset asset)
        {
            if (asset == null)
            {
                throw new ArgumentNullException("asset");
            }

            var retVal = new dataModel.Asset();
            var id     = retVal.Id;

            retVal.InjectFrom(asset);
            if (asset.Id == null)
            {
                retVal.Id = id;
            }
            return(retVal);
        }