Solved

c# asp.net

Posted on 2011-03-02
4
240 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:
sedgwick earned 500 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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

734 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