コード例 #1
0
        public Guid Create(Model.Orgin orgin)
        {
            Domain.Orgin domainOrgins = this.mapper.Map <Domain.Orgin>(orgin);

            orginRepository.Create(domainOrgins);
            orginRepository.SaveChanges();

            return(domainOrgins.Id);
        }
コード例 #2
0
 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);
     }
 }
コード例 #3
0
        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);
            }
        }