Example #1
0
        protected override async Task <List <AccountForSave> > SavePreprocessAsync(List <AccountForSave> entities)
        {
            // Defaults
            entities.ForEach(entity =>
            {
                // Can't have a custody without the custody definition
                if (entity.CustodyDefinitionId == null)
                {
                    entity.CustodyId = null;
                }

                // Can't have a resource without the resource definition
                if (entity.ResourceDefinitionId == null)
                {
                    entity.ResourceId = null;
                }
            });

            // SQL Preprocessing
            await _repo.Accounts__Preprocess(entities);

            return(entities);
        }
Example #2
0
        protected override async Task <List <AccountForSave> > SavePreprocessAsync(List <AccountForSave> entities)
        {
            // Defaults
            //var settings = _settingsCache.GetCurrentSettingsIfCached().Data;
            entities.ForEach(result =>
            {
                result.IsCurrent ??= false;
                result.HasResource ??= false;
                result.HasAgent ??= false;
                result.IsRelated ??= false;
                result.HasExternalReference ??= false;
                result.HasAdditionalReference ??= false;
                result.HasNotedAgentId ??= false;
                result.HasNotedAgentName ??= false;
                result.HasNotedAmount ??= false;
                result.HasNotedDate ??= false;
            });

            // SQL Preprocessing
            await _repo.Accounts__Preprocess(entities);

            return(entities);
        }