コード例 #1
0
        /// <summary>
        /// Patch changes
        /// </summary>
        /// <param name="source"></param>
        /// <param name="target"></param>
        public static void Patch(this dataModel.ApiAccountEntity source, dataModel.ApiAccountEntity target)
        {
            if (target == null)
            {
                throw new ArgumentNullException("target");
            }

            var patchInjection = new PatchInjection <dataModel.ApiAccountEntity>(x => x.Name, x => x.ApiAccountType, x => x.IsActive, x => x.SecretKey, x => x.AppId);

            target.InjectFrom(patchInjection, source);
        }
コード例 #2
0
        public static dataModel.ApiAccountEntity ToDataModel(this ApiAccount model)
        {
            var result = new dataModel.ApiAccountEntity();
            result.InjectFrom(model);

            if (model.Id != null)
            {
                result.Id = model.Id;
            }

            if (model.IsActive != null)
            {
                result.IsActive = model.IsActive.Value;
            }

            result.ApiAccountType = model.ApiAccountType;

            return result;
        }
コード例 #3
0
        public static dataModel.ApiAccountEntity ToDataModel(this ApiAccount model)
        {
            var result = new dataModel.ApiAccountEntity();

            result.InjectFrom(model);

            if (model.Id != null)
            {
                result.Id = model.Id;
            }

            if (model.IsActive != null)
            {
                result.IsActive = model.IsActive.Value;
            }

            result.ApiAccountType = model.ApiAccountType;

            return(result);
        }
コード例 #4
0
        public static dataModel.ApiAccountEntity ToFoundation(this webModel.ApiAccount account)
        {
            var result = new dataModel.ApiAccountEntity();

            result.InjectFrom(account);

            if (account.Id != null)
            {
                result.Id = account.Id;
            }

            if (account.IsActive != null)
            {
                result.IsActive = account.IsActive.Value;
            }

            result.ApiAccountType = (dataModel.ApiAccountType)account.ApiAccountType;

            return(result);
        }