public static Attachment AttachmentNew(int sourceId, SourceType sourceType) { var attachment = Attachment.NewAttachment(); attachment.SourceId = sourceId; attachment.SourceTypeId = (int)sourceType; return attachment; }