Closed rpallares closed 1 year ago
Some properties defined as optional into the base model: c#public IList<int>? SomeList { get; set; }
c#public IList<int>? SomeList { get; set; }
Are translated to a Required property when ODataConnectedServices generate the client.
[global::Microsoft.OData.Client.OriginalNameAttribute("SomeList")] [global::System.ComponentModel.DataAnnotations.RequiredAttribute(ErrorMessage = "SomeList is required.")] public virtual global::System.Collections.ObjectModel.ObservableCollection<int> SomeList { get { return this._SomeList; } set { this.OnSomeListChanging(value); this._SomeList = value; this.OnSomeListChanged(); this.OnPropertyChanged("SomeList"); } }
ODataConnectedService v1.0.0 VisualStudio Version v17.6.4 Microsoft.Odata.Client v7.17.0
Steps to reproduce the behavior:
The generated model must have the same Required restrictions than the original model
IList? properties without any Required attribute must not become Required at client side
NA
Finally the issue looks more at ODataConventionalModelBuilder side as they don't generate the right model for IList. But it's doing it correctly for IList
Describe the bug
Some properties defined as optional into the base model:
c#public IList<int>? SomeList { get; set; }
Are translated to a Required property when ODataConnectedServices generate the client.
Version of the Project affected
ODataConnectedService v1.0.0 VisualStudio Version v17.6.4 Microsoft.Odata.Client v7.17.0
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The generated model must have the same Required restrictions than the original model
Actual behavior
IList? properties without any Required attribute must not become Required at client side
Screenshots
NA
Additional context
NA