Question

My setup is the following:

I have POCO classes which are generated by T4 templates based off of my database. My domain models inherit from these POCOs. Basically the POCO models are there so that when I change the database I don't have to update the model by hand all the time (we use Dapper as our ORM).

My question is:

When I try to use ReSharper to generate equality comparers for my domain models the resharper interface does not include properties from the underlying POCO class only the properties from the domain model. Why is this happening when, in my case, domain models inherit from the POCOs and therefore have all the properties from the POCOs?

This is my POCO class:

 namespace Models.Database
 {
      [Table("Restaurants")]
      public abstract class Restaurant
      {
           [Key]
           public virtual int Id { get; set; }
           public virtual string RestaurantName { get; set; }
           public virtual int? PreferredDayOfWeek { get; set; }
           public virtual int? RestaurantTypeId { get; set; }
      }
 }

And then my domain model is:

 public class Restaurant : Models.Database.Restaurant
 {
      public virtual RestaurantType RestaurantType { get; set; }
 }
Was it helpful?

Solution

This is known issue, planned feature for R# 8.0, sorry :(

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top