示例#1
0
        public async Task <IActionResult> CalculateAll()
        {
            var toraObjects = await dbContext.Set <ToraObject>().ToListAsync();

            foreach (var toraObject in toraObjects)
            {
                ToraHelper.CalculateToraObject(dbContext, toraObject);
            }
            return(Ok(new RequestResult()
            {
                Message = "Success"
            }));
        }
示例#2
0
        public async Task <IActionResult> Calculate(int id)
        {
            var toraObject = await dbContext.Set <ToraObject>().FirstOrDefaultAsync(to => to.Id == id);

            if (toraObject == null)
            {
                throw new NotFoundException();
            }
            ToraHelper.CalculateToraObject(dbContext, toraObject);
            return(Ok(new RequestResult()
            {
                Message = "Success"
            }));
        }