Exemple #1
0
 public static void Copy(this 本Entity item, long _eventNumber, Domain.RentalSubDomain.Events.Book.ReturnedBookDTOVer100 _dto)
 {
     item.EventNumber = _eventNumber;
     item.利用者EntityId = (Guid?)null;
     item.貸出期間自       = (DateTime?)null;
     item.貸出期間至       = (DateTime?)null;
 }
        public void Update(long _eventNumber, Domain.RentalSubDomain.Events.Book.ReturnedBookDTOVer100 _dto)
        {
            using (var db = new RentalProjectorContext())
            {
                db.Database.EnsureCreated();

                var x = db.本一覧.SingleOrDefault(item => item.Id.Equals(Guid.Parse(_dto.id)));

                if (x == null)
                {
                    throw new ArgumentException("ReturnedBookDTOVer100", "該当するGUIDが存在しません。: " + _dto.id);
                }

                x.Copy(_eventNumber, _dto);

                db.SaveChanges();
            }
        }