c# - EF complex class getting me null -


I have a class like this.

public class user {public id id}; Set; } Public string first name {receives; Set; } Public String LastName {get; Set; } Public String Email {get; Set; } Public IList & lt; Role & gt; Roles (get; set;} public virtual branch branch {received; set;} public string password {get} set;}} public square branch {public entry id (get; set;} public string name {get; set; } Public string location {get} set;} Public virtual area area {get; set;}}

The problem I have is that when I store the layer layer the property for the branch property In use The passer-by appears in the null. I have verified that before it reaches the repository, it is not empty. I seem to have something in sequence, but know i'dont correct it

< P> Thanks in advance

This way the store gets the objects:!

  Public read-only IDbSet  DbSet; Public IEnumerable & lt; T & gt; (; & lt; t, bool & gt; & gt; expression & lt; expression of the string; string sortColumn = null, bool sortDi Find rect = true, including parameter string [], {if (sortColumn == faucet) {var ResultSet = GetDbSet (included) .Where (predicate); ResultSet.ForEachAsync (E = & Seperate (E)). Wait (); Return result all too; } Else returned OrderByField & LT; T & gt; (GetDbSet (included) .Where (predicate), sortColumn, sortDirection); } Private IQueryable & lt; T & gt; GetDbSet (parameter string [] included) {IQueryable & lt; T & gt; Resultset = dbet; Results (include string) resultSet = resultSet.Include (include); Return result all too; } Private TeaTitT (T Entity) {System.Diagnostics.Contracts.Contract.Requires (unit! = Null); Var Access = Reference. Entry (unit); Entry.State = System.Data.Entity.EntityState.Detached; Return unit; }  

I solved it. The problem was on the generic repository, which I am working on. When entries are entered, entries are set separately and to avoid this, when I pass the repository. I have removed the different method and everything is working.


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -