Esempio n. 1
0
        private GradeViewModel MapToViewModel(GradeModel model)
        {
            var vm = new GradeViewModel()
            {
                LastModifiedUtc = model.LastModifiedUtc,
                Type            = model.Type,
                Code            = model.Code,
                IsAvalGrade     = model.IsAvalGrade,
                Id                = model.Id,
                Active            = model.Active,
                CreatedAgent      = model.CreatedAgent,
                CreatedBy         = model.CreatedBy,
                CreatedUtc        = model.CreatedUtc,
                DeletedAgent      = model.DeletedAgent,
                DeletedBy         = model.DeletedBy,
                DeletedUtc        = model.DeletedUtc,
                IsDeleted         = model.IsDeleted,
                LastModifiedAgent = model.LastModifiedAgent,
                LastModifiedBy    = model.LastModifiedBy
            };

            return(vm);
        }
Esempio n. 2
0
        public Task <int> Create(GradeViewModel viewModel)
        {
            var model = new GradeModel(viewModel.Type, viewModel.Code, viewModel.IsAvalGrade);

            return(_repository.InsertAsync(model));
        }
Esempio n. 3
0
        public Task <int> Update(int id, GradeViewModel viewModel)
        {
            var model = new GradeModel(viewModel.Type, viewModel.Code, viewModel.IsAvalGrade);

            return(_repository.UpdateAsync(id, model));
        }