public Guid Create(Model.Orgin orgin) { Domain.Orgin domainOrgins = this.mapper.Map <Domain.Orgin>(orgin); orginRepository.Create(domainOrgins); orginRepository.SaveChanges(); return(domainOrgins.Id); }
public Guid Update(Model.Orgin orgin) { Domain.Orgin domainOrgin = orginRepository.ReadBy(x => x.Id == orgin.Id); if (domainOrgin.OrginName != null) { domainOrgin.OrginName = orgin.OrginName; orginRepository.Update(domainOrgin); orginRepository.SaveChanges(); return(orgin.Id); } else { return(Guid.Empty); } }
public Boolean Delete(Guid ID) { Domain.Orgin domainOrgin = orginRepository.ReadBy(x => x.Id == ID); if (domainOrgin.OrginName != null) { orginRepository.Delete(domainOrgin); orginRepository.SaveChanges(); return(true); } else { return(false); } }