?
Solved

c# asp.net

Posted on 2011-03-02
4
Medium Priority
?
242 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 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
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
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
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…
Suggested Courses

764 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