예제 #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);
        }
        public async Task <ActionResult <Example> > Get(int id)
        {
            var result = await UnitOfWork.Use <IExampleRepo>().GetExampleAsync(id);

            return(Ok(result));
        }