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); }
public Attachment(Database.POCO.Attachment attachmentEntity, Message message) { this.Filename = attachmentEntity.Filename; this.Url = attachmentEntity.Url; this.Message = message; }