AspNetCoreOData icon indicating copy to clipboard operation
AspNetCoreOData copied to clipboard

ODataInstanceAnnotationContainer is not available in AspNetCoreOData

Open giulianob opened this issue 2 years ago • 2 comments

ODataInstanceAnnotationContainer in OData\WebApi allows CLR types to add annotations by having a ODataInstanceAnnotationContainer InstanceAnnotations property as seen here. This functionality was added in https://github.com/OData/WebApi/pull/2219 but never ported to AspNetCoreOData. For example,

    public class Address
    {
        public string Street { get; set; }
        public string City { get; set; }
        public ODataInstanceAnnotationContainer InstanceAnnotations { get; set; }
    }

    var address = new Address 
    {
        Street = "foo",
        InstanceAnnotations = new ODataInstanceAnnotationContainer()
    }
    address.InstanceAnnotations.AddResourceAnnotation("Foo", 2);

Is there an alternative option in AspNetCoreOData or does the feature just need to be ported?

giulianob avatar Mar 18 '22 19:03 giulianob

@giulianob I haven't fully ported this feature from 7 to 8 yet. I'd like to rethink the design in 7 and maybe need a better design.

xuzhg avatar Mar 20 '22 04:03 xuzhg

@xuzhg is there already some architectural decision how to implement this? and if yes can the community (maybe I) contribute this feature? this is highly needed for my projects and I try to migrate them until end of year. (because dotnet 3.1 support ends)

paule96 avatar Aug 29 '22 08:08 paule96