Here is my method that returns an IQueryable of Countries:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace InternationalShipments.Repository
{
public class CountryRepository
{
ShipmentsEntities db = new ShipmentsEntities();
public IQueryable<Country> FindAll()
{
return db.Countries;
}
public Country Get(int id)
{
return db.Countries.FirstOrDefault(x => x.ID == id);
}
public void Add(Country country)
{
db.Countries.AddObject(country);
}
public void Delete(Country country)
{
db.Countries.DeleteObject(country);
}
public void Save()
{
db.SaveChanges();
}
}
}
My intent is to show a form that lets you create new countries and on the same page, continue to display all countries in the DB. So if a user adds a new country, it should display in the table above.
Any guidance?