TextBlob with CascadeOperations crashes at runtime

Issue #50 closed
Jeremy Kolb created an issue
     public class OperationalPointCollection : IOperationalGeometry
    {
        [PrimaryKey, AutoIncrement]
        public int Id { get; set; }

        public string Name { get; set; }

        public IMultiPoint Points { get; set; }

        [ManyToOne(CascadeOperations = CascadeOperation.CascadeRead)]
        public OperationalPointType PointType { get; set; }

        [ForeignKey(typeof(OperationalPointType))]
        public int OperationalPointTypeId { get; set; }

        [ManyToOne]
        public Operation Operation { get; set; }

        [ForeignKey(typeof(Operation))]
        public int OperationId { get; set; }

        [TextBlob("PointIdsBlobbed", CascadeOperations = CascadeOperation.All)]
        public List<string> PointIds { get; set; }

        public string PointIdsBlobbed { get; set; }
    }

At runtime: System.Reflection.CustomAttributeFormatException: Could not find the setter for CascadeOperations

Comments (4)

  1. Guillermo Gutiérrez

    TextBlob attribute doesn't have a setter for CascadeOperation. It should be a compiler error, not a runtime error. It made no sense navigating to objects inside a TextBlobbed relationship, so cascade operations were disabled by design.

  2. Guillermo Gutiérrez

    New tests have shown that Cascade Insert operations are working fine for TextBlob properties and CascadeOperations is not required. TextBlob will always be read and write when using any WithChildren operation.

  3. Log in to comment