Errors creating RIA Services client proxy classes

Errors creating RIA Services client proxy classes

Postby guymonlh » Mon 03 Dec 2012 19:49

Hello,
We are currently evaluating the Devart for Oracle provider and I have attempted to create a WCF RIA Services Class Library project using the Devart provider. Just to get started quickly, I created a model by adding an ADO.NET Entity Data Model item. Then I added a Domain Service Class with just one class in the model. The Server project compiles just fine but the client proxies do not generated on the client and I get a bunch of these errors:

TreModel.ssdl(10,6) : error 0040: The Type VARCHAR2 is not qualified with a namespace or alias. Only primitive types can be used without qualification

I referenced your forums and it appears people have had this in the past but those suggestions did not seem to help.

Here is what I modified in my dbContext class to try to accommodate the error:
Code: Select all
public partial class TreContext : DbContext
    {
        static TreContext()
        {
            var config = Devart.Data.Oracle.Entity.Configuration.OracleEntityProviderConfig.Instance;
            config.CodeFirstOptions.ColumnTypeCasingConventionCompatibility = false;
        }

        public TreContext()
            : base(new Devart.Data.Oracle.OracleConnection("Data Source=xxx;password=aaa;user id=bbb;"), true)
        {

        }
   
        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            throw new UnintentionalCodeFirstException();
        }
   
        public DbSet<TAX_AUTHORITY> TAX_AUTHORITY { get; set; }
    }


Here is my Domain Service:

Code: Select all
[EnableClientAccess()]
    public class DomainService1 : DbDomainService<TreContext>
    {

         public IQueryable<TAX_AUTHORITY> GetTAX_AUTHORITY()
        {
            return this.DbContext.TAX_AUTHORITY;
        }
    }


I can access the database if I use this code in a console application:

Code: Select all
var config = Devart.Data.Oracle.Entity.Configuration.OracleEntityProviderConfig.Instance;
            config.CodeFirstOptions.ColumnTypeCasingConventionCompatibility = false;
            var treContext = new TreContext();
            var x = treContext.MILL_LEVY_YEAR.Take(4).ToList();


I think RIA just seems to have an issue. Any help would be appreciated. We are trying to find a provider that would allow us to use the dbContext (generated from the model) in a RIA service instead of the old ObjectContext using Oracle.
Thank You

UPDATE: It seems RIA needs to know that the config.CodeFirstOptions.ColumnTypeCasingConventionCompatibility needs to be false during the build process (thats when it errors). Is there anyway to do this?
guymonlh
 
Posts: 3
Joined: Mon 03 Dec 2012 19:23

Re: Errors creating RIA Services client proxy classes

Postby Shalex » Wed 05 Dec 2012 08:49

A similar problem was fixed in the latest (7.3.132) version of dotConnect for Oracle. Please try 7.3.132 and notify us about the results.
Shalex
Devart Team
 
Posts: 7780
Joined: Thu 14 Aug 2008 12:44

Re: Errors creating RIA Services client proxy classes

Postby guymonlh » Wed 05 Dec 2012 15:47

I just downloaded the driver two days ago for evaluation and when I click on the Devart.Data.Oracle reference in my project, the version from the properties window says it is 7.3.132.0. Darn! Data access works fine if I don't try to create a Domain Service (I confirmed using EF in a console application) but the moment I try to create a Domain Service class (that inherits from dbDomainService - not DomainService using ObjectContext), my solution won't even build (the client project fails during the build). Seems like RIA is doing something in the build process and it doesn't know that ColumnTypeCasingConventionCompatibility is false - because that setting doesn't happen until runtime in the context constructor? Is there something to put in the config file to help?

Just to be clear, my app never runs as the errors occur in the BUILD of the solution. In re-reading my previous post, I may have given the impression that my app runs but the client proxies are just not generated when I meant to say the solution fails during the build because my client project is not building.
guymonlh
 
Posts: 3
Joined: Mon 03 Dec 2012 19:23

Re: Errors creating RIA Services client proxy classes

Postby Shalex » Thu 06 Dec 2012 16:14

Here is an example of setting ColumnTypeCasingConventionCompatibility via *.config:
Code: Select all
<configuration>
  <configSections>
    ...
    <section name="Devart.Data.Oracle.Entity" type="Devart.Data.Oracle.Entity.Configuration.OracleEntityProviderConfigurationSection, Devart.Data.Oracle.Entity, Version=7.3.132.0, Culture=neutral, PublicKeyToken=09af7300eec23701" />
  </configSections>
  <Devart.Data.Oracle.Entity xmlns="http://devart.com/schemas/Devart.Data.Oracle.Entity/1.0">
    <CodeFirstOptions ColumnTypeCasingConventionCompatibility="false"/>
  </Devart.Data.Oracle.Entity>
  ...
</configuration>

The value (true/false) of ColumnTypeCasingConventionCompatibility should be the same as the value of the Fluent Mapping property of DbContext template in Devart Entity Model.
Shalex
Devart Team
 
Posts: 7780
Joined: Thu 14 Aug 2008 12:44

Re: Errors creating RIA Services client proxy classes

Postby guymonlh » Thu 06 Dec 2012 23:27

Thank you very much! That worked. Unfortunately, the moment I try to add a relationship between two entities in the model (works great with just one entity or 2 entities without a relationship), I get a build error: Object reference not set to an instance of an object

I just don't think RIA Services + Oracle + EF 5.0 (need to use EF 4.1) is ready yet. If I am mistaken please let me know if your provider will work with EF 5.0 and RIA Services as we are anxious to use enums on our project.
guymonlh
 
Posts: 3
Joined: Mon 03 Dec 2012 19:23

Re: Errors creating RIA Services client proxy classes

Postby Shalex » Fri 14 Dec 2012 15:43

guymonlh wrote: Unfortunately, the moment I try to add a relationship between two entities in the model (works great with just one entity or 2 entities without a relationship), I get a build error: Object reference not set to an instance of an object

Could you please send us a small test project so that we can reproduce the issue in our environment?

guymonlh wrote:I just don't think RIA Services + Oracle + EF 5.0 (need to use EF 4.1) is ready yet. If I am mistaken please let me know if your provider will work with EF 5.0 and RIA Services as we are anxious to use enums on our project.

dotConnect for Oracle supports ADO.NET Entity Framework 5 starting from the 7.2.77 version: http://www.devart.com/dotconnect/oracle/revision_history.html. If you encounter the problem with EF v5.0 and dotConnect for Oracle v7.3.132, please describe the issue.
Shalex
Devart Team
 
Posts: 7780
Joined: Thu 14 Aug 2008 12:44


Return to dotConnect for Oracle