コード例 #1
0
 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;
 }
コード例 #2
0
 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);
 }
コード例 #3
0
        // 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);
        }
コード例 #4
0
 public PostEntityOperationHandler(IEntityReader entityReader, IEntityCreator entityCreator, IODataEntityDtoBuilderFactory dtoBuilderFactory)
 {
     this.entityReader      = entityReader;
     this.entityCreator     = entityCreator;
     this.dtoBuilderFactory = dtoBuilderFactory;
 }
コード例 #5
0
 public PatchEntityOperationHandler(IEntityReader entityReader, IEntityUpdater entityUpdater, IODataEntityDtoBuilderFactory dtoBuilderFactory)
 {
     this.entityReader      = entityReader;
     this.entityUpdater     = entityUpdater;
     this.dtoBuilderFactory = dtoBuilderFactory;
 }