Пример #1
0
        public IResultMapper <TView> Select <TView>(
            ProjectionModel <TEntity, TView> projectionModel
            ) where TView : class
        {
            var(fields, joins) = projectionModel.GetProjectedFields(_tableIdentifier);
            _joinBuilders.AddRange(joins);
            foreach (var kvp in fields)
            {
                if (_projectionExpressions.ContainsKey(kvp.Key))
                {
                    continue;
                }
                _projectionExpressions.Add(kvp.Key, kvp.Value);
            }

            return(new EntityTypeMapper <TEntity, TView>(
                       _dataModel.StorageModel,
                       projectionModel.StorageToEntityMapping,
                       projectionModel.EntityToViewMapping,
                       _objectFactory
                       ));
        }
Пример #2
0
 public Mapping.IResultMapper <TView> Select <TView>(ProjectionModel <TEntity, TView> projectionModel) where TView : class
 => _projectionBuilder.Select(projectionModel);