Hi,
I am trying to migrate from 2010 to 2012.
When I try to build I get this error when it was working in the previous with the 6.1.8.
Erreur 1 CodeFirst entities were found in this assembly, but an EntityManager or DbContext was not. You must define a container for these entities in this assembly. xxx.Common.Domain
This assembly doesn't contains any entitymanager or DBContext because it hosts the base class (all abstract) for all the others domains assemblies.
Is it now mandatory to create a DBContext or entitymanager in any assembly hosting a code first class even if all are abstract ?
I created an internal empty entityManager to be able to continue the migration but I feel I shouldn't have to.
Another issue (also working in 6.1.8) :
Erreur 4 An error occurred during metadata generation and a metadata file could not be created. Error: You cannot use Ignore method on the property 'AdressPrincipal' on type 'xxx.Global.Domain.Entities.Professional' because this type inherits from the type 'xxx.Global.Domain.Entities.Person' where this property is mapped. To exclude this property from your model, use NotMappedAttribute or Ignore method on the base type. xxx.Global.Domain
I already have the NotMapped attribut on the property AdressPrincipal (below the code)
[DataContract(IsReference = true)]
public abstract class Personne : BaseAuditEntity
{
[DataMember]
public int Id { get; set; }
...
[NotMapped]
public Adresse AdressPrincipal {... }
}
public class Professionel : Person
{
...
}
I don't know, generaly speaking, if I should put the DataContract attribute on the inherited class if the parent class has it
Anyway I tried both case and both give this error
Edited by Walid - 22-Sep-2012 at 2:24pm