This project is read-only.

Odata - getting error 406

Topics: ASP.NET Web API
Feb 19, 2014 at 10:33 AM
for a solution i need to publish my enums, i have created a dummy class of enumentity and published all the enums under this class - each enum had it own controller, however when i tried to consume this with breeze - i saw only one enum cause all of them had the same type, it just took the last one. so i have tried to generate for each enum a dummy class in runtime useing codedom
public static class Constants
        public const string ENUM_PROTO_CLASS = "@EnumEntityTemplate";

        public const string ENUM_ENTITY_TEMPLATE =

            @"using System;
            using System.Collections.Generic;
            using System.Linq;
            using System.Text;
            using Comergency.Common;
            using Stabilis.Situator.OpServerTypes;

            namespace Stabilis.Situator.OpServerTypes
                public class @EnumEntityTemplate : EnumEntity 
internal void GenerateEnumController<T>(ODataModelBuilder builder, string entity) where T : EnumEntity
        var dset = builder.EntitySets.FirstOrDefault(set => set.Name == entity);
        if (dset != null)
        EntitySetConfiguration<T> enumEntity = builder.EntitySet<T>(entity);
        enumEntity.EntityType.HasKey(c => c.Name);
        enumEntity.EntityType.Property(c => c.UIVisibilty);
        enumEntity.EntityType.Property(c => c.Order);
        enumEntity.HasIdLink(eic =>
            return (string)null;
        }, false);
so far all went ok, however when i tried to get the enum entries i got 406
GET /SituatorWebApi/odata/BadgeStatus HTTP/1.1
HTTP/1.1 406 Not Acceptable

when debugging the code, i see that i gets to the controller and no exceptions