Exemplo n.º 1
0
 public static IEnumerable <Tuple <ColumnMappingBuilder, System.Data.Entity.Core.Metadata.Edm.EntityType> > GetComplexPropertyMappings(
     this DbDatabaseMapping databaseMapping,
     Type complexType)
 {
     return(databaseMapping.EntityContainerMappings.Single <EntityContainerMapping>().EntitySetMappings.SelectMany((Func <EntitySetMapping, IEnumerable <EntityTypeMapping> >)(esm => (IEnumerable <EntityTypeMapping>)esm.EntityTypeMappings), (esm, etm) => new
     {
         esm = esm,
         etm = etm
     }).SelectMany(_param0 => (IEnumerable <MappingFragment>)_param0.etm.MappingFragments, (_param0, etmf) => new
     {
         \u003C\u003Eh__TransparentIdentifiera = _param0,
         etmf = etmf
     }).SelectMany(_param0 => _param0.etmf.ColumnMappings, (_param0, epm) => new
     {
         \u003C\u003Eh__TransparentIdentifierb = _param0,
         epm = epm
     }).Where(_param1 => _param1.epm.PropertyPath.Any <EdmProperty>((Func <EdmProperty, bool>)(p =>
     {
         if (p.IsComplexType)
         {
             return ComplexTypeExtensions.GetClrType(p.ComplexType) == complexType;
         }
         return false;
     }))).Select(_param0 => Tuple.Create <ColumnMappingBuilder, System.Data.Entity.Core.Metadata.Edm.EntityType>(_param0.epm, _param0.\u003C\u003Eh__TransparentIdentifierb.etmf.Table)));
 }
Exemplo n.º 2
0
 public static IEnumerable <ModificationFunctionParameterBinding> GetComplexParameterBindings(
     this DbDatabaseMapping databaseMapping,
     Type complexType)
 {
     return(databaseMapping.GetEntitySetMappings().SelectMany((Func <EntitySetMapping, IEnumerable <EntityTypeModificationFunctionMapping> >)(esm => (IEnumerable <EntityTypeModificationFunctionMapping>)esm.ModificationFunctionMappings), (esm, mfm) => new
     {
         esm = esm,
         mfm = mfm
     }).SelectMany(_param0 => _param0.mfm.PrimaryParameterBindings, (_param0, pb) => new
     {
         \u003C\u003Eh__TransparentIdentifier1f = _param0,
         pb = pb
     }).Where(_param1 => _param1.pb.MemberPath.Members.OfType <EdmProperty>().Any <EdmProperty>((Func <EdmProperty, bool>)(p =>
     {
         if (p.IsComplexType)
         {
             return ComplexTypeExtensions.GetClrType(p.ComplexType) == complexType;
         }
         return false;
     }))).Select(_param0 => _param0.pb));
 }
Exemplo n.º 3
0
        public static Type GetClrType(this EdmType item)
        {
            EntityType entityType = item as EntityType;

            if (entityType != null)
            {
                return(EntityTypeExtensions.GetClrType(entityType));
            }
            EnumType enumType = item as EnumType;

            if (enumType != null)
            {
                return(EnumTypeExtensions.GetClrType(enumType));
            }
            ComplexType complexType = item as ComplexType;

            if (complexType != null)
            {
                return(ComplexTypeExtensions.GetClrType(complexType));
            }
            return((Type)null);
        }
Exemplo n.º 4
0
 public static ComplexType GetComplexType(this EdmModel model, Type clrType)
 {
     return(model.ComplexTypes.SingleOrDefault <ComplexType>((Func <ComplexType, bool>)(e => ComplexTypeExtensions.GetClrType(e) == clrType)));
 }
Exemplo n.º 5
0
 public static IEnumerable <Type> GetClrTypes(this EdmModel model)
 {
     return(model.EntityTypes.Select <System.Data.Entity.Core.Metadata.Edm.EntityType, Type>((Func <System.Data.Entity.Core.Metadata.Edm.EntityType, Type>)(e => EntityTypeExtensions.GetClrType(e))).Union <Type>(model.ComplexTypes.Select <ComplexType, Type>((Func <ComplexType, Type>)(ct => ComplexTypeExtensions.GetClrType(ct)))));
 }