1

I'm testing C# and Restier library. As many people, I try to expose a person's "FullName" property of an entity framework model, and Restier refuses to expose it.

public partial class User
{
        public User()
        {
        }

        public int id { get; set; }
        public string lastName { get; set; }
        public string firstName { get; set; }
        public fullName // not visible
        {
               get { return lastName + " " + firstName; }
        }
}

I saw in this article that it should be possible with DelegateDecompiler, without loosing performance with ugly sql queries.
links :
https://daveaglick.com/posts/computed-properties-and-entity-framework
https://github.com/hazzik/DelegateDecompiler

I installed it and wrote :

[NotMapped]
[Computed]
public string fullName
{
     get { return firstName + " " + lastName; }
}

However I cannot make it work, the property is still not exposed to the API.
What am I missing ?
Thanks

Kiruahxh
  • 1,276
  • 13
  • 30

0 Answers0