Search code examples
telerikopenaccess

How to use interfaces with Telerik OpenAccess


I am trying to implement my persitent classes using interfaces. I have created the following

public interface IFoo
{
    int Id {get;set;}
}

public class Foo : IFoo
{
    private int _id;

    public int Id {get{return _id;} set{_id = value;}}
}

public interface IBar
{
    int Id {get;set;}
    IFoo Foo {get;set;}
}

public class Bar : IBar
{
    private int _id;
    private IFoo _foo;

    public int Id {get{return _id;} set{_id = value;}}
    public IFoo Foo {get{return _foo;} set{_foo = value;}}
}

Is it possible to indicate that Foo is a valid class and to use it by default, i dont want to use the database to store the class type.

Thanks

Rohan


Solution

  • after reading through the Telerik guide i posted a question on their forum...

    Using Interfaces without storing the Class Type in the database

    It looks like its not possible.