Hi,
I have 2 basics classes, with a one to many relationship.
in my model I don't need/want to have the EntityRelatedList on the primary end of the relationship. I have my own dbcontext (pretty small in this case).
My modele looks like this :
public class User : BaseEntity
{
[Key]
public int Id { get; set; }
public string Name { get; set; }
}
public class Document : BaseEntity
{
[Key]
public int Id { get; set; }
[Required]
public string Title { get; set; }
public User User { get; set; }
}
When I want to save a new Document I get an EntityManagerSaveException with the message "La séquence ne contient aucun élément correspondant" which I beleive can be translated to "Sequence contains no matching element". Below is the StackTrace:
à System.Linq.Enumerable.First[TSource](IEnumerable`1 source, Func`2 predicate)
à IdeaBlade.EntityModel.Edm.EdmSaveExecutor.GetRelatedEnd(IEntity entity, String propertyName)
à IdeaBlade.EntityModel.Edm.EdmSaveExecutor.ProcessManyToMany(List`1 entities)
à IdeaBlade.EntityModel.Edm.EdmSaveExecutor.ProcessSaves(IEnumerable`1 groupsByType)
à IdeaBlade.EntityModel.Edm.EdmSaveExecutor.SaveWithinContext()
à IdeaBlade.EntityModel.Edm.EdmSaveExecutor.Save(DataSourceResolver dataSourceResolver, IDataSourceKey dsKey, SaveWorkState workState)
If i do the exact same thing without using the entityManager but the dbcontext it works fine.
to make it works with Devforce, I have to add this RelatedEntityList property and do the correct mapping in the dbcontext
below a project where both case are implemented. Just uncomment the navigation property in the User class and the mapping in the dbcontext to make it work with devforce.
Edited by Walid - 30-Mar-2012 at 7:28am