Пример #1
0
        private static void CreateDataSource()
        {
            DataSources = Settings.Get <List <DataSource> >("DataSources").ToDictionary(p => p.Name, q => q);
            DataSources.Values.ForEach(p =>
            {
                p.Entities.Split(new char[] { ',', ',', ';', ';' }, StringSplitOptions.RemoveEmptyEntries).ForEach(q =>
                {
                    var entityType = ConvertToEntityType(q.Trim());

                    if (!TableDescriptors.ContainsKey(entityType))
                    {
                        throw new Exception(string.Format("没有找到 {0} 的 TableDescriptor。", entityType.Name));
                    }
                    p.TableDescriptors[entityType] = TableDescriptors[entityType];
                });
            });
        }