C# Linq DBML Class Wrapper -


i have generic class extends linq class. means can't extend linq class, need have separate generic class.

public linqcake // linq class dbml {      string name;      frostingtype type; }  public class cake<t> : linqcake t frostingtype {    public bool someproperty     {                      {              return linqcake.type == frostingtype;           }    }               // want this,    // can't because code isn't valid    public cake (int id)    {            = db.linqcakes.where(x=>x.id = id).single();    } }  public void main() {    cake<chocolate> chocolatecake = cake<chocolate>(7);    console.writeline(chocolatecake.someproperty); } 

i want populate cake's inherited class linqcake information database. can implicit cast?

how accomplish spirit of i'm trying do? can think of 2 ways of sort of doing this; a) add private linqcake member b) read in each property of linqcake class duplicate properties of cake class.

i feel there better solution, idea?

if understand question doing projection here involves mapping fields type linqcake of type cake. can't set linqcake cake because isn't specified in type hierarchy.

maybe tool automapper can you.


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -