0

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; }
 }
Marko
  • 12,543
  • 10
  • 48
  • 58
  • Sounds like a question for the R# team. They probably watch this tag, though. Those JetBrains guys are on the ball, in my experience. – MrBoJangles Mar 08 '13 at 16:02
  • It would be better if you could include code samples. Without them I can only give you this advise: try to create equality comparers for POCO class and then for domain model. Would domain model comparer include a call to base comparer in your case? – Dmitry Osinovskiy Mar 08 '13 at 16:07
  • I updated the original post with my model example. – Marko Mar 08 '13 at 16:43

1 Answers1

3

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

controlflow
  • 6,667
  • 1
  • 31
  • 55
  • No need to appologize... :) I just thought I was overlooking something because I hold ReSharper in such high regards. – Marko Mar 08 '13 at 18:23