コード例 #1
0
        public void AddItems(MyItems item, String eveniment, String loc)
        {
            MyItems item1 = new MyItems()
            {
                IPath = item.IPath, IDelete = item.IDelete, IDate = item.IDate, IDescription = item.IDescription
            };

            if (eveniment != string.Empty)
            {
                var event1 = AddEvents(eveniment);
                item1.Event = event1;
                event1.MyItems.Add(item1);
            }

            if (loc != string.Empty)
            {
                var place = AddLocation(loc);
                item1.Place = place;
                place.MyItems.Add(item1);
            }

            this.context.MyItems.Add(item1);
            this.context.SaveChanges();
        }
コード例 #2
0
 public void Remove(MyItems item)
 {
     this.context.MyItems.Remove(item);
     this.context.SaveChanges();
 }