public async Task <IActionResult> Create([Bind("Id,Address,SellingPrice,Title,Description")] Property @property)
        {
            if (ModelState.IsValid)
            {
                _context.Add(@property);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(@property));
        }
Beispiel #2
0
        public async Task <IActionResult> DeleteConfirmed(int id)
        {
            var salesTransaction = await _context.SalesTransaction.FindAsync(id);

            _context.SalesTransaction.Remove(salesTransaction);
            await _context.SaveChangesAsync();

            return(RedirectToAction(nameof(Index)));
        }
Beispiel #3
0
        public async Task <IActionResult> DeleteConfirmed(int id)
        {
            var buyer = await _context.Buyer.FindAsync(id);

            _context.Buyer.Remove(buyer);
            await _context.SaveChangesAsync();

            return(RedirectToAction(nameof(Index)));
        }