This project has moved. For the latest updates, please go here.
1
Vote

This Code-first entity fails; columns get confused

description

The item below is incompatible with this MappingAPI. The properites returned confuse the Telemetry_Id and Vehicle_Id columns.
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Asi.Common.Utilities;

namespace Asi.Server.History.DBOs
{
    [Table("TelemetryLogEntry")]
    public class TelemetryLogEntryDbo
    {
        public TelemetryLogEntryDbo()
        {
            Id = SequentialGuid.NewGuid();
        }

        [Required, Key]
        public Guid Id { get; set; }

        // assuming OneToManyCascadeDeleteConvention is enabled (which it is by default)
        [Required, Index("IX_TelemetryLogEntry_Vehicle_Timestamp", 1)]
        public virtual VehicleDbo Vehicle { get; set; }

        [Required, Index("IX_TelemetryLogEntry_Telemetry")]
        public virtual TelemetryDbo Telemetry { get; set; }

        [Required]
        public virtual LogSourceDbo LogSource { get; set; }

        [Required, Index("IX_TelemetryLogEntry_Vehicle_Timestamp", 2), DateTimeKind(DateTimeKind.Utc)]
        public DateTime Timestamp { get; set; } // TODO: add a separate Timestamp index if we ever pull data without specifying the TelemetryId

        public bool? Degraded { get; set; }
        public string Value { get; set; }

        [Required]
        public bool IsProcessed { get; protected set; }
    }
}

comments