Ejemplo n.º 1
0
        public async Task <bool> DeleteSpecialStore(SpecialStores specialStore)
        {
            _db.Remove(specialStore);
            await _db.SaveChangesAsync();

            return(true);
        }
Ejemplo n.º 2
0
        public async Task <SpecialStores> InsertSpecialStore(int specialId, int storeId)
        {
            var ss = await(from s in _db.SpecialStores
                           where s.SpecialId == specialId && s.StoreId == storeId
                           select s).SingleOrDefaultAsync();

            if (ss == null)
            {
                ss = new SpecialStores()
                {
                    SpecialId = specialId, StoreId = storeId
                };
                _db.Add(ss);
                await _db.SaveChangesAsync();

                return(ss);
            }

            //This function did not insert a new entry
            return(null);
        }