public static webModel.ApiAccount ToWebModel(this dataModel.ApiAccountEntity account)
        {
            var result = new webModel.ApiAccount();

            result.InjectFrom(account);

            result.Id             = account.Id;
            result.ApiAccountType = (webModel.ApiAccountType)account.ApiAccountType;
            result.IsActive       = account.IsActive;

            return(result);
        }
        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);
        }