Example #1
0
        public async Task <Result> Insert(FootballTeam rootAggregate)
        {
            var vtr = await RootAggregateRepositoryFootballTeamStategy.Insert(db, rootAggregate);

            //db.ChangeTracker.Clear(); //<-- DbContext is a singleton so dont want it having tracking info being just kept weird wierd

            db.Entry(rootAggregate).State = Microsoft.EntityFrameworkCore.EntityState.Detached; //Previous was throwing an error when I wanted to attach and update
            return(vtr);
        }
 public async Task <Result> Insert(FootballTeam rootAggregate)
 {
     //Will fail with error result because inserting of teams is only from hosted service, a singleton
     return(await RootAggregateRepositoryFootballTeamStategy.Insert(db, rootAggregate));
 }