public void Post(PersonItem value) { using (BuySellBidsContext myDB = new BuySellBidsContext()) { myDB.PersonItems.Add(value); myDB.SaveChanges(); } }
public void Post(Photo value) { using (BuySellBidsContext myDB = new BuySellBidsContext()) { myDB.Photos.Add(value); myDB.SaveChanges(); } }
public void Put(int id, Photo value) { Photo PhotoToUpdate; //Buyer temp = new Buyer(); using (BuySellBidsContext myDB = new BuySellBidsContext()) { PhotoToUpdate = myDB.Photos.Where(t => t.PhotoId == id).First(); myDB.Photos.Update(PhotoToUpdate); myDB.SaveChanges(); } }
public void Put(int id, Person value) { Person PersonToUpdate; //Buyer temp = new Buyer(); using (BuySellBidsContext myDB = new BuySellBidsContext()) { PersonToUpdate = myDB.Persons.Where(t => t.PersonId == id).First(); myDB.Persons.Update(PersonToUpdate); myDB.SaveChanges(); } }
public List <PersonItem> GetPersonsForItem(int id) { List <PersonItem> PersonItemInContext; //Buyer temp = new Buyer(); using (BuySellBidsContext myDB = new BuySellBidsContext()) { PersonItemInContext = myDB.PersonItems.Where(t => t.ItemId == id).ToList(); } return(PersonItemInContext); }
public void Put(int id, Item value) { Item ItemToUpdate; //Buyer temp = new Buyer(); using (BuySellBidsContext myDB = new BuySellBidsContext()) { ItemToUpdate = myDB.Items.Where(t => t.ItemId == id).First(); myDB.Items.Update(ItemToUpdate); myDB.SaveChanges(); } }
public PersonItem Get(int id) { PersonItem PersonItemInContext; //Buyer temp = new Buyer(); using (BuySellBidsContext myDB = new BuySellBidsContext()) { PersonItemInContext = myDB.PersonItems.Where(t => t.PersonItemId == id).First(); } return(PersonItemInContext); }
public Photo Get(int id) { Photo PhotoInContext; //Buyer temp = new Buyer(); using (BuySellBidsContext myDB = new BuySellBidsContext()) { PhotoInContext = myDB.Photos.Where(t => t.PhotoId == id).First(); } return(PhotoInContext); //var Buyers = myDB.Photos.Where(t=> t.PhotoIdId==id).Include(t=>t.BuyerEntity).Include(t=>t.Items); //return Buyers.First(); //return "value"; }
public ItemType Get(int id) { ItemType ItemTypeInContext; //Buyer temp = new Buyer(); using (BuySellBidsContext myDB = new BuySellBidsContext()) { ItemTypeInContext = myDB.ItemTypes.Where(t => t.ItemTypeId == id).First(); } return(ItemTypeInContext); //var Buyers = myDB.ItemTypes.Where(t=> t.ItemTypeIdId==id).Include(t=>t.BuyerEntity).Include(t=>t.ItemTypes); //return Buyers.First(); //return "value"; }
public Status Get(int id) { Status StatusInContext; //Buyer temp = new Buyer(); using (BuySellBidsContext myDB = new BuySellBidsContext()) { StatusInContext = myDB.Statuses.Where(t => t.StatusId == id).First(); } return(StatusInContext); //var Buyers = myDB.Persons.Where(t=> t.PersonIdId==id).Include(t=>t.BuyerEntity).Include(t=>t.Items); //return Buyers.First(); //return "value"; }
public void Delete(int id) { Photo PhotoToDelete; //Buyer temp = new Buyer(); using (BuySellBidsContext myDB = new BuySellBidsContext()) { PhotoToDelete = myDB.Photos.Where(t => t.PhotoId == id).First(); myDB.Photos.Remove(PhotoToDelete); myDB.SaveChanges(); } // using( BuySellBidsContext myDB = new BuySellBidsContext()) // { // myDB.Entry(BuyerToDelete).State = EntityState.Deleted; // myDB.SaveChanges(); // } }
public IEnumerable <Photo> Get() { List <Photo> PhotoList = new List <Photo>(); //Buyer temp = new Buyer(); using (BuySellBidsContext myDB = new BuySellBidsContext()) { PhotoList = myDB.Photos.ToList(); } return(PhotoList); // BuyerId = 1; // Photo BuyerEntity; // List<ListItem> Items; // bool BuyerStatus; // return BuyerList; }
public IEnumerable <Item> Get() { List <Item> ItemsList = new List <Item>(); //Buyer temp = new Buyer(); using (BuySellBidsContext myDB = new BuySellBidsContext()) { ItemsList = myDB.Items.ToList(); } return(ItemsList); // BuyerId = 1; // Item BuyerEntity; // List<ListItem> Items; // bool BuyerStatus; // return BuyerList; }
public IEnumerable <RoleType> Get() { List <RoleType> RoleTypeList = new List <RoleType>(); //Buyer temp = new Buyer(); using (BuySellBidsContext myDB = new BuySellBidsContext()) { RoleTypeList = myDB.RoleTypes.ToList(); } return(RoleTypeList); // BuyerId = 1; // RoleType BuyerEntity; // List<ListItem> Items; // bool BuyerRoleType; // return BuyerList; }
public IEnumerable <Status> Get() { List <Status> StatusList = new List <Status>(); //Buyer temp = new Buyer(); using (BuySellBidsContext myDB = new BuySellBidsContext()) { StatusList = myDB.Statuses.ToList(); } return(StatusList); // BuyerId = 1; // Status BuyerEntity; // List<ListItem> Items; // bool BuyerStatus; // return BuyerList; }