Методы CUD не срабатывают

Я пытаюсь использовать службы RIA с шаблоном репозитория. Все операции CRUD работали отлично, пока я не реализовал репозитории. Теперь работают только методы query и Submit. Я пробовал методы как с атрибутами Query, Insert, Update и Delete, так и без них.

Кто-нибудь знает, в чем проблема?

[LinqToEntitiesDomainServiceDescriptionProvider(typeof(MyEntityModelContainer))]
[EnableClientAccess()]
public class MyService : DomainService
{
    internal IUnitOfWork ObjectContext { get; private set; }

    public MyService(IUnitOfWork context)
    {
        this.ObjectContext = context;
    }

    public IQueryable<Employee> GetEmployees()
    {
        return this.ObjectContext.BusinessEntities.OfType<Employee>();
    }

    public void InsertEmployee(Employee employee)
    {
        this.ObjectContext.BusinessEntities.AddObject(employee);
    }

    public void UpdateEmployee(Employee currentEmployee)
    {
        this.ObjectContext.BusinessEntities.AttachAsModified(currentEmployee,     this.ChangeSet.GetOriginal(currentEmployee));
    }

    public void DeleteEmployee(Employee employee)
    {
        if( (employee.EntityState == EntityState.Detached) )
        {
            this.ObjectContext.BusinessEntities.Attach(employee);
        }

        this.ObjectContext.BusinessEntities.DeleteObject(employee);
    }

    public override bool Submit(ChangeSet changeSet)
    {
        this.ObjectContext.Commit();
        return true;
    }
}

person mrtaikandi    schedule 22.06.2010    source источник


Ответы (1)


Я переопределил метод Submit по ошибке.

person mrtaikandi    schedule 22.06.2010