This Question is Not Answered

1 "correct" answer available (4 pts) 2 "helpful" answers available (2 pts)
0 Replies Last post: Feb 11, 2012 4:28 PM by Ben Joyce  
Ben Joyce Newbie 5 posts since
Feb 10, 2012
Currently Being Moderated

Feb 11, 2012 4:28 PM

Resharper suggesting conversion to Abstract Class

Hello.

 

In an ASP.NET MVC project I have a set of DTO classes I use to return data from the Service layer to the Controller.

 

Here's an example of the DTO class:

 

     public class ClaimDTO
     {
          public int ClaimId { get; set; }
          public int CustomerId { get; set; }
          public string CustomerName { get; set; }
     }

 

And I return data like this:

 

     ClaimDTO claimDTO = _claimService.GetClaim(claimId);

 

My Service does the following (using AutoMapper to map the EF entity to the DTO:

 

          public ClaimDTO GetClaim(int claimId)
          {
               try
               {
                    var claim = _claimRepository.Fetch().SingleOrDefault(c => c.ClaimId == claimId);
                    return Mapper.Map<Claim, ClaimDTO>(claim);
               }
               catch (Exception ex)
               {
                    throw ex;
               }
          }

 

Resharper is suggesting that I make ClaimDTO an Abstract class as it is never instantiated.  Is this correct?

 

Apologies if this is not the correct forum for this sort of question.

 

Kind regards,

 

Ben

More Like This

  • Retrieving data ...