✅ Redis.OM create key from 2 fields
I have a class
I want to create key that contains two fields stationId and Id, for example $"{stationId}{id}". How can I do it?
8 Replies
Make a calculated get only property?
Okay, I'll try it, thank you
public string CombinedIds => $"{Id}_{StationID}";
I set an id on
Sensor
object creation because Senser is inherited from class Entity
which has property int Id, and I'm not use if it is OK to override id property with new
in Sensor
class
Not a big fan of that
int
requirementI think it's possible to change it to string, but won't there be any "performance" issues if I use string instead of int?
consider a GUID then
I don't really see why the ID must be a combined id here, other than to guarantee uniqueness
The data that I get has a nested structure 1 station has many sensors (different stations can have the same sensor), and I need to store all the sensor data in way that they don't overwrite each other, but I can update their data. The sensor and station already contains id