Exemplo n.º 1
0
        public NewsBannerViewModel UpdateNewsBanner(NewsBannerViewModel model)
        {
            var entity = model.ToEntity();

            _repository.Update(entity);
            _context.SaveChanges();
            return(model);
        }
Exemplo n.º 2
0
        public NewsBannerViewModel SaveNewsBanner(NewsBannerViewModel model)
        {
            var entity = model.ToEntity();

            entity.Id         = SequenceQueue.NewIdGuid();
            entity.CreateTime = DateTime.Now;
            _repository.AddAsync(entity);
            model.Id = entity.Id;
            _context.SaveChanges();
            return(model);
        }