public IEnumerable <ODataEntityDto> Handle(IOperationContext context, ODataEntityDto incomingODataEntity) { var entities = this.entityReader.ReadEntitiesFromPath(context.ModelContext.As <IBindableModelContext>(), context.Path); return(this.SerializeEntities( context.ModelContext.As <IBindableModelContext>(), entities, context.GetTargetEntityType(), context.QueryOptions.SelectExpandClause)); }
// UNDONE BJ: This method is currently used to create the odata response of a POST or PATCH operation. It does simply render all properties. // Should be changed to respect the properties actually affected and to expand included navigation properties. public static ODataEntityDto CreatePatchOrPostResponse( this IOperationContext context, IEntity sourceEntity, IODataEntityDtoBuilderFactory dtoBuilderFactory) { var entityType = context.GetTargetEntityType(); var dtoBuilder = dtoBuilderFactory.Create(entityType); dtoBuilder.ApplyAllStructuralPropertiesAndKeys(sourceEntity); return(dtoBuilder.DtoUnderConstruction); }