i trying return list of entities wcf data service. not using entity framework rather pulling data out of neo4j , returning asqueryeable . 404 error if run code saying url not found objectentitiesservice.svc?
here code: object
[dataservicekeyattribute("id")] public class objectentity { public string id { get; set; } public string name { get; set; } public string entitytype { get; set; } public int version { get; set; } public string datetimecreated { get; set; } public string status { get; set; } } getting data:
public partial class objectentitydata { static list<objectentity> objectentitylist; static objectentityoperations objectentityops; static objectentitydata() { var foundentities = objectentityops.getallobjectentities(); foreach (var graphnode in foundentities) { var entityinformation = new objectentity() { id = graphnode.data.id, name = graphnode.data.name, datetimecreated = graphnode.data.datetimecreated, version = graphnode.data.version, status = graphnode.data.status, entitytype = graphnode.data.entitytype }; objectentitylist.add(entityinformation); } } public iqueryable<objectentity> items { { return objectentitylist.asqueryable<objectentity>(); } } } service class
public class objectentitiesservice : dataservice<objectentitydata> { // method called once initialize service-wide policies. public static void initializeservice(dataserviceconfiguration config) { config.setentitysetaccessrule("items", entitysetrights.allread); config.dataservicebehavior.maxprotocolversion = dataserviceprotocolversion.v3; } }
Comments
Post a Comment