i have class exposed asp.net odata v4 api:
public class person { public int titleid { get; set; } //other properties first name, last name, dob , on... }
the titleid property id maps persons title (mr, miss, mrs on) located @ different odata endpoint address.
is there way of providing metadata let consumer of api know lookup values property or should approach in different way?
edit: looking way provide metadata inform consumer of location of lookup values. there no database involved, mapping layer on more complicated api.
if have class of title , have in database working:
public class title { public int id { get; set; } public string titlename { get; set; } }
then use virtual in current model.
[foreignkey("titleid")] public virtual title { get; set; } public int titleid{ get; set; }
i'm sure mapping. address them title.titlename
.