NeinLinq provides helpful extensions for using LINQ providers such as Entity Framework that support only a minor subset of .NET functions, reusing functions, rewriting queries, even making them null-safe, and building dynamic queries using translatable predicates and selectors.
Hi, I'm having some problems with reusing expressions and stumbled upon this really nice library!
Now I wonder if the following is already possible with NeinLinq and if not if it would be possible to implement (I guess it might be tricky).
I have a DTO class that is display in a list, some of the properties in the DTO should be featched from diffrent places depending on selections of the users so I have done this now:
public class DTO
{
public Guid Id {get;set;}
public string Name {get;set;}
public string ExtendedName {get;set;}
}
Expression<Func<Education, StaticEducation, DTO>> base = (e, _) => new DTO { Id = e.Id, Name = e.Name};
Expression<Func<Education, StaticEducation, DTO>> extended = (e, es) => new DTO { ExtendedName = es.Name};
var combined = base.Apply(extended);
This works but I would like to do this: Override the first Name mapping with the second one like this:
public class DTO
{
public Guid Id {get;set;}
public string Name {get;set;}
}
Expression<Func<Education, StaticEducation, DTO>> base = (e, _) => new DTO { Id = e.Id, Name = e.Name};
Expression<Func<Education, StaticEducation, DTO>> extended = (e, es) => new DTO { Name = es.Name};
//Here Id is from Education and Name is from StaticEducation
var combined = base.Apply(extended);
So my two questions:
Is this possible with NeinLinq today somehow? (I have looked long at the documentation and code but could not figure it out)
If not would it be hard to implement as a feature?
Hi, I'm having some problems with reusing expressions and stumbled upon this really nice library!
Now I wonder if the following is already possible with NeinLinq and if not if it would be possible to implement (I guess it might be tricky).
I have a DTO class that is display in a list, some of the properties in the DTO should be featched from diffrent places depending on selections of the users so I have done this now:
This works but I would like to do this: Override the first Name mapping with the second one like this:
So my two questions: