0

In my database, I have the following tables

CustomExpressions
GlobalExpressions

I had corresponding POCO classes in my application

public class CustomExpressions: IExpression
{
    //blah blah blah
}

public class GlobalExpressions: IExpression
{
    //blah blah blah
}

and I have the inteface IExpression

interface IExpression
{
    //yada yada yada
}

One of my business objects in my application aggregates an object of type IExpression like the following

public class MyBusinessObject
{
    public IExpression { get; set; }
}

this is done because this property on the MyBusinessObject can either be of type CustomExpression, or GlobalExpression, but is decided at dynamically.

This all worked fine, but I was directed to take out the CustomExpression and GlobalExpression object and to directly use the CustomExpression and GlobalExpression linqtosql object. This allows me to not have to convert from POCO to linqtosql object every time I need to do something with the database.

The problem with this tho, is that I no longer have CustomExpression and GlobalExpression objects that implement the IExpression interface.

What am I supposed to do in this situation? Is there a way to represent this relationship with that interface with these objects?

1 Answer 1

3

The classes are created as partial classes, you can simply add:

public partial class CustomExpressions: IExpression
{
        //blah blah blah
}

public partial class GlobalExpressions: IExpression
{
     //blah blah blah
}

and add the missing bits in there.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.