示例#1
0
 public ProjectionMapper(IContainer container, SqlDataReader reader, JsonSerializerSettings jsonSerializerSettings, RelationalMappings mappings)
 {
     _container = container;
     _mappings  = mappings;
     _reader    = reader;
     _jsonSerializerSettings = jsonSerializerSettings;
 }
示例#2
0
 public Transaction(IContainer container, string connectionString, IsolationLevel isolationLevel, JsonSerializerSettings jsonSerializerSettings, RelationalMappings mappings)
 {
     _jsonSerializerSettings = jsonSerializerSettings;
     _mappings   = mappings;
     _connection = new SqlConnection(connectionString);
     _connection.Open();
     _transaction = _connection.BeginTransaction(isolationLevel);
     CurrentTransactions.TryAdd(this, true);
     _container = container;
 }
示例#3
0
 public Store(IContainer container, IHomeConfiguration config, string connectionString, RelationalMappings mappings)
 {
     _container        = container;
     _config           = config;
     _mappings         = mappings;
     _connectionString = SetConnectionStringOptions(connectionString);
     _jsonSettings.ContractResolver = new RelationalJsonContractResolver(mappings);
     _jsonSettings.Converters.Add(new StringEnumConverter());
     _jsonSettings.Converters.Add(new VersionConverter());
     _jsonSettings.DateFormatHandling     = 0;
     _jsonSettings.DateTimeZoneHandling   = (DateTimeZoneHandling)3;
     _jsonSettings.TypeNameHandling       = (TypeNameHandling)4;
     _jsonSettings.TypeNameAssemblyFormat = FormatterAssemblyStyle.Simple;
 }
示例#4
0
        public static RelationalMappings CreateMappings()
        {
            RelationalMappings   relationalMappings = new RelationalMappings();
            List <EntityMapping> list =
                typeof(StoreFactory).Assembly.GetTypes().Where(
                    type => typeof(EntityMapping).IsAssignableFrom(type))
                .Where(type =>
            {
                if (type.IsClass)
                {
                    return(!type.IsAbstract && !type.ContainsGenericParameters);
                }
                return(false);
            })
                .Select(
                    type => Activator.CreateInstance(type) as EntityMapping)
                .ToList();

            relationalMappings.Install(list);
            return(relationalMappings);
        }
 public RelationalJsonContractResolver(RelationalMappings mappings)
 {
     _mappings = mappings;
 }