You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
consider a base class for WeatherForcast:
public enum CloudType
{
A = 1, B = 2
}
public class WeatherForecastBase
{
public int CloudType { get; set; }
}
public class WeatherForecast : WeatherForecastBase
{
public Guid Id { get; set; }
public DateTime Date { get; set; }
[IsBlinded]
public int TemperatureC { get; set; }
[IsBlinded]
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
public string Summary { get; set; }
public virtual Person WeatherPerson { get; set; }
public virtual IList<Location> Locations { get; set; }
public virtual Location Location { get; set; }
public Address Address { get; set; }
public bool IsCloudy { get; set; }
public new CloudType CloudType { get; set; }
}
The CloudType (int) property is hidden by the child class with a new property that also changes it's type (CloudType enum). Is there a way for ODataConventionModelBuilder to successfully build a model for WeatherForecast and ignore the base class version of CloudType? In my use case I get an error about the property must be a primative type.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
consider a base class for WeatherForcast:
public enum CloudType
{
A = 1, B = 2
}
public class WeatherForecastBase
{
public int CloudType { get; set; }
}
public class WeatherForecast : WeatherForecastBase
{
public Guid Id { get; set; }
}
The CloudType (int) property is hidden by the child class with a new property that also changes it's type (CloudType enum). Is there a way for ODataConventionModelBuilder to successfully build a model for WeatherForecast and ignore the base class version of CloudType? In my use case I get an error about the property must be a primative type.
Beta Was this translation helpful? Give feedback.
All reactions