Exemplo n.º 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;
		}
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 4
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;
		}
Exemplo n.º 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);
        }