コード例 #1
0
ファイル: CherrySeeder.cs プロジェクト: hur1can3/CherrySeed
        public CherrySeeder(Action <ISeederConfigurationBuilder> configurationExpression)
        {
            _entityMetadataDict = new Dictionary <Type, EntityMetadata>();
            _idMappingProvider  = new IdMappingProvider();

            var configBuilder = new SeederConfigurationBuilder();

            configurationExpression(configBuilder);
            _configuration = configBuilder.Build();

            _objectListTransformation = new ObjectListTransformation(
                new ObjectTransformation.ObjectTransformation(
                    new PropertyHandler(
                        _idMappingProvider,
                        new TypeTransformationProvider(_configuration.TypeTransformations)
                        )
                    )
                );

            foreach (var entitySetting in _configuration.EntitySettings)
            {
                _entityMetadataDict.Add(entitySetting.EntityType, new EntityMetadata
                {
                    EntityType    = entitySetting.EntityType,
                    EntitySetting = entitySetting
                });
            }
        }
コード例 #2
0
ファイル: CherrySeeder.cs プロジェクト: hur1can3/CherrySeed
 private List <object> Transform(Type type, List <Dictionary <string, string> > inputObjectDictionary,
                                 ObjectListTransformation objectListTransformation, EntitySetting entitySetting)
 {
     return(objectListTransformation.Transform(type, inputObjectDictionary, entitySetting));
 }