Exemplo n.º 1
0
        public void Update(JobStatsInputModel viewModel)
        {
            Id       = viewModel.Id;
            DateTime = viewModel.DateTime;
            EntityId = viewModel.EntityId;

            Monday    = viewModel.Monday;
            Тuesday   = viewModel.Тuesday;
            Wednesday = viewModel.Wednesday;
            Thursday  = viewModel.Thursday;
            Friday    = viewModel.Friday;
            Saturday  = viewModel.Saturday;
            Sunday    = viewModel.Sunday;
        }
Exemplo n.º 2
0
        public async Task <OperationResult> Update(JobStatsInputModel viewModel)
        {
            JobStats Entity = await jobsStatsRepository.GetByIdAsync(viewModel.Id);

            if (Entity is null)
            {
                Entity = new JobStats();
                Entity.Update(viewModel);
                await jobsStatsRepository.AddAsync(Entity);
            }
            else
            {
                Entity.Update(viewModel);
                jobsStatsRepository.Update(Entity);
            }

            var result = await jobsStatsRepository.SaveChangesAsync();

            return(result);
        }