Exemplo n.º 1
0
        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);
            }
        }