Page 1 of 1

Attach additional table on existing data mapping

Posted: Mon 31 Aug 2015 07:42
by navirius
I have database, and mapping it using linqconnect (using designer), I build generated code (data and datacontext) into one assembly, let say BaseDataContext.dll

later my db have additional table, but I dont want rebuild BaseDataContext.dll, I want to map additional table, but delete generated datacontext, then I want attach it to BaseDataContext.dll as different assembly, let say, AdditionalTable.dll

I know I must have function like below on my datacontext, for my datatable

Code: Select all

        internal Devart.Data.Linq.Table<TableClassData> TableClassData
        {
            get
            {
                return this.GetTable<TableClassData>();
            }
        }
My goal is, Can I use same datacontext (that exist on BaseDataContext.dll) for AdditionalTable.dll? with DI/injection/reflection may be?

thanks

Re: Attach additional table on existing data mapping

Posted: Tue 01 Sep 2015 08:35
by MariiaI
navirius wrote:My goal is, Can I use same datacontext (that exist on BaseDataContext.dll) for AdditionalTable.dll? with DI/injection/reflection may be?
It is possible to implement such scenario with the fluent mapping approach.
We are sending you a sample project, that demonstrates possible solution for your scenario, to the e-mail address you provided in your forum profile. Please check that the letter is not blocked by your mail filter.
Please tell us if this helps.

Re: Attach additional table on existing data mapping

Posted: Wed 02 Sep 2015 04:08
by navirius
I got the concept, I try it now, thanks for your help