Code Monkey home page Code Monkey logo

pather.csharp's People

Contributors

domysee avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

pather.csharp's Issues

Non-Enumerable class with Indexer

NullReferenceException happens if you try to Resolve a indexer path on an object which does not implement IEnumerable

Test code:

    public class IndexerClassNoIEnumerable
    {
        private readonly string value;

        public IndexerClassNoIEnumerable(string value)
        {
            this.value = value;
        }

        public string this[int index] => value + index;
    }

    [TestMethod]
    public void Resolver_IndexerClassNoIEnumerable_ThrowsException()
    {
        var target = new IndexerClassNoIEnumerable("Test");
        var resolver = new Resolver();
        var path = "[123456]";

        var res = resolver.Resolve(target, path);
        // throws 
        // System.NullReferenceException: Object reference not set to an instance of an object.
        // at Pather.CSharp.PathElements.EnumerableAccess.Apply(Object target)
        // at Pather.CSharp.Resolver.Resolve(Object target, IList`1 pathElements)
        // at Pather.CSharp.Resolver.Resolve(Object target, String path)

        res.Should().Be("Test123456");
    }

Environment Variable Provider

This is a feature recommendation: supporting Environment Variable resolution. This could search for a match in the natural progression from process => user => computer level environment settings.

Dealing with paths through nullable objects

Inevitably, when using the path through an object, you come across the case where an object in the path is null. As expected this causes an exception. Is there any way to deal with this in a similar way to the c#6 syntax e.g. myproperty?.mySubproperty

Really handy little library by the way :)

.Net Standard Library Dependency

I like your work.
One thing I noticed is the dependency to the .Net Standard Library.
When I install the nuget package for Pather.CSharp I end up with over 2000 changed files.

Is the .Net Standard Library really required as a dependency?

NetStandard Target

Good library. Works great.

However, this is one small issue.
When I have a solution that targets .NET Standard 1.4 and I add your package, it adds a reference to System.Runtime.InteropServices version 4.3. When I compile I get the 'found conflicts between two different versions'. This is caused by your library combined with the the above reference.

If I change my target to .NET Standard 1.6, the warnings go away.

I think the issue is you have targeted .NET Standard 1.0, PLUS a package from .NET Standard 1.1. I think instead, you should simply target 1.1 and nothing else extra.

Thoughts?

Does not get property of base class.

if the current class has an abstract base class, the property does not get resolved:

File: Property.cs
Line of Code: PropertyInfo p = target.GetType().GetTypeInfo().GetDeclaredProperty(property);

It will get resolved with
PropertyInfo p = target.GetType().GetTypeInfo().GetProperty(property);

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.