Giter VIP home page Giter VIP logo

Comments (5)

hazzik avatar hazzik commented on June 2, 2024

That is interesting. There is a similar test to one you've submitted:

public void TestGenericMethodPersonHandle()
{
using (var env = new MethodEnvironment(classEnv))
{
//SETUP
var linq = env.Db.EfPersons.Select(x => x.FirstName + (x.MiddleName == null ? "" : " ") + x.MiddleName + " " + x.LastName).ToList();
//ATTEMPT
env.AboutToUseDelegateDecompiler();
var dd = GetGenericPersonHandle(env.Db.EfPersons).Decompile().ToList();
//VERIFY
env.CompareAndLogList(linq, dd);
}
}
public IQueryable<string> GetGenericPersonHandle<T>(IQueryable<T> people)
where T : class, EfItems.Abstracts.IPerson
{
return people.Select(x => x.FullNameHandleNull);
}

Only difference is in where T definition. One we have with class, the submitted is without class. Adding class to your test fixes it. And removing breaks our test.

from delegatedecompiler.

cmeyertons avatar cmeyertons commented on June 2, 2024

The class constraint fixing it is quite bizarre! Your solution is more elegant than mine - I just wasn’t sure I could apply it as globally as you did and tried to leverage the knowledge of the caller.

Looks great to me. What is the turnaround time on getting a fix published? On Monday, we will test adding the class constraint as a workaround.

from delegatedecompiler.

hazzik avatar hazzik commented on June 2, 2024

What is the turnaround time on getting a fix published?

I was going to review one other PR, and then wanted to publish a new version. It is already past my deadline as I was going to do that on the past weekend (it's Monday here already).

from delegatedecompiler.

hazzik avatar hazzik commented on June 2, 2024

I just wasn’t sure I could apply it as globally as you did

When there is an upcasting (cast to a parent type) - it should be safe to remove. I was worried about explicit interfaces, but tested them locally - works as expected.

from delegatedecompiler.

cmeyertons avatar cmeyertons commented on June 2, 2024

Sounds great! Thank you very much for the quick resolution on this one!

from delegatedecompiler.

Related Issues (20)

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.