Can I use RIA services with Entity Framework 4.3?

This is my setup: MVC application. Domain model with data access level using the first Enitity Framework code. Silverlight application (displayed in the MVC application)

I use RIA Service so that the Silverlight application interacts with the database.

Ria services only support entity infrastructure 4.1. The current release is 4.3. It seems to be a waste of time to not get new EF features (like migrations and hopefully list support in the future) just because of the Ria service for the Silverlight application.

So my question is:

  • How reasonable is it to rely on the Ria service when using the EF code for the first time (i.e. will they always fall behind so much?) Could this be a problem in the future?)
  • Do you have an alternative solution in which the Silverlight application is not so dependent on which version of ORM I use?
+4
source share
3 answers

RIA services can be used with NHibernate or any other ORM model or object / domain. Only a few of VS Wizards assume that there is a connection between EF and RIA Services, but you obviously do not need to use these wizards, and there is no connection between EF and RIA Services.

The answer to the question "Can I use RIA services with Entity Framework 4.3?" absolutely yes.

OData is an alternative to RIA services, but has quite a few limitations and is not a direct competitor. WCF is also an alternative.

+4
source

The workaround for getting migrations before the RIA services correctly supports EF4.3 can also be to create a project exclusively for migration, similar to the spirit of database projects in Visual Studio Ultimate.

The model should be included by such a project through "add as a link", and you will need to make sure that it can be compiled in both projects. For example, you may need to define some dummy attribute that is defined in RIA-Services ("Include" will be one).

This is not ideal, but it may be the best option in some cases.

0
source

To get a temporary workaround to block the version <4.2 of the RiaServices.EntityFramework NuGet package, I used the NuGet Package Explorer to change the package metadata and remove the restriction.

Remember that you must add a local cache as the source of NuGet .

Tools β†’ Options β†’ Package Manager β†’ Package Sources β†’ Add (C: / Users /% username% / Appdata / Local / Nuget / Cache)

0
source

Source: https://habr.com/ru/post/1396739/


All Articles