简体   繁体   English

ReSharper在创建相等比较器时不显示基础类的属性

[英]ReSharper not displaying properties from underlying class when creating equality comparers

My setup is the following: 我的设置如下:

I have POCO classes which are generated by T4 templates based off of my database. 我有基于我的数据库的T4模板生成的POCO类。 My domain models inherit from these POCOs. 我的域模型继承自这些POCO。 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). 基本上,这里有POCO模型,因此当我更改数据库时,不必一直手动更新模型(我们使用Dapper作为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. 当我尝试使用ReSharper为我的域模型生成相等比较器时,resharper接口不包括基础POCO类的属性,而仅包括域模型的属性。 Why is this happening when, in my case, domain models inherit from the POCOs and therefore have all the properties from the POCOs? 在我的情况下,为什么域模型从POCO继承而具有POCO的所有属性,为什么会发生这种情况?

This is my POCO class: 这是我的POCO课程:

 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; }
 }

这是已知问题,R#8.0的计划功能,对不起:(

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM