コード例 #1
0
ファイル: Repository.cs プロジェクト: LeanVers/TCCFYHomeApi
        public T Add(T entity)
        {
            _dbContext.Set <T>().Add(entity);
            _dbContext.SaveChanges();

            return(entity);
        }
コード例 #2
0
        public static void Initialize(FYHomeContext context)
        {
            context.Database.EnsureCreated();

            if (context.Person.Any())
            {
                return;
            }

            context.SaveChanges();
        }