public IEntityTypeBuilder WithStructuralProperty(IStructuralProperty property) { this.ThrowIfAlreadyBuilt(); this.ThrowIfDuplicatePropertyName(property.EdmPropertyName); this.properties.Add(property.EdmPropertyName, property); return(this); }
public ResourceSignatureTypeInitializer( ISignatureEntitySetInitializer signatureSetInitializer, IResourceService resourceService, IStructuralProperty quantityTypeProperty) { this.signatureSetInitializer = signatureSetInitializer; this.resourceService = resourceService; this.quantityTypeProperty = quantityTypeProperty; }
public bool TryCreate(IProperty property, string edmPropertyName, out IStructuralProperty structuralProperty) { IDataType dataType; if (!this.TryGetDataType(property, out dataType)) { structuralProperty = null; return(false); } structuralProperty = new CostSharpStructuralProperty(property, edmPropertyName, dataType); return(true); }
public bool TryCreate(IProperty property, out IStructuralProperty structuralProperty) { IDataType dataType; if (!this.TryGetDataType(property, out dataType)) { structuralProperty = null; return(false); } structuralProperty = new CostSharpStructuralProperty(property, this.modelItemNamingService.GetSafeEdmPropertyName(property), dataType); return(true); }
private static bool TryGetPropertyDependency(IStructuralProperty property, ODataEntityDto oDataEntity, out IDependency dependency) { object propertyValue; if (oDataEntity.TryGetPropertyValue(property, out propertyValue)) { dependency = new PropertyDependency(property, propertyValue); return(true); } dependency = null; return(false); }
public static bool TryGetPropertyValue(this ODataEntityDto oDataEntity, IStructuralProperty property, out object value) { var targetProperty = oDataEntity.Entry.Properties.FirstOrDefault(p => p.Name == property.EdmPropertyName); if (targetProperty != null) { var odataPropertyValue = targetProperty.Value; value = property.Deserialize(odataPropertyValue); return(true); } value = null; return(false); }
protected override bool TryHandleStructuralProperty( IEntity targetEntity, ODataEntityDto oDataEntity, IStructuralProperty structuralProperty) { var structuralEntityProperty = structuralProperty as IStructuralEntityProperty; if (structuralEntityProperty != null && structuralEntityProperty.IsReadOnly(targetEntity)) { // According to OData v4 Part 1 (Protocol), section 11.4.3 and 11.4.4, properties which are non-updatable should be ignored // during Update and Upsert. Hence, we return true here, claiming the property was handled correctly. return(true); } return(base.TryHandleStructuralProperty(targetEntity, oDataEntity, structuralProperty)); }
public bool TryCreate <T>( string edmPropertyName, Func <IEntity, T> valueGetter, Action <IEntity, T> valueSetter, bool canBeNull, out IStructuralProperty structuralProperty) { IValueBasedDataType dataType; if (!this.TryGetValueBasedDataType <T>(out dataType)) { structuralProperty = null; return(false); } structuralProperty = new StructuralProperty <T>(edmPropertyName, dataType, valueGetter, valueSetter, canBeNull); return(true); }
protected virtual bool TryHandleStructuralProperty( IEntity targetEntity, ODataEntityDto oDataEntity, IStructuralProperty structuralProperty) { var structuralEntityProperty = structuralProperty as IStructuralEntityProperty; if (structuralEntityProperty == null) { return(false); } if (!this.structuralPropertyBinder.TrySetOnEntity(targetEntity, oDataEntity, structuralEntityProperty)) { return(false); } return(true); }
public IBindableModelBuilder WithOptionalDependency(INavigatableElementBuilder navigatableElementBuilder, IStructuralProperty dependency) { var declaration = new DependencyDeclaration(dependency, true); this.dependencies.Add(new KeyValuePair <INavigatableElementBuilder, DependencyDeclaration>(navigatableElementBuilder, declaration)); return(this); }
public bool TryGetKeyProperty(string propertyName, out IStructuralProperty keyProperty) { return(this.keyProperties.TryGetValue(propertyName, out keyProperty)); }
public PropertyDependency(IStructuralProperty property, object value) { this.property = property; this.Value = value; }