Files
Disco/Disco.Models/Repository/Device/DeviceAttachment.cs
T
Gary Sharp 5ea9a814d6 Pdf Import Rewrite
Pdf Import rewritten to greatly improve QR Code detection, reduce
reliance on iTextSharp and improve thumbnails. Fixes #50
2016-09-01 18:31:35 +10:00

40 lines
1.2 KiB
C#

using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Disco.Models.Repository
{
public class DeviceAttachment : IAttachment
{
[Key]
public int Id { get; set; }
public string DeviceSerialNumber { get; set; }
[Required]
public string TechUserId { get; set; }
[StringLength(500), Required]
public string Filename { get; set; }
[Required, StringLength(500)]
public string MimeType { get; set; }
public DateTime Timestamp { get; set; }
[Required, StringLength(500)]
public string Comments { get; set; }
public string DocumentTemplateId { get; set; }
[NotMapped]
public object Reference { get { return DeviceSerialNumber; } }
[NotMapped]
public AttachmentTypes AttachmentType { get { return AttachmentTypes.Device; } }
[InverseProperty("DeviceAttachments"), ForeignKey("DeviceSerialNumber")]
public virtual Device Device { get; set; }
[ForeignKey("TechUserId")]
public virtual User TechUser { get; set; }
[ForeignKey("DocumentTemplateId")]
public virtual DocumentTemplate DocumentTemplate { get; set; }
}
}