using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using AlfredoLotar.Livro.Aspnet.SchoolModel;
using System.Data.Objects;

public partial class ExecuteFunction : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void bntExecutar_Click(object sender, EventArgs e)
    {
        using (SchoolEntities contexto = new SchoolEntities())
        {
            ObjectParameter iDParameter = new ObjectParameter("ID", 2);
            ObjectParameter nome = new ObjectParameter("Name", typeof(String));
            contexto.ExecuteFunction("GetDepartmentName", iDParameter, nome);
            Response.Write(nome.Value);
        }
    }
}