Esempio n. 1
0
        public async Task <bool> AddCustomerReferenceAsync(MemberDocumentStorage document)
        {
            try
            {
                DocumentstorageContext context = new DocumentstorageContext(_connectionString);
                context.Add(document);
                await context.SaveChangesAsync();

                return(true);
            }
            catch
            {
                //add logging
                throw;
            }
        }
Esempio n. 2
0
        public async Task <bool> DeleteDocumentRecordByURIAsync(int memberId, string uri)
        {
            try
            {
                DocumentstorageContext context = new DocumentstorageContext(_connectionString);
                var entity =
                    context.MemberDocumentStorage.FirstOrDefault(x => x.MemberId == memberId && x.FileUri == uri);
                context.MemberDocumentStorage.Remove(entity);
                await context.SaveChangesAsync();

                return(true);
            }
            catch
            {
                //add logging
                throw;
            }
        }