Skip to content
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

Select does not work for some types #475

Open
granit1986 opened this issue Aug 14, 2024 · 2 comments
Open

Select does not work for some types #475

granit1986 opened this issue Aug 14, 2024 · 2 comments

Comments

@granit1986
Copy link

If you use Select to get only the required fields, then for types bool, byte[], TimeSpan it will not work. Is there anything you can do about it?

@abbottdev
Copy link
Contributor

Could you post a code example to demonstrate what you're trying to achieve, where it doesn't work and how you might expect it to work?

@granit1986
Copy link
Author

granit1986 commented Sep 24, 2024

For example

[Fact]
public void TestBoolSelects()
{
    var obj = new Person { Name = "steve", Age = 33, IsEngineer = true, Date = DateTime.Now };
    var collection = new RedisCollection<Person>(_connection);
    collection.Insert(obj);
    var res = collection.Where(x => x.Age == obj.Age).Select(x => new Result { Age = x.Age, IsEngineer = x.IsEngineer }).ToList();
    Assert.NotEmpty(res);
    collection.Delete(obj);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants