34 lines
800 B
C#
34 lines
800 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Web;
|
|
using EnVisage.Models;
|
|
|
|
namespace EnVisage.Code.BLL
|
|
{
|
|
public class ContactManager : ManagerBase<Contact, ContactModel>
|
|
{
|
|
public ContactManager(EnVisageEntities dbContext)
|
|
: base(dbContext)
|
|
{
|
|
}
|
|
|
|
protected override Contact InitInstance()
|
|
{
|
|
return new Contact { Id = Guid.NewGuid() };
|
|
}
|
|
|
|
protected override Contact RetrieveReadOnlyById(Guid key)
|
|
{
|
|
return DataTable.AsNoTracking().FirstOrDefault(t => t.Id == key);
|
|
}
|
|
|
|
public override System.Data.Entity.DbSet<Contact> DataTable
|
|
{
|
|
get
|
|
{
|
|
return DbContext.Contacts;
|
|
}
|
|
}
|
|
}
|
|
} |