Example #1
0
        public async Task <Attachment> AddAsync(Attachment attachment)
        {
            var attachmentEntity = new Database.POCO.Attachment()
            {
                Filename  = attachment.Filename,
                Url       = attachment.Url,
                MessageId = attachment.Message.Id
            };

            context.Attachments.Add(attachmentEntity);
            await context.SaveChangesAsync();

            return(attachment);
        }
Example #2
0
 public Attachment(Database.POCO.Attachment attachmentEntity, Message message)
 {
     this.Filename = attachmentEntity.Filename;
     this.Url      = attachmentEntity.Url;
     this.Message  = message;
 }