I have the following class that can create/delete and list entities:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
namespace Backend.Models
{
public class PaisRepository
{
private EnviosDataContext db = new EnviosDataContext();
public IQueryable<Pai> FindAll()
{
return db.Pais;
}
public Pai Get(int id)
{
return db.Pais.FirstOrDefault(x => x.ID == id);
}
public void Add(Pai pai)
{
db.Pais.InsertOnSubmit(pai);
}
public void Delete(Pai pai)
{
db.Pais.InsertOnSubmit(pai);
}
public void Save()
{
db.SubmitChanges();
}
}
}
How can I update a model?