C#C
C#2y ago
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; }
}

I want to create key that contains two fields stationId and Id, for example $"{stationId}{id}". How can I do it?
Was this page helpful?