private Action <TSource, object> GetSetter(DbContext context)
        {
            var path         = ExpressHelper.GetPath(_extractor);
            var propertyName = context.Db <TSource>().Properties.Single(o => o.NavigationProperty?.PropertyName == path).PropertyName;

            return(ExpressHelper.GetPropSetter <TSource, object>(propertyName).Compile());
        }
        private Action <TDestination, object> GetSetter(DbContext context)
        {
            var propertyName = _propertyName ?? context.Db <TDestination>()
                               .Properties.Single(o => o.NavigationProperty?.Type == typeof(TSource))
                               .PropertyName;

            return(ExpressHelper.GetPropSetter <TDestination, object>(propertyName).Compile());
        }
        public async Task RetrieveIdsLong <TEntity>(IContextAdapter context, TEntity[] entities)
        {
            var tableName = context.GetTableName <TEntity>();

            var entitiesLength = entities.Length;
            var minId          = Minus(await context.RunScalar <TValue>(RetrieveIdsSql(tableName, entitiesLength)), entitiesLength);
            var pkSetter       = ExpressHelper.GetPropSetter <TEntity, TValue>(context.GetPk <TEntity>().PropertyName).Compile();
            var id             = minId;

            foreach (var entity in entities)
            {
                id = AddOne(id);
                pkSetter(entity, id);
            }
        }