public void Put(long id, [FromBody] HolderInformationBO editedHolder)
 {
     if (id == editedHolder.Id)
     {
         _holder.Update(editedHolder);
     }
 }
Exemplo n.º 2
0
        public HolderInformationBO Update(HolderInformationBO holderInformation)
        {
            HolderInformation holder = hiConverter.Convert(GetById(holderInformation.Id));

            _context.Entry(holder).State = Microsoft.EntityFrameworkCore.EntityState.Modified;
            _context.SaveChanges();
            return(hiConverter.Convert(holder));
        }
Exemplo n.º 3
0
        public HolderInformationBO Create(HolderInformationBO holderInformation)
        {
            HolderInformation holder = hiConverter.Convert(holderInformation);

            _context.HolderInformations.Add(holder);
            _context.SaveChanges();
            return(hiConverter.Convert(holder));
        }
        public HolderInformationBO Convert(HolderInformation hi)
        {
            if (hi == null)
            {
                return(null);
            }
            HolderInformationBO holderInformation = new HolderInformationBO
            {
                DateOfBirth            = hi.DateOfBirth,
                FatherName             = hi.FatherName,
                FirstName              = hi.FirstName,
                Id                     = hi.Id,
                LastName               = hi.LastName,
                LocationOfRegistration = hi.LocationOfRegistration,
                MotherName             = hi.MotherName,
                NumberOfRegistration   = hi.NumberOfRegistration,
                Title                  = titleConverter.Convert(hi.Title),
                TitleId                = hi.TitleId
            };

            return(holderInformation);
        }
 public HolderInformationBO Post([FromBody] HolderInformationBO holder)
 {
     return(_holder.Create(holder));
 }