示例#1
0
 internal TypeMapping(MappingModel model, Type type, string tableName)
 {
     Model = model;
     Type = type;
     TableName = tableName;
     memberMappings = new Dictionary<string, MemberMapping>();
 }
示例#2
0
 internal TypeMapping(MappingModel model, Type type, string tableName)
 {
     Model          = model;
     Type           = type;
     TableName      = tableName;
     memberMappings = new Dictionary <string, MemberMapping>();
 }
示例#3
0
        private TypeMapping CreateTypeMapping(MappingModel model, ITypeMappingConfiguration configuration)
        {
            var tableName = GetTableName(configuration);
            var mapping   = new TypeMapping(model, configuration.ElementType, tableName);

            foreach (var pair in configuration.Members)
            {
                var member        = pair.Value;
                var memberMapping = MapMember(mapping, member);
                mapping.AddMember(memberMapping);
            }

            return(mapping);
        }
        public ProviderSettings(string userName, string password, MappingModel model)
        {
            if (String.IsNullOrEmpty(userName))
                throw new ArgumentNullException("userName");
            if (String.IsNullOrEmpty(password))
                throw new ArgumentNullException("password");
            if (model == null)
                throw new ArgumentNullException("model");

            UserName = userName;
            Password = password;
            MappingModel = model;

            Metadata = new Dictionary<string, object>(StringComparer.OrdinalIgnoreCase);
        }
示例#5
0
        internal MappingModel CreateModel()
        {
            var model = new MappingModel();

            if (configurations != null)
            {
                foreach (var configuration in configurations.Values)
                {
                    var mapping = CreateTypeMapping(model, configuration);

                    // TODO: make relationships...

                    model.Map(mapping);
                }
            }

            return(model);
        }
 public static IQueryProvider GetQueryProvider(this IQuery context, MappingModel model)
 {
     var queryMapping = model.CreateQueryMapping();
     return new DeveelDbProvider(context, queryMapping, new EntityPolicy());
 }
示例#7
0
 public DeveelDbMapping(MappingModel model)
 {
     Model = model;
 }