public ODataEntityDtoBuilder(IODataObjectFactory objectFactory, IODataEntityDtoBuilderFactory dtoBuilderFactory, IEntityType entityType) { this.dtoBuilderFactory = dtoBuilderFactory; this.EntityType = entityType; this.DtoUnderConstruction = objectFactory.CreateODataEntityDto(entityType.ResultingEdmEntityType); this.DtoUnderConstruction.NavigationProperties = this.navigationProperties; this.DtoUnderConstruction.Entry.Properties = this.structuralProperties; }
public DefaultOperationHandlerProvider( IEntityReader entityReader, IEntityCreator entityCreator, IEntityUpdater entityUpdater, IODataEntityDtoBuilderFactory dtoBuilderFactory) { this.getOperationHandler = new GetEntityOperationHandler(entityReader, dtoBuilderFactory); this.patchOperationHandler = new PatchEntityOperationHandler(entityReader, entityUpdater, dtoBuilderFactory); this.postOperationHandler = new PostEntityOperationHandler(entityReader, entityCreator, dtoBuilderFactory); }
// 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); }
public PostEntityOperationHandler(IEntityReader entityReader, IEntityCreator entityCreator, IODataEntityDtoBuilderFactory dtoBuilderFactory) { this.entityReader = entityReader; this.entityCreator = entityCreator; this.dtoBuilderFactory = dtoBuilderFactory; }
public PatchEntityOperationHandler(IEntityReader entityReader, IEntityUpdater entityUpdater, IODataEntityDtoBuilderFactory dtoBuilderFactory) { this.entityReader = entityReader; this.entityUpdater = entityUpdater; this.dtoBuilderFactory = dtoBuilderFactory; }