Esempio n. 1
0
 public DTO.HashTagDTO Delete(DTO.HashTagDTO item)
 {
     DAL.Context.HashTag entity = repository.Get(item.HashTagId);
     repository.Delete(entity);
     repository.SaveChanges();
     return(item);
 }
Esempio n. 2
0
        public Task <DTO.HashTagDTO> Get(int id)
        {
            Task <DTO.HashTagDTO> task = new Task <DTO.HashTagDTO>(() =>
            {
                DAL.Context.HashTag entity = repository.Get(id);
                return(mapper.Map <DAL.Context.HashTag, DTO.HashTagDTO>(entity));
            });

            task.Start();
            return(task);
        }
Esempio n. 3
0
 public void CreateOrUpdate(DTO.HashTagDTO item)
 {
     DAL.Context.HashTag entity = mapper.Map <DTO.HashTagDTO, DAL.Context.HashTag>(item);
     repository.CreateOrUpdate(entity);
     repository.SaveChanges();
 }