Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

c# asp.net

Posted on 2011-03-02
4
Medium Priority
?
245 Views
Last Modified: 2012-06-27
Hi experts,

I'm sure this is a simple one, but why does my following code get the error:
IFactory<E,D>.UpdateEntity(E, D)': interface members cannot have a definition..??


 public interface IFactory<E, D> where E : EntityBase where D:IDto
    {
        // update an entity with a populated Dto
        void UpdateEntity( E e , D d ) { }

        // update a dto with a populated entity
        void UpdateDto ( E e , D d ) { }

        // make an entity from an existing dto
        E MakeEntity (E e, D d) { }

        // make a dto from an existing entity
        D MakeDto( E e , D d ) { }
    }
0
Comment
Question by:critto
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 8

Expert Comment

by:crysallus
ID: 35017144
Replace your curly braces with a semi-colon:

public interface IFactory<E, D> where E : EntityBase where D:IDto
    {
        // update an entity with a populated Dto
        void UpdateEntity( E e , D d );

        // update a dto with a populated entity
        void UpdateDto ( E e , D d );

        // make an entity from an existing dto
        E MakeEntity (E e, D d);

        // make a dto from an existing entity
        D MakeDto( E e , D d );
    }

Open in new window

0
 
LVL 42

Accepted Solution

by:
Meir Rivkin earned 2000 total points
ID: 35017153
change interface to:
 public interface IFactory<E, D> where E : EntityBase where D:IDto
    {
        // update an entity with a populated Dto
        void UpdateEntity( E e , D d );

        // update a dto with a populated entity
        void UpdateDto ( E e , D d );

        // make an entity from an existing dto
        E MakeEntity (E e, D d) ;

        // make a dto from an existing entity
        D MakeDto( E e , D d );
    }
0
 

Author Comment

by:critto
ID: 35017155
Yep. Just realised that too. Muppet.

Cheers.
0
 
LVL 10

Expert Comment

by:Asim Nazir
ID: 35017161
You are right. interface members cannot have a definition.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question