Quantcast
Channel: .NET Framework Class Libraries forum
Viewing all articles
Browse latest Browse all 8156

Circular Dependency

$
0
0

I am using EF Code first but there is a problem.
I have 2 different layers: myProject.DataAccess and myProject.Model

At DataAccess layer I need to add reference to model so I can use the models as:

public DbSet<MyProject.Model.UserAccess> UsersAccess { get; set; } //This UserAccess model isunder myProject.Model project.

However I also need on myProject.Model add a reference to myProject.DataAccess on my migration configuration.cs file:

internal sealed class Configuration : DbMigrationsConfiguration<myProject.Model.MyContext>
{


But when I try to add the second reference I got the message :

A reference to '' could not be added. Adding this project as a reference would case a circular dependency.


Viewing all articles
Browse latest Browse all 8156

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>