-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I am want to Use your nuget in runtime for generation class using IL #71
Comments
You can't. The whole point of this library is to write companion expressions at compile time using roslyn source generators. |
Possible exists way ? |
Possible can you to extend ProjectableAttriibute for mmy case? I am want follow
In this case
I.e. i am want to wrote all Extensions methods in common class. And when generate IL User class, i am want to generate ProjectableAttribute and using my common class. I really need this functionality. |
This is currently already supported for members within the same type, e.g. this is allowed: public record Entity
{
public int Id { get; set; }
[Projectable(UseMemberBody = nameof(Computed2))]
public int Computed1 => Id;
private int Computed2 => Id * 2;
[Projectable(UseMemberBody = nameof(Computed4))]
public int Computed3 => Id;
private static Expression<Func<Entity, int>> Computed4 => x => x.Id * 3;
} Is that sufficient for your use-case? |
Hi, thank you for your solution. But i need to pass value to Expression function. I.e. am want to have base class with expression and set params in child class. For example ` //Base class created in compile-time/design-time VS
` can you to help in implementation my scenario? |
Hi, can you to help in implementation my scenario? |
Do you have news about this? |
If I understand you correctly, you're asking for a dynamic expression body replacement strategy where the actual expression body of a projectable method can be configured at runtime. I think this is a very niche use-case and I'm not planning on implementing it. I'm not against the feature in general and happy to accept a PR if anyone wants to pick it up. I can give some guidelines on how to get started if anyone wants to give this is a shot |
Hi. I am want to generate class like this in rntime using Emit
public class User
{
public int Id { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
}
In result extension methods not generated. How to use your nuget in my case?
The text was updated successfully, but these errors were encountered: