Can't create XmlMappingSource via FromReader method.

Discussion of open issues, suggestions and bugs regarding LinqConnect – Devart's LINQ to SQL compatible ORM
Post Reply
Albert
Posts: 20
Joined: Fri 06 Dec 2013 06:38

Can't create XmlMappingSource via FromReader method.

Post by Albert » Thu 19 Jun 2014 10:37

Hi,
I try to create XmlMappingSource dynamically with following code:

Code: Select all

            XNamespace ns = @"http://schemas.devart.com/linqconnect/mapping";

            XElement database = new XElement(ns + "Database",
            new XAttribute("Provider", "Devart.Data.Oracle.Linq.Provider.OracleDataProvider, Devart.Data.Oracle.Linq, Version=4.4.509.0, Culture=neutral, PublicKeyToken=09AF7300EEC23701"),
            new XAttribute("Name", string.Empty));

            var column = new XElement(ns + "Column", new XAttribute("Member", "Name"), new XAttribute("Name", "Name"));
            var type = new XElement(ns + "Type", new XAttribute("Name", "ObjType"), column);
            database.Add(new XElement(ns + "Table", new XAttribute("Name", "Obj$types"), type));


            DataContext dc = new Context(conn, Devart.Data.Linq.Mapping.XmlMappingSource.FromReader(database.CreateReader()));
And I get the following System.InvalidOperationException on last line of code:

Code: Select all

"Database node not found 'http://schemas.microsoft.com/linqtosql/mapping/2007', 'http://schemas.microsoft.com/linqtosql/dbml/2007' or 'http://schemas.devart.com/linqconnect/mapping'."}
When I create XmlMappingSource from static xml via XmlMappingSource.FromXlm method everything works fine!
Can you point me in the right direction?
Thanks!

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: Can't create XmlMappingSource via FromReader method.

Post by MariiaI » Fri 20 Jun 2014 06:48

Thank you for the report on this. We have reproduced this issue. We will investigate it in more details and inform you about the results as soon as possible.
As a workaround, please use the XmlMappingSource.FromXml method.

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: Can't create XmlMappingSource via FromReader method.

Post by MariiaI » Mon 23 Jun 2014 11:34

We have fixed this issue. The fix will be included in the next public build of LinqConnect, which we plan to release this week. We will post here when it is available for download.

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: Can't create XmlMappingSource via FromReader method.

Post by MariiaI » Thu 26 Jun 2014 12:20

New build of LinqConnect 4.4.529 is available!
It can be downloaded from http://www.devart.com/linqconnect/download.html (trial version) or from Registered Users' Area (for users with active subscription only).
For more information, please refer to http://forums.devart.com/viewtopic.php?f=31&t=29870.

Post Reply