예제 #1
0
        public async Task <Models.Test.Example> InsertThenGetAsync(Models.Test.Example example)
        {
            await UnitOfWork.Use <IExampleRepo>().InsertExampleAsync(example);

            UnitOfWork.SaveChanges();
            var result = await UnitOfWork.Use <IExampleRepo>().GetExampleAsync(example.Id);

            return(result);
        }
예제 #2
0
        public async Task <Models.Test.Example> InsertThenGetAsync(ISqlServerDbSession dbSession, Models.Test.Example example)
        {
            await UnitOfWork.Use <IExampleRepo>(dbSession).InsertExampleAsync(example);

            // Equal to: session.SaveChanges();
            UnitOfWork.SaveChanges(dbSession);

            var result = await UnitOfWork.Use <IExampleRepo>(dbSession).GetExampleAsync(example.Id);

            return(result);
        }