© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•2y ago•
9 replies
Alex

✅ Redis.OM create key from 2 fields

I have a class
public class Sensor:Entity
{
    public int Id { get; set; }
    public int StationId { get; set; }
    public string Name { get; set; }
    [Indexed(Sortable = true)]
    public DateTime? TimeWindowStart { get; set; }
    [Indexed(Sortable = true)]
    public DateTime? TimeWindowEnd { get; set; }
    public DateTime? MeasuredTime { get; set; }
    public string Unit { get; set; }
    public int Value { get; set; }
}
public class Sensor:Entity
{
    public int Id { get; set; }
    public int StationId { get; set; }
    public string Name { get; set; }
    [Indexed(Sortable = true)]
    public DateTime? TimeWindowStart { get; set; }
    [Indexed(Sortable = true)]
    public DateTime? TimeWindowEnd { get; set; }
    public DateTime? MeasuredTime { get; set; }
    public string Unit { get; set; }
    public int Value { get; set; }
}

I want to create key that contains two fields stationId and Id, for example $"{stationId}{id}". How can I do it?
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

redis field not updating (redis-om)
C#CC# / help
4y ago
Redis.OM Indexes are dropped automatically
C#CC# / help
2y ago
✅ Purpose of '?' key when declaring certain fields.
C#CC# / help
3y ago
Redis Timeout
C#CC# / help
15mo ago