public IQueryable ListPousadas () {
var y = _db.Set<Pousada>().AsNoTracking().Where(x => x.Deleted == false);
return y;
}
public enum PousadaSize
{
Small = 1, Medium = 2, Large = 4, ExtraLarge = 8
}
В Почтальоне: [{"id": "3f5b8ad1-feb4-42f8-8095-ca5011823011", "name": "USATest", "owner": "USATest1", "state": "Kol", "city": "Asansol", "size": 1, // Здесь я хочу показать Small "language": "en", "legalRepresenlative": "TestOwner", "hostingFacilityType": 2, "creationAt": "2019-07-10T06: 19: 49.752", "updatedAt": null, "deleteAt": null, "удалено": false, "isActive": верно}]
Я пытаюсь этот код:
builder
.Entity<Pousada>()
.Property(u => u.PousadaSize)
.HasConversion(
v => v.ToString(),
v => (PousadaSizeEnum.PousadaSize)Enum.Parse(typeof(PousadaSizeEnum.PousadaSize), v));