public async Task <FormContent> AddAsync(RaeClassContentType contentType, FormContent formContent) { FillFormContent(contentType, ref formContent); BaseFormContent baseFormContent = GetBaseFormContent(contentType, formContent); context.BaseFormContentSet.Add(baseFormContent); int res = await context.SaveChangesAsync(); if (res == 1) { serialNumberRepository.UpdateMaxIndex(contentType); return(formContent); } else { return(null); } }