dimanche 27 mars 2016

how to convert reflection from wp8.1 silverlight to wp8.1

I am using vs2015, I developed an app in wp7.1 Silverlight. i upgraded it to wp8.1 Silverlight. When i try to publish it to the store it does not pass the certification. i made some tests and i decided to convert it to wp8.1 to pass the certification.

During the process of conversion from wp8.1 Silverlight to wp8.1, I have some difficulties in reflection because it is not the same as in win8.1 Silverlight.

I have this method (in wp8.1 Silverlight compile without errors). could some one help me to write it in wp8.1.

  public ByConventionMapperStrategy(Type entityType, bool publicOnly)
        : base(entityType, publicOnly)
    {
        //map members that are properties
        ColumnPredicate = m => m.MemberType == MemberTypes.Property;

        //map members that are properties and icollection types.
        RelationshipPredicate = m =>
            {
                return m.MemberType == MemberTypes.Property && typeof(ICollection).IsAssignableFrom((m as PropertyInfo).PropertyType);
            };
    }

    public Func<MemberInfo, bool> ColumnPredicate;
    public Func<MemberInfo, bool> RelationshipPredicate;

excuse me for my English. thank you for help.





Aucun commentaire:

Enregistrer un commentaire