Breeze throwing InconsistentCLRPropertyDefinition on an enum while having the same class on both sides

19 views Asked by At

We have been having the issue that when we request metadata it gives us this error System.Exception: Metadata mismatch - values do not match between server and client for DataProperty: 'ApprovalState' on the EntityType: 'Approval:#DMS.Shared.Dto.Db' Metadata property: DataType. Approval state is a flagged enum like this:

public EnumStatus.ApprovalState ApprovalState
{
    get { return GetValue<EnumStatus.ApprovalState>(); }
    set { SetValue(value); }
}

And this is how we get our metadata:

dataService = new DataService(httpClient.BaseAddress + rootApiPath, httpClient);
entityManager = new EntityManager(dataService);

dataServiceKpvl = new DataService("Kpvl", null) { HasServerMetadata = false };

entityManagerKpvl = new EntityManager(dataServiceKpvl);

entityManager.MetadataStore.AllowedMetadataMismatchTypes = MetadataMismatchTypes.AllAllowable;

var idClientNameSpace = typeof(ApplicationUser).Namespace;
var kpvlNameSpace = typeof(Kpvl).Namespace;
var dic = new Dictionary<string, string>();

entityManager.MetadataStore.NamingConvention = new NamingConvention().WithClientServerNamespaceMapping(dic);
entityManager.FetchMetadata().ContinueWith(t =>
{
    if (t.IsFaulted)
        logger.LogError("FetchMetadata: {0}", t.Exception.GetBaseException());
});

It looks like it is not parsing the enums correctly to the frontend.

0

There are 0 answers